楼主: 芯☆淡茹水

[原创发布] ★ 仿网游装备系统 ★<更新[15/3/14]>

[复制链接]
梦石
0
星屑
17566
在线时间
4250 小时
注册时间
2013-7-18
回帖
2491
发表于 2014-5-17 10:30:15 | 显示全部楼层
有个小意见:你更新的哪条脚本可不可以说出来,我不想再全部复制上去啊,可以吗?

点评

“设置” + “Game_Equip” + “Scene_Renovation”  发表于 2014-5-17 10:34
退隐....
回复

使用道具 举报

梦石
0
星屑
17566
在线时间
4250 小时
注册时间
2013-7-18
回帖
2491
发表于 2014-5-26 12:24:58 | 显示全部楼层
问题:副手(盾)加了速度,但装备上去没有效果,状态里也不显示
退隐....
回复

使用道具 举报

梦石
0
星屑
34511
在线时间
5096 小时
注册时间
2012-11-19
回帖
4715

开拓者

 楼主| 发表于 2014-5-26 21:04:48 | 显示全部楼层
本帖最后由 芯☆淡茹水 于 2014-5-26 21:11 编辑

@y967  

未加之前:

111.JPG



防具盾牌:

222.JPG


加了以后:

333.JPG

如果是状态的话:

未加之前:

111.JPG


防具:

222.JPG

加了之后:

333.JPG
xp vx va mv  va mz 各类型脚本/插件定制
回复

使用道具 举报

梦石
0
星屑
9292
在线时间
2504 小时
注册时间
2011-5-20
回帖
14521

开拓者

发表于 2014-6-1 12:29:13 | 显示全部楼层
芯☆淡茹水 发表于 2014-5-26 21:04
@y967  

未加之前:

身上多个装备都有状态会不会一起显示?

点评

那是状态显示问题。  发表于 2014-6-1 13:44
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复

使用道具 举报

梦石
0
星屑
677
在线时间
509 小时
注册时间
2011-4-25
回帖
155
发表于 2014-6-3 16:55:17 | 显示全部楼层
我来试一试,把他整合XAS系统,整合XAS3.9版本问题不大,因为XAS3.9用的就是RM自带的伤害公式。

点评

楼主这个整合RATB回合战斗系统,要费一般功夫了。  发表于 2014-6-3 16:56
回复

使用道具 举报

梦石
0
星屑
585
在线时间
0 小时
注册时间
2014-6-4
回帖
1
发表于 2014-6-4 14:45:01 | 显示全部楼层
大大啊!这系统真的是太好了!真不知道该怎么说了,一定给32个赞
回复

使用道具 举报

梦石
0
星屑
17566
在线时间
4250 小时
注册时间
2013-7-18
回帖
2491
发表于 2014-6-5 16:26:24 | 显示全部楼层
问题:
限制一下20%攻击力石头吧,限制只能武器能镶嵌,要不所有装备都能镶嵌,太变态了

点评

你把石头的百分比改小点不就得了!再比如多弄几种百分比的,比如:2%;5%;12%,,,,等。  发表于 2014-6-8 05:40
退隐....
回复

使用道具 举报

梦石
0
星屑
65
在线时间
11 小时
注册时间
2010-8-14
回帖
3
发表于 2014-7-16 20:28:52 | 显示全部楼层
哇,看看,好似好东西啊
回复

使用道具 举报

梦石
0
星屑
45
在线时间
64 小时
注册时间
2013-7-29
回帖
40
发表于 2014-7-18 20:57:09 | 显示全部楼层
额……我就想要打造什么的系统啊……
555555貌似容错不好啊
回复

使用道具 举报

梦石
0
星屑
590
在线时间
392 小时
注册时间
2012-1-20
回帖
212

开拓者

发表于 2014-7-27 09:37:27 | 显示全部楼层
本帖最后由 哆啦溯 于 2014-7-27 09:41 编辑

都是很好的脚本啊!特别是我最需要的显示物品详细信息的脚本也有!
但是...都不容易和其他脚本兼容啊{:2_270:}
我目前用的是【物品分类】【装备能力变化】【装备栏拓展】脚本,不知道能不能在这个基础上增加显示物品详细信息的功能?

——脚本盲一个- -

