赞 | 5 |
VIP | 0 |
好人卡 | 2 |
积分 | 36 |
经验 | 24079 |
最后登录 | 2024-11-27 |
在线时间 | 1892 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 3616
- 在线时间
- 1892 小时
- 注册时间
- 2010-6-19
- 帖子
- 1211
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
帮助窗口如何显示 自动状态
#============================================================================== # ■ Shop_Help #------------------------------------------------------------------------------ # 特技及物品的说明、角色的状态显示的窗口。 # 若要更改属性,请搜索element_set={1=>"火",2=>"冰",3=>"光",4=>"暗",9=>"特殊物品",11=>"宠物书籍",12=>"金柳露"} 改成对应属性即可 #============================================================================== class Shop_Help < Window_Base #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(150,200, 342, 431) self.opacity = 255 self.z = 999 # 隐藏帮助窗口 self.visible = false # 更改窗口皮肤 self.windowskin = RPG::Cache.windowskin('物品皮肤/物品') end #-------------------------------------------------------------------------- # ● 设置文本 # text : 窗口显示的字符串 # align : 对齐方式 (0..左对齐、1..中间对齐、2..右对齐) #-------------------------------------------------------------------------- def set_text(data) @data=data case @data when RPG::Item # 物品 set_item_text(@data) when RPG::Weapon # 武器 set_weapon_text(@data) when RPG::Armor # 防具 set_armor_text(@data) end end #-------------------------------------------------------------------------- # ● 物品帮助窗口 #-------------------------------------------------------------------------- def set_item_text(item) @item=item description=@item.description x=0 y=0 height=0.5+2.5 #依要显示的内容确定高 #由描叙确定高 height+=description.size/3/10 if description.size%10!=0 height+=1 end height+=3 #空行,效果范围,价格 if @item.recover_hp_rate!=0 #HP 回复率。 height+=1 end if @item.recover_hp!=0 #HP 回复量。 height+=1 end if @item.recover_sp_rate!=0 #SP 回复率。 height+=1 end if @item.recover_sp!=0 #SP 回复量。 height+=1 end if @item.parameter_type!=0 #增加能力值 height+=1 end if @item.element_set.empty?!=true #属性。为属性 ID 的数组 height+=1 end if @item.plus_state_set.empty?!=true #附加状态。为状态 ID 的数组 height+=@item.plus_state_set.size end if @item.minus_state_set.empty?!=true #解除状态。为状态 ID 的数组 height+=@item.minus_state_set.size end self.height=height*15+40+15 self.contents = Bitmap.new(self.width - 32,self.height - 32) self.contents.clear #描绘名字 text=@item.name self.contents.font.color.set(255, 255, 128) # 颜色 黄色 self.contents.font.size=22 if text!=nil self.visible = true self.contents.draw_text(0,0, @item.name.size*70, 22, text, 0) else self.visible = false end x=0 y+=1 text=description #描绘描叙 while ((text = description.slice!(/./m)) != nil) self.contents.font.color = normal_color self.contents.font.size=18 self.contents.draw_text(x*15, y*15+13, 160, 18, text, 0) x+=1 if x==12#每行10个字 x=0 y+=1.2 end end #由特技属性确定高 #效果范围 scope = {0=>"特殊物品",1=>"敌单体",2=>"敌全体",3=>"己方单体",4=>"己方全体",5=>"己方昏死单体",6=>"己方昏死全体",7=>"使用者"}#HASH表 text="范围:"+scope[@item.scope] x=0 y+=2 #空一行 self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) #============================================================ # 显示物品图片 bitmap = RPG::Cache.icon('物品大图/' + item.icon_name+"_W") self.contents.blt(190, 0, bitmap, Rect.new(0, 0, 120, 120))#物品 #============================================================ #价格 # x=0 # y+=1 # self.contents.font.color = normal_color # self.contents.font.size=14 # self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0) #HP 回复率 if @item.recover_hp_rate!=0 x=0 y+=1 text="回复HP:"+@item.recover_hp_rate.to_s+"%" self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end #HP回复量 if @item.recover_hp!=0 x=0 y+=1 text="回复HP:"+@item.recover_hp.to_s self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end #SP 回复率 if @item.recover_sp_rate!=0 x=0 y+=1 text="回复SP:"+@item.recover_sp_rate.to_s+"%" self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end #SP 回复量 if @item.recover_sp!=0 x=0 y+=1 text="回复SP:"+@item.recover_sp.to_s self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end #增加能力值 if @item.parameter_type!=0 parameter_type={1=>"MaxHP",2=>"MaxSP",3=>$data_system.words.str,4=>$data_system.words.dex,5=>$data_system.words.agi,6=>$data_system.words.int} x=0 y+=1 text="增益:"+parameter_type[@item.parameter_type]+" +"+@item.parameter_points.to_s self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end #物品属性 if @item.element_set.empty?!=true #属性。为属性 ID 的数组 element_set={1=>"火",2=>"冰",3=>"光",4=>"暗",9=>"特殊物品",11=>"宠物书籍",12=>"金柳露"} text="属性:" for i in 0...@item.element_set.size text+=element_set[@item.element_set[i]]+" " end x=0 y+=1 self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end #附加状态 if @item.plus_state_set.empty?!=true #附加状态。为状态 ID 的数组 text="附加状态:" x=0 y+=1 self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) y-=1 x+=text.size*5 for i in 0...@item.plus_state_set.size y+=1 text=$data_states[@item.plus_state_set[i]].name self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end end #解除状态 if @item.minus_state_set.empty?!=true #解除状态。为状态 ID 的数组 text="解除状态:" x=0 y+=1 self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) y-=1 x+=text.size*5 for i in 0...@item.minus_state_set.size y+=1 text=$data_states[@item.minus_state_set[i]].name self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end end end #-------------------------------------------------------------------------- # ● 武器帮助窗口 #-------------------------------------------------------------------------- def set_weapon_text(weapon) @weapon=weapon description=@weapon.description x=0 y=0 height=0.5+1 #依要显示的内容确定高 #由描叙确定高 height+=description.size/3/10 if description.size%10!=0 height+=1 end height+=3 #2个空行,攻击,价格 if @weapon.pdef!=0 #物理防御 height+=1 end if @weapon.mdef!=0 #魔法防御 height+=1 end if @weapon.str_plus!=0 #力量 height+=1 end if @weapon.dex_plus!=0#体质 height+=1 end if @weapon.agi_plus!=0#敏捷 height+=1 end if @weapon.int_plus!=0 #智力 height+=1 end if @weapon.element_set.empty?!=true #属性。为属性 ID 的数组 height+=1 end if @weapon.plus_state_set.empty?!=true #附加状态。为状态 ID 的数组 height+=@weapon.plus_state_set.size end if @weapon.minus_state_set.empty?!=true #解除状态。为状态 ID 的数组 height+=@weapon.minus_state_set.size end self.height=height*15+40+15 self.contents = Bitmap.new(self.width - 32,self.height - 32) self.contents.clear #描绘名字 text=@weapon.name self.contents.font.color.set(255, 255, 128) # 颜色 黄色 self.contents.font.size=22 if text!=nil self.visible = true self.contents.draw_text(0,0, @weapon.name.size*70, 22, text, 0) else self.visible = false end x=0 y+=1.5 text=description #描绘描叙 while ((text = description.slice!(/./m)) != nil) self.contents.font.color = normal_color self.contents.font.size=18 self.contents.draw_text(x*15, y*15+5, 160, 18, text, 0) x+=1 if x==12#每行10个字 x=0 y+=1.2 end end #由特技属性确定高 #攻击 x=0 y+=2 #空行 text="攻击:"+@weapon.atk.to_s self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) #============================================================ # 显示武器图片 bitmap = RPG::Cache.icon('物品大图/' + weapon.icon_name+"_W") self.contents.blt(190, 0, bitmap, Rect.new(0, 0, 120, 120))#武器 #============================================================ #价格 # x=0 # y+=1 # self.contents.font.color = normal_color # self.contents.font.size=14 # self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0) if @weapon.pdef!=0 #物理防御 x=0 y+=1 text="物理防御:"+@weapon.pdef.to_s self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end if @weapon.mdef!=0 #魔法防御 x=0 y+=1 text="魔法防御:"+@weapon.mdef.to_s self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end #武器属性 if @weapon.element_set.empty?!=true #属性。为属性 ID 的数组 element_set={1=>"火",2=>"冰",3=>"光",4=>"暗",9=>"特殊物品",11=>"宠物书籍",12=>"金柳露"} text="属性:" for i in 0...@weapon.element_set.size text+=element_set[@weapon.element_set[i]]+" " end x=0 y+=1 self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end #附加状态 if @weapon.plus_state_set.empty?!=true #附加状态。为状态 ID 的数组 text="附加状态:" x=0 y+=1 self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) y-=1 x+=text.size*5 for i in 0...@weapon.plus_state_set.size y+=1 text=$data_states[@weapon.plus_state_set[i]].name self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end end #解除状态 if @weapon.minus_state_set.empty?!=true #解除状态。为状态 ID 的数组 text="解除状态:" x=0 y+=1 self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) y-=1 x+=text.size*5 for i in 0...@weapon.minus_state_set.size y+=1 text=$data_states[@weapon.minus_state_set[i]].name self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end end y+=1 #空行 if @weapon.str_plus!=0 #力量 x=0 y+=1 text=$data_system.words.str+" + "+@weapon.str_plus.to_s self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end if @weapon.dex_plus!=0#体质 x=0 y+=1 text=$data_system.words.dex+" + "+@weapon.dex_plus.to_s self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end if @weapon.agi_plus!=0#敏捷 x=0 y+=1 text=$data_system.words.agi+" + "+@weapon.agi_plus.to_s self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end if @weapon.int_plus!=0 #智力 x=0 y+=1 text=$data_system.words.int+" + "+@weapon.int_plus.to_s self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end end #-------------------------------------------------------------------------- # ● 防具帮助窗口 #-------------------------------------------------------------------------- def set_armor_text(armor) def set_armor_text(armor) @armor=armor description=@armor.description x=0 y=0 height=1+0.5 #依要显示的内容确定高 #由描叙确定高 height+=description.size/3/10 if description.size%10!=0 height+=1 end height+=2 #2个空行,价格 if @armor.pdef!=0 #物理防御 height+=1 end if @armor.mdef!=0 #魔法防御 height+=1 end if @armor.str_plus!=0 #力量 height+=1 end if @armor.dex_plus!=0#体质 height+=1 end if @armor.agi_plus!=0#敏捷 height+=1 end if @armor.int_plus!=0 #智力 height+=1 end if @armor.guard_element_set.empty?!=true #属性防御。为属性 ID 的数组 height+=1 end if @armor.guard_state_set.empty?!=true #状态防御。为状态 ID 的数组 height+=@armor.guard_state_set.size end self.height=height*15+40+15 self.contents = Bitmap.new(self.width - 32,self.height - 32) self.contents.clear #描绘名字 text=@armor.name self.contents.font.color.set(255, 255, 128) # 颜色 黄色 self.contents.font.size=22 if text!=nil self.visible = true self.contents.draw_text(0,0, @armor.name.size*70, 22, text, 0) else self.visible = false end x=0 y+=1.5 text=description #描绘描叙 while ((text = description.slice!(/./m)) != nil) self.contents.font.color = normal_color self.contents.font.size=18 self.contents.draw_text(x*15, y*15+5, 160, 18, text, 0) x+=1 if x==12#每行10个字 x=0 y+=1.2 end end #由特技属性确定高 #============================================================ # 显示防具图片 bitmap = RPG::Cache.icon('物品大图/' + armor.icon_name+"_W") self.contents.blt(190, 0, bitmap, Rect.new(0, 0, 120, 120))#防具 #============================================================ #价格 # x=0 y+=1#空行 # self.contents.font.color = normal_color # self.contents.font.size=14 # self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0) if @armor.pdef!=0 #物理防御 x=0 y+=1 text="物理防御:"+@armor.pdef.to_s self.contents.font.color = text_color(armor.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end if @armor.mdef!=0 #魔法防御 x=0 y+=1 text="魔法防御:"+@armor.mdef.to_s self.contents.font.color = text_color(armor.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end #属性防御 if @armor.guard_element_set.empty?!=true #属性。为属性 ID 的数组 element_set={1=>"火",2=>"冰",3=>"光",4=>"暗",9=>"特殊物品",11=>"宠物书籍",12=>"金柳露"} text="属性防御:" for i in 0...@armor.guard_element_set.size text+=element_set[@armor.guard_element_set[i]]+" " end x=0 y+=1 self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end #状态防御 if @armor.guard_state_set.empty?!=true #附加状态。为状态 ID 的数组 text="状态防御:" x=0 y+=1 self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) y-=1 x+=text.size*5 for i in 0...@armor.guard_state_set.size y+=1 text=$data_states[@armor.guard_state_set[i]].name self.contents.font.color = normal_color self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end end y+=1 #空行 if @armor.str_plus!=0 #力量 x=0 y+=1 text=$data_system.words.str+" + "+@armor.str_plus.to_s self.contents.font.color = text_color(armor.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end if @armor.dex_plus!=0#体质 x=0 y+=1 text=$data_system.words.dex+" + "+@armor.dex_plus.to_s self.contents.font.color = text_color(armor.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end if @armor.agi_plus!=0#敏捷 x=0 y+=1 text=$data_system.words.agi+" + "+@armor.agi_plus.to_s self.contents.font.color = text_color(armor.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end if @armor.int_plus!=0 #智力 x=0 y+=1 text=$data_system.words.int+" + "+@armor.int_plus.to_s self.contents.font.color = text_color(armor.name_color_66RPG)#颜色脚本 self.contents.font.size=14 self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0) end end end #-------------------------------------------------------------------------- # ● 设置角色 # actor : 要显示状态的角色 #-------------------------------------------------------------------------- def set_actor(actor) if actor != @actor self.contents.clear draw_actor_name(actor, 4, 0) draw_actor_state(actor, 140, 0) draw_actor_hp(actor, 284, 0) draw_actor_sp(actor, 460, 0) @actor = actor @text = nil self.visible = true end end #-------------------------------------------------------------------------- # ● 设置敌人 # enemy : 要显示名字和状态的敌人 #-------------------------------------------------------------------------- def set_enemy(enemy) text = enemy.name state_text = make_battler_state_text(enemy, 112, false) if state_text != "" text += " " + state_text end set_text(text, 1) end #-------------------------------------------------------------------------- # ● 校正帮助窗口位置 #-------------------------------------------------------------------------- def set_pos(x,y,width,oy,index,column_max) #光标坐标 xx = index % column_max * 59.5 - ox yy = index / column_max * 60 - oy self.x=xx+x+74 self.y=yy+y+74 if self.x+self.width>1024 self.x=1024-self.width end if self.y+self.height>420 self.y=420-self.height end end end
#==============================================================================
# ■ Shop_Help
#------------------------------------------------------------------------------
# 特技及物品的说明、角色的状态显示的窗口。
# 若要更改属性,请搜索element_set={1=>"火",2=>"冰",3=>"光",4=>"暗",9=>"特殊物品",11=>"宠物书籍",12=>"金柳露"} 改成对应属性即可
#==============================================================================
class Shop_Help < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(150,200, 342, 431)
self.opacity = 255
self.z = 999
# 隐藏帮助窗口
self.visible = false
# 更改窗口皮肤
self.windowskin = RPG::Cache.windowskin('物品皮肤/物品')
end
#--------------------------------------------------------------------------
# ● 设置文本
# text : 窗口显示的字符串
# align : 对齐方式 (0..左对齐、1..中间对齐、2..右对齐)
#--------------------------------------------------------------------------
def set_text(data)
@data=data
case @data
when RPG::Item # 物品
set_item_text(@data)
when RPG::Weapon # 武器
set_weapon_text(@data)
when RPG::Armor # 防具
set_armor_text(@data)
end
end
#--------------------------------------------------------------------------
# ● 物品帮助窗口
#--------------------------------------------------------------------------
def set_item_text(item)
@item=item
description=@item.description
x=0
y=0
height=0.5+2.5 #依要显示的内容确定高
#由描叙确定高
height+=description.size/3/10
if description.size%10!=0
height+=1
end
height+=3 #空行,效果范围,价格
if @item.recover_hp_rate!=0 #HP 回复率。
height+=1
end
if @item.recover_hp!=0 #HP 回复量。
height+=1
end
if @item.recover_sp_rate!=0 #SP 回复率。
height+=1
end
if @item.recover_sp!=0 #SP 回复量。
height+=1
end
if @item.parameter_type!=0 #增加能力值
height+=1
end
if @item.element_set.empty?!=true #属性。为属性 ID 的数组
height+=1
end
if @item.plus_state_set.empty?!=true #附加状态。为状态 ID 的数组
height+=@item.plus_state_set.size
end
if @item.minus_state_set.empty?!=true #解除状态。为状态 ID 的数组
height+=@item.minus_state_set.size
end
self.height=height*15+40+15
self.contents = Bitmap.new(self.width - 32,self.height - 32)
self.contents.clear
#描绘名字
text=@item.name
self.contents.font.color.set(255, 255, 128) # 颜色 黄色
self.contents.font.size=22
if text!=nil
self.visible = true
self.contents.draw_text(0,0, @item.name.size*70, 22, text, 0)
else
self.visible = false
end
x=0
y+=1
text=description
#描绘描叙
while ((text = description.slice!(/./m)) != nil)
self.contents.font.color = normal_color
self.contents.font.size=18
self.contents.draw_text(x*15, y*15+13, 160, 18, text, 0)
x+=1
if x==12#每行10个字
x=0
y+=1.2
end
end
#由特技属性确定高
#效果范围
scope = {0=>"特殊物品",1=>"敌单体",2=>"敌全体",3=>"己方单体",4=>"己方全体",5=>"己方昏死单体",6=>"己方昏死全体",7=>"使用者"}#HASH表
text="范围:"+scope[@item.scope]
x=0
y+=2 #空一行
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
#============================================================
# 显示物品图片
bitmap = RPG::Cache.icon('物品大图/' + item.icon_name+"_W")
self.contents.blt(190, 0, bitmap, Rect.new(0, 0, 120, 120))#物品
#============================================================
#价格
# x=0
# y+=1
# self.contents.font.color = normal_color
# self.contents.font.size=14
# self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
#HP 回复率
if @item.recover_hp_rate!=0
x=0
y+=1
text="回复HP:"+@item.recover_hp_rate.to_s+"%"
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
#HP回复量
if @item.recover_hp!=0
x=0
y+=1
text="回复HP:"+@item.recover_hp.to_s
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
#SP 回复率
if @item.recover_sp_rate!=0
x=0
y+=1
text="回复SP:"+@item.recover_sp_rate.to_s+"%"
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
#SP 回复量
if @item.recover_sp!=0
x=0
y+=1
text="回复SP:"+@item.recover_sp.to_s
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
#增加能力值
if @item.parameter_type!=0
parameter_type={1=>"MaxHP",2=>"MaxSP",3=>$data_system.words.str,4=>$data_system.words.dex,5=>$data_system.words.agi,6=>$data_system.words.int}
x=0
y+=1
text="增益:"+parameter_type[@item.parameter_type]+" +"+@item.parameter_points.to_s
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
#物品属性
if @item.element_set.empty?!=true #属性。为属性 ID 的数组
element_set={1=>"火",2=>"冰",3=>"光",4=>"暗",9=>"特殊物品",11=>"宠物书籍",12=>"金柳露"}
text="属性:"
for i in 0...@item.element_set.size
text+=element_set[@item.element_set[i]]+" "
end
x=0
y+=1
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
#附加状态
if @item.plus_state_set.empty?!=true #附加状态。为状态 ID 的数组
text="附加状态:"
x=0
y+=1
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
y-=1
x+=text.size*5
for i in 0...@item.plus_state_set.size
y+=1
text=$data_states[@item.plus_state_set[i]].name
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
end
#解除状态
if @item.minus_state_set.empty?!=true #解除状态。为状态 ID 的数组
text="解除状态:"
x=0
y+=1
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
y-=1
x+=text.size*5
for i in 0...@item.minus_state_set.size
y+=1
text=$data_states[@item.minus_state_set[i]].name
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
end
end
#--------------------------------------------------------------------------
# ● 武器帮助窗口
#--------------------------------------------------------------------------
def set_weapon_text(weapon)
@weapon=weapon
description=@weapon.description
x=0
y=0
height=0.5+1 #依要显示的内容确定高
#由描叙确定高
height+=description.size/3/10
if description.size%10!=0
height+=1
end
height+=3 #2个空行,攻击,价格
if @weapon.pdef!=0 #物理防御
height+=1
end
if @weapon.mdef!=0 #魔法防御
height+=1
end
if @weapon.str_plus!=0 #力量
height+=1
end
if @weapon.dex_plus!=0#体质
height+=1
end
if @weapon.agi_plus!=0#敏捷
height+=1
end
if @weapon.int_plus!=0 #智力
height+=1
end
if @weapon.element_set.empty?!=true #属性。为属性 ID 的数组
height+=1
end
if @weapon.plus_state_set.empty?!=true #附加状态。为状态 ID 的数组
height+=@weapon.plus_state_set.size
end
if @weapon.minus_state_set.empty?!=true #解除状态。为状态 ID 的数组
height+=@weapon.minus_state_set.size
end
self.height=height*15+40+15
self.contents = Bitmap.new(self.width - 32,self.height - 32)
self.contents.clear
#描绘名字
text=@weapon.name
self.contents.font.color.set(255, 255, 128) # 颜色 黄色
self.contents.font.size=22
if text!=nil
self.visible = true
self.contents.draw_text(0,0, @weapon.name.size*70, 22, text, 0)
else
self.visible = false
end
x=0
y+=1.5
text=description
#描绘描叙
while ((text = description.slice!(/./m)) != nil)
self.contents.font.color = normal_color
self.contents.font.size=18
self.contents.draw_text(x*15, y*15+5, 160, 18, text, 0)
x+=1
if x==12#每行10个字
x=0
y+=1.2
end
end
#由特技属性确定高
#攻击
x=0
y+=2 #空行
text="攻击:"+@weapon.atk.to_s
self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
#============================================================
# 显示武器图片
bitmap = RPG::Cache.icon('物品大图/' + weapon.icon_name+"_W")
self.contents.blt(190, 0, bitmap, Rect.new(0, 0, 120, 120))#武器
#============================================================
#价格
# x=0
# y+=1
# self.contents.font.color = normal_color
# self.contents.font.size=14
# self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
if @weapon.pdef!=0 #物理防御
x=0
y+=1
text="物理防御:"+@weapon.pdef.to_s
self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
if @weapon.mdef!=0 #魔法防御
x=0
y+=1
text="魔法防御:"+@weapon.mdef.to_s
self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
#武器属性
if @weapon.element_set.empty?!=true #属性。为属性 ID 的数组
element_set={1=>"火",2=>"冰",3=>"光",4=>"暗",9=>"特殊物品",11=>"宠物书籍",12=>"金柳露"}
text="属性:"
for i in 0...@weapon.element_set.size
text+=element_set[@weapon.element_set[i]]+" "
end
x=0
y+=1
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
#附加状态
if @weapon.plus_state_set.empty?!=true #附加状态。为状态 ID 的数组
text="附加状态:"
x=0
y+=1
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
y-=1
x+=text.size*5
for i in 0...@weapon.plus_state_set.size
y+=1
text=$data_states[@weapon.plus_state_set[i]].name
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
end
#解除状态
if @weapon.minus_state_set.empty?!=true #解除状态。为状态 ID 的数组
text="解除状态:"
x=0
y+=1
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
y-=1
x+=text.size*5
for i in 0...@weapon.minus_state_set.size
y+=1
text=$data_states[@weapon.minus_state_set[i]].name
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
end
y+=1 #空行
if @weapon.str_plus!=0 #力量
x=0
y+=1
text=$data_system.words.str+" + "+@weapon.str_plus.to_s
self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
if @weapon.dex_plus!=0#体质
x=0
y+=1
text=$data_system.words.dex+" + "+@weapon.dex_plus.to_s
self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
if @weapon.agi_plus!=0#敏捷
x=0
y+=1
text=$data_system.words.agi+" + "+@weapon.agi_plus.to_s
self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
if @weapon.int_plus!=0 #智力
x=0
y+=1
text=$data_system.words.int+" + "+@weapon.int_plus.to_s
self.contents.font.color = text_color(weapon.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
end
#--------------------------------------------------------------------------
# ● 防具帮助窗口
#--------------------------------------------------------------------------
def set_armor_text(armor)
def set_armor_text(armor)
@armor=armor
description=@armor.description
x=0
y=0
height=1+0.5 #依要显示的内容确定高
#由描叙确定高
height+=description.size/3/10
if description.size%10!=0
height+=1
end
height+=2 #2个空行,价格
if @armor.pdef!=0 #物理防御
height+=1
end
if @armor.mdef!=0 #魔法防御
height+=1
end
if @armor.str_plus!=0 #力量
height+=1
end
if @armor.dex_plus!=0#体质
height+=1
end
if @armor.agi_plus!=0#敏捷
height+=1
end
if @armor.int_plus!=0 #智力
height+=1
end
if @armor.guard_element_set.empty?!=true #属性防御。为属性 ID 的数组
height+=1
end
if @armor.guard_state_set.empty?!=true #状态防御。为状态 ID 的数组
height+=@armor.guard_state_set.size
end
self.height=height*15+40+15
self.contents = Bitmap.new(self.width - 32,self.height - 32)
self.contents.clear
#描绘名字
text=@armor.name
self.contents.font.color.set(255, 255, 128) # 颜色 黄色
self.contents.font.size=22
if text!=nil
self.visible = true
self.contents.draw_text(0,0, @armor.name.size*70, 22, text, 0)
else
self.visible = false
end
x=0
y+=1.5
text=description
#描绘描叙
while ((text = description.slice!(/./m)) != nil)
self.contents.font.color = normal_color
self.contents.font.size=18
self.contents.draw_text(x*15, y*15+5, 160, 18, text, 0)
x+=1
if x==12#每行10个字
x=0
y+=1.2
end
end
#由特技属性确定高
#============================================================
# 显示防具图片
bitmap = RPG::Cache.icon('物品大图/' + armor.icon_name+"_W")
self.contents.blt(190, 0, bitmap, Rect.new(0, 0, 120, 120))#防具
#============================================================
#价格
# x=0
y+=1#空行
# self.contents.font.color = normal_color
# self.contents.font.size=14
# self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
if @armor.pdef!=0 #物理防御
x=0
y+=1
text="物理防御:"+@armor.pdef.to_s
self.contents.font.color = text_color(armor.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
if @armor.mdef!=0 #魔法防御
x=0
y+=1
text="魔法防御:"+@armor.mdef.to_s
self.contents.font.color = text_color(armor.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
#属性防御
if @armor.guard_element_set.empty?!=true #属性。为属性 ID 的数组
element_set={1=>"火",2=>"冰",3=>"光",4=>"暗",9=>"特殊物品",11=>"宠物书籍",12=>"金柳露"}
text="属性防御:"
for i in 0...@armor.guard_element_set.size
text+=element_set[@armor.guard_element_set[i]]+" "
end
x=0
y+=1
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
#状态防御
if @armor.guard_state_set.empty?!=true #附加状态。为状态 ID 的数组
text="状态防御:"
x=0
y+=1
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
y-=1
x+=text.size*5
for i in 0...@armor.guard_state_set.size
y+=1
text=$data_states[@armor.guard_state_set[i]].name
self.contents.font.color = normal_color
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
end
y+=1 #空行
if @armor.str_plus!=0 #力量
x=0
y+=1
text=$data_system.words.str+" + "+@armor.str_plus.to_s
self.contents.font.color = text_color(armor.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
if @armor.dex_plus!=0#体质
x=0
y+=1
text=$data_system.words.dex+" + "+@armor.dex_plus.to_s
self.contents.font.color = text_color(armor.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
if @armor.agi_plus!=0#敏捷
x=0
y+=1
text=$data_system.words.agi+" + "+@armor.agi_plus.to_s
self.contents.font.color = text_color(armor.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
if @armor.int_plus!=0 #智力
x=0
y+=1
text=$data_system.words.int+" + "+@armor.int_plus.to_s
self.contents.font.color = text_color(armor.name_color_66RPG)#颜色脚本
self.contents.font.size=14
self.contents.draw_text(x, y*15+5, text.size*60, 16, text, 0)
end
end
end
#--------------------------------------------------------------------------
# ● 设置角色
# actor : 要显示状态的角色
#--------------------------------------------------------------------------
def set_actor(actor)
if actor != @actor
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
draw_actor_hp(actor, 284, 0)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
end
end
#--------------------------------------------------------------------------
# ● 设置敌人
# enemy : 要显示名字和状态的敌人
#--------------------------------------------------------------------------
def set_enemy(enemy)
text = enemy.name
state_text = make_battler_state_text(enemy, 112, false)
if state_text != ""
text += " " + state_text
end
set_text(text, 1)
end
#--------------------------------------------------------------------------
# ● 校正帮助窗口位置
#--------------------------------------------------------------------------
def set_pos(x,y,width,oy,index,column_max)
#光标坐标
xx = index % column_max * 59.5 - ox
yy = index / column_max * 60 - oy
self.x=xx+x+74
self.y=yy+y+74
if self.x+self.width>1024
self.x=1024-self.width
end
if self.y+self.height>420
self.y=420-self.height
end
end
end
|
|