189.19 KB, 下载次数: 70
#==============================================================================
# ■ Window_BattleResult
#------------------------------------------------------------------------------
# 战斗结束时、显示获得的 EXP 及金钱的窗口。
#==============================================================================
class Window_BattleResult < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
# exp : EXP
# gold : 金钱
# treasures : 宝物
#--------------------------------------------------------------------------
def initialize(exp, gold, treasures)
@数量 = Hash.new {|hash,key| hash[key] = 0}
@重复 = []
for item in treasures
unless @重复.include? item
@重复 << item
@数量[item] += 1
else
@数量[item] += 1
end
end
@exp = exp
@gold = gold
@treasures = treasures
super(160, 0, 320, @重复.size * 32 + 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.y = 160 - height / 2
self.back_opacity = 160
self.visible = false
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
x = 4
self.contents.font.color = normal_color
cx = contents.text_size(@exp.to_s).width
self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
x += cx + 4
self.contents.font.color = system_color
cx = contents.text_size("EXP").width
self.contents.draw_text(x, 0, 64, 32, "EXP")
x += cx + 16
self.contents.font.color = normal_color
cx = contents.text_size(@gold.to_s).width
self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
x += cx + 4
self.contents.font.color = system_color
self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
y = 32
for item in @重复
draw_item_name(item, 4, y)
contents.draw_text(24 + contents.text_size(item.name).width, y,
width - 40, 32, " × "+@数量[item].to_s)
y += 32
end
end
end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |