查看: 2020|回复: 1

[已经过期] 装备位置如何设定条件开启!

[复制链接]
梦石
0
星屑
606
在线时间
797 小时
注册时间
2014-7-1
回帖
501

开拓者

发表于 2017-12-9 13:16:56 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 jiushiainilip19 于 2017-12-9 13:20 编辑

414行开始那里,我设定是变量大于多少开启装备位置
这3个装备是一样的 没有区分头和盔类的,
我这样设定后只要条件变量大于任何一个都会导致全部都开启
求帮忙!!!


  1. #==============================================================================
  2. # 本脚本来自[url=http://www.66RPG.com]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.     ###############################################################
  47.     when 7
  48.       parameter_name = ""
  49.       parameter_value = actor.eva
  50.       
  51.     end
  52.     self.contents.font.color = system_color
  53.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  54.     self.contents.font.color = normal_color
  55.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
  56.   end
  57. end
  58. #==============================================================================
  59. # ■ Window_EquipLeft
  60. #------------------------------------------------------------------------------
  61. #  装备画面的、显示角色能力值变化的窗口。
  62. #==============================================================================
  63. class Window_EquipLeft < Window_Base
  64.   UP_ICON = "橙宝石小"
  65.   DOWN_ICON = "047-Skill04"
  66.   #--------------------------------------------------------------------------
  67.   # ● 初始化对像
  68.   #     actor : 角色
  69.   #--------------------------------------------------------------------------
  70.   def initialize(actor)
  71.     #super(0, 64, 272, 480)
  72.     super(0, 0, 300, 310)
  73.     self.y = 0
  74.     self.contents = Bitmap.new(width - 32, height - 32)
  75.     @actor = actor
  76.     self.contents.font.size = 20
  77.     refresh
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # ● 刷新
  81.   #--------------------------------------------------------------------------
  82.   def refresh
  83.     self.contents.clear
  84.     #draw_actor_name(@actor, 10, 280)
  85.     draw_actor_level(@actor,90, 280)
  86.     draw_actor_hp(@actor, 10,0)
  87.    
  88.     self.contents.draw_text(10, 40,100, 32, "攻击:")
  89.     draw_actor_parameter(@actor, x-50, 40, 0)
  90.    
  91.     self.contents.draw_text(10, 70,100, 32, "防御:")
  92.     draw_actor_parameter(@actor, x-50, 70, 1)
  93.    
  94.     #self.contents.draw_text(10,100,60, 32, "暴伤:")
  95.     #draw_actor_parameter(@actor, x-50, 100, 2)
  96.    
  97.     self.contents.draw_text(10,100,100, 32, "力道:")
  98.     draw_actor_parameter(@actor, x-50, 100, 3)
  99.    
  100.     self.contents.draw_text(10,130,100, 32, "敏捷:")
  101.     draw_actor_parameter(@actor, x-50, 130, 4)
  102.    
  103.     self.contents.draw_text(10,160,100, 32, "速度:")
  104.     draw_actor_parameter(@actor, x-50, 160, 5)
  105.    
  106.     self.contents.draw_text(10,190,100, 32, "内劲:")
  107.     draw_actor_parameter(@actor, x-50, 190, 6)

  108.     self.contents.draw_text(10,220,100, 32, "暴击:")
  109.     self.contents.draw_text(75,220,60, 32, @actor.crt.to_s)
  110.    
  111.     self.contents.draw_text(10,250,100, 32, "暴伤:")
  112.     self.contents.draw_text(75,250,60, 32, @actor.maxcrt.to_s)
  113.    
  114.     if @new_atk != nil
  115.       if @new_atk > @actor.atk
  116.          self.contents.font.color = up_color
  117.          self.contents.draw_text(140,40,100, 32, "升→")
  118.          self.contents.draw_text(120,40,100, 32, @new_atk.to_s, 2)
  119.        elsif @new_atk < @actor.atk
  120.          self.contents.font.color = down_color
  121.          self.contents.draw_text(140,40,100, 32, "低→")
  122.          self.contents.draw_text(120,40,100, 32, @new_atk.to_s, 2)
  123.        end
  124.     end
  125.     if @new_pdef != nil
  126.       if @new_pdef > @actor.pdef
  127.          self.contents.font.color = up_color
  128.          self.contents.draw_text(140,70,100, 32, "升→")
  129.          self.contents.draw_text(120,70,100, 32, @new_pdef.to_s, 2)
  130.        elsif @new_pdef < @actor.pdef
  131.          self.contents.font.color = down_color
  132.          self.contents.draw_text(140,70,100, 32, "低→")
  133.          self.contents.draw_text(120,70,100, 32, @new_pdef.to_s, 2)
  134.        end
  135.     end
  136.     if @new_mdef != nil
  137.       if @new_mdef > @actor.mdef
  138.          self.contents.font.color = up_color
  139.          self.contents.draw_text(140,70,100, 32, "升→")
  140.          self.contents.draw_text(120,70,100, 32, @new_mdef.to_s, 2)
  141.        elsif @new_mdef < @actor.mdef
  142.          self.contents.font.color = down_color
  143.          self.contents.draw_text(140,70,100, 32, "低→")
  144.          self.contents.draw_text(120,70,100, 32, @new_mdef.to_s, 2)
  145.        end
  146.     end
  147.     if @new_str != nil
  148.       if @new_str > @actor.str
  149.          self.contents.font.color = up_color
  150.          self.contents.draw_text(140,100,100, 32, "升→")
  151.          self.contents.draw_text(120,100,100, 32, @new_str.to_s, 2)
  152.        elsif @new_str < @actor.str
  153.          self.contents.font.color = down_color
  154.          self.contents.draw_text(140,100,100, 32, "低→")
  155.          self.contents.draw_text(120,100,100, 32, @new_str.to_s, 2)
  156.        end
  157.     end
  158.     if @new_dex != nil
  159.       if @new_dex > @actor.dex
  160.          self.contents.font.color = up_color
  161.          self.contents.draw_text(140,130,100, 32, "升→")
  162.          self.contents.draw_text(120,130,100, 32, @new_dex.to_s, 2)
  163.        elsif @new_dex < @actor.dex
  164.          self.contents.font.color = down_color
  165.          self.contents.draw_text(140,130,100, 32, "低→")
  166.          self.contents.draw_text(120,130,100, 32, @new_dex.to_s, 2)
  167.        end
  168.     end
  169.     if @new_agi != nil
  170.       if @new_agi > @actor.agi
  171.          self.contents.font.color = up_color
  172.          self.contents.draw_text(140,160,100, 32, "升→")
  173.          self.contents.draw_text(120,160,100, 32, @new_agi.to_s, 2)
  174.        elsif @new_agi < @actor.agi
  175.          self.contents.font.color = down_color
  176.          self.contents.draw_text(140,160,100, 32, "低→")
  177.          self.contents.draw_text(120,160,100, 32, @new_agi.to_s, 2)
  178.        end
  179.     end
  180.     if @new_int != nil
  181.       if @new_int > @actor.int
  182.          self.contents.font.color = up_color
  183.          self.contents.draw_text(140,190,100, 32, "升→")
  184.          self.contents.draw_text(120,190,100, 32, @new_int.to_s, 2)
  185.        elsif @new_int < @actor.int
  186.          self.contents.font.color = down_color
  187.          self.contents.draw_text(140,190,100, 32, "低→")
  188.          self.contents.draw_text(120,190,100, 32, @new_int.to_s, 2)
  189.        end
  190.      end  
  191.      
  192.     if @new_crt != nil
  193.       if @new_crt > @actor.crt
  194.          self.contents.font.color = up_color
  195.          self.contents.draw_text(140,220,100, 32, "升→")
  196.          self.contents.draw_text(120,220,100, 32, @new_crt.to_s, 2)
  197.        elsif @new_crt < @actor.crt
  198.          self.contents.font.color = down_color
  199.          self.contents.draw_text(140,220,100, 32, "低→")
  200.          self.contents.draw_text(120,220,100, 32, @new_crt.to_s, 2)
  201.        end
  202.     end
  203.      
  204.     if @new_maxcrt != nil
  205.       if @new_maxcrt > @actor.maxcrt
  206.          self.contents.font.color = up_color
  207.          self.contents.draw_text(140,250,100, 32, "升→")
  208.          self.contents.draw_text(120,250,100, 32, @new_maxcrt.to_s, 2)
  209.        elsif @new_maxcrt < @actor.maxcrt
  210.          self.contents.font.color = down_color
  211.          self.contents.draw_text(140,250,100, 32, "低→")
  212.          self.contents.draw_text(120,250,100, 32, @new_maxcrt.to_s, 2)
  213.        end
  214.     end
  215.    
  216.   end
  217.   
  218.    
  219.   #--------------------------------------------------------------------------
  220.   # ● 变更装备后的能力值设置
  221.   #     new_atk  : 变更装备后的攻击力
  222.   #     new_pdef : 变更装备后的物理防御
  223.   #     new_mdef : 变更装备后的魔法防御
  224.   #--------------------------------------------------------------------------
  225.     ###############################################################
  226.   def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int,new_crt,new_maxcrt)
  227.     if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or @new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int or @new_crt != new_crt or @new_maxcrt != new_maxcrt   
  228.       @new_atk = new_atk
  229.       @new_pdef = new_pdef
  230.       @new_mdef = new_mdef
  231.       @new_eva = new_eva
  232.       @new_str = new_str
  233.       @new_dex = new_dex
  234.       @new_agi = new_agi
  235.       @new_int = new_int
  236.       @new_crt = new_crt
  237.       @new_maxcrt = new_maxcrt
  238.       refresh
  239.     end
  240.   end
  241. end
  242. #==============================================================================
  243. # ■ Window_EquipItem
  244. #------------------------------------------------------------------------------
  245. #  装备画面、显示浏览变更装备的候补物品的窗口。
  246. #==============================================================================
  247. class Window_EquipItem < Window_Selectable
  248.   #--------------------------------------------------------------------------
  249.   # ● 初始化对像
  250.   #     actor      : 角色
  251.   #     equip_type : 装备部位 (0~3) #装备栏下的显示高低
  252.   #--------------------------------------------------------------------------
  253.   def initialize(actor, equip_type)
  254.     super(300, 380, 340, 100)
  255.     @actor = actor
  256.     @equip_type = equip_type
  257.     @column_max = 1
  258.     refresh
  259.     self.active = false
  260.     self.index = -1
  261.     #self.z = 9998
  262.   end
  263.   #--------------------------------------------------------------------------
  264.   # ● 项目的描绘
  265.   #     index : 项目符号
  266.   #--------------------------------------------------------------------------
  267.   def draw_item(index)
  268.     item = @data[index]
  269.     ################改了改坐标#################################
  270.     x = 4
  271.     y = index * 32
  272.     case item
  273.     when RPG::Weapon
  274.       number = $game_party.weapon_number(item.id)
  275.     when RPG::Armor
  276.       number = $game_party.armor_number(item.id)
  277.     end
  278.     bitmap = RPG::Cache.icon(item.icon_name)
  279.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  280.     self.contents.font.color = normal_color
  281.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  282.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  283.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  284.   end
  285. end
  286. #==============================================================================
  287. # ■ Scene_Equip
  288. #------------------------------------------------------------------------------
  289. #  处理装备画面的类。
  290. #==============================================================================

  291. class Scene_Equip
  292.   #--------------------------------------------------------------------------
  293.   # ● 初始化对像
  294.   #     actor_index : 角色索引
  295.   #     equip_index : 装备索引
  296.   #--------------------------------------------------------------------------
  297.   def initialize(actor_index = 0, equip_index = 0)
  298.     @actor_index = actor_index
  299.     @equip_index = equip_index
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # ● 主处理
  303.   #--------------------------------------------------------------------------
  304.   def main
  305.     # 获取角色
  306.     @actor = $game_party.actors[@actor_index]
  307.     # 生成窗口
  308.    # @help_window = Window_Help.new
  309.     @help_window = Window_Help_Self.new(@actor)#错误
  310.     @left_window = Window_EquipLeft.new(@actor)
  311.     @right_window = Window_EquipRight.new(@actor)
  312.     @item_window1 = Window_EquipItem.new(@actor, 0)
  313.     @item_window2 = Window_EquipItem.new(@actor, 1)
  314.     @item_window3 = Window_EquipItem.new(@actor, 2)
  315.     @item_window4 = Window_EquipItem.new(@actor, 3)
  316.     @item_window5 = Window_EquipItem.new(@actor, 4)
  317.     @item_window6 = Window_EquipItem.new(@actor, 5)
  318.     @item_window7 = Window_EquipItem.new(@actor, 6)
  319.     @item_window8 = Window_EquipItem.new(@actor, 7)
  320.    
  321.     @item_window9 = Window_EquipItem.new(@actor, 8)
  322.     @item_window10 = Window_EquipItem.new(@actor, 9)
  323.     @item_window11 = Window_EquipItem.new(@actor, 10)
  324.    
  325.     # 关联帮助窗口
  326.     @right_window.help_window = @help_window
  327.     @item_window1.help_window = @help_window
  328.     @item_window2.help_window = @help_window
  329.     @item_window3.help_window = @help_window
  330.     @item_window4.help_window = @help_window
  331.     @item_window5.help_window = @help_window
  332.     @item_window6.help_window = @help_window
  333.     @item_window7.help_window = @help_window
  334.     @item_window8.help_window = @help_window
  335.    
  336.     @item_window9.help_window = @help_window
  337.     @item_window10.help_window = @help_window
  338.     @item_window11.help_window = @help_window
  339.   
  340.     # 设置光标位置
  341.     @right_window.index = @equip_index
  342.     refresh
  343.     # 执行过渡
  344.     Graphics.transition
  345.     # 主循环
  346.     loop do
  347.       # 刷新游戏画面
  348.       Graphics.update
  349.       # 刷新输入信息
  350.       Input.update
  351.       # 刷新画面
  352.       update
  353.       # 如果画面切换的话的就中断循环
  354.       if $scene != self
  355.         break
  356.       end
  357.     end
  358.     # 准备过渡
  359.     Graphics.freeze
  360.     # 释放窗口
  361.     @help_window.dispose
  362.     @left_window.dispose
  363.     @right_window.dispose
  364.     @item_window1.dispose
  365.     @item_window2.dispose
  366.     @item_window3.dispose
  367.     @item_window4.dispose
  368.     @item_window5.dispose
  369.     @item_window6.dispose
  370.     @item_window7.dispose
  371.     @item_window8.dispose
  372.     @item_window9.dispose
  373.     @item_window10.dispose
  374.     @item_window11.dispose
  375.   end
  376.   #--------------------------------------------------------------------------
  377.   # ● 刷新
  378.   #--------------------------------------------------------------------------
  379.   def refresh
  380.     # 设置物品窗口的可视状态
  381.     @item_window1.visible = (@right_window.index == 0)
  382.     @item_window2.visible = (@right_window.index == 1)
  383.     @item_window3.visible = (@right_window.index == 2)
  384.     @item_window4.visible = (@right_window.index == 3)
  385.     @item_window5.visible = (@right_window.index == 4)
  386.     @item_window6.visible = (@right_window.index == 5)
  387.     @item_window7.visible = (@right_window.index == 6)
  388.     @item_window8.visible = (@right_window.index == 7)
  389.   
  390.     @item_window9.visible = (@right_window.index == 8 or @right_window.index == 9 or @right_window.index == 10)
  391.   
  392.     # 获取当前装备中的物品
  393.     item1 = @right_window.item
  394.     # 设置当前的物品窗口到 @item_window
  395.     case @right_window.index
  396.     when 0
  397.       @item_window = @item_window1
  398.     when 1
  399.       @item_window = @item_window2
  400.     when 2
  401.       @item_window = @item_window3
  402.     when 3
  403.       @item_window = @item_window4
  404.     when 4
  405.       @item_window = @item_window5
  406.     when 5
  407.       @item_window = @item_window6
  408.     when 6
  409.       @item_window = @item_window7
  410.     when 7
  411.       @item_window = @item_window8
  412.     when 8  #条件限制开启装备位置
  413.       if @actor.upstar >= 1
  414.         @item_window = @item_window9   
  415.       end
  416.     when 9
  417.       if @actor.upstar >= 2
  418.         @item_window = @item_window9   
  419.       end
  420.     when 10
  421.       if @actor.upstar >= 3
  422.         @item_window = @item_window9   
  423.       end
  424.     end
  425.     # 右窗口被激活的情况下
  426.     if @right_window.active
  427.       # 删除变更装备后的能力
  428.     ###############################################################
  429.       @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
  430.     end
  431.     # 物品窗口被激活的情况下
  432.     if @item_window.active
  433.       # 获取现在选中的物品
  434.       item2 = @item_window.item
  435.       # 变更装备
  436.       last_hp = @actor.hp
  437.       last_sp = @actor.sp
  438.       @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  439.       # 获取变更装备后的能力值
  440.     ###############################################################
  441.       new_atk = @actor.atk
  442.       new_pdef = @actor.pdef
  443.       new_mdef = @actor.mdef
  444.       new_eva = @actor.eva
  445.       new_str = @actor.str
  446.       new_dex = @actor.dex
  447.       new_agi = @actor.agi
  448.       new_int = @actor.int
  449.       
  450.       new_crt = @actor.crt
  451.       new_maxcrt = @actor.maxcrt
  452.       
  453.       # 返回到装备
  454.       @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  455.       @actor.hp = last_hp
  456.       @actor.sp = last_sp
  457.       # 描画左窗口
  458.     ###############################################################
  459.       @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int, new_crt, new_maxcrt)
  460.     end
  461.   end  
  462.   #--------------------------------------------------------------------------
  463.   # ● 刷新画面
  464.   #--------------------------------------------------------------------------
  465.   def update
  466.     # 刷新窗口
  467.     @left_window.update
  468.     @right_window.update
  469.     @item_window.update
  470.   #  @help1_window.update
  471.     refresh
  472.     # 右侧窗口被激活的情况下: 调用 update_right
  473.     if @right_window.active
  474.       update_right
  475.       return
  476.     end
  477.     # 物品窗口被激活的情况下: 调用 update_item
  478.     if @item_window.active
  479.       update_item
  480.       return
  481.     end
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # ● 刷新画面 (右侧窗口被激活的情况下)
  485.   #--------------------------------------------------------------------------
  486.   def update_right
  487.     #★★★★★★★★★★★★★★★★
  488.     if @right_window.item==nil
  489.         @help_window.visible=false
  490.     else
  491.         @help_window.visible=true
  492.     end
  493.     #★★★★★★★★★★★★★★★★  
  494.     # 按下 B 键的情况下
  495.     if Input.trigger?(Input::B)
  496.       # 演奏取消 SE
  497.       $game_system.se_play($data_system.cancel_se)
  498.       # 切换到菜单画面
  499.       $scene = Scene_Menu.new(2)
  500.       return
  501.     end
  502.     # 按下 C 键的情况下
  503.     if Input.trigger?(Input::C)
  504.       # 固定装备的情况下
  505.       if @actor.equip_fix?(@right_window.index)
  506.         # 演奏冻结 SE
  507.         $game_system.se_play($data_system.buzzer_se)
  508.         return
  509.       end
  510.       # 演奏确定 SE
  511.       $game_system.se_play($data_system.decision_se)
  512.       # 激活物品窗口
  513.       @right_window.active = false
  514.       @item_window.active = true
  515.       @item_window.index = 0
  516.       return
  517.     end
  518.     # 按下 R 键的情况下
  519.     if Input.trigger?(Input::R)
  520.       # 演奏光标 SE
  521.       $game_system.se_play($data_system.cursor_se)
  522.       # 移至下一位角色
  523.       @actor_index += 1
  524.       @actor_index %= $game_party.actors.size
  525.       # 切换到别的装备画面
  526.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  527.       return
  528.     end
  529.     # 按下 L 键的情况下
  530.     if Input.trigger?(Input::L)
  531.       # 演奏光标 SE
  532.       $game_system.se_play($data_system.cursor_se)
  533.       # 移至上一位角色
  534.       @actor_index += $game_party.actors.size - 1
  535.       @actor_index %= $game_party.actors.size
  536.       # 切换到别的装备画面
  537.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  538.       return
  539.     end
  540.   end
  541.   #--------------------------------------------------------------------------
  542.   # ● 刷新画面 (物品窗口被激活的情况下)
  543.   #--------------------------------------------------------------------------
  544.   def update_item
  545.     #★★★★★★★★★★★★★★★★   
  546.     if @item_window.item==nil
  547.         @help_window.visible=false
  548.     else
  549.         @help_window.visible=true
  550.     end
  551.     #★★★★★★★★★★★★★★★★     
  552.     # 按下 B 键的情况下
  553.     if Input.trigger?(Input::B)
  554.       # 演奏取消 SE
  555.       $game_system.se_play($data_system.cancel_se)
  556.       # 激活右侧窗口
  557.       @right_window.active = true
  558.       @item_window.active = false
  559.       @item_window.index = -1
  560.       return
  561.     end
  562.     # 按下 C 键的情况下
  563.     if Input.trigger?(Input::C)
  564.       # 演奏装备 SE
  565.       $game_system.se_play($data_system.equip_se)
  566.       # 获取物品窗口现在选择的装备数据
  567.       item = @item_window.item
  568.       # 变更装备
  569.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  570.       # 激活右侧窗口
  571.       @right_window.active = true
  572.       @item_window.active = false
  573.       @item_window.index = -1
  574.       # 再生成右侧窗口、物品窗口的内容
  575.       @right_window.refresh
  576.       @item_window.refresh
  577.       return
  578.     end
  579.   end
  580. end
