Project1

标题: 物品分类和物品颜色的两个脚本冲突怎么解决。。。? [打印本页]

作者: CR~    时间: 2014-12-16 22:52
标题: 物品分类和物品颜色的两个脚本冲突怎么解决。。。?
冲突就是在物品界面不显示装备的颜色,,,
  1. # ————————————————————————————————————
  2. # 本脚本来自www.66rpg.com,转载请保留此信息
  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. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================
  4. #


  5. # 脚本功能:给不同物品显示不同颜色,类似暗黑破坏神,比如套装为绿色,超级为金色
  6. #           可以更改的种类包括物品、防具、特技、武器。
  7. #
  8. # 使用方法:对于不想为白色表示的物品,在描述中最后添加@6,@4一类的即可。
  9. #           数字为颜色编号,和对话框中的一样。
  10. # ——————————————————————————————————————
  11. module RPG
  12.   class Skill
  13.     def description
  14.       description = @description.split(/@/)[0]
  15.       return description != nil ? description : ''
  16.     end
  17.     def name_color_66RPG
  18.       name_color = @description.split(/@/)[1]
  19.       return name_color != nil ? name_color.to_i : 0
  20.     end
  21.   end
  22.   class Weapon
  23.     def description
  24.       description = @description.split(/@/)[0]
  25.       description = description != nil ? description : ''

  26.       description.gsub!(/\\[Vv]\[([0-9]+)\]/){$game_variables[$1.to_i]}

  27.       return description

  28.     end
  29.     def name_color_66RPG
  30.       name_color = @description.split(/@/)[1]
  31.       return name_color != nil ? name_color.to_i : 0
  32.     end
  33.   end
  34.   class Item
  35.     def description
  36.       description = @description.split(/@/)[0]
  37.       return description != nil ? description : ''
  38.     end
  39.     def name_color_66RPG
  40.       name_color = @description.split(/@/)[1]
  41.       return name_color != nil ? name_color.to_i : 0
  42.     end
  43.   end
  44.   class Armor
  45.     def description
  46.       description = @description.split(/@/)[0]
  47.       description = description != nil ? description : ''

  48.       description.gsub!(/\\[Vv]\[([0-9]+)\]/){$game_variables[$1.to_i]}

  49.       return description

  50.     end
  51.     def name_color_66RPG
  52.       name_color = @description.split(/@/)[1]
  53.       return name != nil ? name_color.to_i : 0
  54.     end
  55.   end
  56. end
  57. # ——————————————————————————————————————
  58. # 本脚本原创自www.66rpg.com,转载请保留此信息
  59. # ——————————————————————————————————————
  60. class Window_Base < Window
  61.   #--------------------------------------------------------------------------
  62.   # ● 描绘物品名
  63.   #     item : 物品
  64.   #     x    : 描画目标 X 坐标
  65.   #     y    : 描画目标 Y 坐标
  66.   #--------------------------------------------------------------------------
  67.   def draw_item_name(item, x, y)
  68.     if item == nil
  69.       return
  70.     end
  71.     bitmap = RPG::Cache.icon(item.icon_name)
  72.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  73.     self.contents.font.color = text_color(item.name_color_66RPG)
  74.     self.contents.draw_text(x + 28, y, 212, 32, item.name.to_s)
  75.   end
  76. end
  77. # ——————————————————————————————————————
  78. # 本脚本原创自www.66rpg.com,转载请保留此信息
  79. # ——————————————————————————————————————
  80. class Window_Item

  81.   #--------------------------------------------------------------------------
  82.   # ● 描绘项目
  83.   #     index : 项目编号
  84.   #--------------------------------------------------------------------------
  85.   def draw_item(index)
  86.     item = @data[index]
  87.     case item
  88.     when RPG::Item
  89.       number = $game_party.item_number(item.id)
  90.     when RPG::Weapon
  91.       number = $game_party.weapon_number(item.id)
  92.     when RPG::Armor
  93.       number = $game_party.armor_number(item.id)
  94.     end
  95.     if item.is_a?(RPG::Item) and
  96.        $game_party.item_can_use?(item.id)
  97.       self.contents.font.color = text_color(item.name_color_66RPG)
  98.     else
  99.       self.contents.font.color = disabled_color
  100.     end
  101.     x = 4 + index % 2 * (288 + 32)
  102.     y = index / 2 * 32
  103.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  104.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  105.     bitmap = RPG::Cache.icon(item.icon_name)
  106.     opacity = self.contents.font.color == disabled_color ? 128 : 255
  107.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  108.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  109.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  110.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  111.   end
  112. end
  113. # ——————————————————————————————————————
  114. # 本脚本原创自www.66rpg.com,转载请保留此信息
  115. # ——————————————————————————————————————
  116. class Window_EquipItem < Window_Selectable
  117.   #--------------------------------------------------------------------------
  118.   # ● 项目的描绘
  119.   #     index : 项目符号
  120.   #--------------------------------------------------------------------------
  121.   def draw_item(index)
  122.     item = @data[index]
  123.     x = 4 + index % 2 * (0)
  124.     y = index / 1 * 32
  125.     case item
  126.     when RPG::Weapon
  127.       number = $game_party.weapon_number(item.id)
  128.     when RPG::Armor
  129.       number = $game_party.armor_number(item.id)
  130.     end
  131.     bitmap = RPG::Cache.icon(item.icon_name)
  132.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  133.     self.contents.font.color = text_color(item.name_color_66RPG)
  134.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  135.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  136.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  137.   end
  138. end
  139. # ——————————————————————————————————————
  140. # 本脚本原创自www.66rpg.com,转载请保留此信息
  141. # ——————————————————————————————————————
  142. class Window_ShopBuy < Window_Selectable
  143.   #--------------------------------------------------------------------------
  144.   # ● 描绘羡慕
  145.   #     index : 项目编号
  146.   #--------------------------------------------------------------------------
  147.   def draw_item(index)
  148.     item = @data[index]
  149.     # 获取物品所持数
  150.     case item
  151.     when RPG::Item
  152.       number = $game_party.item_number(item.id)
  153.     when RPG::Weapon
  154.       number = $game_party.weapon_number(item.id)
  155.     when RPG::Armor
  156.       number = $game_party.armor_number(item.id)
  157.     end
  158.     # 价格在所持金以下、并且所持数不是 99 的情况下为普通颜色
  159.     # 除此之外的情况设置为无效文字色
  160.     if item.price <= $game_party.gold and number < 99
  161.       self.contents.font.color = text_color(item.name_color_66RPG)
  162.     else
  163.       self.contents.font.color = disabled_color
  164.     end
  165.     x = 4
  166.     y = index * 32
  167.     rect = Rect.new(x, y, self.width - 32, 32)
  168.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  169.     bitmap = RPG::Cache.icon(item.icon_name)
  170.     opacity = self.contents.font.color == disabled_color ? 128 : 255
  171.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  172.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  173.     self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2)
  174.   end
  175. end
  176. # ——————————————————————————————————————
  177. # 本脚本原创自www.66rpg.com,转载请保留此信息
  178. # ——————————————————————————————————————
  179. class Window_ShopSell < Window_Selectable
  180.   #--------------------------------------------------------------------------
  181.   # ● 描绘项目
  182.   #     index : 项目标号
  183.   #--------------------------------------------------------------------------
  184.   def draw_item(index)
  185.     item = @data[index]
  186.     case item
  187.     when RPG::Item
  188.       number = $game_party.item_number(item.id)
  189.     when RPG::Weapon
  190.       number = $game_party.weapon_number(item.id)
  191.     when RPG::Armor
  192.       number = $game_party.armor_number(item.id)
  193.     end
  194.     # 可以卖掉的显示为普通颜色、除此之外设置成无效文字颜色
  195.     if item.price > 0
  196.       self.contents.font.color = text_color(item.name_color_66RPG)
  197.     else
  198.       self.contents.font.color = disabled_color
  199.     end
  200.     x = 4 + index % 2 * (288 + 32)
  201.     y = index / 2 * 32
  202.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  203.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  204.     bitmap = RPG::Cache.icon(item.icon_name)
  205.     opacity = self.contents.font.color == disabled_color ? 128 : 255
  206.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  207.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  208.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  209.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  210.   end
  211. end
  212.    

  213. # ——————————————————————————————————————
  214. # 本脚本原创自www.66rpg.com,转载请保留此信息
  215. # ——————————————————————————————————————
  216. class Window_Skill
  217.   #--------------------------------------------------------------------------
  218.   # ● 描绘项目
  219.   #     index : 项目编号
  220.   #--------------------------------------------------------------------------
  221.   def draw_item(index)
  222.     skill = @data[index]
  223.     if @actor.skill_can_use?(skill.id)
  224.       self.contents.font.color = text_color(skill.name_color_66RPG)
  225.     else
  226.       self.contents.font.color = disabled_color
  227.     end
  228.     x = 4 + index % 2 * (288 + 32)
  229.     y = index / 2 * 32
  230.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  231.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  232.     bitmap = RPG::Cache.icon(skill.icon_name)
  233.     opacity = self.contents.font.color == disabled_color ? 128 : 255
  234.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  235.     self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
  236.     self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  237.   end
  238. end
  239. #==============================================================================
  240. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  241. #==============================================================================
