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

Project1

 找回密码
 注册会员
搜索
查看: 1590|回复: 1
打印 上一主题 下一主题

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
596
在线时间
797 小时
注册时间
2014-7-1
帖子
578

开拓者

跳转到指定楼层
1
发表于 2017-12-9 13:16:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

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


RUBY 代码复制
  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.  
  109.     self.contents.draw_text(10,220,100, 32, "暴击:")
  110.     self.contents.draw_text(75,220,60, 32, @actor.crt.to_s)
  111.  
  112.     self.contents.draw_text(10,250,100, 32, "暴伤:")
  113.     self.contents.draw_text(75,250,60, 32, @actor.maxcrt.to_s)
  114.  
  115.     if @new_atk != nil
  116.       if @new_atk > @actor.atk
  117.          self.contents.font.color = up_color
  118.          self.contents.draw_text(140,40,100, 32, "升→")
  119.          self.contents.draw_text(120,40,100, 32, @new_atk.to_s, 2)
  120.        elsif @new_atk < @actor.atk
  121.          self.contents.font.color = down_color
  122.          self.contents.draw_text(140,40,100, 32, "低→")
  123.          self.contents.draw_text(120,40,100, 32, @new_atk.to_s, 2)
  124.        end
  125.     end
  126.     if @new_pdef != nil
  127.       if @new_pdef > @actor.pdef
  128.          self.contents.font.color = up_color
  129.          self.contents.draw_text(140,70,100, 32, "升→")
  130.          self.contents.draw_text(120,70,100, 32, @new_pdef.to_s, 2)
  131.        elsif @new_pdef < @actor.pdef
  132.          self.contents.font.color = down_color
  133.          self.contents.draw_text(140,70,100, 32, "低→")
  134.          self.contents.draw_text(120,70,100, 32, @new_pdef.to_s, 2)
  135.        end
  136.     end
  137.     if @new_mdef != nil
  138.       if @new_mdef > @actor.mdef
  139.          self.contents.font.color = up_color
  140.          self.contents.draw_text(140,70,100, 32, "升→")
  141.          self.contents.draw_text(120,70,100, 32, @new_mdef.to_s, 2)
  142.        elsif @new_mdef < @actor.mdef
  143.          self.contents.font.color = down_color
  144.          self.contents.draw_text(140,70,100, 32, "低→")
  145.          self.contents.draw_text(120,70,100, 32, @new_mdef.to_s, 2)
  146.        end
  147.     end
  148.     if @new_str != nil
  149.       if @new_str > @actor.str
  150.          self.contents.font.color = up_color
  151.          self.contents.draw_text(140,100,100, 32, "升→")
  152.          self.contents.draw_text(120,100,100, 32, @new_str.to_s, 2)
  153.        elsif @new_str < @actor.str
  154.          self.contents.font.color = down_color
  155.          self.contents.draw_text(140,100,100, 32, "低→")
  156.          self.contents.draw_text(120,100,100, 32, @new_str.to_s, 2)
  157.        end
  158.     end
  159.     if @new_dex != nil
  160.       if @new_dex > @actor.dex
  161.          self.contents.font.color = up_color
  162.          self.contents.draw_text(140,130,100, 32, "升→")
  163.          self.contents.draw_text(120,130,100, 32, @new_dex.to_s, 2)
  164.        elsif @new_dex < @actor.dex
  165.          self.contents.font.color = down_color
  166.          self.contents.draw_text(140,130,100, 32, "低→")
  167.          self.contents.draw_text(120,130,100, 32, @new_dex.to_s, 2)
  168.        end
  169.     end
  170.     if @new_agi != nil
  171.       if @new_agi > @actor.agi
  172.          self.contents.font.color = up_color
  173.          self.contents.draw_text(140,160,100, 32, "升→")
  174.          self.contents.draw_text(120,160,100, 32, @new_agi.to_s, 2)
  175.        elsif @new_agi < @actor.agi
  176.          self.contents.font.color = down_color
  177.          self.contents.draw_text(140,160,100, 32, "低→")
  178.          self.contents.draw_text(120,160,100, 32, @new_agi.to_s, 2)
  179.        end
  180.     end
  181.     if @new_int != nil
  182.       if @new_int > @actor.int
  183.          self.contents.font.color = up_color
  184.          self.contents.draw_text(140,190,100, 32, "升→")
  185.          self.contents.draw_text(120,190,100, 32, @new_int.to_s, 2)
  186.        elsif @new_int < @actor.int
  187.          self.contents.font.color = down_color
  188.          self.contents.draw_text(140,190,100, 32, "低→")
  189.          self.contents.draw_text(120,190,100, 32, @new_int.to_s, 2)
  190.        end
  191.      end  
  192.  
  193.     if @new_crt != nil
  194.       if @new_crt > @actor.crt
  195.          self.contents.font.color = up_color
  196.          self.contents.draw_text(140,220,100, 32, "升→")
  197.          self.contents.draw_text(120,220,100, 32, @new_crt.to_s, 2)
  198.        elsif @new_crt < @actor.crt
  199.          self.contents.font.color = down_color
  200.          self.contents.draw_text(140,220,100, 32, "低→")
  201.          self.contents.draw_text(120,220,100, 32, @new_crt.to_s, 2)
  202.        end
  203.     end
  204.  
  205.     if @new_maxcrt != nil
  206.       if @new_maxcrt > @actor.maxcrt
  207.          self.contents.font.color = up_color
  208.          self.contents.draw_text(140,250,100, 32, "升→")
  209.          self.contents.draw_text(120,250,100, 32, @new_maxcrt.to_s, 2)
  210.        elsif @new_maxcrt < @actor.maxcrt
  211.          self.contents.font.color = down_color
  212.          self.contents.draw_text(140,250,100, 32, "低→")
  213.          self.contents.draw_text(120,250,100, 32, @new_maxcrt.to_s, 2)
  214.        end
  215.     end
  216.  
  217.   end
  218.  
  219.  
  220.   #--------------------------------------------------------------------------
  221.   # ● 变更装备后的能力值设置
  222.   #     new_atk  : 变更装备后的攻击力
  223.   #     new_pdef : 变更装备后的物理防御
  224.   #     new_mdef : 变更装备后的魔法防御
  225.   #--------------------------------------------------------------------------
  226.     ###############################################################
  227.   def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int,new_crt,new_maxcrt)
  228.     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   
  229.       @new_atk = new_atk
  230.       @new_pdef = new_pdef
  231.       @new_mdef = new_mdef
  232.       @new_eva = new_eva
  233.       @new_str = new_str
  234.       @new_dex = new_dex
  235.       @new_agi = new_agi
  236.       @new_int = new_int
  237.       @new_crt = new_crt
  238.       @new_maxcrt = new_maxcrt
  239.       refresh
  240.     end
  241.   end
  242. end
  243. #==============================================================================
  244. # ■ Window_EquipItem
  245. #------------------------------------------------------------------------------
  246. #  装备画面、显示浏览变更装备的候补物品的窗口。
  247. #==============================================================================
  248. class Window_EquipItem < Window_Selectable
  249.   #--------------------------------------------------------------------------
  250.   # ● 初始化对像
  251.   #     actor      : 角色
  252.   #     equip_type : 装备部位 (0~3) #装备栏下的显示高低
  253.   #--------------------------------------------------------------------------
  254.   def initialize(actor, equip_type)
  255.     super(300, 380, 340, 100)
  256.     @actor = actor
  257.     @equip_type = equip_type
  258.     @column_max = 1
  259.     refresh
  260.     self.active = false
  261.     self.index = -1
  262.     #self.z = 9998
  263.   end
  264.   #--------------------------------------------------------------------------
  265.   # ● 项目的描绘
  266.   #     index : 项目符号
  267.   #--------------------------------------------------------------------------
  268.   def draw_item(index)
  269.     item = @data[index]
  270.     ################改了改坐标#################################
  271.     x = 4
  272.     y = index * 32
  273.     case item
  274.     when RPG::Weapon
  275.       number = $game_party.weapon_number(item.id)
  276.     when RPG::Armor
  277.       number = $game_party.armor_number(item.id)
  278.     end
  279.     bitmap = RPG::Cache.icon(item.icon_name)
  280.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  281.     self.contents.font.color = normal_color
  282.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  283.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  284.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  285.   end
  286. end
  287. #==============================================================================
  288. # ■ Scene_Equip
  289. #------------------------------------------------------------------------------
  290. #  处理装备画面的类。
  291. #==============================================================================
  292.  
  293. class Scene_Equip
  294.   #--------------------------------------------------------------------------
  295.   # ● 初始化对像
  296.   #     actor_index : 角色索引
  297.   #     equip_index : 装备索引
  298.   #--------------------------------------------------------------------------
  299.   def initialize(actor_index = 0, equip_index = 0)
  300.     @actor_index = actor_index
  301.     @equip_index = equip_index
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ● 主处理
  305.   #--------------------------------------------------------------------------
  306.   def main
  307.     # 获取角色
  308.     @actor = $game_party.actors[@actor_index]
  309.     # 生成窗口
  310.    # @help_window = Window_Help.new
  311.     @help_window = Window_Help_Self.new(@actor)#错误
  312.     @left_window = Window_EquipLeft.new(@actor)
  313.     @right_window = Window_EquipRight.new(@actor)
  314.     @item_window1 = Window_EquipItem.new(@actor, 0)
  315.     @item_window2 = Window_EquipItem.new(@actor, 1)
  316.     @item_window3 = Window_EquipItem.new(@actor, 2)
  317.     @item_window4 = Window_EquipItem.new(@actor, 3)
  318.     @item_window5 = Window_EquipItem.new(@actor, 4)
  319.     @item_window6 = Window_EquipItem.new(@actor, 5)
  320.     @item_window7 = Window_EquipItem.new(@actor, 6)
  321.     @item_window8 = Window_EquipItem.new(@actor, 7)
  322.  
  323.     @item_window9 = Window_EquipItem.new(@actor, 8)
  324.     @item_window10 = Window_EquipItem.new(@actor, 9)
  325.     @item_window11 = Window_EquipItem.new(@actor, 10)
  326.  
  327.     # 关联帮助窗口
  328.     @right_window.help_window = @help_window
  329.     @item_window1.help_window = @help_window
  330.     @item_window2.help_window = @help_window
  331.     @item_window3.help_window = @help_window
  332.     @item_window4.help_window = @help_window
  333.     @item_window5.help_window = @help_window
  334.     @item_window6.help_window = @help_window
  335.     @item_window7.help_window = @help_window
  336.     @item_window8.help_window = @help_window
  337.  
  338.     @item_window9.help_window = @help_window
  339.     @item_window10.help_window = @help_window
  340.     @item_window11.help_window = @help_window
  341.  
  342.     # 设置光标位置
  343.     @right_window.index = @equip_index
  344.     refresh
  345.     # 执行过渡
  346.     Graphics.transition
  347.     # 主循环
  348.     loop do
  349.       # 刷新游戏画面
  350.       Graphics.update
  351.       # 刷新输入信息
  352.       Input.update
  353.       # 刷新画面
  354.       update
  355.       # 如果画面切换的话的就中断循环
  356.       if $scene != self
  357.         break
  358.       end
  359.     end
  360.     # 准备过渡
  361.     Graphics.freeze
  362.     # 释放窗口
  363.     @help_window.dispose
  364.     @left_window.dispose
  365.     @right_window.dispose
  366.     @item_window1.dispose
  367.     @item_window2.dispose
  368.     @item_window3.dispose
  369.     @item_window4.dispose
  370.     @item_window5.dispose
  371.     @item_window6.dispose
  372.     @item_window7.dispose
  373.     @item_window8.dispose
  374.     @item_window9.dispose
  375.     @item_window10.dispose
  376.     @item_window11.dispose
  377.   end
  378.   #--------------------------------------------------------------------------
  379.   # ● 刷新
  380.   #--------------------------------------------------------------------------
  381.   def refresh
  382.     # 设置物品窗口的可视状态
  383.     @item_window1.visible = (@right_window.index == 0)
  384.     @item_window2.visible = (@right_window.index == 1)
  385.     @item_window3.visible = (@right_window.index == 2)
  386.     @item_window4.visible = (@right_window.index == 3)
  387.     @item_window5.visible = (@right_window.index == 4)
  388.     @item_window6.visible = (@right_window.index == 5)
  389.     @item_window7.visible = (@right_window.index == 6)
  390.     @item_window8.visible = (@right_window.index == 7)
  391.  
  392.     @item_window9.visible = (@right_window.index == 8 or @right_window.index == 9 or @right_window.index == 10)
  393.  
  394.     # 获取当前装备中的物品
  395.     item1 = @right_window.item
  396.     # 设置当前的物品窗口到 @item_window
  397.     case @right_window.index
  398.     when 0
  399.       @item_window = @item_window1
  400.     when 1
  401.       @item_window = @item_window2
  402.     when 2
  403.       @item_window = @item_window3
  404.     when 3
  405.       @item_window = @item_window4
  406.     when 4
  407.       @item_window = @item_window5
  408.     when 5
  409.       @item_window = @item_window6
  410.     when 6
  411.       @item_window = @item_window7
  412.     when 7
  413.       @item_window = @item_window8
  414.     when 8  #条件限制开启装备位置
  415.       if @actor.upstar >= 1
  416.         @item_window = @item_window9   
  417.       end
  418.     when 9
  419.       if @actor.upstar >= 2
  420.         @item_window = @item_window9   
  421.       end
  422.     when 10
  423.       if @actor.upstar >= 3
  424.         @item_window = @item_window9   
  425.       end
  426.     end
  427.     # 右窗口被激活的情况下
  428.     if @right_window.active
  429.       # 删除变更装备后的能力
  430.     ###############################################################
  431.       @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
  432.     end
  433.     # 物品窗口被激活的情况下
  434.     if @item_window.active
  435.       # 获取现在选中的物品
  436.       item2 = @item_window.item
  437.       # 变更装备
  438.       last_hp = @actor.hp
  439.       last_sp = @actor.sp
  440.       @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  441.       # 获取变更装备后的能力值
  442.     ###############################################################
  443.       new_atk = @actor.atk
  444.       new_pdef = @actor.pdef
  445.       new_mdef = @actor.mdef
  446.       new_eva = @actor.eva
  447.       new_str = @actor.str
  448.       new_dex = @actor.dex
  449.       new_agi = @actor.agi
  450.       new_int = @actor.int
  451.  
  452.       new_crt = @actor.crt
  453.       new_maxcrt = @actor.maxcrt
  454.  
  455.       # 返回到装备
  456.       @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  457.       @actor.hp = last_hp
  458.       @actor.sp = last_sp
  459.       # 描画左窗口
  460.     ###############################################################
  461.       @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)
  462.     end
  463.   end  
  464.   #--------------------------------------------------------------------------
  465.   # ● 刷新画面
  466.   #--------------------------------------------------------------------------
  467.   def update
  468.     # 刷新窗口
  469.     @left_window.update
  470.     @right_window.update
  471.     @item_window.update
  472.   #  @help1_window.update
  473.     refresh
  474.     # 右侧窗口被激活的情况下: 调用 update_right
  475.     if @right_window.active
  476.       update_right
  477.       return
  478.     end
  479.     # 物品窗口被激活的情况下: 调用 update_item
  480.     if @item_window.active
  481.       update_item
  482.       return
  483.     end
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ● 刷新画面 (右侧窗口被激活的情况下)
  487.   #--------------------------------------------------------------------------
  488.   def update_right
  489.     #★★★★★★★★★★★★★★★★
  490.     if @right_window.item==nil
  491.         @help_window.visible=false
  492.     else
  493.         @help_window.visible=true
  494.     end
  495.     #★★★★★★★★★★★★★★★★  
  496.     # 按下 B 键的情况下
  497.     if Input.trigger?(Input::B)
  498.       # 演奏取消 SE
  499.       $game_system.se_play($data_system.cancel_se)
  500.       # 切换到菜单画面
  501.       $scene = Scene_Menu.new(2)
  502.       return
  503.     end
  504.     # 按下 C 键的情况下
  505.     if Input.trigger?(Input::C)
  506.       # 固定装备的情况下
  507.       if @actor.equip_fix?(@right_window.index)
  508.         # 演奏冻结 SE
  509.         $game_system.se_play($data_system.buzzer_se)
  510.         return
  511.       end
  512.       # 演奏确定 SE
  513.       $game_system.se_play($data_system.decision_se)
  514.       # 激活物品窗口
  515.       @right_window.active = false
  516.       @item_window.active = true
  517.       @item_window.index = 0
  518.       return
  519.     end
  520.     # 按下 R 键的情况下
  521.     if Input.trigger?(Input::R)
  522.       # 演奏光标 SE
  523.       $game_system.se_play($data_system.cursor_se)
  524.       # 移至下一位角色
  525.       @actor_index += 1
  526.       @actor_index %= $game_party.actors.size
  527.       # 切换到别的装备画面
  528.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  529.       return
  530.     end
  531.     # 按下 L 键的情况下
  532.     if Input.trigger?(Input::L)
  533.       # 演奏光标 SE
  534.       $game_system.se_play($data_system.cursor_se)
  535.       # 移至上一位角色
  536.       @actor_index += $game_party.actors.size - 1
  537.       @actor_index %= $game_party.actors.size
  538.       # 切换到别的装备画面
  539.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  540.       return
  541.     end
  542.   end
  543.   #--------------------------------------------------------------------------
  544.   # ● 刷新画面 (物品窗口被激活的情况下)
  545.   #--------------------------------------------------------------------------
  546.   def update_item
  547.     #★★★★★★★★★★★★★★★★   
  548.     if @item_window.item==nil
  549.         @help_window.visible=false
  550.     else
  551.         @help_window.visible=true
  552.     end
  553.     #★★★★★★★★★★★★★★★★     
  554.     # 按下 B 键的情况下
  555.     if Input.trigger?(Input::B)
  556.       # 演奏取消 SE
  557.       $game_system.se_play($data_system.cancel_se)
  558.       # 激活右侧窗口
  559.       @right_window.active = true
  560.       @item_window.active = false
  561.       @item_window.index = -1
  562.       return
  563.     end
  564.     # 按下 C 键的情况下
  565.     if Input.trigger?(Input::C)
  566.       # 演奏装备 SE
  567.       $game_system.se_play($data_system.equip_se)
  568.       # 获取物品窗口现在选择的装备数据
  569.       item = @item_window.item
  570.       # 变更装备
  571.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  572.       # 激活右侧窗口
  573.       @right_window.active = true
  574.       @item_window.active = false
  575.       @item_window.index = -1
  576.       # 再生成右侧窗口、物品窗口的内容
  577.       @right_window.refresh
  578.       @item_window.refresh
  579.       return
  580.     end
  581.   end
  582. end

RUBY 代码复制
  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



学习使我疲劳,打工使我疲惫,恋爱使我伤身,吸烟伤我肺腑,饮酒损我形象,旅游使我破费,月底不见铜板,只有在论坛里面看看各种大佬才能使我进去
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
78
在线时间
1 小时
注册时间
2018-1-12
帖子
10
2
发表于 2018-1-12 18:44:26 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-27 14:52

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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