XP 스크립트

아래의 스크립트는 RPG Advocate씨의 Advanced Equip Window 스크립트를 대폭 수정한 것입니다.


#==============================================================================
# Complete equipment screen
#------------------------------------------------------------------------------
# Guillaume777
# 2.0
# 2006/04/24
# Edit from RPG Avocate's script ( http://www.phylomortis.com/resource/script/scr012.html )
#==============================================================================
module Adv_Equip_Mod
DRAW_EVA = false # true = show the evade statistic, if you didn't change
# draw_actor_parameter to take this into account it will crash
HEIGHT_LEFT_WINDOW = 416 #416 full screen height, 352 help window at bottom

AUTO_CALC_SPACE_SIZE = true #true = automaticly calculate optimum space size
#between each stat
SPACE = 32 # manually set the space size, 32 : default

FONT_NAME = 'Monotype Corsiva' #Arial = default
FONT_SIZE = 22 #font size : 24 default
NEW_STAT_SYMBOL = '→'
REMOVE_ITEM_TEXT = '[Remove]'
end

class Window_EquipLeft < Window_Base
# --------------------------------
attr_accessor :mode
attr_accessor :changes
# --------------------------------
def initialize(actor)
super(0, 64, 272, Adv_Equip_Mod::HEIGHT_LEFT_WINDOW)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = Adv_Equip_Mod::FONT_NAME
self.contents.font.size = Adv_Equip_Mod::FONT_SIZE
self.z += 100
@actor = actor
@mode = 0
@changes = [0, 0, 0, 0, 0, 0, 0, 0]
@elem_text = ""
@stat_text = ""
refresh
end
# --------------------------------
def calculate_space_size(height_window)
#this automaticly calculates the optimum size of spaces between each stats
borders = 32
number_of_lines = 12
if Adv_Equip_Mod::DRAW_EVA then number_of_lines += 1 end
space_size = (height_window - borders) / number_of_lines
return space_size
end

def refresh
self.contents.clear
symbol = Adv_Equip_Mod::NEW_STAT_SYMBOL
if Adv_Equip_Mod::AUTO_CALC_SPACE_SIZE
space = self.calculate_space_size(self.height) #space size is calculated
else
space = Adv_Equip_Mod::SPACE #space size as manually specified
end
extra = 0
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 180, 0)
draw_actor_parameter(@actor, 4, space, 0)
draw_actor_parameter(@actor, 4, space*2, 1)
draw_actor_parameter(@actor, 4, space*3, 2)

if Adv_Equip_Mod::DRAW_EVA
draw_actor_parameter(@actor, 4, space*4, 7)
extra = 1 #makes extra space for evasion to fit
end
draw_actor_parameter(@actor, 4, space*(4+extra), 3)
draw_actor_parameter(@actor, 4, space*(5+extra), 4)
draw_actor_parameter(@actor, 4, space*(6+extra), 5)
draw_actor_parameter(@actor, 4, space*(7+extra), 6)
if @mode == 0
self.contents.draw_text(4, space*(8+extra), 200, 32, "Elemental Attack:")
self.contents.draw_text(4, space*(10+extra), 200, 32, "Status Attack:")
end
if @mode == 1
self.contents.draw_text(4, space*(8+extra), 200, 32, "Elemental Defense:")
self.contents.draw_text(4, space*(10+extra), 200, 32, "Status Defense:")
end
self.contents.draw_text(12, space*(9+extra), 260, 32, @elem_text)
self.contents.draw_text(12, space*(11+extra), 260, 32, @stat_text)
if @new_atk != nil
self.contents.font.color = system_color
self.contents.draw_text(160, space, 40, 32, symbol, 1)
if @changes[0] == 0
self.contents.font.color = normal_color
elsif @changes[0] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, space, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, space*2, 40, 32, symbol, 1)
if @changes[1] == 0
self.contents.font.color = normal_color
elsif @changes[1] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, space*2, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, space*3, 40, 32, symbol, 1)
if @changes[2] == 0
self.contents.font.color = normal_color
elsif @changes[2] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, space*3, 36, 32, @new_mdef.to_s, 2)
end
if @new_eva != nil and Adv_Equip_Mod::DRAW_EVA # if drawing evasion
self.contents.font.color = system_color
self.contents.draw_text(160, space*4, 40, 32, symbol, 1)
if @changes[7] == 0
self.contents.font.color = normal_color
elsif @changes[7] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, space*4, 36, 32, @new_eva.to_s, 2)
end
if @new_str != nil
self.contents.font.color = system_color
self.contents.draw_text(160, space*(4+extra), 40, 32, symbol, 1)
if @changes[3] == 0
self.contents.font.color = normal_color
elsif @changes[3] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, space*(4+extra), 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil
self.contents.font.color = system_color
self.contents.draw_text(160, space*(5+extra), 40, 32, symbol, 1)
if @changes[4] == 0
self.contents.font.color = normal_color
elsif @changes[4] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, space*(5+extra), 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil
self.contents.font.color = system_color
self.contents.draw_text(160, space*(6+extra), 40, 32,symbol , 1)
if @changes[5] == 0
self.contents.font.color = normal_color
elsif @changes[5] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, space*(6+extra), 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil
self.contents.font.color = system_color
self.contents.draw_text(160, space*(7+extra), 40, 32, symbol, 1)
if @changes[6] == 0
self.contents.font.color = normal_color
elsif @changes[6] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, space*(7+extra), 36, 32, @new_int.to_s, 2)
end
end
# --------------------------------
def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex,
new_agi, new_int, new_eva, elem_text, stat_text)
flag = false
if new_atk != @new_atk || new_pdef != @new_pdef || new_mdef != @new_mdef
flag = true
end
if new_str != @new_str || new_dex != @new_dex || new_agi != @new_agi
flag = true
end
if new_eva != @new_eva || elem_text != @elem_text || stat_text != @stat_text
flag = true
end
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
@new_eva = new_eva
@elem_text = elem_text
@stat_text = stat_text
if flag
refresh
end
end
end