复制代码
这是装备分类脚本


作者: chd114    时间: 2014-12-18 21:27
self.contents.font.color=text_color
搜这个,然后把()里面的数字改成X.name_color_66RPG,X可以是skill、item
作者: 断电    时间: 2014-12-19 21:40
本帖最后由 断电 于 2014-12-19 21:55 编辑

整合.zip (205.78 KB, 下载次数: 79)
上面是整合范例
新的使用方法举例:恢复HP100点。@药品@3
第一个@后面跟分类名,第二个@后面跟颜色序号。
作者: chd114    时间: 2014-12-19 21:48
  1. module RPG
  2.   class Skill
  3.     def description
  4.       description = @description.split(/@/)[0]
  5.       return description != nil ? description : ''
  6.     end
  7.     def name_color_66RPG
  8.       name_color = @description.split(/@/)[1]
  9.       return name_color != nil ? name_color.to_i : 0
  10.     end
  11.   end
  12.   class Weapon
  13.     def description
  14.       description = @description.split(/@/)[0]
  15.       description = description != nil ? description : ''

  16.       description.gsub!(/\\[Vv]\[([0-9]+)\]/){$game_variables[$1.to_i]}

  17.       return description

  18.     end
  19.     def name_color_66RPG
  20.       name_color = @description.split(/@/)[1]
  21.       return name_color != nil ? name_color.to_i : 0
  22.     end
  23.   end
  24.   class Item
  25.     def description
  26.       description = @description.split(/@/)[0]
  27.       return description != nil ? description : ''
  28.     end
  29.     def name_color_66RPG
  30.       name_color = @description.split(/@/)[1]
  31.       return name_color != nil ? name_color.to_i : 0
  32.     end
  33.   end
  34.   class Armor
  35.     def description
  36.       description = @description.split(/@/)[0]
  37.       description = description != nil ? description : ''

  38.       description.gsub!(/\\[Vv]\[([0-9]+)\]/){$game_variables[$1.to_i]}

  39.       return description

  40.     end
  41.     def name_color_66RPG
  42.       name_color = @description.split(/@/)[1]
  43.       return name != nil ? name_color.to_i : 0
  44.     end
  45.   end
  46. end
复制代码
是你自己修改过的地方?你还改了哪些地方···把自己改的全部去掉再试试?




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1