复制代码

  1. class Window_EquipRight < Window_Selectable
  2.   #--------------------------------------------------------------------------
  3.   # ● 初始化对像
  4.   #     actor : 角色
  5.   #--------------------------------------------------------------------------
  6.   def initialize(actor)
  7.     super(300, 0, 340, 400)
  8.     self.contents = Bitmap.new(width - 32, height - 32)
  9.     @actor = actor
  10.     refresh
  11.     self.index = 0
  12.   end
  13.   #--------------------------------------------------------------------------
  14.   # ● 获取物品
  15.   #--------------------------------------------------------------------------
  16.   def item
  17.     return @data[self.index]
  18.   end
  19.   #--------------------------------------------------------------------------
  20.   # ● 刷新
  21.   #--------------------------------------------------------------------------
  22.   def refresh
  23.     self.contents.clear
  24.     @data = []
  25.     @data.push($data_weapons[@actor.weapon_id])
  26.     @data.push($data_armors[@actor.armor1_id])
  27.     @data.push($data_armors[@actor.armor2_id])
  28.     @data.push($data_armors[@actor.armor3_id])
  29.     @data.push($data_armors[@actor.armor4_id])
  30.     @data.push($data_armors[@actor.armor5_id])
  31.     @data.push($data_armors[@actor.armor6_id])
  32.     @data.push($data_armors[@actor.armor7_id])
  33.    
  34.     @data.push($data_armors[@actor.armor8_id])
  35.     @data.push($data_armors[@actor.armor9_id])
  36.     @data.push($data_armors[@actor.armor10_id])
  37.    
  38.    
  39.     @item_max = @data.size
  40.     self.contents.font.color = system_color
  41.     self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
  42.     self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
  43.     self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
  44.     self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
  45.     self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
  46.     self.contents.draw_text(6, 32 * 5, 92, 32, "秘法")
  47.     self.contents.draw_text(7, 32 * 6, 92, 32, "特器")
  48.     self.contents.draw_text(8, 32 * 7, 92, 32, "功法")
  49.    
  50.    
  51.     self.contents.draw_text(9, 32 * 8, 92, 32, "绝内")
  52.     self.contents.draw_text(9, 32 * 9, 92, 32, "绝内")
  53.     self.contents.draw_text(9, 32 * 10, 92, 32, "绝内")
  54.    
  55.   if @actor.upstar >= 1
  56.     self.contents.draw_text(60, 32 * 8, 92, 32, "")
  57.   else
  58.     self.contents.font.color = Color.new(255,1,1, 255)
  59.     self.contents.draw_text(60, 32 * 8, 92, 32, "二星开启")
  60.   end
  61.   
  62.   if @actor.upstar >= 2
  63.     self.contents.draw_text(60, 32 * 9, 92, 32, "")
  64.   else
  65.     self.contents.draw_text(60, 32 * 9, 92, 32, "三星开启")
  66.   end
  67.   if @actor.upstar >= 3
  68.     self.contents.draw_text(60, 32 * 10, 92, 32, "")
  69.   else
  70.     self.contents.draw_text(60, 32 * 10, 92, 32, "四星开启")
  71.   end
  72.   
  73.    
  74.     draw_item_name(@data[0], 50, 32 * 0)
  75.     draw_item_name(@data[1], 50, 32 * 1)
  76.     draw_item_name(@data[2], 50, 32 * 2)
  77.     draw_item_name(@data[3], 50, 32 * 3)
  78.     draw_item_name(@data[4], 50, 32 * 4)
  79.     draw_item_name(@data[5], 50, 32 * 5)
  80.     draw_item_name(@data[6], 50, 32 * 6)
  81.     draw_item_name(@data[7], 50, 32 * 7)
  82.     draw_item_name(@data[8], 50, 32 * 8)
  83.     draw_item_name(@data[9], 50, 32 * 9)
  84.     draw_item_name(@data[10], 50, 32 * 10)
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● 刷新帮助文本
  88.   #--------------------------------------------------------------------------
  89.   def update_help
  90.     @help_window.set_text(item)
  91.   #  @help_window.set_text(self.item == nil ? "" : self.item.description)
  92.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  93.   end
  94. end
复制代码



学习使我疲劳,打工使我疲惫,恋爱使我伤身,吸烟伤我肺腑,饮酒损我形象,旅游使我破费,月底不见铜板,只有在论坛里面看看各种大佬才能使我进去
头像被屏蔽
梦石
0
星屑
78
在线时间
1 小时
注册时间
2018-1-12
回帖
10
发表于 2018-1-12 18:44:26 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部