【物品分类】
  1. # ————————————————————————————————————
  2. # 本脚本来自[url]www.66rpg.com[/url],转载请保留此信息
  3. # ————————————————————————————————————

  4. #==============================================================================
  5. # ■ Harts_Window_ItemTitle
  6. #==============================================================================

  7. class Harts_Window_ItemTitle < Window_Base
  8.   def initialize
  9.     super(0, 0, 160, 64)
  10.     self.contents = Bitmap.new(width - 32, height - 32)
  11.     self.contents.clear
  12.     self.contents.font.color = normal_color
  13.     self.contents.draw_text(4, 0, 120, 32, $data_system.words.item, 1)
  14.   end
  15. end

  16. #==============================================================================
  17. # ■ Harts_Window_ItemCommand
  18. #==============================================================================

  19. class Harts_Window_ItemCommand < Window_Selectable
  20.   attr_accessor :commands
  21.   #--------------------------------------------------------------------------
  22.   # ● 初始化,生成commands窗口
  23.   #--------------------------------------------------------------------------
  24.   def initialize
  25.     super(0, 64, 160, 352)
  26.     self.contents = Bitmap.new(width - 32, height - 32)
  27.     @commands = []
  28.     #————————生成commands窗口
  29.     for i in 1...$data_items.size
  30.       if $game_party.item_number(i) > 0
  31.         push = true
  32.         for com in @commands
  33.           if com == $data_items[i].desc
  34.             push = false
  35.           end
  36.         end
  37.         if push == true
  38.           @commands.push($data_items[i].desc)
  39.         end
  40.       end
  41.     end
  42.     for i in 1...$data_weapons.size
  43.       if $game_party.weapon_number(i) > 0
  44.         push = true
  45.         for com in @commands
  46.           if com == $data_weapons[i].desc
  47.             push = false
  48.           end
  49.         end
  50.         if push == true
  51.           @commands.push($data_weapons[i].desc)
  52.         end
  53.       end
  54.     end
  55.     for i in 1...$data_armors.size
  56.       if $game_party.armor_number(i) > 0
  57.         push = true
  58.         for com in @commands
  59.           if com == $data_armors[i].desc
  60.             push = false
  61.           end
  62.         end
  63.         if push == true
  64.           @commands.push($data_armors[i].desc)
  65.         end
  66.       end
  67.     end
  68.     if @commands == []
  69.       @commands.push("普通物品")
  70.     end      
  71.     @item_max = @commands.size
  72.     refresh
  73.     self.index = 0
  74.   end
  75.   #--------------------------------------------------------------------------
  76.   #--------------------------------------------------------------------------
  77.   def refresh
  78.     self.contents.clear
  79.     for i in 0...@item_max
  80.       draw_item(i, normal_color)
  81.     end
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   #--------------------------------------------------------------------------
  85.   def draw_item(index, color)
  86.     self.contents.font.color = color
  87.     y = index * 32
  88.     self.contents.draw_text(4, y, 128, 32, @commands[index])
  89.   end
  90.   #--------------------------------------------------------------------------
  91.   # 只描绘原文字
  92.   #--------------------------------------------------------------------------
  93.   def update_help
  94.     @help_window.set_text(@commands[self.index])
  95.   end
  96. end

  97. #==============================================================================
  98. # ■ Window_Item
  99. #==============================================================================

  100. class Harts_Window_ItemList < Window_Selectable
  101.   #--------------------------------------------------------------------------
  102.   #--------------------------------------------------------------------------
  103.   def initialize
  104.     super(160, 0, 480, 416)
  105.     refresh
  106.     self.index = 0
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   #--------------------------------------------------------------------------
  110.   def item
  111.     return @data[self.index]
  112.   end
  113.   #--------------------------------------------------------------------------
  114.   #--------------------------------------------------------------------------
  115.   def refresh
  116.     if self.contents != nil
  117.       self.contents.dispose
  118.       self.contents = nil
  119.     end
  120.     @data = []
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   #--------------------------------------------------------------------------
  124.   def set_item(command)
  125.     refresh
  126.     for i in 1...$data_items.size
  127.       if $game_party.item_number(i) > 0 and $data_items[i].desc == command
  128.         @data.push($data_items[i])
  129.       end
  130.     end
  131.     for i in 1...$data_weapons.size
  132.       if $game_party.weapon_number(i) > 0 and $data_weapons[i].desc == command
  133.         @data.push($data_weapons[i])
  134.       end
  135.     end
  136.     for i in 1...$data_armors.size
  137.       if $game_party.armor_number(i) > 0 and $data_armors[i].desc == command
  138.         @data.push($data_armors[i])
  139.       end
  140.     end
  141.     @item_max = @data.size
  142.     if @item_max > 0
  143.       self.contents = Bitmap.new(width - 32, row_max * 32)
  144.       self.contents.clear
  145.       for i in 0...@item_max
  146.         draw_item(i)
  147.       end
  148.     end
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   #--------------------------------------------------------------------------
  152.   def item_number
  153.     return @item_max
  154.   end
  155.   #--------------------------------------------------------------------------
  156.   #--------------------------------------------------------------------------
  157.   def draw_item(index)
  158.     item = @data[index]
  159.     case item
  160.     when RPG::Item
  161.       number = $game_party.item_number(item.id)
  162.     when RPG::Weapon
  163.       number = $game_party.weapon_number(item.id)
  164.     when RPG::Armor
  165.       number = $game_party.armor_number(item.id)
  166.     end
  167.     if item.is_a?(RPG::Item) and
  168.       $game_party.item_can_use?(item.id)
  169.       self.contents.font.color = normal_color
  170.     else
  171.       self.contents.font.color = disabled_color
  172.     end
  173.     x = 4
  174.     y = index * 32
  175.     bitmap = RPG::Cache.icon(item.icon_name)
  176.     opacity = self.contents.font.color == normal_color ? 255 : 128
  177.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  178.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  179.     self.contents.draw_text(x + 400, y, 16, 32, ":", 1)
  180.     self.contents.draw_text(x + 416, y, 24, 32, number.to_s, 2)
  181.   end
  182.   #--------------------------------------------------------------------------
  183.   #--------------------------------------------------------------------------
  184.   def update_help
  185.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  186.   end
  187. end

  188. #==============================================================================
  189. # ■ Harts_Scene_Item
  190. #==============================================================================

  191. class Scene_Item
  192.   #--------------------------------------------------------------------------
  193.   #--------------------------------------------------------------------------
  194.   def main
  195.     @itemtitle_window = Harts_Window_ItemTitle.new
  196.     @itemcommand_window = Harts_Window_ItemCommand.new
  197.     @command_index = @itemcommand_window.index
  198.     @itemlist_window = Harts_Window_ItemList.new
  199.     @itemlist_window.active = false
  200.     @help_window = Window_Help.new
  201.     @help_window.x = 0
  202.     @help_window.y = 416
  203.     @itemcommand_window.help_window = @help_window
  204.     @itemlist_window.help_window = @help_window
  205.     @target_window = Window_Target.new
  206.     @target_window.visible = false
  207.     @target_window.active = false
  208.     @itemlist_window.set_item(@itemcommand_window.commands[@command_index])
  209.     Graphics.transition
  210.     loop do
  211.       Graphics.update
  212.       Input.update
  213.       update
  214.       if $scene != self
  215.         break
  216.       end
  217.     end
  218.     Graphics.freeze
  219.     @itemtitle_window.dispose
  220.     @itemcommand_window.dispose
  221.     @itemlist_window.dispose
  222.     @help_window.dispose
  223.     @target_window.dispose
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   #--------------------------------------------------------------------------
  227.   def update
  228.     @itemtitle_window.update
  229.     @itemcommand_window.update
  230.     @itemlist_window.update
  231.     @help_window.update
  232.     @target_window.update
  233.     if @command_index != @itemcommand_window.index
  234.       @command_index = @itemcommand_window.index
  235.       @itemlist_window.set_item(@itemcommand_window.commands[@command_index])
  236.     end
  237.     if @itemcommand_window.active
  238.       update_itemcommand
  239.       return
  240.     end
  241.     if @itemlist_window.active
  242.       update_itemlist
  243.       return
  244.     end
  245.     if @target_window.active
  246.       update_target
  247.       return
  248.     end
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   #--------------------------------------------------------------------------
  252.   def update_itemcommand
  253.     if Input.trigger?(Input::B)
  254.       $game_system.se_play($data_system.cancel_se)
  255.       $scene = Scene_Menu.new(0)
  256.       return
  257.     end
  258.     if Input.trigger?(Input::C)
  259.       if @itemlist_window.item_number == 0
  260.         $game_system.se_play($data_system.buzzer_se)
  261.         return
  262.       end
  263.       $game_system.se_play($data_system.decision_se)
  264.       @itemcommand_window.active = false
  265.       @itemlist_window.active = true
  266.       @itemlist_window.index = 0
  267.       return
  268.     end
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   #--------------------------------------------------------------------------
  272.   def update_itemlist
  273.     if Input.trigger?(Input::B)
  274.       $game_system.se_play($data_system.cancel_se)
  275.       @itemcommand_window.active = true
  276.       @itemlist_window.active = false
  277.       @itemlist_window.index = 0
  278.       @itemcommand_window.index = @command_index
  279.       return
  280.     end
  281.     if Input.trigger?(Input::C)
  282.       @item = @itemlist_window.item
  283.       unless @item.is_a?(RPG::Item)
  284.         $game_system.se_play($data_system.buzzer_se)
  285.         return
  286.       end
  287.       unless $game_party.item_can_use?(@item.id)
  288.         $game_system.se_play($data_system.buzzer_se)
  289.         return
  290.       end
  291.       $game_system.se_play($data_system.decision_se)
  292.       if @item.scope >= 3
  293.         @itemlist_window.active = false
  294.         @target_window.x = 304
  295.         @target_window.visible = true
  296.         @target_window.active = true
  297.         if @item.scope == 4 || @item.scope == 6
  298.           @target_window.index = -1
  299.         else
  300.           @target_window.index = 0
  301.         end
  302.       else
  303.         if @item.common_event_id > 0
  304.           $game_temp.common_event_id = @item.common_event_id
  305.           $game_system.se_play(@item.menu_se)
  306.             if @item.consumable
  307.               $game_party.lose_item(@item.id, 1)
  308.               @itemlist_window.draw_item(@itemlist_window.index)
  309.             end
  310.           $scene = Scene_Map.new
  311.           return
  312.         end
  313.       end
  314.       return
  315.     end
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   #--------------------------------------------------------------------------
  319.   def update_target
  320.     if Input.trigger?(Input::B)
  321.       $game_system.se_play($data_system.cancel_se)
  322.       unless $game_party.item_can_use?(@item.id)
  323.         @itemlist_window.refresh
  324.       end
  325.       @itemlist_window.active = true
  326.       @target_window.visible = false
  327.       @target_window.active = false
  328.       @itemlist_window.set_item(@itemcommand_window.commands[@command_index])
  329.       return
  330.     end
  331.     if Input.trigger?(Input::C)
  332.       if $game_party.item_number(@item.id) == 0
  333.         $game_system.se_play($data_system.buzzer_se)
  334.         return
  335.       end
  336.       if @target_window.index == -1
  337.         used = false
  338.         for i in $game_party.actors
  339.           used |= i.item_effect(@item)
  340.         end
  341.       end
  342.       if @target_window.index >= 0
  343.         target = $game_party.actors[@target_window.index]
  344.         used = target.item_effect(@item)
  345.       end
  346.       if used
  347.         $game_system.se_play(@item.menu_se)
  348.         if @item.consumable
  349.           $game_party.lose_item(@item.id, 1)
  350.           @itemlist_window.draw_item(@itemlist_window.index)
  351.           @itemlist_window.set_item(@itemcommand_window.commands[@command_index])
  352.         end
  353.         @target_window.refresh
  354.         if $game_party.all_dead?
  355.           $scene = Scene_Gameover.new
  356.           return
  357.         end
  358.         if @item.common_event_id > 0
  359.           $game_temp.common_event_id = @item.common_event_id
  360.           $scene = Scene_Map.new
  361.           return
  362.         end
  363.       end
  364.       unless used
  365.         $game_system.se_play($data_system.buzzer_se)
  366.       end
  367.     return
  368.     end
  369.   end
  370. end

  371. #==============================================================================
  372. # ■ RPG追加定义,使用@符号分类
  373. #==============================================================================

  374. module RPG
  375.   class Weapon#武器
  376.     def description
  377.       description = @description.split(/@/)[0]
  378.       return description != nil ? description : ''
  379.     end
  380.     def desc
  381.       desc = @description.split(/@/)[1]
  382.       return desc != nil ? desc : "武器防具"
  383.     end
  384.   end
  385.   class Item#物品
  386.     def description
  387.       description = @description.split(/@/)[0]
  388.       return description != nil ? description : ''
  389.     end
  390.     def desc
  391.       desc = @description.split(/@/)[1]
  392.       return desc != nil ? desc : "物品"
  393.     end
  394.   end
  395.   class Armor#防具
  396.     def description
  397.       description = @description.split(/@/)[0]
  398.       return description != nil ? description : ''
  399.     end
  400.     def desc
  401.       desc = @description.split(/@/)[1]
  402.       return desc != nil ? desc : "武器防具"
  403.     end
  404.   end
  405. end
