조회 수 1656 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
#======================================================================
# ■ Window_ShopStatus
#------------------------------------------------------------------------------
#  숍 화면에서, 아이템의 소지수나 엑터의 장비를 표시하는 윈도우입니다.
#======================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# ● 오브젝트 초기화
#--------------------------------------------------------------------------
def initialize(actor_index = 0)
super(368, 128, 272, 352)
self.contents = Bitmap.new(width - 32, height - 32)
@actor_index = actor_index
@item = nil
#@actor_index = 0
refresh
end
#-------------------
def update
super
번호돌리기
end
#-------------------
#--------------------------------------------------------------------------
# ● 리프레쉬
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if @item == nil
return
end
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 200, 32, "소지수")
self.contents.font.color = normal_color
self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
if @item.is_a? (RPG::Item)
return
end
# 장비품 추가 정보
for i in 0...$game_party.actors.size
# 엑터를 취득
actor = $game_party.actors[@actor_index]#$game_party.actors[i]
# 장비 가능하면 통상 문자색에, 불가능하면 무효 문자색으로 설정
if actor.equippable? (@item)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
# 엑터의 이름을 묘화
@이름 = $game_party.actors[@actor_index].name
$game_party.actors[@actor_index]
self.contents.draw_text(4, 64, 120, 32, @이름)#(4, 64 + 64 * i, 120, 32, actor.name)
# 현재의 장비품을 취득
if @item.is_a? (RPG::Weapon)
item1 = $data_weapons[$game_party.actors[@actor_index].weapon_id]#$data_weapons[actor.weapon_id]
elsif @item.kind == 0
item1 = $data_armors[$game_party.actors[@actor_index].armor1_id]#$data_armors[actor.armor1_id]
elsif @item.kind == 1
item1 = $data_armors[$game_party.actors[@actor_index].armor2_id]#$data_armors[actor.armor2_id]
else
item1 = $data_armors[$game_party.actors[@actor_index].armor3_id]#$data_armors[actor.armor3_id]
end
# 장비 가능한 경우
if actor.equippable? (@item)
# 무기의 경우
if @item.is_a? (RPG::Weapon)
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item.atk : 0
str1 = item1 != nil ? item1.str_plus : 0
str2 = @item != nil ? @item.str_plus : 0
dex1 = item1 != nil ? item1.dex_plus : 0
dex2 = @item != nil ? @item.dex_plus : 0
agi1 = item1 != nil ? item1.agi_plus : 0
agi2 = @item != nil ? @item.agi_plus : 0
int1 = item1 != nil ? item1.int_plus : 0
int2 = @item != nil ? @item.int_plus : 0
change1 = atk2 - atk1
change4 = str2 - str1
change5 = dex2 - dex1
change6 = agi2 - agi1
change7 = int2 - int1
end
# 방어용 기구의 경우
if @item.is_a? (RPG::Armor)
pdef1 = item1 != nil ? item1.pdef : 0
mdef1 = item1 != nil ? item1.mdef : 0
pdef2 = @item != nil ? @item.pdef : 0
mdef2 = @item != nil ? @item.mdef : 0
str1 = item1 != nil ? item1.str_plus : 0
str2 = @item != nil ? @item.str_plus : 0
dex1 = item1 != nil ? item1.dex_plus : 0
dex2 = @item != nil ? @item.dex_plus : 0
agi1 = item1 != nil ? item1.agi_plus : 0
agi2 = @item != nil ? @item.agi_plus : 0
int1 = item1 != nil ? item1.int_plus : 0
int2 = @item != nil ? @item.int_plus : 0
change2 = pdef2 - pdef1 #+ mdef2 - mdef1
change3 = mdef2 - mdef1
change4 = str2 - str1
change5 = dex2 - dex1
change6 = agi2 - agi1
change7 = int2 - int1
end
# 파라미터의 변화치를 묘화
self.contents.draw_text(124, 64, 112, 32,
sprintf("공격%+d", change1), 2)
self.contents.draw_text(124, 94, 112, 32,
sprintf("방어%+d", change2), 2)
self.contents.draw_text(124, 124, 112, 32,
sprintf("마법방어%+d", change3), 2)
self.contents.draw_text(124, 154, 112, 32,
sprintf("힘%+d", change4), 2)
self.contents.draw_text(124, 184, 112, 32,
sprintf("민첩%+d", change5), 2)
self.contents.draw_text(124, 214, 112, 32,
sprintf("회피%+d", change6), 2)
self.contents.draw_text(124, 244, 112, 32,
sprintf("지능%+d", change7), 2)
end
# 아이템을 묘화
if item1 != nil
x = 4
y = 104
bitmap = RPG::Cache.icon(item1.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 30
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item1.name, opacity)
end
end
end
#-----------------------------------------------
def 번호돌리기#두개를 분리한 이유는 이해가 쉽게하기 위해서
번호를더하라
번호를빼라
end
#-----------------------------------------------
def 번호를더하라
if Input.trigger? (Input::R)
@actor_index += 1
@actor_index %= $game_party.actors.size
refresh
end
end
#------------------------------------------------
def 번호를빼라
if Input.trigger? (Input::L)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
refresh
end
end
#--------------------------------------------------------------------------
# ● 아이템의 설정
# item : 새로운 아이템
#--------------------------------------------------------------------------
def item=(item)
if @item != item
@item = item
refresh
end
end
end
?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수 추천 수
148 RPGXP 스크립트 밤낮 설정 3 2013.10.01 994 0
147 RPGXP 스크립트 텔레포트 스크립트 1 2013.10.01 894 0
146 RPGXP 스크립트 장비 레벨 제한 2 2013.10.01 903 1
145 RPGXP 스크립트 윈도우 링 메뉴 1 2013.10.01 840 0
144 RPGXP 스크립트 현재위치&임무 표시 2 2013.10.01 968 0
143 RPGXP 스크립트 화면의 쉐이크를 더 어지럽게 바꿔보자! 2013.10.01 986 0
142 RPGXP 스크립트 현재 시간 확인 2 2013.10.01 899 0
141 RPGXP 스크립트 레벨업시 능력치 표시 4 2013.10.01 1081 0
140 RPGXP 스크립트 아이템 갯수 제한 2013.10.01 1061 0
139 RPGXP 스크립트 복권 스크립트 5 2013.10.01 1146 0
138 RPGXP 스크립트 대기 회복 스크립트 2013.10.01 1076 0
» RPGXP 스크립트 상점에서 아이템 능력치를 표시해주는 스크립트 1 2013.10.01 1656 0
136 RPGXP 스크립트 메뉴 스크립트 Zer0 CMS 3 2013.10.01 1383 0
135 RPGXP 스크립트 발소리 스크립트 6 2013.10.01 1730 0
134 RPGXP 스크립트 부활 스크립트 2 2013.10.01 2763 0
133 RPGXP 스크립트 미니맵 스크립트 2 2013.10.01 2177 0
132 RPGXP 스크립트 파이널 판타지 7 스타일 메뉴 6 2013.10.01 2024 0
131 RPGXP 스크립트 요청하신 게이지바 스크립트 입니다. 8 소년영남 2013.10.04 1919 1
130 RPGXP 스크립트 맵이름 표시 스크립트 18  운 2013.10.05 2244 0
129 RPGXP 스크립트 로고를 띄우는 스크립트 14 XEONSOFT블로그 2013.10.07 1677 0
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 ... 15 Next
/ 15






[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)