class Window_EquipItem < Window_Selectable
# --------------------------------
def initialize(actor, equip_type)
super(272, 256, 368, 224)
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
end
# --------------------------------
def item
return @data[self.index]
end
# --------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
if @equip_type == 0
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
@data.push($data_weapons[i])
end
end
end
if @equip_type != 0
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i)
if $data_armors[i].kind == @equip_type-1
@data.push($data_armors[i])
end
end
end
end
@data.push(nil)
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = Adv_Equip_Mod::FONT_NAME
self.contents.font.size = 24
for i in 0...@item_max-1
draw_item(i)
end
i = @item_max-1
x = 4 + i % @column_max * (288 + 32)
y = i / @column_max * 32

self.contents.draw_text(x+4, y, 100, 32, Adv_Equip_Mod::REMOVE_ITEM_TEXT )
end
# --------------------------------
def draw_item(index)
item = @data[index]
x = 4
y = index * 32
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 288, y, 16, 32, ":", 1)
self.contents.draw_text(x + 304, y, 24, 32, number.to_s, 2)
end

end

class Window_Base < Window

# --------------------------------
def up_color
return Color.new(74, 210, 74)
end

def down_color
return Color.new(170, 170, 170)
end
end


class Scene_Equip
# --------------------------------
def refresh
@item_window1.visible = (@right_window.index == 0)
@item_window2.visible = (@right_window.index == 1)
@item_window3.visible = (@right_window.index == 2)
@item_window4.visible = (@right_window.index == 3)
@item_window5.visible = (@right_window.index == 4)
item1 = @right_window.item
case @right_window.index
when 0
@item_window = @item_window1
newmode = 0
when 1
@item_window = @item_window2
newmode = 1
when 2
@item_window = @item_window3
newmode = 1
when 3
@item_window = @item_window4
newmode = 1
when 4
@item_window = @item_window5
newmode = 1
else
newmode = 1
end
if newmode != @left_window.mode
@left_window.mode = newmode
@left_window.refresh
end
if @right_window.active
@left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil,
"", "")
end
if @item_window.active
item2 = @item_window.item
last_hp = @actor.hp
last_sp = @actor.sp
old_atk = @actor.atk
old_pdef = @actor.pdef
old_mdef = @actor.mdef
old_str = @actor.str
old_dex = @actor.dex
old_agi = @actor.agi
old_int = @actor.int
old_eva = @actor.eva
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
new_eva = @actor.eva
@left_window.changes = [0, 0, 0, 0, 0, 0, 0, 0]
if new_atk > old_atk
@left_window.changes[0] = 1
end
if new_atk < old_atk
@left_window.changes[0] = -1
end
if new_pdef > old_pdef
@left_window.changes[1] = 1
end
if new_pdef < old_pdef
@left_window.changes[1] = -1
end
if new_mdef > old_mdef
@left_window.changes[2] = 1
end
if new_mdef < old_mdef
@left_window.changes[2] = -1
end
if new_str > old_str
@left_window.changes[3] = 1
end
if new_str < old_str
@left_window.changes[3] = -1
end
if new_dex > old_dex
@left_window.changes[4] = 1
end
if new_dex < old_dex
@left_window.changes[4] = -1
end
if new_agi > old_agi
@left_window.changes[5] = 1
end
if new_agi < old_agi
@left_window.changes[5] = -1
end
if new_int > old_int
@left_window.changes[6] = 1
end
if new_int < old_int
@left_window.changes[6] = -1
end
if new_eva > old_eva
@left_window.changes[7] = 1
end
if new_eva < old_eva
@left_window.changes[7] = -1
end
elem_text = make_elem_text(item2)
stat_text = make_stat_text(item2)
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str,
new_dex, new_agi, new_int, new_eva, elem_text, stat_text)
end
end

