设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: wingzeroplus
打印 上一主题 下一主题

[已经解决] 装备界面显示HP和SP变化修改

[复制链接]

Lv1.梦旅人

梦石
0
星屑
52
在线时间
586 小时
注册时间
2012-5-31
帖子
768
11
发表于 2013-6-14 20:17:47 | 只看该作者
脚本中并没有看到读取装备状态的语句呀
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
568 小时
注册时间
2012-9-7
帖子
611
12
 楼主| 发表于 2013-6-15 21:48:34 | 只看该作者
麻烦 @亿万星辰  
再看看这个工程,按您的方法如法炮制 了一个,铜盾上加了HP提升的自动状态,问是HP和SP在装备时候不显示变化效果

Project1.zip

208.21 KB, 下载次数: 14

FTM正式版已经发布,点击图片开启传送门
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
52
在线时间
586 小时
注册时间
2012-5-31
帖子
768
13
发表于 2013-6-15 22:35:06 | 只看该作者
表示木有动力了、、、、、有空我再弄下
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
52
在线时间
586 小时
注册时间
2012-5-31
帖子
768
14
发表于 2013-6-15 22:44:50 | 只看该作者
请查收、、、、、、、、、、、、
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================  
  4. #==============================================================================
  5. # ■ Window_Base
  6. #------------------------------------------------------------------------------
  7. #  游戏中全部窗口的超级类。
  8. #==============================================================================
  9. class Window_Base < Window
  10.   def up_color
  11.     return Color.new(255, 0, 0)
  12.   end
  13.   def down_color
  14.     return Color.new(0, 255, 0)
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 描绘能力值
  18.   #     actor : 角色
  19.   #     x     : 描画目标 X 坐标
  20.   #     y     : 描画目标 Y 坐标
  21.   #     type  : 能力值种类 (0~6)
  22.   #--------------------------------------------------------------------------
  23.   def draw_actor_parameter(actor, x, y, type)
  24.     case type
  25.     when 0
  26.       parameter_name = $data_system.words.atk
  27.       parameter_value = actor.atk
  28.     when 1
  29.       parameter_name = $data_system.words.pdef
  30.       parameter_value = actor.pdef
  31.     when 2
  32.       parameter_name = $data_system.words.mdef
  33.       parameter_value = actor.mdef
  34.     when 3
  35.       parameter_name = $data_system.words.str
  36.       parameter_value = actor.str
  37.     when 4
  38.       parameter_name = $data_system.words.dex
  39.       parameter_value = actor.dex
  40.     when 5
  41.       parameter_name = $data_system.words.agi
  42.       parameter_value = actor.agi
  43.     when 6
  44.       parameter_name = $data_system.words.int
  45.       parameter_value = actor.int
  46.       #-------------------------yy
  47.     when 7
  48.       parameter_name = "最大生命"#$data_system.words.hp
  49.       parameter_value = actor.maxhp
  50.     when 8
  51.       parameter_name = "最大魔法"#$data_system.words.sp
  52.       parameter_value = actor.maxsp
  53.       #----------------------------yy
  54.     ###############################################################
  55.     when 9
  56.       parameter_name = "回避"
  57.       parameter_value = actor.eva
  58.     end
  59.     self.contents.font.color = system_color
  60.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  61.     self.contents.font.color = normal_color
  62.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
  63.   end
  64. end
  65. #==============================================================================
  66. # ■ Window_EquipLeft
  67. #------------------------------------------------------------------------------
  68. #  装备画面的、显示角色能力值变化的窗口。
  69. #==============================================================================
  70. class Window_EquipLeft < Window_Base
  71.   UP_ICON = "048-Skill05"
  72.   DOWN_ICON = "047-Skill04"
  73.   #--------------------------------------------------------------------------
  74.   # ● 初始化对像
  75.   #     actor : 角色
  76.   #--------------------------------------------------------------------------
  77.   def initialize(actor)
  78.     super(0, 64, 272, 416)
  79.     self.contents = Bitmap.new(width - 32, height - 32)
  80.     [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  81.     refresh
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # ● 刷新
  85.   #--------------------------------------------------------------------------
  86.   def refresh
  87.     self.contents.clear
  88.     draw_actor_name(@actor, 4, 0)
  89.     draw_actor_level(@actor, 4, 32)
  90.     ###############################################################
  91.     draw_actor_parameter(@actor, 4, 64, 0)
  92.     draw_actor_parameter(@actor, 4, 96, 1)
  93.     draw_actor_parameter(@actor, 4, 128, 2)
  94.     draw_actor_parameter(@actor, 4, 160, 9)
  95.     draw_actor_parameter(@actor, 4, 192, 3)
  96.     draw_actor_parameter(@actor, 4, 224, 4)
  97.     draw_actor_parameter(@actor, 4, 256, 5)
  98.     draw_actor_parameter(@actor, 4, 288, 6)
  99.     #-------------------------yy
  100.     draw_actor_parameter(@actor, 4, 320, 7)
  101.     draw_actor_parameter(@actor, 4, 352, 8)
  102.     #-------------------------yy
  103.     if @new_atk != nil
  104.       if @new_atk > @actor.atk
  105.         self.contents.blt(164, 64, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  106.       elsif @new_atk < @actor.atk
  107.         self.contents.blt(164, 64, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  108.       end
  109.       self.contents.font.color = @new_atk>@actor.atk ? up_color : down_color
  110.       self.contents.font.color = normal_color if @new_atk == @actor.atk
  111.       self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
  112.     end
  113.     if @new_pdef != nil
  114.       if @new_pdef > @actor.pdef
  115.         self.contents.blt(164, 96, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  116.       elsif @new_pdef < @actor.pdef
  117.         self.contents.blt(164, 96, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  118.       end
  119.       self.contents.font.color = @new_pdef>@actor.pdef ? up_color : down_color
  120.       self.contents.font.color = normal_color if @new_pdef == @actor.pdef
  121.       self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
  122.     end
  123.     if @new_mdef != nil
  124.       if @new_mdef > @actor.mdef
  125.         self.contents.blt(164, 128, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  126.       elsif @new_mdef < @actor.mdef
  127.         self.contents.blt(164, 128, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  128.       end
  129.       self.contents.font.color = @new_mdef>@actor.mdef ? up_color : down_color
  130.       self.contents.font.color = normal_color if @new_mdef == @actor.mdef
  131.       self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
  132.     end
  133.     if @new_eva != nil
  134.       if @new_eva > @actor.eva
  135.         self.contents.blt(164, 160, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  136.       elsif @new_eva < @actor.eva
  137.         self.contents.blt(164, 160, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  138.       end
  139.       self.contents.font.color = @new_eva>@actor.eva ? up_color : down_color
  140.       self.contents.font.color = normal_color if @new_eva == @actor.eva
  141.       self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
  142.     end
  143.     if @new_str != nil
  144.       if @new_str > @actor.str
  145.         self.contents.blt(164, 192, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  146.       elsif @new_str < @actor.str
  147.         self.contents.blt(164, 192, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  148.       end
  149.       self.contents.font.color = @new_str>@actor.str ? up_color : down_color
  150.       self.contents.font.color = normal_color if @new_str == @actor.str
  151.       self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
  152.     end
  153.     if @new_dex != nil
  154.       if @new_dex > @actor.dex
  155.         self.contents.blt(164, 224, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  156.       elsif @new_dex < @actor.dex
  157.         self.contents.blt(164, 224, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  158.       end
  159.       self.contents.font.color = @new_dex>@actor.dex ? up_color : down_color
  160.       self.contents.font.color = normal_color if @new_dex == @actor.dex
  161.       self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
  162.     end
  163.     if @new_agi != nil
  164.       if @new_agi > @actor.agi
  165.         self.contents.blt(164, 256, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  166.       elsif @new_agi < @actor.agi
  167.         self.contents.blt(164, 256, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  168.       end
  169.       self.contents.font.color = @new_agi>@actor.agi ? up_color : down_color
  170.       self.contents.font.color = normal_color if @new_agi == @actor.agi
  171.       self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
  172.     end
  173.     if @new_int != nil
  174.       if @new_int > @actor.int
  175.         self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  176.       elsif @new_int < @actor.int
  177.         self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  178.       end
  179.       self.contents.font.color = @new_int>@actor.int ? up_color : down_color
  180.       self.contents.font.color = normal_color if @new_int == @actor.int
  181.       self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
  182.     end
  183.     #-----------------------------yy
  184.     if @new_hp != nil
  185.       if @new_hp > @actor.hp
  186.         self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  187.       elsif @new_hp < @actor.hp
  188.         self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  189.       end
  190.       self.contents.font.color = @new_hp>@actor.hp ? up_color : down_color
  191.       self.contents.font.color = normal_color if @new_hp == @actor.hp
  192.       self.contents.draw_text(200, 288, 36, 32, @new_hp.to_s, 2)
  193.     end
  194.     if @new_sp != nil
  195.       if @new_sp > @actor.sp
  196.         self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  197.       elsif @new_sp < @actor.sp
  198.         self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  199.       end
  200.       self.contents.font.color = @new_sp>@actor.sp ? up_color : down_color
  201.       self.contents.font.color = normal_color if @new_sp == @actor.sp
  202.       self.contents.draw_text(200, 288, 36, 32, @new_sp.to_s, 2)
  203.     end
  204.     #---------------------------------yy
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # ● 变更装备后的能力值设置
  208.   #     new_atk  : 变更装备后的攻击力
  209.   #     new_pdef : 变更装备后的物理防御
  210.   #     new_mdef : 变更装备后的魔法防御
  211.   #--------------------------------------------------------------------------
  212.     ###############################################################
  213.     #-------------------------------yy
  214.   def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
  215.     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
  216.       @new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int or @new_hp != new_hp or @new_sp != new_sp
  217.       @new_atk = new_atk
  218.       @new_pdef = new_pdef
  219.       @new_mdef = new_mdef
  220.       @new_eva = new_eva
  221.       @new_str = new_str
  222.       @new_dex = new_dex
  223.       @new_agi = new_agi
  224.       @new_int = new_int
  225.       @new_hp = new_hp
  226.       @new_sp = new_sp
  227.       refresh
  228.     end
  229.   end
  230.   #------------------------------------yy
  231. end
  232. #==============================================================================
  233. # ■ Window_EquipItem
  234. #------------------------------------------------------------------------------
  235. #  装备画面、显示浏览变更装备的候补物品的窗口。
  236. #==============================================================================
  237. class Window_EquipItem < Window_Selectable
  238.   #--------------------------------------------------------------------------
  239.   # ● 初始化对像
  240.   #     actor      : 角色
  241.   #     equip_type : 装备部位 (0~3)
  242.   #--------------------------------------------------------------------------
  243.   def initialize(actor, equip_type)
  244.     ################改了改坐标和高度#################################
  245.     super(272, 256, 368, 224)
  246.     @actor = actor
  247.     @equip_type = equip_type
  248.     @column_max = 1
  249.     refresh
  250.     self.active = false
  251.     self.index = -1
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ● 项目的描绘
  255.   #     index : 项目符号
  256.   #--------------------------------------------------------------------------
  257.   def draw_item(index)
  258.     item = @data[index]
  259.     ################改了改坐标#################################
  260.     x = 4
  261.     y = index * 32
  262.     case item
  263.     when RPG::Weapon
  264.       number = $game_party.weapon_number(item.id)
  265.     when RPG::Armor
  266.       number = $game_party.armor_number(item.id)
  267.     end
  268.     bitmap = RPG::Cache.icon(item.icon_name)
  269.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  270.     self.contents.font.color = normal_color
  271.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  272.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  273.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  274.   end
  275. end
  276. #==============================================================================
  277. # ■ Scene_Equip
  278. #------------------------------------------------------------------------------
  279. #  处理装备画面的类。
  280. #==============================================================================
  281. class Scene_Equip
  282.   #--------------------------------------------------------------------------
  283.   # ● 刷新
  284.   #--------------------------------------------------------------------------
  285.   def refresh
  286.     # 设置物品窗口的可视状态
  287.     @item_window1.visible = (@right_window.index == 0)
  288.     @item_window2.visible = (@right_window.index == 1)
  289.     @item_window3.visible = (@right_window.index == 2)
  290.     @item_window4.visible = (@right_window.index == 3)
  291.     @item_window5.visible = (@right_window.index == 4)
  292.     # 获取当前装备中的物品
  293.     item1 = @right_window.item
  294.     # 设置当前的物品窗口到 @item_window
  295.     case @right_window.index
  296.     when 0
  297.       @item_window = @item_window1
  298.     when 1
  299.       @item_window = @item_window2
  300.     when 2
  301.       @item_window = @item_window3
  302.     when 3
  303.       @item_window = @item_window4
  304.     when 4
  305.       @item_window = @item_window5
  306.     end
  307.     # 右窗口被激活的情况下
  308.     if @right_window.active
  309.       # 删除变更装备后的能力
  310.     ###############################################################
  311.       @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
  312.     end
  313.     # 物品窗口被激活的情况下
  314.     if @item_window.active
  315.       # 获取现在选中的物品
  316.       item2 = @item_window.item
  317.       # 变更装备
  318.       last_hp = @actor.hp
  319.       last_sp = @actor.sp
  320.       @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  321.       # 获取变更装备后的能力值
  322.     ###############################################################
  323.       new_atk = @actor.atk
  324.       new_pdef = @actor.pdef
  325.       new_mdef = @actor.mdef
  326.       new_eva = @actor.eva
  327.       new_str = @actor.str
  328.       new_dex = @actor.dex
  329.       new_agi = @actor.agi
  330.       new_int = @actor.int
  331.       #----------------------yy
  332.       new_hp = @actor.hp
  333.       new_sp = @actor.sp
  334.       #----------------------yy
  335.       # 返回到装备
  336.       @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  337.       @actor.hp = last_hp
  338.       @actor.sp = last_sp
  339.       # 描画左窗口
  340.     ###############################################################
  341.       @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)
  342.     end
  343.   end
  344. end
  345. #==============================================================================
  346. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  347. #==============================================================================

点评

还是问题重重啊……  发表于 2013-6-15 22:52
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
52
在线时间
586 小时
注册时间
2012-5-31
帖子
768
15
发表于 2013-6-16 09:58:49 | 只看该作者
@亿万星辰    哪出的问题?请大大指正,我马上更正

点评

你自己测试一下吧~比如带个加血加魔的自动状态啥的。  发表于 2013-6-16 10:06
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
52
在线时间
586 小时
注册时间
2012-5-31
帖子
768
16
发表于 2013-6-16 11:19:43 | 只看该作者
本帖最后由 亿万星辰 于 2013-6-16 12:15 编辑

@亿万星辰   这回总可以了吧{:2_276:} 原来漏改了很多地方,谢谢星辰大大指点
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================  
  4. #==============================================================================
  5. # ■ Window_Base
  6. #------------------------------------------------------------------------------
  7. #  游戏中全部窗口的超级类。
  8. #==============================================================================
  9. class Window_Base < Window
  10.   def up_color
  11.     return Color.new(255, 0, 0)
  12.   end
  13.   def down_color
  14.     return Color.new(0, 255, 0)
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 描绘能力值
  18.   #     actor : 角色
  19.   #     x     : 描画目标 X 坐标
  20.   #     y     : 描画目标 Y 坐标
  21.   #     type  : 能力值种类 (0~6)
  22.   #--------------------------------------------------------------------------
  23.   def draw_actor_parameter(actor, x, y, type)
  24.     case type
  25.     when 0
  26.       parameter_name = $data_system.words.atk
  27.       parameter_value = actor.atk
  28.     when 1
  29.       parameter_name = $data_system.words.pdef
  30.       parameter_value = actor.pdef
  31.     when 2
  32.       parameter_name = $data_system.words.mdef
  33.       parameter_value = actor.mdef
  34.     when 3
  35.       parameter_name = $data_system.words.str
  36.       parameter_value = actor.str
  37.     when 4
  38.       parameter_name = $data_system.words.dex
  39.       parameter_value = actor.dex
  40.     when 5
  41.       parameter_name = $data_system.words.agi
  42.       parameter_value = actor.agi
  43.     when 6
  44.       parameter_name = $data_system.words.int
  45.       parameter_value = actor.int
  46.       #-------------------------yy
  47.     when 7
  48.       parameter_name = "最大生命"#$data_system.words.hp
  49.       parameter_value = actor.maxhp
  50.     when 8
  51.       parameter_name = "最大魔法"#$data_system.words.sp
  52.       parameter_value = actor.maxsp
  53.       #----------------------------yy
  54.     ###############################################################
  55.     when 9
  56.       parameter_name = "回避"
  57.       parameter_value = actor.eva
  58.     end
  59.     self.contents.font.color = system_color
  60.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  61.     self.contents.font.color = normal_color
  62.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
  63.   end
  64. end
  65. #==============================================================================
  66. # ■ Window_EquipLeft
  67. #------------------------------------------------------------------------------
  68. #  装备画面的、显示角色能力值变化的窗口。
  69. #==============================================================================
  70. class Window_EquipLeft < Window_Base
  71.   UP_ICON = "048-Skill05"
  72.   DOWN_ICON = "047-Skill04"
  73.   #--------------------------------------------------------------------------
  74.   # ● 初始化对像
  75.   #     actor : 角色
  76.   #--------------------------------------------------------------------------
  77.   def initialize(actor)
  78.     super(0, 64, 272, 416)
  79.     self.contents = Bitmap.new(width - 32, height - 32)
  80.     [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  81.     refresh
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # ● 刷新
  85.   #--------------------------------------------------------------------------
  86.   def refresh
  87.     self.contents.clear
  88.     draw_actor_name(@actor, 4, 0)
  89.     draw_actor_level(@actor, 4, 32)
  90.     ###############################################################
  91.     draw_actor_parameter(@actor, 4, 64, 0)
  92.     draw_actor_parameter(@actor, 4, 96, 1)
  93.     draw_actor_parameter(@actor, 4, 128, 2)
  94.     draw_actor_parameter(@actor, 4, 160, 9)
  95.     draw_actor_parameter(@actor, 4, 192, 3)
  96.     draw_actor_parameter(@actor, 4, 224, 4)
  97.     draw_actor_parameter(@actor, 4, 256, 5)
  98.     draw_actor_parameter(@actor, 4, 288, 6)
  99.     #-------------------------yy
  100.     draw_actor_parameter(@actor, 4, 320, 7)
  101.     draw_actor_parameter(@actor, 4, 352, 8)
  102.     #-------------------------yy
  103.     if @new_atk != nil
  104.       if @new_atk > @actor.atk
  105.         self.contents.blt(164, 64, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  106.       elsif @new_atk < @actor.atk
  107.         self.contents.blt(164, 64, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  108.       end
  109.       self.contents.font.color = @new_atk>@actor.atk ? up_color : down_color
  110.       self.contents.font.color = normal_color if @new_atk == @actor.atk
  111.       self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
  112.     end
  113.     if @new_pdef != nil
  114.       if @new_pdef > @actor.pdef
  115.         self.contents.blt(164, 96, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  116.       elsif @new_pdef < @actor.pdef
  117.         self.contents.blt(164, 96, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  118.       end
  119.       self.contents.font.color = @new_pdef>@actor.pdef ? up_color : down_color
  120.       self.contents.font.color = normal_color if @new_pdef == @actor.pdef
  121.       self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
  122.     end
  123.     if @new_mdef != nil
  124.       if @new_mdef > @actor.mdef
  125.         self.contents.blt(164, 128, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  126.       elsif @new_mdef < @actor.mdef
  127.         self.contents.blt(164, 128, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  128.       end
  129.       self.contents.font.color = @new_mdef>@actor.mdef ? up_color : down_color
  130.       self.contents.font.color = normal_color if @new_mdef == @actor.mdef
  131.       self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
  132.     end
  133.     if @new_eva != nil
  134.       if @new_eva > @actor.eva
  135.         self.contents.blt(164, 160, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  136.       elsif @new_eva < @actor.eva
  137.         self.contents.blt(164, 160, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  138.       end
  139.       self.contents.font.color = @new_eva>@actor.eva ? up_color : down_color
  140.       self.contents.font.color = normal_color if @new_eva == @actor.eva
  141.       self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
  142.     end
  143.     if @new_str != nil
  144.       if @new_str > @actor.str
  145.         self.contents.blt(164, 192, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  146.       elsif @new_str < @actor.str
  147.         self.contents.blt(164, 192, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  148.       end
  149.       self.contents.font.color = @new_str>@actor.str ? up_color : down_color
  150.       self.contents.font.color = normal_color if @new_str == @actor.str
  151.       self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
  152.     end
  153.     if @new_dex != nil
  154.       if @new_dex > @actor.dex
  155.         self.contents.blt(164, 224, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  156.       elsif @new_dex < @actor.dex
  157.         self.contents.blt(164, 224, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  158.       end
  159.       self.contents.font.color = @new_dex>@actor.dex ? up_color : down_color
  160.       self.contents.font.color = normal_color if @new_dex == @actor.dex
  161.       self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
  162.     end
  163.     if @new_agi != nil
  164.       if @new_agi > @actor.agi
  165.         self.contents.blt(164, 256, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  166.       elsif @new_agi < @actor.agi
  167.         self.contents.blt(164, 256, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  168.       end
  169.       self.contents.font.color = @new_agi>@actor.agi ? up_color : down_color
  170.       self.contents.font.color = normal_color if @new_agi == @actor.agi
  171.       self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
  172.     end
  173.     if @new_int != nil
  174.       if @new_int > @actor.int
  175.         self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  176.       elsif @new_int < @actor.int
  177.         self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  178.       end
  179.       self.contents.font.color = @new_int>@actor.int ? up_color : down_color
  180.       self.contents.font.color = normal_color if @new_int == @actor.int
  181.       self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
  182.     end
  183.     #-----------------------------yy
  184.     if @new_hp != nil
  185.       if @new_hp > @actor.maxhp
  186.         self.contents.blt(164, 320, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  187.       elsif @new_hp < @actor.maxhp
  188.         self.contents.blt(164, 320, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  189.       end
  190.       self.contents.font.color = @new_hp>@actor.maxhp ? up_color : down_color
  191.       self.contents.font.color = normal_color if @new_hp == @actor.maxhp
  192.       self.contents.draw_text(200, 320, 36, 32, @new_hp.to_s, 2)
  193.     end
  194.     if @new_sp != nil
  195.       if @new_sp > @actor.maxsp
  196.         self.contents.blt(164, 352, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  197.       elsif @new_sp < @actor.maxsp
  198.         self.contents.blt(164, 352, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  199.       end
  200.       self.contents.font.color = @new_sp>@actor.maxsp ? up_color : down_color
  201.       self.contents.font.color = normal_color if @new_sp == @actor.maxsp
  202.       self.contents.draw_text(200, 352, 36, 32, @new_sp.to_s, 2)
  203.     end
  204.     #---------------------------------yy
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # ● 变更装备后的能力值设置
  208.   #     new_atk  : 变更装备后的攻击力
  209.   #     new_pdef : 变更装备后的物理防御
  210.   #     new_mdef : 变更装备后的魔法防御
  211.   #--------------------------------------------------------------------------
  212.     ###############################################################
  213.     #-------------------------------yy
  214.   def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int, new_hp, new_sp)
  215.     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
  216.       @new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int or @new_hp != new_hp or @new_sp != new_sp
  217.       @new_atk = new_atk
  218.       @new_pdef = new_pdef
  219.       @new_mdef = new_mdef
  220.       @new_eva = new_eva
  221.       @new_str = new_str
  222.       @new_dex = new_dex
  223.       @new_agi = new_agi
  224.       @new_int = new_int
  225.       @new_hp = new_hp
  226.       @new_sp = new_sp
  227.       refresh
  228.     end
  229.   end
  230.   #------------------------------------yy
  231. end
  232. #==============================================================================
  233. # ■ Window_EquipItem
  234. #------------------------------------------------------------------------------
  235. #  装备画面、显示浏览变更装备的候补物品的窗口。
  236. #==============================================================================
  237. class Window_EquipItem < Window_Selectable
  238.   #--------------------------------------------------------------------------
  239.   # ● 初始化对像
  240.   #     actor      : 角色
  241.   #     equip_type : 装备部位 (0~3)
  242.   #--------------------------------------------------------------------------
  243.   def initialize(actor, equip_type)
  244.     ################改了改坐标和高度#################################
  245.     super(272, 256, 368, 224)
  246.     [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  247.     @equip_type = equip_type
  248.     @column_max = 1
  249.     refresh
  250.     self.active = false
  251.     self.index = -1
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ● 项目的描绘
  255.   #     index : 项目符号
  256.   #--------------------------------------------------------------------------
  257.   def draw_item(index)
  258.     item = @data[index]
  259.     ################改了改坐标#################################
  260.     x = 4
  261.     y = index * 32
  262.     case item
  263.     when RPG::Weapon
  264.       number = $game_party.weapon_number(item.id)
  265.     when RPG::Armor
  266.       number = $game_party.armor_number(item.id)
  267.     end
  268.     bitmap = RPG::Cache.icon(item.icon_name)
  269.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  270.     self.contents.font.color = normal_color
  271.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  272.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  273.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  274.   end
  275. end
  276. #==============================================================================
  277. # ■ Scene_Equip
  278. #------------------------------------------------------------------------------
  279. #  处理装备画面的类。
  280. #==============================================================================
  281. class Scene_Equip
  282.   #--------------------------------------------------------------------------
  283.   # ● 刷新
  284.   #--------------------------------------------------------------------------
  285.   def refresh
  286.     # 设置物品窗口的可视状态
  287.     @item_window1.visible = (@right_window.index == 0)
  288.     @item_window2.visible = (@right_window.index == 1)
  289.     @item_window3.visible = (@right_window.index == 2)
  290.     @item_window4.visible = (@right_window.index == 3)
  291.     @item_window5.visible = (@right_window.index == 4)
  292.     # 获取当前装备中的物品
  293.     item1 = @right_window.item
  294.     # 设置当前的物品窗口到 @item_window
  295.     case @right_window.index
  296.     when 0
  297.       @item_window = @item_window1
  298.     when 1
  299.       @item_window = @item_window2
  300.     when 2
  301.       @item_window = @item_window3
  302.     when 3
  303.       @item_window = @item_window4
  304.     when 4
  305.       @item_window = @item_window5
  306.     end
  307.     # 右窗口被激活的情况下
  308.     if @right_window.active
  309.       # 删除变更装备后的能力
  310.     ###############################################################
  311.       @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
  312.     end
  313.     # 物品窗口被激活的情况下
  314.     if @item_window.active
  315.       # 获取现在选中的物品
  316.       item2 = @item_window.item
  317.       # 变更装备
  318.       last_hp = @actor.hp
  319.       last_sp = @actor.sp
  320.       @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  321.       # 获取变更装备后的能力值
  322.     ###############################################################
  323.       new_atk = @actor.atk
  324.       new_pdef = @actor.pdef
  325.       new_mdef = @actor.mdef
  326.       new_eva = @actor.eva
  327.       new_str = @actor.str
  328.       new_dex = @actor.dex
  329.       new_agi = @actor.agi
  330.       new_int = @actor.int
  331.       #----------------------yy
  332.       new_hp = @actor.maxhp
  333.       new_sp = @actor.maxsp
  334.       #----------------------yy
  335.       # 返回到装备
  336.       @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  337.       @actor.hp = last_hp
  338.       @actor.sp = last_sp
  339.       # 描画左窗口
  340.     ###############################################################
  341.       @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)
  342.     end
  343.   end
  344. end
  345. #==============================================================================
  346. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  347. #==============================================================================


@wingzeroplus  

点评

原来是要改MAXHP……都受教了  发表于 2013-6-16 18:49

评分

参与人数 1星屑 +12 收起 理由
wingzeroplus + 12 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-29 14:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表