复制代码



【装备能力变化】
  1. #==============================================================================
  2. # ■ Window_ShopStatus
  3. #------------------------------------------------------------------------------
  4. #  商店画面、显示物品所持数与角色装备的窗口。
  5. #==============================================================================
  6. class Window_ShopStatus < Window_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(368, 128, 272, 352)
  12.     self.contents = Bitmap.new(width - 32, height - 32)
  13.     self.contents.font.size = 16
  14.     @item = nil
  15.     refresh
  16.   end
  17.   #--------------------------------------------------------------------------
  18.   # ● 刷新
  19.   #--------------------------------------------------------------------------
  20.   def refresh
  21.     self.contents.clear
  22.     if @item == nil
  23.       return
  24.     end
  25.     case @item
  26.     when RPG::Item
  27.       number = $game_party.item_number(@item.id)
  28.     when RPG::Weapon
  29.       number = $game_party.weapon_number(@item.id)
  30.     when RPG::Armor
  31.       number = $game_party.armor_number(@item.id)
  32.     end
  33.     self.contents.font.color = system_color
  34.     self.contents.draw_text(4, 0, 200, 32, "所持数")
  35.     self.contents.font.color = normal_color
  36.     self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
  37.     if @item.is_a?(RPG::Item)
  38.       return
  39.     end
  40.     # 添加装备品信息
  41.     for i in 0...$game_party.actors.size
  42.       # 获取角色
  43.       actor = $game_party.actors[i]
  44.       # 可以装备为普通文字颜色、不能装备设置为无效文字颜色
  45.       if actor.equippable?(@item)
  46.         self.contents.font.color = normal_color
  47.       else
  48.         self.contents.font.color = disabled_color
  49.       end
  50.       # 描绘角色名字
  51.       j = 70
  52.       self.contents.draw_text(0, 32 + j * i, 120, 32, actor.name)
  53.       # 获取当前的装备品
  54.       if @item.is_a?(RPG::Weapon)
  55.         item1 = $data_weapons[actor.weapon_id]
  56.       elsif @item.kind == 0
  57.         item1 = $data_armors[actor.armor1_id]
  58.       elsif @item.kind == 1
  59.         item1 = $data_armors[actor.armor2_id]
  60.       elsif @item.kind == 2
  61.         item1 = $data_armors[actor.armor3_id]
  62.       else
  63.         item1 = $data_armors[actor.armor4_id]
  64.       end
  65.       # 可以装备的情况
  66.       #if actor.equippable?(@item)
  67.         # 武器的情况
  68.         i += 1
  69.         if @item.is_a?(RPG::Weapon)
  70.          
  71.          
  72.          
  73.           atk1 = item1 != nil ? item1.atk : 0
  74.           atk2 = @item != nil ? @item.atk : 0
  75.          
  76.           pdef1 = item1 != nil ? item1.pdef : 0
  77.           pdef2 = @item != nil ? @item.pdef : 0
  78.          
  79.           str1 = item1 != nil ? item1.str_plus : 0
  80.           str2 = @item != nil ? @item.str_plus : 0
  81.          
  82.           dex1 = item1 != nil ? item1.dex_plus : 0
  83.           dex2 = @item != nil ? @item.dex_plus : 0
  84.          
  85.           agi1 = item1 != nil ? item1.agi_plus : 0
  86.           agi2 = @item != nil ? @item.agi_plus : 0
  87.          
  88.           int1 = item1 != nil ? item1.int_plus : 0
  89.           int2 = @item != nil ? @item.int_plus : 0
  90.          
  91.          
  92.           [url=home.php?mod=space&uid=101599]@atk[/url] = atk2 - atk1
  93.           @str = str2 - str1
  94.           @dex = dex2 - dex1
  95.           [url=home.php?mod=space&uid=6136]@agi[/url] = agi2 - agi1
  96.           @int = int2 - int1
  97.           @pdef = pdef2 - pdef1
  98.          
  99.          
  100.          
  101.          
  102.          
  103.          
  104.          
  105.         x = -16
  106.         self.contents.draw_text(80*0,        x+j * i, 112, 32,"攻击",0)
  107.         self.contents.draw_text(80*1,        x+j * i, 112, 32,"力量",0)
  108.         self.contents.draw_text(80*2,        x+j * i, 112, 32,"速度",0)
  109.         self.contents.draw_text(80*0,        x+j * i+16, 112, 32,"敏捷",0)
  110.         self.contents.draw_text(80*1,        x+j * i+16, 112, 32,"魔力",0)
  111.         self.contents.draw_text(80*2,        x+j * i+16, 112, 32,"防御",0)
  112.         
  113.         #---------------------------------------------------------------------
  114.         q=40-10
  115.         if atk2 >= atk1
  116.         self.contents.font.color = Color.new(159,251,162,255)
  117.         self.contents.draw_text(80*0+q,      x+j * i, 112, 32,"↑",0)
  118.         else
  119.         self.contents.font.color = Color.new(255,0,0,255)
  120.         self.contents.draw_text(80*0+q,       x+j * i, 112, 32,"↓",0)
  121.         end
  122.         #---------------------------------------------------------------------
  123.         if str2 >= str1
  124.         self.contents.font.color = Color.new(159,251,162,255)
  125.         self.contents.draw_text(80*1+q,    x+j * i, 112, 32,"↑",0)
  126.         else
  127.         self.contents.font.color = Color.new(255,0,0,255)
  128.         self.contents.draw_text(80*1+q,    x+j * i, 112, 32,"↓",0)
  129.         end
  130.         #---------------------------------------------------------------------
  131.         if dex2 >= dex1
  132.         self.contents.font.color = Color.new(159,251,162,255)
  133.         self.contents.draw_text(80*2+q,    x+j * i, 112, 32,"↑",0)
  134.         else
  135.         self.contents.font.color = Color.new(255,0,0,255)
  136.         self.contents.draw_text(80*2+q,    x+j * i, 112, 32,"↓",0)
  137.         end
  138.       
  139.         #---------------------------------------------------------------------
  140.         if agi2 >= agi1
  141.         self.contents.font.color = Color.new(159,251,162,255)
  142.         self.contents.draw_text(80*0+q,       x+j * i+16, 112, 32,"↑",0)
  143.         else
  144.         self.contents.font.color = Color.new(255,0,0,255)
  145.         self.contents.draw_text(80*0+q,       x+j * i+16, 112, 32,"↓",0)
  146.         end
  147.         #---------------------------------------------------------------------
  148.         if int2 >= int1
  149.         self.contents.font.color = Color.new(159,251,162,255)
  150.         self.contents.draw_text(80*1+q,       x+j * i+16, 112, 32,"↑",0)
  151.         else
  152.         self.contents.font.color = Color.new(255,0,0,255)
  153.         self.contents.draw_text(80*1+q,       x+j * i+16, 112, 32,"↓",0)
  154.         end
  155.         #---------------------------------------------------------------------
  156.         if pdef2 >= pdef1
  157.         self.contents.font.color = Color.new(159,251,162,255)
  158.         self.contents.draw_text(80*2+q,       x+j * i+16, 112, 32,"↑",0)
  159.         else
  160.         self.contents.font.color = Color.new(255,0,0,255)
  161.         self.contents.draw_text(80*2+q,       x+j * i+16, 112, 32,"↓",0)
  162.         end

  163.         
  164.         
  165.         
  166.         
  167.         
  168.         
  169.         #---------------------------------------------------------------------
  170.         self.contents.font.color = Color.new(159,251,162,255)
  171.         q=50
  172.         self.contents.draw_text(80*0+q,    x+j * i, 112, 32,@atk.abs.to_s,0)
  173.         self.contents.draw_text(80*1+q,    x+j * i, 112, 32,@str.abs.to_s,0)
  174.         self.contents.draw_text(80*2+q,    x+j * i, 112, 32,@dex.abs.to_s,0)
  175.         
  176.         #---------------------------------------------------------------------
  177.         self.contents.draw_text(80*0+q,     x+j * i+16, 112, 32,@agi.abs.to_s,0)
  178.         self.contents.draw_text(80*1+q,     x+j * i+16, 112, 32,@int.abs.to_s,0)
  179.         self.contents.draw_text(80*2+q,     x+j * i+16, 112, 32,@pdef.abs.to_s,0)
  180.          
  181.          
  182.          
  183.          
  184.          
  185.          
  186.          
  187.          
  188.          
  189.          
  190.          
  191.          
  192.          
  193.         end
  194.         # 防具的情况
  195.         if @item.is_a?(RPG::Armor)

  196.          
  197.          
  198.           str1 = item1 != nil ? item1.str_plus : 0
  199.           str2 = @item != nil ? @item.str_plus : 0
  200.           dex1 = item1 != nil ? item1.dex_plus : 0
  201.           dex2 = @item != nil ? @item.dex_plus : 0

  202.          
  203.           agi1 = item1 != nil ? item1.agi_plus : 0
  204.           agi2 = @item != nil ? @item.agi_plus : 0
  205.           int1 = item1 != nil ? item1.int_plus : 0
  206.           int2 = @item != nil ? @item.int_plus : 0
  207.          
  208.          
  209.          
  210.           pdef1 = item1 != nil ? item1.pdef : 0
  211.           pdef2 = @item != nil ? @item.pdef : 0
  212.           mdef1 = item1 != nil ? item1.mdef : 0
  213.           mdef2 = @item != nil ? @item.mdef : 0
  214.          
  215.          
  216.           @str  = str2 - str1
  217.           @dex  = dex2 - dex1
  218.           [url=home.php?mod=space&uid=6136]@agi[/url]  = agi2 - agi1
  219.           @int  = int2 - int1
  220.           @pdef = pdef2 - pdef1
  221.           @mdef = mdef2 - mdef1
  222.         x=-16  
  223.         self.contents.draw_text(80*0,        x+j * i, 112, 32,"力量",0)
  224.         self.contents.draw_text(80*1,        x+j * i, 112, 32,"速度",0)
  225.         self.contents.draw_text(80*2,        x+j * i, 112, 32,"敏捷",0)
  226.         self.contents.draw_text(80*0,        x+j * i+16, 112, 32,"魔力",0)
  227.         self.contents.draw_text(80*1,        x+j * i+16, 112, 32,"防御",0)
  228.         self.contents.draw_text(80*2,        x+j * i+16, 112, 32,"魔御",0)
  229.         
  230.         #---------------------------------------------------------------------
  231.         q=30
  232.         if str2 >= str1
  233.         self.contents.font.color = Color.new(159,251,162,255)
  234.         self.contents.draw_text(80*0+q,       x+j * i, 112, 32,"↑",0)
  235.         else
  236.         self.contents.font.color = Color.new(255,0,0,255)
  237.         self.contents.draw_text(80*0+q,       x+j * i, 112, 32,"↓",0)
  238.         end
  239.         #---------------------------------------------------------------------
  240.         if dex2 >= dex1
  241.         self.contents.font.color = Color.new(159,251,162,255)
  242.         self.contents.draw_text(80*1+q,    x+j * i, 112, 32,"↑",0)
  243.         else
  244.         self.contents.font.color = Color.new(255,0,0,255)
  245.         self.contents.draw_text(80*1+q,    x+j * i, 112, 32,"↓",0)
  246.         end
  247.         #---------------------------------------------------------------------
  248.         if agi2 >= agi1
  249.         self.contents.font.color = Color.new(159,251,162,255)
  250.         self.contents.draw_text(80*2+q,    x+j * i, 112, 32,"↑",0)
  251.         else
  252.         self.contents.font.color = Color.new(255,0,0,255)
  253.         self.contents.draw_text(80*2+q,    x+j * i, 112, 32,"↓",0)
  254.         end
  255.       
  256.         #---------------------------------------------------------------------
  257.         if int2 >= int1
  258.         self.contents.font.color = Color.new(159,251,162,255)
  259.         self.contents.draw_text(80*0+q,       x+j * i+16, 112, 32,"↑",0)
  260.         else
  261.         self.contents.font.color = Color.new(255,0,0,255)
  262.         self.contents.draw_text(80*0+q,       x+j * i+16, 112, 32,"↓",0)
  263.         end
  264.         #---------------------------------------------------------------------
  265.         q=40-10
  266.         if pdef2 >= pdef1
  267.         self.contents.font.color = Color.new(159,251,162,255)
  268.         self.contents.draw_text(80*1+q,       x+j * i+16, 112, 32,"↑",0)
  269.         else
  270.         self.contents.font.color = Color.new(255,0,0,255)
  271.         self.contents.draw_text(80*1+q,       x+j * i+16, 112, 32,"↓",0)
  272.         end
  273.         #---------------------------------------------------------------------
  274.         if mdef2 >= mdef1
  275.         self.contents.font.color = Color.new(159,251,162,255)
  276.         self.contents.draw_text(80*2+q,       x+j * i+16, 112, 32,"↑",0)
  277.         else
  278.         self.contents.font.color = Color.new(255,0,0,255)
  279.         self.contents.draw_text(80*2+q,       x+j * i+16, 112, 32,"↓",0)
  280.         end
  281.         
  282.         
  283.         #---------------------------------------------------------------------
  284.         self.contents.font.color = Color.new(159,251,162,255)
  285.         q=50
  286.         self.contents.draw_text(80*0+q,     x+j * i, 112, 32,@str.abs.to_s,0)
  287.         self.contents.draw_text(80*1+q,    x+j * i, 112, 32,@dex.abs.to_s,0)
  288.         self.contents.draw_text(80*2+q,    x+j * i, 112, 32,@agi.abs.to_s,0)
  289.         
  290.         #---------------------------------------------------------------------
  291.         self.contents.draw_text(80*0+q,     x+j * i+16, 112, 32,@int.abs.to_s,0)
  292.         self.contents.draw_text(80*1+q,       x+j * i+16, 112, 32,@pdef.abs.to_s,0)
  293.         self.contents.draw_text(80*2+q,       x+j * i+16, 112, 32,@mdef.abs.to_s,0)
  294.         end
  295.         end
  296.         
  297.         
  298.         
  299.         
  300.       self.contents.font.color = normal_color
  301.       i -= 1
  302.       #self.contents.font.size = 22
  303.       # 描绘物品
  304.       if item1 != nil
  305.         x = 4
  306.         y = 64 + 64 * i + 32
  307.         #bitmap = RPG::Cache.icon(item1.icon_name)
  308.         #opacity = self.contents.font.color == normal_color ? 255 : 128
  309.         #self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  310.         #self.contents.draw_text(x + 28, y, 212, 32, item1.name)
  311.       end
  312.     end
  313.   #end
  314.   #--------------------------------------------------------------------------
  315.   # ● 设置物品
  316.   #     item : 新的物品
  317.   #--------------------------------------------------------------------------
  318.   def item=(item)
  319.     if @item != item
  320.       @item = item
  321.       refresh
  322.     end
  323.   end
  324. end
复制代码


【装备栏拓展】
  1. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  2. #
  3. #                                防具类追加
  4. #
  5. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  6. module RPG
  7.   class Armor
  8.     def name
  9.       name = @name.split(/,/)[0]
  10.       return name != nil ? name : ''
  11.     end
  12.     def kind
  13.       kind  = @name.split(/,/)[1]
  14.       return kind  != nil ? kind.to_i : @kind
  15.     end
  16.   end
  17. end
  18. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  19. #
  20. #                  Game_Actor添加新的防具ID,并对相关方法修正
  21. #
  22. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  23. class Game_Actor < Game_Battler
  24.   attr_reader   :armor5_id                # 道具 ID
  25.   attr_reader   :armor6_id                # 装饰品 ID
  26.   #--------------------------------------------------------------------------
  27.   # ● 设置
  28.   #     actor_id : 角色 ID
  29.   #--------------------------------------------------------------------------
  30.   alias old_setup setup
  31.   def setup(actor_id)
  32.     old_setup(actor_id)
  33.     @armor5_id = 0
  34.     @armor6_id = 0
  35.     update_auto_state(nil, $data_armors[@armor5_id])
  36.     update_auto_state(nil, $data_armors[@armor6_id])
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ● 取得属性修正值
  40.   #     element_id : 属性 ID
  41.   #--------------------------------------------------------------------------
  42.   def element_rate(element_id)
  43.     # 获取对应属性有效度的数值
  44.     table = [0,200,150,100,50,0,-100]
  45.     result = table[$data_classes[@class_id].element_ranks[element_id]]
  46.     # 防具能防御本属性的情况下效果减半
  47.     for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id, @armor5_id, @armor6_id]
  48.       armor = $data_armors[i]
  49.       if armor != nil and armor.guard_element_set.include?(element_id)
  50.         result /= 2
  51.       end
  52.     end
  53.     # 状态能防御本属性的情况下效果减半
  54.     for i in @states
  55.       if $data_states[i].guard_element_set.include?(element_id)
  56.         result /= 2
  57.       end
  58.     end
  59.     # 过程结束
  60.     return result
  61.   end
  62.   #--------------------------------------------------------------------------
  63.   # ● 判定防御属性
  64.   #     state_id : 属性 ID
  65.   #--------------------------------------------------------------------------
  66.   def state_guard?(state_id)
  67.     for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id, @armor5_id, @armor6_id]
  68.       armor = $data_armors[i]
  69.       if armor != nil
  70.         if armor.guard_state_set.include?(state_id)
  71.           return true
  72.         end
  73.       end
  74.     end
  75.     return false
  76.   end
  77.   #--------------------------------------------------------------------------
  78.   # ● 获取基本力量
  79.   #--------------------------------------------------------------------------
  80.   def base_str
  81.     n = $data_actors[@actor_id].parameters[2, @level]
  82.     weapon = $data_weapons[@weapon_id]
  83.     armor1 = $data_armors[@armor1_id]
  84.     armor2 = $data_armors[@armor2_id]
  85.     armor3 = $data_armors[@armor3_id]
  86.     armor4 = $data_armors[@armor4_id]
  87.     armor5 = $data_armors[@armor5_id]
  88.     armor6 = $data_armors[@armor6_id]
  89.     n += weapon != nil ? weapon.str_plus : 0
  90.     n += armor1 != nil ? armor1.str_plus : 0
  91.     n += armor2 != nil ? armor2.str_plus : 0
  92.     n += armor3 != nil ? armor3.str_plus : 0
  93.     n += armor4 != nil ? armor4.str_plus : 0
  94.     n += armor5 != nil ? armor5.str_plus : 0
  95.     n += armor6 != nil ? armor6.str_plus : 0
  96.     return [[n, 1].max, 999].min
  97.   end
  98.   #--------------------------------------------------------------------------
  99.   # ● 获取基本灵巧
  100.   #--------------------------------------------------------------------------
  101.   def base_dex
  102.     n = $data_actors[@actor_id].parameters[3, @level]
  103.     weapon = $data_weapons[@weapon_id]
  104.     armor1 = $data_armors[@armor1_id]
  105.     armor2 = $data_armors[@armor2_id]
  106.     armor3 = $data_armors[@armor3_id]
  107.     armor4 = $data_armors[@armor4_id]
  108.     armor5 = $data_armors[@armor5_id]
  109.     armor6 = $data_armors[@armor6_id]
  110.     n += weapon != nil ? weapon.dex_plus : 0
  111.     n += armor1 != nil ? armor1.dex_plus : 0
  112.     n += armor2 != nil ? armor2.dex_plus : 0
  113.     n += armor3 != nil ? armor3.dex_plus : 0
  114.     n += armor4 != nil ? armor4.dex_plus : 0
  115.     n += armor5 != nil ? armor5.dex_plus : 0
  116.     n += armor6 != nil ? armor6.dex_plus : 0
  117.     return [[n, 1].max, 999].min
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # ● 获取基本速度
  121.   #--------------------------------------------------------------------------
  122.   def base_agi
  123.     n = $data_actors[@actor_id].parameters[4, @level]
  124.     weapon = $data_weapons[@weapon_id]
  125.     armor1 = $data_armors[@armor1_id]
  126.     armor2 = $data_armors[@armor2_id]
  127.     armor3 = $data_armors[@armor3_id]
  128.     armor4 = $data_armors[@armor4_id]
  129.     armor5 = $data_armors[@armor5_id]
  130.     armor6 = $data_armors[@armor6_id]
  131.     n += weapon != nil ? weapon.agi_plus : 0
  132.     n += armor1 != nil ? armor1.agi_plus : 0
  133.     n += armor2 != nil ? armor2.agi_plus : 0
  134.     n += armor3 != nil ? armor3.agi_plus : 0
  135.     n += armor4 != nil ? armor4.agi_plus : 0
  136.     n += armor5 != nil ? armor5.agi_plus : 0
  137.     n += armor6 != nil ? armor6.agi_plus : 0
  138.     return [[n, 1].max, 999].min
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ● 获取基本魔力
  142.   #--------------------------------------------------------------------------
  143.   def base_int
  144.     n = $data_actors[@actor_id].parameters[5, @level]
  145.     weapon = $data_weapons[@weapon_id]
  146.     armor1 = $data_armors[@armor1_id]
  147.     armor2 = $data_armors[@armor2_id]
  148.     armor3 = $data_armors[@armor3_id]
  149.     armor4 = $data_armors[@armor4_id]
  150.     armor5 = $data_armors[@armor5_id]
  151.     armor6 = $data_armors[@armor6_id]
  152.     n += weapon != nil ? weapon.int_plus : 0
  153.     n += armor1 != nil ? armor1.int_plus : 0
  154.     n += armor2 != nil ? armor2.int_plus : 0
  155.     n += armor3 != nil ? armor3.int_plus : 0
  156.     n += armor4 != nil ? armor4.int_plus : 0
  157.     n += armor5 != nil ? armor5.int_plus : 0
  158.     n += armor6 != nil ? armor6.int_plus : 0
  159.     return [[n, 1].max, 999].min
  160.   end
  161.   #--------------------------------------------------------------------------
  162.   # ● 获取基本物理防御
  163.   #--------------------------------------------------------------------------
  164.   def base_pdef
  165.     weapon = $data_weapons[@weapon_id]
  166.     armor1 = $data_armors[@armor1_id]
  167.     armor2 = $data_armors[@armor2_id]
  168.     armor3 = $data_armors[@armor3_id]
  169.     armor4 = $data_armors[@armor4_id]
  170.     armor5 = $data_armors[@armor5_id]
  171.     armor6 = $data_armors[@armor6_id]
  172.     pdef1 = weapon != nil ? weapon.pdef : 0
  173.     pdef2 = armor1 != nil ? armor1.pdef : 0
  174.     pdef3 = armor2 != nil ? armor2.pdef : 0
  175.     pdef4 = armor3 != nil ? armor3.pdef : 0
  176.     pdef5 = armor4 != nil ? armor4.pdef : 0
  177.     pdef6 = armor5 != nil ? armor5.pdef : 0
  178.     pdef7 = armor6 != nil ? armor6.pdef : 0
  179.     return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 + pdef6 + pdef7
  180.   end
  181.   #--------------------------------------------------------------------------
  182.   # ● 获取基本魔法防御
  183.   #--------------------------------------------------------------------------
  184.   def base_mdef
  185.     weapon = $data_weapons[@weapon_id]
  186.     armor1 = $data_armors[@armor1_id]
  187.     armor2 = $data_armors[@armor2_id]
  188.     armor3 = $data_armors[@armor3_id]
  189.     armor4 = $data_armors[@armor4_id]
  190.     armor5 = $data_armors[@armor5_id]
  191.     armor6 = $data_armors[@armor6_id]
  192.     mdef1 = weapon != nil ? weapon.mdef : 0
  193.     mdef2 = armor1 != nil ? armor1.mdef : 0
  194.     mdef3 = armor2 != nil ? armor2.mdef : 0
  195.     mdef4 = armor3 != nil ? armor3.mdef : 0
  196.     mdef5 = armor4 != nil ? armor4.mdef : 0
  197.     mdef6 = armor5 != nil ? armor5.mdef : 0
  198.     mdef7 = armor6 != nil ? armor6.mdef : 0
  199.     return mdef1 + mdef2 + mdef3 + mdef4 + mdef5 + mdef6 + mdef7
  200.   end
  201.   #--------------------------------------------------------------------------
  202.   # ● 获取基本回避修正
  203.   #--------------------------------------------------------------------------
  204.   def base_eva
  205.     armor1 = $data_armors[@armor1_id]
  206.     armor2 = $data_armors[@armor2_id]
  207.     armor3 = $data_armors[@armor3_id]
  208.     armor4 = $data_armors[@armor4_id]
  209.     armor5 = $data_armors[@armor5_id]
  210.     armor6 = $data_armors[@armor6_id]
  211.     eva1 = armor1 != nil ? armor1.eva : 0
  212.     eva2 = armor2 != nil ? armor2.eva : 0
  213.     eva3 = armor3 != nil ? armor3.eva : 0
  214.     eva4 = armor4 != nil ? armor4.eva : 0
  215.     eva5 = armor5 != nil ? armor5.eva : 0
  216.     eva6 = armor6 != nil ? armor6.eva : 0
  217.     return eva1 + eva2 + eva3 + eva4 + eva5 + eva6
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ● 装备固定判定
  221.   #     equip_type : 装备类型
  222.   #--------------------------------------------------------------------------
  223.   def equip_fix?(equip_type)
  224.     case equip_type
  225.     when 0  # 武器
  226.       return $data_actors[@actor_id].weapon_fix
  227.     when 1  # 盾
  228.       return $data_actors[@actor_id].armor1_fix
  229.     when 2  # 头
  230.       return $data_actors[@actor_id].armor2_fix
  231.     when 3  # 身体
  232.       return $data_actors[@actor_id].armor3_fix
  233.     when 4  # 道具
  234.       return $data_actors[@actor_id].armor4_fix
  235.     end
  236.     return false
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # ● 变更装备
  240.   #     equip_type : 装备类型
  241.   #     id    : 武器 or 防具 ID  (0 为解除装备)
  242.   #--------------------------------------------------------------------------
  243.   def equip(equip_type, id)
  244.     case equip_type
  245.     when 0  # 武器
  246.       if id == 0 or $game_party.weapon_number(id) > 0
  247.         $game_party.gain_weapon(@weapon_id, 1)
  248.         @weapon_id = id
  249.         $game_party.lose_weapon(id, 1)
  250.       end
  251.     when 1  # 盾
  252.       if id == 0 or $game_party.armor_number(id) > 0
  253.         update_auto_state($data_armors[@armor1_id], $data_armors[id])
  254.         $game_party.gain_armor(@armor1_id, 1)
  255.         @armor1_id = id
  256.         $game_party.lose_armor(id, 1)
  257.       end
  258.     when 2  # 头
  259.       if id == 0 or $game_party.armor_number(id) > 0
  260.         update_auto_state($data_armors[@armor2_id], $data_armors[id])
  261.         $game_party.gain_armor(@armor2_id, 1)
  262.         @armor2_id = id
  263.         $game_party.lose_armor(id, 1)
  264.       end
  265.     when 3  # 身体
  266.       if id == 0 or $game_party.armor_number(id) > 0
  267.         update_auto_state($data_armors[@armor3_id], $data_armors[id])
  268.         $game_party.gain_armor(@armor3_id, 1)
  269.         @armor3_id = id
  270.         $game_party.lose_armor(id, 1)
  271.       end
  272.     when 4  # 道具
  273.       if id == 0 or $game_party.armor_number(id) > 0
  274.         update_auto_state($data_armors[@armor4_id], $data_armors[id])
  275.         $game_party.gain_armor(@armor4_id, 1)
  276.         @armor4_id = id
  277.         $game_party.lose_armor(id, 1)
  278.       end
  279.     when 5  # 装饰品
  280.       if id == 0 or $game_party.armor_number(id) > 0
  281.         update_auto_state($data_armors[@armor5_id], $data_armors[id])
  282.         $game_party.gain_armor(@armor5_id, 1)
  283.         @armor5_id = id
  284.         $game_party.lose_armor(id, 1)
  285.       end
  286.     when 6  # 道具
  287.       if id == 0 or $game_party.armor_number(id) > 0
  288.         update_auto_state($data_armors[@armor6_id], $data_armors[id])
  289.         $game_party.gain_armor(@armor6_id, 1)
  290.         @armor6_id = id
  291.         $game_party.lose_armor(id, 1)
  292.       end
  293.     end
  294.   end
  295.   #--------------------------------------------------------------------------
  296.   # ● 更改职业 ID
  297.   #     class_id : 新的职业 ID
  298.   #--------------------------------------------------------------------------
  299.   def class_id=(class_id)
  300.     if $data_classes[class_id] != nil
  301.       @class_id = class_id
  302.       # 避开无法装备的物品
  303.       unless equippable?($data_weapons[@weapon_id])
  304.         equip(0, 0)
  305.       end
  306.       unless equippable?($data_armors[@armor1_id])
  307.         equip(1, 0)
  308.       end
  309.       unless equippable?($data_armors[@armor2_id])
  310.         equip(2, 0)
  311.       end
  312.       unless equippable?($data_armors[@armor3_id])
  313.         equip(3, 0)
  314.       end
  315.       unless equippable?($data_armors[@armor4_id])
  316.         equip(4, 0)
  317.       end
  318.       unless equippable?($data_armors[@armor5_id])
  319.         equip(5, 0)
  320.       end
  321.       unless equippable?($data_armors[@armor6_id])
  322.         equip(6, 0)
  323.       end
  324.     end
  325.   end
  326. end
  327. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  328. #
  329. #              Window_Base美化,增加属性增减颜色,及全能力值描绘
  330. #
  331. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  332. #==============================================================================
  333. # ■ Window_Base
  334. #------------------------------------------------------------------------------
  335. #  游戏中全部窗口的超级类。
  336. #==============================================================================

  337. class Window_Base < Window
  338.   ################## 属性增减颜色 ##############################
  339.   def up_color
  340.     return Color.new(255, 0, 0)
  341.   end
  342.   def down_color
  343.     return Color.new(0, 255, 0)
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● 描绘能力值
  347.   #     actor : 角色
  348.   #     x     : 描画目标 X 坐标
  349.   #     y     : 描画目标 Y 坐标
  350.   #     type  : 能力值种类 (0~6)
  351.   #--------------------------------------------------------------------------
  352.   def draw_actor_parameter(actor, x, y, type)
  353.     case type
  354.     when 0
  355.       parameter_name = $data_system.words.atk
  356.       parameter_value = actor.atk
  357.     when 1
  358.       parameter_name = $data_system.words.pdef
  359.       parameter_value = actor.pdef
  360.     when 2
  361.       parameter_name = $data_system.words.mdef
  362.       parameter_value = actor.mdef
  363.     when 3
  364.       parameter_name = $data_system.words.str
  365.       parameter_value = actor.str
  366.     when 4
  367.       parameter_name = $data_system.words.dex
  368.       parameter_value = actor.dex
  369.     when 5
  370.       parameter_name = $data_system.words.agi
  371.       parameter_value = actor.agi
  372.     when 6
  373.       parameter_name = $data_system.words.int
  374.       parameter_value = actor.int
  375.     when 7
  376.       parameter_name = "回避"
  377.       parameter_value = actor.eva
  378.     end
  379.     self.contents.font.color = system_color
  380.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  381.     self.contents.font.color = normal_color
  382.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
  383.   end
  384. end
  385. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  386. #
  387. #              装备窗口美化,全能力值描绘并追加新的防具装备栏
  388. #
  389. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  390. #==============================================================================
  391. # ■ Window_EquipRight
  392. #------------------------------------------------------------------------------
  393. #  装备画面、显示角色现在装备的物品的窗口。
  394. #==============================================================================

  395. class Window_EquipRight < Window_Selectable
  396.   #--------------------------------------------------------------------------
  397.   # ● 初始化对像
  398.   #     actor : 角色
  399.   #--------------------------------------------------------------------------
  400.   def initialize(actor)
  401.     super(272, 64, 368, 256)
  402.     self.contents = Bitmap.new(width - 32, height - 32)
  403.     @actor = actor
  404.     refresh
  405.     self.index = 0
  406.   end
  407.   #--------------------------------------------------------------------------
  408.   # ● 刷新
  409.   #--------------------------------------------------------------------------
  410.   def refresh
  411.     self.contents.clear
  412.     @data = []
  413.     @data.push($data_weapons[@actor.weapon_id])
  414.     @data.push($data_armors[@actor.armor1_id])
  415.     @data.push($data_armors[@actor.armor2_id])
  416.     @data.push($data_armors[@actor.armor3_id])
  417.     @data.push($data_armors[@actor.armor4_id])
  418.     @data.push($data_armors[@actor.armor5_id])
  419.     @data.push($data_armors[@actor.armor6_id])
  420.     @item_max = @data.size
  421.     self.contents.font.color = system_color
  422.     self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
  423.     self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
  424.     self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
  425.     self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
  426.     self.contents.draw_text(4, 32 * 4, 92, 32, $data_system.words.armor4)
  427.     self.contents.draw_text(4, 32 * 5, 92, 32, "道具")
  428.     self.contents.draw_text(4, 32 * 6, 92, 32, "装饰品")
  429.     draw_item_name(@data[0], 92, 32 * 0)
  430.     draw_item_name(@data[1], 92, 32 * 1)
  431.     draw_item_name(@data[2], 92, 32 * 2)
  432.     draw_item_name(@data[3], 92, 32 * 3)
  433.     draw_item_name(@data[4], 92, 32 * 4)
  434.     draw_item_name(@data[5], 92, 32 * 5)
  435.     draw_item_name(@data[6], 92, 32 * 6)
  436.   end
  437. end

  438. #==============================================================================
  439. # ■ Window_EquipLeft
  440. #------------------------------------------------------------------------------
  441. #  装备画面的、显示角色能力值变化的窗口。
  442. #==============================================================================

  443. class Window_EquipLeft < Window_Base
  444.   #--------------------------------------------------------------------------
  445.   # ● 初始化对像
  446.   #     actor : 角色
  447.   #--------------------------------------------------------------------------
  448.   def initialize(actor)
  449.     super(0, 64, 272, 416)
  450.     self.contents = Bitmap.new(width - 32, height - 32)
  451.     @actor = actor
  452.     refresh
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # ● 刷新
  456.   #--------------------------------------------------------------------------
  457.   def refresh
  458.     self.contents.clear
  459.     draw_actor_name(@actor, 4, 0)
  460.     draw_actor_level(@actor, 4, 32)

  461.     draw_actor_parameter(@actor, 4, 64, 0)
  462.     draw_actor_parameter(@actor, 4, 96, 1)
  463.     draw_actor_parameter(@actor, 4, 128, 2)
  464.     draw_actor_parameter(@actor, 4, 160, 7)
  465.     draw_actor_parameter(@actor, 4, 192, 3)
  466.     draw_actor_parameter(@actor, 4, 224, 4)
  467.     draw_actor_parameter(@actor, 4, 256, 5)
  468.     draw_actor_parameter(@actor, 4, 288, 6)
  469.     if @new_atk != nil
  470.       self.contents.font.color = system_color
  471.       self.contents.draw_text(160, 64, 40, 32, "→", 1)
  472.       self.contents.font.color = @new_atk>@actor.atk ? up_color : down_color
  473.       self.contents.font.color = normal_color if @new_atk == @actor.atk
  474.       self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
  475.     end
  476.     if @new_pdef != nil
  477.       self.contents.font.color = system_color
  478.       self.contents.draw_text(160, 96, 40, 32, "→", 1)
  479.       self.contents.font.color = @new_pdef>@actor.pdef ? up_color : down_color
  480.       self.contents.font.color = normal_color if @new_pdef == @actor.pdef
  481.       self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
  482.     end
  483.     if @new_mdef != nil
  484.       self.contents.font.color = system_color
  485.       self.contents.draw_text(160, 128, 40, 32, "→", 1)
  486.       self.contents.font.color = @new_mdef>@actor.mdef ? up_color : down_color
  487.       self.contents.font.color = normal_color if @new_mdef == @actor.mdef
  488.       self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
  489.     end
  490.     if @new_eva != nil
  491.       self.contents.font.color = system_color
  492.       self.contents.draw_text(160, 160, 40, 32, "→", 1)
  493.       self.contents.font.color = @new_eva>@actor.eva ? up_color : down_color
  494.       self.contents.font.color = normal_color if @new_eva == @actor.eva
  495.       self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
  496.     end
  497.     if @new_str != nil
  498.       self.contents.font.color = system_color
  499.       self.contents.draw_text(160, 192, 40, 32, "→", 1)
  500.       self.contents.font.color = @new_str>@actor.str ? up_color : down_color
  501.       self.contents.font.color = normal_color if @new_str == @actor.str
  502.       self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
  503.     end
  504.     if @new_dex != nil
  505.       self.contents.font.color = system_color
  506.       self.contents.draw_text(160, 224, 40, 32, "→", 1)
  507.       self.contents.font.color = @new_dex>@actor.dex ? up_color : down_color
  508.       self.contents.font.color = normal_color if @new_dex == @actor.dex
  509.       self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
  510.     end
  511.     if @new_agi != nil
  512.       self.contents.font.color = system_color
  513.       self.contents.draw_text(160, 256, 40, 32, "→", 1)
  514.       self.contents.font.color = @new_agi>@actor.agi ? up_color : down_color
  515.       self.contents.font.color = normal_color if @new_agi == @actor.agi
  516.       self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
  517.     end
  518.     if @new_int != nil
  519.       self.contents.font.color = system_color
  520.       self.contents.draw_text(160, 288, 40, 32, "→", 1)
  521.       self.contents.font.color = @new_int>@actor.int ? up_color : down_color
  522.       self.contents.font.color = normal_color if @new_int == @actor.int
  523.       self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
  524.     end
  525.   end
  526.   #--------------------------------------------------------------------------
  527.   # ● 变更装备后的能力值设置
  528.   #     new_atk  : 变更装备后的攻击力
  529.   #     new_pdef : 变更装备后的物理防御
  530.   #     new_mdef : 变更装备后的魔法防御
  531.   #--------------------------------------------------------------------------
  532.   def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
  533.     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
  534.       @new_atk = new_atk
  535.       @new_pdef = new_pdef
  536.       @new_mdef = new_mdef
  537.       @new_eva = new_eva
  538.       @new_str = new_str
  539.       @new_dex = new_dex
  540.       @new_agi = new_agi
  541.       @new_int = new_int
  542.       refresh
  543.     end
  544.   end
  545. end
  546. #==============================================================================
  547. # ■ Window_EquipItem
  548. #------------------------------------------------------------------------------
  549. #  装备画面、显示浏览变更装备的候补物品的窗口。
  550. #==============================================================================

  551. class Window_EquipItem < Window_Selectable
  552.   #--------------------------------------------------------------------------
  553.   # ● 初始化对像
  554.   #     actor      : 角色
  555.   #     equip_type : 装备部位 (0~3)
  556.   #--------------------------------------------------------------------------
  557.   def initialize(actor, equip_type)
  558.     super(272, 320, 368, 160)
  559.     @actor = actor
  560.     @equip_type = equip_type
  561.     @column_max = 1
  562.     refresh
  563.     self.active = false
  564.     self.index = -1
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # ● 项目的描绘
  568.   #     index : 项目符号
  569.   #--------------------------------------------------------------------------
  570.   def draw_item(index)
  571.     item = @data[index]
  572.     x = 4
  573.     y = index * 32
  574.     case item
  575.     when RPG::Weapon
  576.       number = $game_party.weapon_number(item.id)
  577.     when RPG::Armor
  578.       number = $game_party.armor_number(item.id)
  579.     end
  580.     bitmap = RPG::Cache.icon(item.icon_name)
  581.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  582.     self.contents.font.color = normal_color
  583.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  584.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  585.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  586.   end
  587. end

  588. class Scene_Equip
  589.   #--------------------------------------------------------------------------
  590.   # ● 主处理
  591.   #--------------------------------------------------------------------------
  592.   def main
  593.     # 获取角色
  594.     @actor = $game_party.actors[@actor_index]
  595.     # 生成窗口
  596.     @help_window = Window_Help.new
  597.     @left_window = Window_EquipLeft.new(@actor)
  598.     @right_window = Window_EquipRight.new(@actor)
  599.     @item_window1 = Window_EquipItem.new(@actor, 0)
  600.     @item_window2 = Window_EquipItem.new(@actor, 1)
  601.     @item_window3 = Window_EquipItem.new(@actor, 2)
  602.     @item_window4 = Window_EquipItem.new(@actor, 3)
  603.     @item_window5 = Window_EquipItem.new(@actor, 4)
  604.     @item_window6 = Window_EquipItem.new(@actor, 5)
  605.     @item_window7 = Window_EquipItem.new(@actor, 6)
  606.     # 关联帮助窗口
  607.     @right_window.help_window = @help_window
  608.     @item_window1.help_window = @help_window
  609.     @item_window2.help_window = @help_window
  610.     @item_window3.help_window = @help_window
  611.     @item_window4.help_window = @help_window
  612.     @item_window5.help_window = @help_window
  613.     @item_window6.help_window = @help_window
  614.     @item_window7.help_window = @help_window
  615.     # 设置光标位置
  616.     @right_window.index = @equip_index
  617.     refresh
  618.     # 执行过渡
  619.     Graphics.transition
  620.     # 主循环
  621.     loop do
  622.       # 刷新游戏画面
  623.       Graphics.update
  624.       # 刷新输入信息
  625.       Input.update
  626.       # 刷新画面
  627.       update
  628.       # 如果画面切换的话的就中断循环
  629.       if $scene != self
  630.         break
  631.       end
  632.     end
  633.     # 准备过渡
  634.     Graphics.freeze
  635.     # 释放窗口
  636.     @help_window.dispose
  637.     @left_window.dispose
  638.     @right_window.dispose
  639.     @item_window1.dispose
  640.     @item_window2.dispose
  641.     @item_window3.dispose
  642.     @item_window4.dispose
  643.     @item_window5.dispose
  644.     @item_window6.dispose
  645.     @item_window7.dispose
  646.   end
  647.   #--------------------------------------------------------------------------
  648.   # ● 刷新
  649.   #--------------------------------------------------------------------------
  650.   def refresh
  651.     # 设置物品窗口的可视状态
  652.     @item_window1.visible = (@right_window.index == 0)
  653.     @item_window2.visible = (@right_window.index == 1)
  654.     @item_window3.visible = (@right_window.index == 2)
  655.     @item_window4.visible = (@right_window.index == 3)
  656.     @item_window5.visible = (@right_window.index == 4)
  657.     @item_window6.visible = (@right_window.index == 5)
  658.     @item_window7.visible = (@right_window.index == 6)
  659.     # 获取当前装备中的物品
  660.     item1 = @right_window.item
  661.     # 设置当前的物品窗口到 @item_window
  662.     case @right_window.index
  663.     when 0
  664.       @item_window = @item_window1
  665.     when 1
  666.       @item_window = @item_window2
  667.     when 2
  668.       @item_window = @item_window3
  669.     when 3
  670.       @item_window = @item_window4
  671.     when 4
  672.       @item_window = @item_window5
  673.     when 5
  674.       @item_window = @item_window6
  675.     when 6
  676.       @item_window = @item_window7
  677.     end
  678.     # 右窗口被激活的情况下
  679.     if @right_window.active
  680.       # 删除变更装备后的能力
  681.     ###############################################################
  682.       @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
  683.     end
  684.     # 物品窗口被激活的情况下
  685.     if @item_window.active
  686.       # 获取现在选中的物品
  687.       item2 = @item_window.item
  688.       # 变更装备
  689.       last_hp = @actor.hp
  690.       last_sp = @actor.sp
  691.       @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  692.     ###############################################################
  693.       # 获取变更装备后的能力值
  694.       new_atk = @actor.atk
  695.       new_pdef = @actor.pdef
  696.       new_mdef = @actor.mdef
  697.       new_eva = @actor.eva
  698.       new_str = @actor.str
  699.       new_dex = @actor.dex
  700.       new_agi = @actor.agi
  701.       new_int = @actor.int
  702.       # 返回到装备
  703.       @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  704.       @actor.hp = last_hp
  705.       @actor.sp = last_sp
  706.       # 描画左窗口
  707.     ###############################################################
  708.       @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
  709.     ###############################################################
  710.     end
  711.   end
  712. end
  713. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  714. #
  715. #              状态窗口美化,全防具装备栏描绘
  716. #
  717. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  718. #==============================================================================
  719. # ■ Window_Status
  720. #------------------------------------------------------------------------------
  721. #  显示状态画面、完全规格的状态窗口。
  722. #==============================================================================

  723. class Window_Status < Window_Base
  724.   #--------------------------------------------------------------------------
  725.   # ● 刷新
  726.   #--------------------------------------------------------------------------
  727.   def refresh
  728.     self.contents.clear
  729.     draw_actor_graphic(@actor, 40, 112)
  730.     draw_actor_name(@actor, 4, 0)
  731.     draw_actor_class(@actor, 4 + 144, 0)
  732.     draw_actor_level(@actor, 96, 32)
  733.     draw_actor_state(@actor, 96, 64)
  734.     draw_actor_hp(@actor, 96, 112, 172)
  735.     draw_actor_sp(@actor, 96, 144, 172)
  736.     draw_actor_parameter(@actor, 96, 192, 0)
  737.     draw_actor_parameter(@actor, 96, 224, 1)
  738.     draw_actor_parameter(@actor, 96, 256, 2)
  739.     draw_actor_parameter(@actor, 96, 304, 3)
  740.     draw_actor_parameter(@actor, 96, 336, 4)
  741.     draw_actor_parameter(@actor, 96, 368, 5)
  742.     draw_actor_parameter(@actor, 96, 400, 6)
  743.     self.contents.font.color = system_color
  744.     self.contents.draw_text(320, 48, 80, 32, "EXP")
  745.     self.contents.draw_text(320, 80, 80, 32, "NEXT")
  746.     self.contents.font.color = normal_color
  747.     self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
  748.     self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
  749.     self.contents.font.color = system_color
  750.     self.contents.draw_text(320, 160, 96, 32, "装备")
  751.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
  752.     draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 240)
  753.     draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 272)
  754.     draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 304)
  755.     draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 336)
  756.     draw_item_name($data_armors[@actor.armor5_id], 320 + 16, 368)
  757.     draw_item_name($data_armors[@actor.armor6_id], 320 + 16, 400)
  758.   end
  759.   def dummy
  760.     self.contents.font.color = system_color
  761.     self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
  762.     self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
  763.     self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
  764.     self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
  765.     self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
  766.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
  767.     draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
  768.     draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
  769.     draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
  770.     draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  771.   end
  772. end
  773. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  774. #
  775. #              商店购买窗口美化,增加对新装备位置的描述
  776. #
  777. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  778. #==============================================================================
  779. # ■ Window_ShopStatus
  780. #------------------------------------------------------------------------------
  781. #  商店画面、显示物品所持数与角色装备的窗口。
  782. #==============================================================================

  783. class Window_ShopStatus < Window_Base
  784.   #--------------------------------------------------------------------------
  785.   # ● 刷新
  786.   #--------------------------------------------------------------------------
  787.   def refresh
  788.     self.contents.clear
  789.     if @item == nil
  790.       return
  791.     end
  792.     case @item
  793.     when RPG::Item
  794.       number = $game_party.item_number(@item.id)
  795.     when RPG::Weapon
  796.       number = $game_party.weapon_number(@item.id)
  797.     when RPG::Armor
  798.       number = $game_party.armor_number(@item.id)
  799.     end
  800.     self.contents.font.color = system_color
  801.     self.contents.draw_text(4, 0, 200, 32, "所持数")
  802.     self.contents.font.color = normal_color
  803.     self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
  804.     if @item.is_a?(RPG::Item)
  805.       return
  806.     end
  807.     # 添加装备品信息
  808.     for i in 0...$game_party.actors.size
  809.       # 获取角色
  810.       actor = $game_party.actors[i]
  811.       # 可以装备为普通文字颜色、不能装备设置为无效文字颜色
  812.       if actor.equippable?(@item)
  813.         self.contents.font.color = normal_color
  814.       else
  815.         self.contents.font.color = disabled_color
  816.       end
  817.       # 描绘角色名字
  818.       self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name)
  819.       # 获取当前的装备品
  820.       if @item.is_a?(RPG::Weapon)
  821.         item1 = $data_weapons[actor.weapon_id]
  822.       elsif @item.kind == 0
  823.         item1 = $data_armors[actor.armor1_id]
  824.       elsif @item.kind == 1
  825.         item1 = $data_armors[actor.armor2_id]
  826.       elsif @item.kind == 2
  827.         item1 = $data_armors[actor.armor3_id]
  828.       elsif @item.kind == 3
  829.         item1 = $data_armors[actor.armor4_id]
  830.       elsif @item.kind == 4
  831.         item1 = $data_armors[actor.armor5_id]
  832.       else# if @item.kind == 5
  833.         item1 = $data_armors[actor.armor6_id]
  834.       end
  835.       # 可以装备的情况
  836.       if actor.equippable?(@item)
  837.         # 武器的情况
  838.         if @item.is_a?(RPG::Weapon)
  839.           atk1 = item1 != nil ? item1.atk : 0
  840.           atk2 = @item != nil ? @item.atk : 0
  841.           change = atk2 - atk1
  842.         end
  843.         # 防具的情况
  844.         if @item.is_a?(RPG::Armor)
  845.           pdef1 = item1 != nil ? item1.pdef : 0
  846.           mdef1 = item1 != nil ? item1.mdef : 0
  847.           pdef2 = @item != nil ? @item.pdef : 0
  848.           mdef2 = @item != nil ? @item.mdef : 0
  849.           change = pdef2 - pdef1 + mdef2 - mdef1
  850.         end
  851.         # 描绘能力值变化
  852.         self.contents.draw_text(124, 64 + 64 * i, 112, 32,
  853.           sprintf("%+d", change), 2)
  854.       end
  855.       # 描绘物品
  856.       if item1 != nil
  857.         x = 4
  858.         y = 64 + 64 * i + 32
  859.         bitmap = RPG::Cache.icon(item1.icon_name)
  860.         opacity = self.contents.font.color == normal_color ? 255 : 128
  861.         self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  862.         self.contents.draw_text(x + 28, y, 212, 32, item1.name)
  863.       end
  864.     end
  865.   end
  866. end
复制代码
支持一下下我的这个游戏吧~~
大雄与空间军团
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部