def make_elem_text(item)
text = ""
flag = false
if item.is_a?(RPG::Weapon)
for i in item.element_set
if flag
text += ", "
end
text += $data_system.elements[i]
flag = true
end
end
if item.is_a?(RPG::Armor)
for i in item.guard_element_set
if flag
text += ", "
end
text += $data_system.elements[i]
flag = true
end
end
return text
end
# --------------------------------
def make_stat_text(item)
text = ""
flag = false
if item.is_a?(RPG::Weapon)
for i in item.plus_state_set
if flag
text += ", "
end
text += $data_states[i].name
flag = true
end
end
if item.is_a?(RPG::Armor)
for i in item.guard_state_set
if flag
text += ", "
end
text += $data_states[i].name
flag = true
end
end
return text
end

end


**장비확장 스크립트와 사용시 정상적인 작동은 보장할 수 없습니다.(Guillaume777씨의 장비확장 스크립트와 같이 쓰는 경우 이 스크립트를 장비확장 스크립트 위에 넣어주면 문제없습니다만, 그 외 다른 장비확장 스크립트 사이의 호환성은 보장 못함)

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6312
461 메뉴 넷플레이 업그레이드됀 메뉴 스크립트 4 백호 2009.02.22 2040
460 전투 S ABS_NonSDK(구버전용) 5 file 백호 2009.02.22 1494
459 전투 S ABS_NonSDK ver 1 file 백호 2009.02.22 1458
458 기타 Defining Encounter Areas by RPG Advocate (사용법 첨부) file 백호 2009.02.22 1201
457 아이템 Item Acquired Window by SiliconHero@rmxp.net 백호 2009.02.22 1097
456 기타 풀스크린 스크립트 2 백호 2009.02.22 1408
455 온라인 Multi-Netplay Extended[구버전용] 3 백호 2009.02.22 2176
454 온라인 Multi-Netplay Extended (신버전) 10 백호 2009.02.22 2865
453 HUD 넷플레이 HUD표시 2 file 백호 2009.02.22 3097
452 메뉴 링 메뉴 Edited by Hypershadow180@rmxp.net 1 file 백호 2009.02.22 1976
451 전투 Steal Script 5.5 by trickster@rmxp.net (SDK호환) file 백호 2009.02.22 1206
450 기타 스크립트 자료 3 file 백호 2009.02.22 906
449 온라인 multy-netplay 로그인창에서 비밀번호를 ***표시해주는 script~! 1 백호 2009.02.22 1890
448 타이틀/게임오버 심심해서 구현해본 타이틀음악만으로 게임 플레이하기 2 백호 2009.02.22 1622
447 기타 Selected phyolomortis.com scripts 1 file 백호 2009.02.22 789
446 파티 Party Switching Screen by exseiken file 백호 2009.02.22 1305
445 기타 창고 시스템 8 백호 2009.02.22 1763
» 장비 Advanced Equip Window 백호 2009.02.22 806
443 장비 장비창 개조 스크립트 from Harts Horn 7 백호 2009.02.22 1775
442 오디오 WinAMP 플러그인을 이용하여 RMXP에서 다른 사운드포맷 지원하기 v3 by Guillame777@rmxp.net 백호 2009.02.22 936
Board Pagination Prev 1 ... 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ... 52 Next
/ 52