Project1
标题: 装备界面显示HP和SP变化修改 [打印本页]
作者: wingzeroplus 时间: 2013-6-12 15:59
标题: 装备界面显示HP和SP变化修改
本帖最后由 wingzeroplus 于 2013-6-16 22:31 编辑
原帖是亿万大哥的这个
http://www.66rpg.com/articles/4448
里面只包含能力上升下降显示,并不包含HP和SP上升和下降显示(比如装备自带状态 hp120%之类的)
自己尝试修改了增加了new_hp,@new_hp,new_sp,@new_sp以及调整成了10个参数,不过运行还是报错
内容为new_hp为定义,找来找去都没找到,求指导
作者: 美丽晨露 时间: 2013-6-13 15:43
http://rpg.blue/thread-256098-1-1.html
通过状态,让HPSP增减的话,在装备栏不知道用上贴的方式显示?
作者: wingzeroplus 时间: 2013-6-14 16:30
召唤原作者 @亿万星辰 不知道过了这么多年还能想起来不(2007年我就见过这个东西了,至少6年了)
作者: 亿万星辰 时间: 2013-6-14 16:50
这个里面首先没有HP和SP的描绘,这个增加上就可以了,然后同样的根据装备前后的数值比较一下就可以依法炮制了。
作者: wwwcctvty 时间: 2013-6-14 16:52
是不是这个效果{:2_275:}
作者: wwwcctvty 时间: 2013-6-14 16:55
脚本修改好了{:2_262:}
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
def up_color
return Color.new(255, 0, 0)
end
def down_color
return Color.new(0, 255, 0)
end
#--------------------------------------------------------------------------
# ● 描绘能力值
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# type : 能力值种类 (0~6)
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
#-------------------------yy
when 7
parameter_name = $data_system.words.hp
parameter_value = actor.hp
when 8
parameter_name = $data_system.words.sp
parameter_value = actor.sp
#----------------------------yy
###############################################################
when 9
parameter_name = "回避"
parameter_value = actor.eva
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
end
#==============================================================================
# ■ Window_EquipLeft
#------------------------------------------------------------------------------
# 装备画面的、显示角色能力值变化的窗口。
#==============================================================================
class Window_EquipLeft < Window_Base
UP_ICON = "048-Skill05"
DOWN_ICON = "047-Skill04"
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 272, 416)
self.contents = Bitmap.new(width - 32, height - 32)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 4, 32)
###############################################################
draw_actor_parameter(@actor, 4, 64, 0)
draw_actor_parameter(@actor, 4, 96, 1)
draw_actor_parameter(@actor, 4, 128, 2)
draw_actor_parameter(@actor, 4, 160, 7)
draw_actor_parameter(@actor, 4, 192, 3)
draw_actor_parameter(@actor, 4, 224, 4)
draw_actor_parameter(@actor, 4, 256, 5)
draw_actor_parameter(@actor, 4, 288, 6)
#-------------------------yy
draw_actor_parameter(@actor, 4, 320, 7)
draw_actor_parameter(@actor, 4, 352, 8)
#-------------------------yy
if @new_atk != nil
if @new_atk > @actor.atk
self.contents.blt(164, 64, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_atk < @actor.atk
self.contents.blt(164, 64, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_atk>@actor.atk ? up_color : down_color
self.contents.font.color = normal_color if @new_atk == @actor.atk
self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
if @new_pdef > @actor.pdef
self.contents.blt(164, 96, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_pdef < @actor.pdef
self.contents.blt(164, 96, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_pdef>@actor.pdef ? up_color : down_color
self.contents.font.color = normal_color if @new_pdef == @actor.pdef
self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
if @new_mdef > @actor.mdef
self.contents.blt(164, 128, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_mdef < @actor.mdef
self.contents.blt(164, 128, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_mdef>@actor.mdef ? up_color : down_color
self.contents.font.color = normal_color if @new_mdef == @actor.mdef
self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
end
if @new_eva != nil
if @new_eva > @actor.eva
self.contents.blt(164, 160, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_eva < @actor.eva
self.contents.blt(164, 160, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_eva>@actor.eva ? up_color : down_color
self.contents.font.color = normal_color if @new_eva == @actor.eva
self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
end
if @new_str != nil
if @new_str > @actor.str
self.contents.blt(164, 192, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_str < @actor.str
self.contents.blt(164, 192, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_str>@actor.str ? up_color : down_color
self.contents.font.color = normal_color if @new_str == @actor.str
self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil
if @new_dex > @actor.dex
self.contents.blt(164, 224, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_dex < @actor.dex
self.contents.blt(164, 224, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_dex>@actor.dex ? up_color : down_color
self.contents.font.color = normal_color if @new_dex == @actor.dex
self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil
if @new_agi > @actor.agi
self.contents.blt(164, 256, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_agi < @actor.agi
self.contents.blt(164, 256, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_agi>@actor.agi ? up_color : down_color
self.contents.font.color = normal_color if @new_agi == @actor.agi
self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil
if @new_int > @actor.int
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_int < @actor.int
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_int>@actor.int ? up_color : down_color
self.contents.font.color = normal_color if @new_int == @actor.int
self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
end
#-----------------------------yy
if @new_hp != nil
if @new_hp > @actor.hp
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_hp < @actor.hp
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_hp>@actor.hp ? up_color : down_color
self.contents.font.color = normal_color if @new_hp == @actor.hp
self.contents.draw_text(200, 288, 36, 32, @new_hp.to_s, 2)
end
if @new_sp != nil
if @new_sp > @actor.sp
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_sp < @actor.sp
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_sp>@actor.sp ? up_color : down_color
self.contents.font.color = normal_color if @new_sp == @actor.sp
self.contents.draw_text(200, 288, 36, 32, @new_sp.to_s, 2)
end
#---------------------------------yy
end
#--------------------------------------------------------------------------
# ● 变更装备后的能力值设置
# new_atk : 变更装备后的攻击力
# new_pdef : 变更装备后的物理防御
# new_mdef : 变更装备后的魔法防御
#--------------------------------------------------------------------------
###############################################################
#-------------------------------yy
def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or
@new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int or @new_hp != new_hp or @new_sp != new_sp
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_eva = new_eva
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
@new_hp = new_hp
@new_sp = new_sp
refresh
end
end
#------------------------------------yy
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
# 装备画面、显示浏览变更装备的候补物品的窗口。
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
# equip_type : 装备部位 (0~3)
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# ● 项目的描绘
# index : 项目符号
#--------------------------------------------------------------------------
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 + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end
#==============================================================================
# ■ Scene_Equip
#------------------------------------------------------------------------------
# 处理装备画面的类。
#==============================================================================
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
# 设置当前的物品窗口到 @item_window
case @right_window.index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
# 右窗口被激活的情况下
if @right_window.active
# 删除变更装备后的能力
###############################################################
@left_window.set_new_parameters(nil, nil, 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
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
# 获取变更装备后的能力值
###############################################################
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_eva = @actor.eva
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
#----------------------yy
new_hp = @actor.hp
new_sp = @actor.sp
#----------------------yy
# 返回到装备
@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_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
end
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
def up_color
return Color.new(255, 0, 0)
end
def down_color
return Color.new(0, 255, 0)
end
#--------------------------------------------------------------------------
# ● 描绘能力值
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# type : 能力值种类 (0~6)
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
#-------------------------yy
when 7
parameter_name = $data_system.words.hp
parameter_value = actor.hp
when 8
parameter_name = $data_system.words.sp
parameter_value = actor.sp
#----------------------------yy
###############################################################
when 9
parameter_name = "回避"
parameter_value = actor.eva
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
end
#==============================================================================
# ■ Window_EquipLeft
#------------------------------------------------------------------------------
# 装备画面的、显示角色能力值变化的窗口。
#==============================================================================
class Window_EquipLeft < Window_Base
UP_ICON = "048-Skill05"
DOWN_ICON = "047-Skill04"
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 272, 416)
self.contents = Bitmap.new(width - 32, height - 32)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 4, 32)
###############################################################
draw_actor_parameter(@actor, 4, 64, 0)
draw_actor_parameter(@actor, 4, 96, 1)
draw_actor_parameter(@actor, 4, 128, 2)
draw_actor_parameter(@actor, 4, 160, 7)
draw_actor_parameter(@actor, 4, 192, 3)
draw_actor_parameter(@actor, 4, 224, 4)
draw_actor_parameter(@actor, 4, 256, 5)
draw_actor_parameter(@actor, 4, 288, 6)
#-------------------------yy
draw_actor_parameter(@actor, 4, 320, 7)
draw_actor_parameter(@actor, 4, 352, 8)
#-------------------------yy
if @new_atk != nil
if @new_atk > @actor.atk
self.contents.blt(164, 64, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_atk < @actor.atk
self.contents.blt(164, 64, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_atk>@actor.atk ? up_color : down_color
self.contents.font.color = normal_color if @new_atk == @actor.atk
self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
if @new_pdef > @actor.pdef
self.contents.blt(164, 96, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_pdef < @actor.pdef
self.contents.blt(164, 96, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_pdef>@actor.pdef ? up_color : down_color
self.contents.font.color = normal_color if @new_pdef == @actor.pdef
self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
if @new_mdef > @actor.mdef
self.contents.blt(164, 128, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_mdef < @actor.mdef
self.contents.blt(164, 128, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_mdef>@actor.mdef ? up_color : down_color
self.contents.font.color = normal_color if @new_mdef == @actor.mdef
self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
end
if @new_eva != nil
if @new_eva > @actor.eva
self.contents.blt(164, 160, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_eva < @actor.eva
self.contents.blt(164, 160, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_eva>@actor.eva ? up_color : down_color
self.contents.font.color = normal_color if @new_eva == @actor.eva
self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
end
if @new_str != nil
if @new_str > @actor.str
self.contents.blt(164, 192, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_str < @actor.str
self.contents.blt(164, 192, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_str>@actor.str ? up_color : down_color
self.contents.font.color = normal_color if @new_str == @actor.str
self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil
if @new_dex > @actor.dex
self.contents.blt(164, 224, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_dex < @actor.dex
self.contents.blt(164, 224, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_dex>@actor.dex ? up_color : down_color
self.contents.font.color = normal_color if @new_dex == @actor.dex
self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil
if @new_agi > @actor.agi
self.contents.blt(164, 256, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_agi < @actor.agi
self.contents.blt(164, 256, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_agi>@actor.agi ? up_color : down_color
self.contents.font.color = normal_color if @new_agi == @actor.agi
self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil
if @new_int > @actor.int
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_int < @actor.int
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_int>@actor.int ? up_color : down_color
self.contents.font.color = normal_color if @new_int == @actor.int
self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
end
#-----------------------------yy
if @new_hp != nil
if @new_hp > @actor.hp
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_hp < @actor.hp
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_hp>@actor.hp ? up_color : down_color
self.contents.font.color = normal_color if @new_hp == @actor.hp
self.contents.draw_text(200, 288, 36, 32, @new_hp.to_s, 2)
end
if @new_sp != nil
if @new_sp > @actor.sp
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_sp < @actor.sp
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_sp>@actor.sp ? up_color : down_color
self.contents.font.color = normal_color if @new_sp == @actor.sp
self.contents.draw_text(200, 288, 36, 32, @new_sp.to_s, 2)
end
#---------------------------------yy
end
#--------------------------------------------------------------------------
# ● 变更装备后的能力值设置
# new_atk : 变更装备后的攻击力
# new_pdef : 变更装备后的物理防御
# new_mdef : 变更装备后的魔法防御
#--------------------------------------------------------------------------
###############################################################
#-------------------------------yy
def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or
@new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int or @new_hp != new_hp or @new_sp != new_sp
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_eva = new_eva
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
@new_hp = new_hp
@new_sp = new_sp
refresh
end
end
#------------------------------------yy
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
# 装备画面、显示浏览变更装备的候补物品的窗口。
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
# equip_type : 装备部位 (0~3)
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# ● 项目的描绘
# index : 项目符号
#--------------------------------------------------------------------------
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 + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end
#==============================================================================
# ■ Scene_Equip
#------------------------------------------------------------------------------
# 处理装备画面的类。
#==============================================================================
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
# 设置当前的物品窗口到 @item_window
case @right_window.index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
# 右窗口被激活的情况下
if @right_window.active
# 删除变更装备后的能力
###############################################################
@left_window.set_new_parameters(nil, nil, 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
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
# 获取变更装备后的能力值
###############################################################
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_eva = @actor.eva
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
#----------------------yy
new_hp = @actor.hp
new_sp = @actor.sp
#----------------------yy
# 返回到装备
@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_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
end
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
作者: wwwcctvty 时间: 2013-6-14 17:42
吞?本来脚本就没设置显示“回避”,何来吞之说、、、、、、、、、、、
作者: wwwcctvty 时间: 2013-6-14 18:52
wwwcctvty 发表于 2013-6-14 17:42
吞?本来脚本就没设置显示“回避”,何来吞之说、、、、、、、、、、、 ...
、、、、、我也设置了“回避”呀,加上不就可以了,何来被HP吞了之说{:2_271:}
作者: wingzeroplus 时间: 2013-6-14 19:47
等等,有问题,我自己怎么改都会出现,只要一选择装备,就会发生
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int,new_hp,new_sp)
“未定义 new_hp”报错
作者: wwwcctvty 时间: 2013-6-14 20:00
星辰大大,我错了,大意了。
94行的draw_actor_parameter(@actor, 4, 160, 7)中的7改成9就可以了
作者: wwwcctvty 时间: 2013-6-14 20:17
脚本中并没有看到读取装备状态的语句呀
作者: wingzeroplus 时间: 2013-6-15 21:48
麻烦 @亿万星辰
再看看这个工程,按您的方法如法炮制 了一个,铜盾上加了HP提升的自动状态,问是HP和SP在装备时候不显示变化效果
-
-
Project1.zip
208.21 KB, 下载次数: 14
作者: wwwcctvty 时间: 2013-6-15 22:35
表示木有动力了、、、、、有空我再弄下
作者: wwwcctvty 时间: 2013-6-15 22:44
请查收、、、、、、、、、、、、
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
def up_color
return Color.new(255, 0, 0)
end
def down_color
return Color.new(0, 255, 0)
end
#--------------------------------------------------------------------------
# ● 描绘能力值
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# type : 能力值种类 (0~6)
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
#-------------------------yy
when 7
parameter_name = "最大生命"#$data_system.words.hp
parameter_value = actor.maxhp
when 8
parameter_name = "最大魔法"#$data_system.words.sp
parameter_value = actor.maxsp
#----------------------------yy
###############################################################
when 9
parameter_name = "回避"
parameter_value = actor.eva
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
end
#==============================================================================
# ■ Window_EquipLeft
#------------------------------------------------------------------------------
# 装备画面的、显示角色能力值变化的窗口。
#==============================================================================
class Window_EquipLeft < Window_Base
UP_ICON = "048-Skill05"
DOWN_ICON = "047-Skill04"
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 272, 416)
self.contents = Bitmap.new(width - 32, height - 32)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 4, 32)
###############################################################
draw_actor_parameter(@actor, 4, 64, 0)
draw_actor_parameter(@actor, 4, 96, 1)
draw_actor_parameter(@actor, 4, 128, 2)
draw_actor_parameter(@actor, 4, 160, 9)
draw_actor_parameter(@actor, 4, 192, 3)
draw_actor_parameter(@actor, 4, 224, 4)
draw_actor_parameter(@actor, 4, 256, 5)
draw_actor_parameter(@actor, 4, 288, 6)
#-------------------------yy
draw_actor_parameter(@actor, 4, 320, 7)
draw_actor_parameter(@actor, 4, 352, 8)
#-------------------------yy
if @new_atk != nil
if @new_atk > @actor.atk
self.contents.blt(164, 64, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_atk < @actor.atk
self.contents.blt(164, 64, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_atk>@actor.atk ? up_color : down_color
self.contents.font.color = normal_color if @new_atk == @actor.atk
self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
if @new_pdef > @actor.pdef
self.contents.blt(164, 96, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_pdef < @actor.pdef
self.contents.blt(164, 96, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_pdef>@actor.pdef ? up_color : down_color
self.contents.font.color = normal_color if @new_pdef == @actor.pdef
self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
if @new_mdef > @actor.mdef
self.contents.blt(164, 128, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_mdef < @actor.mdef
self.contents.blt(164, 128, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_mdef>@actor.mdef ? up_color : down_color
self.contents.font.color = normal_color if @new_mdef == @actor.mdef
self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
end
if @new_eva != nil
if @new_eva > @actor.eva
self.contents.blt(164, 160, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_eva < @actor.eva
self.contents.blt(164, 160, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_eva>@actor.eva ? up_color : down_color
self.contents.font.color = normal_color if @new_eva == @actor.eva
self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
end
if @new_str != nil
if @new_str > @actor.str
self.contents.blt(164, 192, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_str < @actor.str
self.contents.blt(164, 192, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_str>@actor.str ? up_color : down_color
self.contents.font.color = normal_color if @new_str == @actor.str
self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil
if @new_dex > @actor.dex
self.contents.blt(164, 224, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_dex < @actor.dex
self.contents.blt(164, 224, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_dex>@actor.dex ? up_color : down_color
self.contents.font.color = normal_color if @new_dex == @actor.dex
self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil
if @new_agi > @actor.agi
self.contents.blt(164, 256, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_agi < @actor.agi
self.contents.blt(164, 256, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_agi>@actor.agi ? up_color : down_color
self.contents.font.color = normal_color if @new_agi == @actor.agi
self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil
if @new_int > @actor.int
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_int < @actor.int
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_int>@actor.int ? up_color : down_color
self.contents.font.color = normal_color if @new_int == @actor.int
self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
end
#-----------------------------yy
if @new_hp != nil
if @new_hp > @actor.hp
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_hp < @actor.hp
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_hp>@actor.hp ? up_color : down_color
self.contents.font.color = normal_color if @new_hp == @actor.hp
self.contents.draw_text(200, 288, 36, 32, @new_hp.to_s, 2)
end
if @new_sp != nil
if @new_sp > @actor.sp
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_sp < @actor.sp
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_sp>@actor.sp ? up_color : down_color
self.contents.font.color = normal_color if @new_sp == @actor.sp
self.contents.draw_text(200, 288, 36, 32, @new_sp.to_s, 2)
end
#---------------------------------yy
end
#--------------------------------------------------------------------------
# ● 变更装备后的能力值设置
# new_atk : 变更装备后的攻击力
# new_pdef : 变更装备后的物理防御
# new_mdef : 变更装备后的魔法防御
#--------------------------------------------------------------------------
###############################################################
#-------------------------------yy
def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or
@new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int or @new_hp != new_hp or @new_sp != new_sp
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_eva = new_eva
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
@new_hp = new_hp
@new_sp = new_sp
refresh
end
end
#------------------------------------yy
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
# 装备画面、显示浏览变更装备的候补物品的窗口。
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
# equip_type : 装备部位 (0~3)
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# ● 项目的描绘
# index : 项目符号
#--------------------------------------------------------------------------
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 + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end
#==============================================================================
# ■ Scene_Equip
#------------------------------------------------------------------------------
# 处理装备画面的类。
#==============================================================================
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
# 设置当前的物品窗口到 @item_window
case @right_window.index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
# 右窗口被激活的情况下
if @right_window.active
# 删除变更装备后的能力
###############################################################
@left_window.set_new_parameters(nil, nil, 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
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
# 获取变更装备后的能力值
###############################################################
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_eva = @actor.eva
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
#----------------------yy
new_hp = @actor.hp
new_sp = @actor.sp
#----------------------yy
# 返回到装备
@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_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
end
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
def up_color
return Color.new(255, 0, 0)
end
def down_color
return Color.new(0, 255, 0)
end
#--------------------------------------------------------------------------
# ● 描绘能力值
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# type : 能力值种类 (0~6)
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
#-------------------------yy
when 7
parameter_name = "最大生命"#$data_system.words.hp
parameter_value = actor.maxhp
when 8
parameter_name = "最大魔法"#$data_system.words.sp
parameter_value = actor.maxsp
#----------------------------yy
###############################################################
when 9
parameter_name = "回避"
parameter_value = actor.eva
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
end
#==============================================================================
# ■ Window_EquipLeft
#------------------------------------------------------------------------------
# 装备画面的、显示角色能力值变化的窗口。
#==============================================================================
class Window_EquipLeft < Window_Base
UP_ICON = "048-Skill05"
DOWN_ICON = "047-Skill04"
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 272, 416)
self.contents = Bitmap.new(width - 32, height - 32)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 4, 32)
###############################################################
draw_actor_parameter(@actor, 4, 64, 0)
draw_actor_parameter(@actor, 4, 96, 1)
draw_actor_parameter(@actor, 4, 128, 2)
draw_actor_parameter(@actor, 4, 160, 9)
draw_actor_parameter(@actor, 4, 192, 3)
draw_actor_parameter(@actor, 4, 224, 4)
draw_actor_parameter(@actor, 4, 256, 5)
draw_actor_parameter(@actor, 4, 288, 6)
#-------------------------yy
draw_actor_parameter(@actor, 4, 320, 7)
draw_actor_parameter(@actor, 4, 352, 8)
#-------------------------yy
if @new_atk != nil
if @new_atk > @actor.atk
self.contents.blt(164, 64, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_atk < @actor.atk
self.contents.blt(164, 64, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_atk>@actor.atk ? up_color : down_color
self.contents.font.color = normal_color if @new_atk == @actor.atk
self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
if @new_pdef > @actor.pdef
self.contents.blt(164, 96, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_pdef < @actor.pdef
self.contents.blt(164, 96, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_pdef>@actor.pdef ? up_color : down_color
self.contents.font.color = normal_color if @new_pdef == @actor.pdef
self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
if @new_mdef > @actor.mdef
self.contents.blt(164, 128, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_mdef < @actor.mdef
self.contents.blt(164, 128, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_mdef>@actor.mdef ? up_color : down_color
self.contents.font.color = normal_color if @new_mdef == @actor.mdef
self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
end
if @new_eva != nil
if @new_eva > @actor.eva
self.contents.blt(164, 160, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_eva < @actor.eva
self.contents.blt(164, 160, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_eva>@actor.eva ? up_color : down_color
self.contents.font.color = normal_color if @new_eva == @actor.eva
self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
end
if @new_str != nil
if @new_str > @actor.str
self.contents.blt(164, 192, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_str < @actor.str
self.contents.blt(164, 192, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_str>@actor.str ? up_color : down_color
self.contents.font.color = normal_color if @new_str == @actor.str
self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil
if @new_dex > @actor.dex
self.contents.blt(164, 224, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_dex < @actor.dex
self.contents.blt(164, 224, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_dex>@actor.dex ? up_color : down_color
self.contents.font.color = normal_color if @new_dex == @actor.dex
self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil
if @new_agi > @actor.agi
self.contents.blt(164, 256, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_agi < @actor.agi
self.contents.blt(164, 256, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_agi>@actor.agi ? up_color : down_color
self.contents.font.color = normal_color if @new_agi == @actor.agi
self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil
if @new_int > @actor.int
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_int < @actor.int
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_int>@actor.int ? up_color : down_color
self.contents.font.color = normal_color if @new_int == @actor.int
self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
end
#-----------------------------yy
if @new_hp != nil
if @new_hp > @actor.hp
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_hp < @actor.hp
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_hp>@actor.hp ? up_color : down_color
self.contents.font.color = normal_color if @new_hp == @actor.hp
self.contents.draw_text(200, 288, 36, 32, @new_hp.to_s, 2)
end
if @new_sp != nil
if @new_sp > @actor.sp
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_sp < @actor.sp
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_sp>@actor.sp ? up_color : down_color
self.contents.font.color = normal_color if @new_sp == @actor.sp
self.contents.draw_text(200, 288, 36, 32, @new_sp.to_s, 2)
end
#---------------------------------yy
end
#--------------------------------------------------------------------------
# ● 变更装备后的能力值设置
# new_atk : 变更装备后的攻击力
# new_pdef : 变更装备后的物理防御
# new_mdef : 变更装备后的魔法防御
#--------------------------------------------------------------------------
###############################################################
#-------------------------------yy
def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or
@new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int or @new_hp != new_hp or @new_sp != new_sp
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_eva = new_eva
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
@new_hp = new_hp
@new_sp = new_sp
refresh
end
end
#------------------------------------yy
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
# 装备画面、显示浏览变更装备的候补物品的窗口。
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
# equip_type : 装备部位 (0~3)
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# ● 项目的描绘
# index : 项目符号
#--------------------------------------------------------------------------
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 + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end
#==============================================================================
# ■ Scene_Equip
#------------------------------------------------------------------------------
# 处理装备画面的类。
#==============================================================================
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
# 设置当前的物品窗口到 @item_window
case @right_window.index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
# 右窗口被激活的情况下
if @right_window.active
# 删除变更装备后的能力
###############################################################
@left_window.set_new_parameters(nil, nil, 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
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
# 获取变更装备后的能力值
###############################################################
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_eva = @actor.eva
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
#----------------------yy
new_hp = @actor.hp
new_sp = @actor.sp
#----------------------yy
# 返回到装备
@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_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
end
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
作者: wwwcctvty 时间: 2013-6-16 09:58
@亿万星辰 哪出的问题?请大大指正,我马上更正
作者: wwwcctvty 时间: 2013-6-16 11:19
本帖最后由 亿万星辰 于 2013-6-16 12:15 编辑
@亿万星辰 这回总可以了吧{:2_276:} 原来漏改了很多地方,谢谢星辰大大指点
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
def up_color
return Color.new(255, 0, 0)
end
def down_color
return Color.new(0, 255, 0)
end
#--------------------------------------------------------------------------
# ● 描绘能力值
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# type : 能力值种类 (0~6)
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
#-------------------------yy
when 7
parameter_name = "最大生命"#$data_system.words.hp
parameter_value = actor.maxhp
when 8
parameter_name = "最大魔法"#$data_system.words.sp
parameter_value = actor.maxsp
#----------------------------yy
###############################################################
when 9
parameter_name = "回避"
parameter_value = actor.eva
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
end
#==============================================================================
# ■ Window_EquipLeft
#------------------------------------------------------------------------------
# 装备画面的、显示角色能力值变化的窗口。
#==============================================================================
class Window_EquipLeft < Window_Base
UP_ICON = "048-Skill05"
DOWN_ICON = "047-Skill04"
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 272, 416)
self.contents = Bitmap.new(width - 32, height - 32)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 4, 32)
###############################################################
draw_actor_parameter(@actor, 4, 64, 0)
draw_actor_parameter(@actor, 4, 96, 1)
draw_actor_parameter(@actor, 4, 128, 2)
draw_actor_parameter(@actor, 4, 160, 9)
draw_actor_parameter(@actor, 4, 192, 3)
draw_actor_parameter(@actor, 4, 224, 4)
draw_actor_parameter(@actor, 4, 256, 5)
draw_actor_parameter(@actor, 4, 288, 6)
#-------------------------yy
draw_actor_parameter(@actor, 4, 320, 7)
draw_actor_parameter(@actor, 4, 352, 8)
#-------------------------yy
if @new_atk != nil
if @new_atk > @actor.atk
self.contents.blt(164, 64, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_atk < @actor.atk
self.contents.blt(164, 64, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_atk>@actor.atk ? up_color : down_color
self.contents.font.color = normal_color if @new_atk == @actor.atk
self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
if @new_pdef > @actor.pdef
self.contents.blt(164, 96, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_pdef < @actor.pdef
self.contents.blt(164, 96, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_pdef>@actor.pdef ? up_color : down_color
self.contents.font.color = normal_color if @new_pdef == @actor.pdef
self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
if @new_mdef > @actor.mdef
self.contents.blt(164, 128, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_mdef < @actor.mdef
self.contents.blt(164, 128, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_mdef>@actor.mdef ? up_color : down_color
self.contents.font.color = normal_color if @new_mdef == @actor.mdef
self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
end
if @new_eva != nil
if @new_eva > @actor.eva
self.contents.blt(164, 160, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_eva < @actor.eva
self.contents.blt(164, 160, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_eva>@actor.eva ? up_color : down_color
self.contents.font.color = normal_color if @new_eva == @actor.eva
self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
end
if @new_str != nil
if @new_str > @actor.str
self.contents.blt(164, 192, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_str < @actor.str
self.contents.blt(164, 192, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_str>@actor.str ? up_color : down_color
self.contents.font.color = normal_color if @new_str == @actor.str
self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil
if @new_dex > @actor.dex
self.contents.blt(164, 224, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_dex < @actor.dex
self.contents.blt(164, 224, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_dex>@actor.dex ? up_color : down_color
self.contents.font.color = normal_color if @new_dex == @actor.dex
self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil
if @new_agi > @actor.agi
self.contents.blt(164, 256, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_agi < @actor.agi
self.contents.blt(164, 256, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_agi>@actor.agi ? up_color : down_color
self.contents.font.color = normal_color if @new_agi == @actor.agi
self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil
if @new_int > @actor.int
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_int < @actor.int
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_int>@actor.int ? up_color : down_color
self.contents.font.color = normal_color if @new_int == @actor.int
self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
end
#-----------------------------yy
if @new_hp != nil
if @new_hp > @actor.maxhp
self.contents.blt(164, 320, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_hp < @actor.maxhp
self.contents.blt(164, 320, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_hp>@actor.maxhp ? up_color : down_color
self.contents.font.color = normal_color if @new_hp == @actor.maxhp
self.contents.draw_text(200, 320, 36, 32, @new_hp.to_s, 2)
end
if @new_sp != nil
if @new_sp > @actor.maxsp
self.contents.blt(164, 352, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_sp < @actor.maxsp
self.contents.blt(164, 352, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_sp>@actor.maxsp ? up_color : down_color
self.contents.font.color = normal_color if @new_sp == @actor.maxsp
self.contents.draw_text(200, 352, 36, 32, @new_sp.to_s, 2)
end
#---------------------------------yy
end
#--------------------------------------------------------------------------
# ● 变更装备后的能力值设置
# new_atk : 变更装备后的攻击力
# new_pdef : 变更装备后的物理防御
# new_mdef : 变更装备后的魔法防御
#--------------------------------------------------------------------------
###############################################################
#-------------------------------yy
def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or
@new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int or @new_hp != new_hp or @new_sp != new_sp
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_eva = new_eva
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
@new_hp = new_hp
@new_sp = new_sp
refresh
end
end
#------------------------------------yy
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
# 装备画面、显示浏览变更装备的候补物品的窗口。
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
# equip_type : 装备部位 (0~3)
#--------------------------------------------------------------------------
def initialize(actor, equip_type)
################改了改坐标和高度#################################
super(272, 256, 368, 224)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ● 项目的描绘
# index : 项目符号
#--------------------------------------------------------------------------
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 + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end
#==============================================================================
# ■ Scene_Equip
#------------------------------------------------------------------------------
# 处理装备画面的类。
#==============================================================================
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
# 设置当前的物品窗口到 @item_window
case @right_window.index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
# 右窗口被激活的情况下
if @right_window.active
# 删除变更装备后的能力
###############################################################
@left_window.set_new_parameters(nil, nil, 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
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
# 获取变更装备后的能力值
###############################################################
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_eva = @actor.eva
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
#----------------------yy
new_hp = @actor.maxhp
new_sp = @actor.maxsp
#----------------------yy
# 返回到装备
@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_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
end
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
def up_color
return Color.new(255, 0, 0)
end
def down_color
return Color.new(0, 255, 0)
end
#--------------------------------------------------------------------------
# ● 描绘能力值
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# type : 能力值种类 (0~6)
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
#-------------------------yy
when 7
parameter_name = "最大生命"#$data_system.words.hp
parameter_value = actor.maxhp
when 8
parameter_name = "最大魔法"#$data_system.words.sp
parameter_value = actor.maxsp
#----------------------------yy
###############################################################
when 9
parameter_name = "回避"
parameter_value = actor.eva
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
end
#==============================================================================
# ■ Window_EquipLeft
#------------------------------------------------------------------------------
# 装备画面的、显示角色能力值变化的窗口。
#==============================================================================
class Window_EquipLeft < Window_Base
UP_ICON = "048-Skill05"
DOWN_ICON = "047-Skill04"
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 272, 416)
self.contents = Bitmap.new(width - 32, height - 32)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 4, 32)
###############################################################
draw_actor_parameter(@actor, 4, 64, 0)
draw_actor_parameter(@actor, 4, 96, 1)
draw_actor_parameter(@actor, 4, 128, 2)
draw_actor_parameter(@actor, 4, 160, 9)
draw_actor_parameter(@actor, 4, 192, 3)
draw_actor_parameter(@actor, 4, 224, 4)
draw_actor_parameter(@actor, 4, 256, 5)
draw_actor_parameter(@actor, 4, 288, 6)
#-------------------------yy
draw_actor_parameter(@actor, 4, 320, 7)
draw_actor_parameter(@actor, 4, 352, 8)
#-------------------------yy
if @new_atk != nil
if @new_atk > @actor.atk
self.contents.blt(164, 64, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_atk < @actor.atk
self.contents.blt(164, 64, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_atk>@actor.atk ? up_color : down_color
self.contents.font.color = normal_color if @new_atk == @actor.atk
self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
if @new_pdef > @actor.pdef
self.contents.blt(164, 96, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_pdef < @actor.pdef
self.contents.blt(164, 96, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_pdef>@actor.pdef ? up_color : down_color
self.contents.font.color = normal_color if @new_pdef == @actor.pdef
self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
if @new_mdef > @actor.mdef
self.contents.blt(164, 128, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_mdef < @actor.mdef
self.contents.blt(164, 128, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_mdef>@actor.mdef ? up_color : down_color
self.contents.font.color = normal_color if @new_mdef == @actor.mdef
self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
end
if @new_eva != nil
if @new_eva > @actor.eva
self.contents.blt(164, 160, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_eva < @actor.eva
self.contents.blt(164, 160, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_eva>@actor.eva ? up_color : down_color
self.contents.font.color = normal_color if @new_eva == @actor.eva
self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
end
if @new_str != nil
if @new_str > @actor.str
self.contents.blt(164, 192, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_str < @actor.str
self.contents.blt(164, 192, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_str>@actor.str ? up_color : down_color
self.contents.font.color = normal_color if @new_str == @actor.str
self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil
if @new_dex > @actor.dex
self.contents.blt(164, 224, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_dex < @actor.dex
self.contents.blt(164, 224, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_dex>@actor.dex ? up_color : down_color
self.contents.font.color = normal_color if @new_dex == @actor.dex
self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil
if @new_agi > @actor.agi
self.contents.blt(164, 256, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_agi < @actor.agi
self.contents.blt(164, 256, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_agi>@actor.agi ? up_color : down_color
self.contents.font.color = normal_color if @new_agi == @actor.agi
self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil
if @new_int > @actor.int
self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_int < @actor.int
self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_int>@actor.int ? up_color : down_color
self.contents.font.color = normal_color if @new_int == @actor.int
self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
end
#-----------------------------yy
if @new_hp != nil
if @new_hp > @actor.maxhp
self.contents.blt(164, 320, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_hp < @actor.maxhp
self.contents.blt(164, 320, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_hp>@actor.maxhp ? up_color : down_color
self.contents.font.color = normal_color if @new_hp == @actor.maxhp
self.contents.draw_text(200, 320, 36, 32, @new_hp.to_s, 2)
end
if @new_sp != nil
if @new_sp > @actor.maxsp
self.contents.blt(164, 352, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
elsif @new_sp < @actor.maxsp
self.contents.blt(164, 352, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
end
self.contents.font.color = @new_sp>@actor.maxsp ? up_color : down_color
self.contents.font.color = normal_color if @new_sp == @actor.maxsp
self.contents.draw_text(200, 352, 36, 32, @new_sp.to_s, 2)
end
#---------------------------------yy
end
#--------------------------------------------------------------------------
# ● 变更装备后的能力值设置
# new_atk : 变更装备后的攻击力
# new_pdef : 变更装备后的物理防御
# new_mdef : 变更装备后的魔法防御
#--------------------------------------------------------------------------
###############################################################
#-------------------------------yy
def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or
@new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int or @new_hp != new_hp or @new_sp != new_sp
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_eva = new_eva
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
@new_hp = new_hp
@new_sp = new_sp
refresh
end
end
#------------------------------------yy
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
# 装备画面、显示浏览变更装备的候补物品的窗口。
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
# equip_type : 装备部位 (0~3)
#--------------------------------------------------------------------------
def initialize(actor, equip_type)
################改了改坐标和高度#################################
super(272, 256, 368, 224)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ● 项目的描绘
# index : 项目符号
#--------------------------------------------------------------------------
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 + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end
#==============================================================================
# ■ Scene_Equip
#------------------------------------------------------------------------------
# 处理装备画面的类。
#==============================================================================
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
# 设置当前的物品窗口到 @item_window
case @right_window.index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
# 右窗口被激活的情况下
if @right_window.active
# 删除变更装备后的能力
###############################################################
@left_window.set_new_parameters(nil, nil, 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
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
# 获取变更装备后的能力值
###############################################################
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_eva = @actor.eva
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
#----------------------yy
new_hp = @actor.maxhp
new_sp = @actor.maxsp
#----------------------yy
# 返回到装备
@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_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
end
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
@wingzeroplus
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |