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

Project1

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

[整合系统] RMXP物品品质以及各种配套(这就是第一个正宗的整合)

[复制链接]

Lv4.逐梦者

梦石
0
星屑
9275
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

跳转到指定楼层
1
发表于 2012-6-27 17:24:18 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 chd114 于 2012-7-9 12:37 编辑
  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.     @commands = []
  27.     #————————生成commands窗口
  28.     for i in 1...$data_items.size
  29.       if $game_party.item_number(i) > 0
  30.         push = true
  31.         for com in @commands
  32.           if com == $data_items[i].desc
  33.             push = false
  34.           end
  35.         end
  36.         if push == true
  37.           @commands.push($data_items[i].desc)
  38.         end
  39.       end
  40.     end
  41.     for i in 1...$data_weapons.size
  42.       if $game_party.weapon_number(i) > 0
  43.         push = true
  44.         for com in @commands
  45.           if com == $data_weapons[i].desc
  46.             push = false
  47.           end
  48.         end
  49.         if push == true
  50.           @commands.push($data_weapons[i].desc)
  51.         end
  52.       end
  53.     end
  54.     for i in 1...$data_armors.size
  55.       if $game_party.armor_number(i) > 0
  56.         push = true
  57.         for com in @commands
  58.           if com == $data_armors[i].desc
  59.             push = false
  60.           end
  61.         end
  62.         if push == true
  63.           @commands.push($data_armors[i].desc)
  64.         end
  65.       end
  66.     end
  67.    
  68.    
  69.     if @commands == []
  70.       @commands.push("")#普通物品")
  71.     end     
  72.     @item_max = @commands.size
  73.     self.contents = Bitmap.new(width - 32, @item_max * 32)
  74.     refresh
  75.     self.index = 0
  76.   end
  77.   #--------------------------------------------------------------------------
  78.   #--------------------------------------------------------------------------
  79.   def refresh
  80.     self.contents.clear
  81.     for i in 0...@item_max
  82.       draw_item(i, normal_color)
  83.     end
  84.   end
  85.   #--------------------------------------------------------------------------
  86.   #--------------------------------------------------------------------------
  87.   def draw_item(index, color)
  88.     self.contents.font.color = color
  89.     y = index * 32
  90.     self.contents.draw_text(4, y, 128, 32, @commands[index])
  91.   end
  92.   #--------------------------------------------------------------------------
  93.   # 只描绘原文字
  94.   #--------------------------------------------------------------------------
  95.   def update_help
  96.     @help_window.set_text(@commands[self.index])
  97.   end
  98. end

  99. #==============================================================================
  100. # ■ Window_Item
  101. #==============================================================================

  102. class Harts_Window_ItemList < Window_Selectable
  103.   #--------------------------------------------------------------------------
  104.   #--------------------------------------------------------------------------
  105.   def initialize
  106.     super(160, 0, 480, 416)
  107.     refresh
  108.     self.index = 0
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   #--------------------------------------------------------------------------
  112.   def item
  113.     return @data[self.index]
  114.   end
  115.   #--------------------------------------------------------------------------
  116.   #--------------------------------------------------------------------------
  117.   def refresh
  118.     if self.contents != nil
  119.       self.contents.dispose
  120.       self.contents = nil
  121.     end
  122.     @data = []
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   #--------------------------------------------------------------------------
  126.   def set_item(command)
  127.     refresh
  128.     for i in 1...$data_items.size
  129.       if $game_party.item_number(i) > 0 and $data_items[i].desc == command
  130.         @data.push($data_items[i])
  131.       end
  132.     end
  133.     for i in 1...$data_weapons.size
  134.       if $game_party.weapon_number(i) > 0 and $data_weapons[i].desc == command
  135.         @data.push($data_weapons[i])
  136.       end
  137.     end
  138.     for i in 1...$data_armors.size
  139.       if $game_party.armor_number(i) > 0 and $data_armors[i].desc == command
  140.         @data.push($data_armors[i])
  141.       end
  142.     end
  143.     @item_max = @data.size
  144.     if @item_max > 0
  145.       self.contents = Bitmap.new(width - 32, row_max * 32)
  146.       self.contents.clear
  147.       for i in 0...@item_max
  148.         draw_item(i)
  149.       end
  150.     end
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   #--------------------------------------------------------------------------
  154.   def item_number
  155.     return @item_max
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   #--------------------------------------------------------------------------
  159.   def draw_item(index)
  160.     item = @data[index]
  161.     #—— 取得具体物品数量 ——
  162.     case item
  163.     when RPG::Item
  164.       number = $game_party.item_number(item.id)
  165.     when RPG::Weapon
  166.       number = $game_party.weapon_number(item.id)
  167.     when RPG::Armor
  168.       number = $game_party.armor_number(item.id)
  169.     end
  170.     #—— 给出物品的颜色 ——
  171.     if item.is_a?(RPG::Item)
  172.       if $game_party.item_can_use?(item.id)
  173.         self.contents.font.color = text_color(item.name_color_66RPG)
  174.       else
  175.         self.contents.font.color = disabled_color
  176.       end
  177.     else
  178.       if item.is_a?(RPG::Weapon)#武器不能装备用灰色
  179.         if $data_classes[$data_actors[$game_variables[1]+1].class_id].weapon_set.include?(item.id)
  180.           self.contents.font.color = text_color(item.name_color_66RPG)
  181.         else
  182.           self.contents.font.color = disabled_color
  183.         end
  184.       end

  185.       if item.is_a?(RPG::Armor)#防具不能装备用灰色
  186.         if $data_classes[$data_actors[$game_variables[1]+1].class_id].armor_set.include?(item.id)
  187.           self.contents.font.color = text_color(item.name_color_66RPG)#normal_color
  188.         else
  189.           self.contents.font.color = disabled_color
  190.          end
  191.       end
  192.     end

  193.     x = 4
  194.     y = index * 32
  195.     bitmap = RPG::Cache.icon(item.icon_name)
  196.     opacity = self.contents.font.color == normal_color ? 255 : 128
  197.     self.contents.blt(x, y , bitmap, Rect.new(0, 0, 32, 32), opacity)#物品图标用32*32
  198.     self.contents.draw_text(x + 40, y, 212, 32, item.name, 0)
  199.     self.contents.draw_text(x + 240, y, 16, 32, "×", 1) if $game_party.item_number(item.id)>1
  200.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2) if $game_party.item_number(item.id)>1
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   #--------------------------------------------------------------------------
  204.   def update_help
  205.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  206.   end
  207. end

  208. #==============================================================================
  209. # ■ Harts_Scene_Item
  210. #==============================================================================

  211. class Scene_Item
  212.   #--------------------------------------------------------------------------
  213.   #--------------------------------------------------------------------------
  214.   def main
  215.     @itemtitle_window = Harts_Window_ItemTitle.new
  216.     @itemcommand_window = Harts_Window_ItemCommand.new
  217.     @command_index = @itemcommand_window.index
  218.     @itemlist_window = Harts_Window_ItemList.new
  219.     @itemlist_window.active = false
  220.     @help_window = Window_Help.new
  221.     @help_window.x = 0
  222.     @help_window.y = 416
  223.     @itemcommand_window.help_window = @help_window
  224.     @itemlist_window.help_window = @help_window
  225.     @target_window = Window_Target.new
  226.     @target_window.visible = false
  227.     @target_window.active = false
  228.     @itemlist_window.set_item(@itemcommand_window.commands[@command_index])
  229.     Graphics.transition
  230.     loop do
  231.       Graphics.update
  232.       Input.update
  233.       update
  234.       if $scene != self
  235.         break
  236.       end
  237.     end
  238.     Graphics.freeze
  239.     @itemtitle_window.dispose
  240.     @itemcommand_window.dispose
  241.     @itemlist_window.dispose
  242.     @help_window.dispose
  243.     @target_window.dispose
  244.   end
  245.   #--------------------------------------------------------------------------
  246.   #--------------------------------------------------------------------------
  247.   def update
  248.     @itemtitle_window.update
  249.     @itemcommand_window.update
  250.     @itemlist_window.update
  251.     @help_window.update
  252.     @target_window.update
  253.     if @command_index != @itemcommand_window.index
  254.       @command_index = @itemcommand_window.index
  255.       @itemlist_window.set_item(@itemcommand_window.commands[@command_index])
  256.     end
  257.     if @itemcommand_window.active
  258.       update_itemcommand
  259.       return
  260.     end
  261.     if @itemlist_window.active
  262.       update_itemlist
  263.       return
  264.     end
  265.     if @target_window.active
  266.       update_target
  267.       return
  268.     end
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   #--------------------------------------------------------------------------
  272.   def update_itemcommand
  273.     if Input.trigger?(Input::B)
  274.       $game_system.se_play($data_system.cancel_se)
  275.       $scene = Scene_Map.new
  276. #      $scene = Scene_Menu.new(1)
  277.       return
  278.     end
  279.     if Input.trigger?(Input::C)
  280.       if @itemlist_window.item_number == 0
  281.         $game_system.se_play($data_system.buzzer_se)
  282.         return
  283.       end
  284.       $game_system.se_play($data_system.decision_se)
  285.       @itemcommand_window.active = false
  286.       @itemlist_window.active = true
  287.       @itemlist_window.index = 0
  288.       return
  289.     end
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   #--------------------------------------------------------------------------
  293.   def update_itemlist
  294.     if Input.trigger?(Input::B)
  295.       $game_system.se_play($data_system.cancel_se)
  296.       @itemcommand_window.active = true
  297.       @itemlist_window.active = false
  298.       @itemlist_window.index = 0
  299.       @itemcommand_window.index = @command_index
  300.       return
  301.     end
  302.     if Input.trigger?(Input::C)
  303.       @item = @itemlist_window.item

  304.       
  305.       target_actor = $game_party.actors[0]#@item_target_window_equip.index]
  306.       if target_actor.equippable?(@item)# and $game_party.item_can_equip?(target_actor,@item)
  307.         $scene = Scene_Equip.new
  308.       end
  309. #      unless @item.is_a?(RPG::Item)
  310. #        $game_system.se_play($data_system.buzzer_se)
  311. #        return
  312. #      end
  313.       unless $game_party.item_can_use?(@item.id)
  314.         $game_system.se_play($data_system.buzzer_se)
  315.         return
  316.       end
  317.       $game_system.se_play($data_system.decision_se)
  318.       if @item.scope >= 3
  319.         @itemlist_window.active = false
  320.         @target_window.x = 304
  321.         @target_window.visible = true
  322.         @target_window.active = true
  323.         if @item.scope == 4 || @item.scope == 6
  324.           @target_window.index = -1
  325.         else
  326.           @target_window.index = 0
  327.         end
  328.       else
  329.         if @item.common_event_id > 0
  330.          
  331.           #      #下一句在使用物品时获得物品id
  332.           $game_variables[20] = @item.id
  333.          
  334.           $game_temp.common_event_id = @item.common_event_id
  335.           $game_system.se_play(@item.menu_se)
  336.             if @item.consumable
  337.               $game_party.lose_item(@item.id, 1)
  338.               @itemlist_window.draw_item(@itemlist_window.index)
  339.             end
  340.           $scene = Scene_Map.new
  341.           return
  342.         end
  343.       end
  344.       return
  345.     end
  346.   end
  347.   #--------------------------------------------------------------------------
  348.   #--------------------------------------------------------------------------
  349.   def update_target
  350.     if Input.trigger?(Input::B)
  351.       $game_system.se_play($data_system.cancel_se)
  352.       unless $game_party.item_can_use?(@item.id)
  353.         @itemlist_window.refresh
  354.       end
  355.       @itemlist_window.active = true
  356.       @target_window.visible = false
  357.       @target_window.active = false
  358.       @itemlist_window.set_item(@itemcommand_window.commands[@command_index])
  359.       return
  360.     end
  361.     if Input.trigger?(Input::C)
  362.       if $game_party.item_number(@item.id) == 0
  363.         $game_system.se_play($data_system.buzzer_se)
  364.         return
  365.       end
  366.       if @target_window.index == -1
  367.         used = false
  368.         for i in $game_party.actors
  369.           used |= i.item_effect(@item)
  370.         end
  371.       end
  372.       if @target_window.index >= 0
  373.         target = $game_party.actors[@target_window.index]
  374.         used = target.item_effect(@item)
  375.       end
  376.       if used
  377.         $game_system.se_play(@item.menu_se)
  378.         if @item.consumable
  379.           $game_party.lose_item(@item.id, 1)
  380.           @itemlist_window.draw_item(@itemlist_window.index)
  381.           @itemlist_window.set_item(@itemcommand_window.commands[@command_index])
  382.         end
  383.         @target_window.refresh
  384.         if $game_party.all_dead?
  385.           $scene = Scene_Gameover.new
  386.           return
  387.         end
  388.         if @item.common_event_id > 0
  389.           $game_temp.common_event_id = @item.common_event_id
  390.           $scene = Scene_Map.new
  391.           return
  392.         end
  393.       end
  394.       unless used
  395.         $game_system.se_play($data_system.buzzer_se)
  396.       end
  397.     return
  398.     end
  399.   end
  400. end

  401. #==============================================================================
  402. # ■ RPG追加定义,使用@符号分类
  403. #==============================================================================

  404. module RPG
  405.   class Weapon
  406.     def description
  407.       description = @description.split(/@/)[0]
  408.       return description != nil ? description : ''
  409.     end
  410.     def desc
  411.       desc = @description.split(/@/)[1]
  412.       return desc != nil ? desc : "普通物品"
  413.     end
  414.   end
  415.   class Item
  416.     def description
  417.       description = @description.split(/@/)[0]
  418.       return description != nil ? description : ''
  419.     end
  420.     def desc
  421.       desc = @description.split(/@/)[1]
  422.       return desc != nil ? desc : "普通物品"
  423.     end
  424.   end
  425.   class Armor
  426.     def description
  427.       description = @description.split(/@/)[0]
  428.       return description != nil ? description : ''
  429.     end
  430.     def desc
  431.       desc = @description.split(/@/)[1]
  432.       return desc != nil ? desc : "普通物品"
  433.     end
  434.   end
  435. end

  436. #==============================================================================
  437. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  438. #==============================================================================
  439. # ————————————————————————————————————
  440. # 本脚本来自www.66rpg.com,转载请保留此信息
  441. # ————————————————————————————————————
  442. #==============================================================================
  443. # ■ Window_Warehouse_Title
  444. #------------------------------------------------------------------------------
  445. #  仓库窗口:标题
  446. #==============================================================================
  447. class Window_Warehouse_Title < Window_Base
  448.   def initialize
  449.     super(0, 64, 160, 64)
  450.     self.contents = Bitmap.new(width - 32, height - 32)
  451.     self.contents.clear
  452.     self.contents.font.color = normal_color
  453.     self.contents.draw_text(4, 0, 120, 32, "仓库", 1)
  454.   end
  455. end
  456. #==============================================================================
  457. # ■ Window_Warehouse_Action
  458. #------------------------------------------------------------------------------
  459. #  仓库窗口:存取动作选择
  460. #==============================================================================
  461. class Window_Warehouse_Action < Window_Selectable
  462. #--------------------------------------------------------------------------
  463. # ● 初始化对像
  464. #--------------------------------------------------------------------------
  465. def initialize
  466.    super(160, 64, 480, 64)
  467.    self.contents = Bitmap.new(width - 32, height - 32)
  468.    @item_max = 3
  469.    @column_max = 3
  470.    @commands = ["存入物品", "取出物品", "离开"]
  471.    refresh
  472.    self.index = 0
  473. end
  474. #--------------------------------------------------------------------------
  475. # ● 刷新
  476. #--------------------------------------------------------------------------
  477. def refresh
  478.    self.contents.clear
  479.    for i in 0...@item_max
  480.      draw_item(i)
  481.    end
  482. end
  483. #--------------------------------------------------------------------------
  484. # ● 描绘项目
  485. #     index : 项目编号
  486. #--------------------------------------------------------------------------
  487. def draw_item(index)
  488.    x = 4 + index * 160
  489.    self.contents.draw_text(x, 0, 128, 32, @commands[index])
  490. end
  491. end
  492. #==============================================================================
  493. # ■ Window_Warehouse_Sorting
  494. #------------------------------------------------------------------------------
  495. #  仓库窗口:物品分类
  496. #==============================================================================
  497. class Window_Warehouse_Sorting < Window_Selectable
  498.   attr_accessor :commands
  499.   #--------------------------------------------------------------------------
  500.   # ● 初始化
  501.   #--------------------------------------------------------------------------
  502.   def initialize
  503.     super(0, 128, 160, 352)
  504.     self.contents = Bitmap.new(width - 32, height - 32)
  505.     if $Sorting != []
  506.       @commands = $Sorting
  507.     else
  508.       @commands = []
  509.     end
  510.     #提取项目:例遍物品
  511.       for i in 1...$data_items.size
  512.           if $game_party.item_number(i) > 0
  513.             push = true
  514.             for com in @commands
  515.               if com == $data_items[i].desc
  516.                 push = false
  517.               end
  518.             end
  519.             if push == true
  520.               @commands.push($data_items[i].desc)
  521.             end
  522.           end
  523.       end
  524.     #提取项目:例遍武器
  525.       for i in 1...$data_weapons.size
  526.           if $game_party.weapon_number(i) > 0
  527.             push = true
  528.             for com in @commands
  529.               if com == $data_weapons[i].desc
  530.                 push = false
  531.               end
  532.             end
  533.             if push == true
  534.               @commands.push($data_weapons[i].desc)
  535.             end
  536.           end
  537.       end
  538.     #提取项目:例遍防具
  539.       for i in 1...$data_armors.size
  540.           if $game_party.armor_number(i) > 0
  541.             push = true
  542.             for com in @commands
  543.               if com == $data_armors[i].desc
  544.                 push = false
  545.               end
  546.             end
  547.             if push == true
  548.               @commands.push($data_armors[i].desc)
  549.             end
  550.           end
  551.       end
  552.     #判断物品是否为空
  553.       if @commands == []
  554.         @commands.push("无任何物品")
  555.       end
  556.     @item_max = @commands.size
  557.     refresh
  558.     self.index = 0
  559.   end
  560.   #--------------------------------------------------------------------------
  561.   # 更新画面
  562.   #--------------------------------------------------------------------------
  563.   def refresh(action = 0)
  564.     self.contents.clear
  565.     for i in 0...@item_max
  566.       if action == 0
  567.         draw_item(i, have_item(i))
  568.       else
  569.         draw_item(i, have_item_w(i))
  570.       end
  571.     end
  572.   end
  573.   #--------------------------------------------------------------------------
  574.   # 描绘
  575.   #--------------------------------------------------------------------------
  576.   def draw_item(index, color)
  577.     self.contents.font.color = color
  578.     y = index * 32
  579.     self.contents.draw_text(4, y, 128, 32, @commands[index])
  580.   end
  581.   #--------------------------------------------------------------------------
  582.   # 只描绘原文字
  583.   #--------------------------------------------------------------------------
  584.   def update_help
  585.     @help_window.set_text(@commands[self.index])
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # 判断分类下是否有内容
  589.   #--------------------------------------------------------------------------
  590.   def have_item(index)
  591.     s = 0
  592.     for i in 1...$data_armors.size
  593.       if $game_party.armor_number(i) > 0 and $data_armors[i].desc == @commands[index]
  594.         s += 1
  595.       end
  596.     end
  597.     for i in 1...$data_items.size
  598.       if $game_party.item_number(i) > 0 and $data_items[i].desc == @commands[index]
  599.         s += 1
  600.       end
  601.     end
  602.     for i in 1...$data_weapons.size
  603.       if $game_party.weapon_number(i) > 0 and $data_weapons[i].desc == @commands[index]
  604.         s += 1
  605.       end
  606.     end
  607.    
  608.     if s == 0
  609.       return disabled_color
  610.     else
  611.       return normal_color
  612.     end
  613.   end
  614.   
  615.     def have_item_w(index)
  616.     s = 0
  617.     for i in 1...$data_armors.size
  618.       if $game_party.get_warehouse(i,"A") > 0 and $data_armors[i].desc == @commands[index]
  619.         s += 1
  620.       end
  621.     end
  622.     for i in 1...$data_items.size
  623.       if $game_party.get_warehouse(i,"I") > 0 and $data_items[i].desc == @commands[index]
  624.         s += 1
  625.       end
  626.     end
  627.     for i in 1...$data_weapons.size
  628.       if $game_party.get_warehouse(i,"W") > 0 and $data_weapons[i].desc == @commands[index]
  629.         s += 1
  630.       end
  631.     end
  632.    
  633.     if s == 0
  634.       return disabled_color
  635.     else
  636.       return normal_color
  637.     end
  638.   end

  639. end
  640. #==============================================================================
  641. # ■ Window_Warehouse_Item
  642. #------------------------------------------------------------------------------
  643. #  仓库显示物品的窗口。
  644. #==============================================================================

  645. class Window_Warehouse_Item < Window_Selectable
  646.   #--------------------------------------------------------------------------
  647.   # 初始化
  648.   #--------------------------------------------------------------------------
  649.   def initialize
  650.     super(160, 128, 480, 352)
  651.     refresh
  652.     self.index = -1
  653.   end
  654.   #--------------------------------------------------------------------------
  655.   #--------------------------------------------------------------------------
  656.   def item
  657.     return @data[self.index]
  658.   end
  659.   #--------------------------------------------------------------------------
  660.   #--------------------------------------------------------------------------
  661.   def refresh
  662.     if self.contents != nil
  663.       self.contents.dispose
  664.       self.contents = nil
  665.     end
  666.     @data = []
  667.   end
  668.   #--------------------------------------------------------------------------
  669.   #--------------------------------------------------------------------------
  670.   def set_item(command)
  671.     refresh
  672.     for i in 1...$data_armors.size
  673.       if $game_party.armor_number(i) > 0 and $data_armors[i].desc == command
  674.         @data.push($data_armors[i])
  675.       end
  676.     end
  677.     for i in 1...$data_items.size
  678.       if $game_party.item_number(i) > 0 and $data_items[i].desc == command
  679.         @data.push($data_items[i])
  680.       end
  681.     end
  682.     for i in 1...$data_weapons.size
  683.       if $game_party.weapon_number(i) > 0 and $data_weapons[i].desc == command
  684.         @data.push($data_weapons[i])
  685.       end
  686.     end
  687.     @item_max = @data.size
  688.     if @item_max > 0
  689.       self.contents = Bitmap.new(width - 32, row_max * 32)
  690.       self.contents.clear
  691.       for i in 0...@item_max
  692.         draw_item(i)
  693.       end
  694.     end
  695.   end
  696.   
  697.   def set_item_w(command)
  698.     refresh
  699.     for i in 1...$data_armors.size
  700.       if $game_party.get_warehouse(i,"A") > 0 and $data_armors[i].desc == command
  701.         @data.push($data_armors[i])
  702.       end
  703.     end
  704.     for i in 1...$data_items.size
  705.       if $game_party.get_warehouse(i,"I") > 0 and $data_items[i].desc == command
  706.         @data.push($data_items[i])
  707.       end
  708.     end
  709.     for i in 1...$data_weapons.size
  710.       if $game_party.get_warehouse(i,"W") > 0 and $data_weapons[i].desc == command
  711.         @data.push($data_weapons[i])
  712.       end
  713.     end
  714.     @item_max = @data.size
  715.     if @item_max > 0
  716.       self.contents = Bitmap.new(width - 32, row_max * 32)
  717.       self.contents.clear
  718.       for i in 0...@item_max
  719.         draw_item(i,true)
  720.       end
  721.     end
  722.   end

  723.   #--------------------------------------------------------------------------
  724.   #--------------------------------------------------------------------------
  725.   def item_number
  726.     return @item_max
  727.   end
  728.   #--------------------------------------------------------------------------
  729.   #--------------------------------------------------------------------------
  730.   def draw_item(index,w = false)
  731.     item = @data[index]
  732.     case item
  733.     when RPG::Item
  734.       number = $game_party.item_number(item.id)
  735.     when RPG::Weapon
  736.       number = $game_party.weapon_number(item.id)
  737.     when RPG::Armor
  738.       number = $game_party.armor_number(item.id)
  739.     end
  740.     if w == true
  741.       case item
  742.         when RPG::Item
  743.           number = $game_party.get_warehouse(item.id,"I")
  744.         when RPG::Weapon
  745.           number = $game_party.get_warehouse(item.id,"W")
  746.         when RPG::Armor
  747.           number = $game_party.get_warehouse(item.id,"A")
  748.         end
  749.     end
  750.     x = 4
  751.     y = index * 32
  752.     bitmap = RPG::Cache.icon(item.icon_name)
  753.     opacity = self.contents.font.color == normal_color ? 255 : 128
  754.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 32, 32), opacity)
  755.     self.contents.font.color = text_color(item.name_color_66RPG)
  756.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  757.     self.contents.font.color = normal_color
  758.     self.contents.draw_text(x + 400, y, 16, 32, ":", 1)
  759.     self.contents.draw_text(x + 416, y, 24, 32, number.to_s, 2)
  760.   end
  761.   #--------------------------------------------------------------------------
  762.   #--------------------------------------------------------------------------
  763.   def update_help
  764.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  765.   end
  766. end

  767. #==============================================================================
  768. # ■ Window_Warehouse_Number
  769. #------------------------------------------------------------------------------
  770. #  仓库输入存取数量的窗口。
  771. #==============================================================================

  772. class Window_Warehouse_Number < Window_Base
  773. #--------------------------------------------------------------------------
  774. # ● 初始化对像
  775. #--------------------------------------------------------------------------
  776. def initialize
  777.    super(140, 208, 360, 64)
  778.    self.contents = Bitmap.new(width - 32, height - 32)
  779.    @item = nil
  780.    @max = 1
  781.    @number = 1
  782. end
  783. #--------------------------------------------------------------------------
  784. # ● 设置物品、最大个数、价格
  785. #--------------------------------------------------------------------------
  786. def set(item, max)
  787.    @item = item
  788.    @max = max
  789.    @number = 1
  790.    refresh
  791. end
  792. #--------------------------------------------------------------------------
  793. # ● 被输入的件数设置
  794. #--------------------------------------------------------------------------
  795. def number
  796.    return @number
  797. end

  798. def get_item
  799.    return @item
  800. end

  801. #--------------------------------------------------------------------------
  802. # ● 刷新
  803. #--------------------------------------------------------------------------
  804. def refresh
  805.    self.contents.clear
  806.    draw_item_name(@item, 0, 0)
  807.    self.contents.font.color = normal_color
  808.    self.contents.draw_text( 263, 0, 32, 32, "×")
  809.    self.contents.draw_text( 290, 0, 24, 32, @number.to_s, 2)
  810.    self.cursor_rect.set( 287, 0, 32, 32)
  811. end
  812. #--------------------------------------------------------------------------
  813. # ● 刷新画面
  814. #--------------------------------------------------------------------------
  815. def update
  816.    super
  817.    if self.active
  818.      # 光标右 (+1)
  819.      if Input.repeat?(Input::RIGHT) and @number < @max
  820.        $game_system.se_play($data_system.cursor_se)
  821.        @number += 1
  822.        refresh
  823.      end
  824.      # 光标左 (-1)
  825.      if Input.repeat?(Input::LEFT) and @number > 1
  826.        $game_system.se_play($data_system.cursor_se)
  827.        @number -= 1
  828.        refresh
  829.      end
  830.      # 光标上 (+10)
  831.      if Input.repeat?(Input::UP) and @number < @max
  832.        $game_system.se_play($data_system.cursor_se)
  833.        @number = [@number + 10, @max].min
  834.        refresh
  835.      end
  836.      # 光标下 (-10)
  837.      if Input.repeat?(Input::DOWN) and @number > 1
  838.        $game_system.se_play($data_system.cursor_se)
  839.        @number = [@number - 10, 1].max
  840.        refresh
  841.      end
  842.    end
  843. end
  844. end
  845. #==============================================================================
  846. # ■ 设置
  847. #==============================================================================
  848. #在这里设定分类项目,顺序按照编号排列
  849. $Sorting = ["普通物品",
  850.               "药品类",
  851.               "武器类",
  852.               "护甲类",
  853.               "首饰类",
  854.                 "食材",
  855.                 "料理",
  856.             "任务物品"]
  857. #==============================================================================
  858. # ■ RPG追加定义,使用@符号分类
  859. #==============================================================================

  860. module RPG
  861.   class Weapon
  862.     def description
  863.       description = @description.split(/@/)[0]
  864.       return description != nil ? description : ''
  865.     end
  866.     def desc
  867.       desc = @description.split(/@/)[1]
  868.       return desc != nil ? desc : "武器"
  869.     end
  870.   end
  871.   class Item
  872.     def description
  873.       description = @description.split(/@/)[0]
  874.       return description != nil ? description : ''
  875.     end
  876.     def desc
  877.       desc = @description.split(/@/)[1]
  878.       return desc != nil ? desc : "物品"
  879.     end
  880.   end
  881.   class Armor
  882.     def description
  883.       description = @description.split(/@/)[0]
  884.       return description != nil ? description : ''
  885.     end
  886.     def desc
  887.       desc = @description.split(/@/)[1]
  888.       return desc != nil ? desc : "防具"
  889.     end
  890.   end
  891. end
  892. # ————————————————————————————————————
  893. # 本脚本来自www.66rpg.com,转载请保留此信息
  894. # ————————————————————————————————————
  895. #==============================================================================
  896. # ■ Scene_Warehouse
  897. #------------------------------------------------------------------------------
  898. #  处理仓库画面的类。
  899. #==============================================================================
  900. class Scene_Warehouse
  901.   def main
  902.    # 生成帮助窗口
  903.    @help_window = Window_Help.new
  904.    # 生成动作窗口
  905.    @action_window = Window_Warehouse_Action.new
  906.    # 生成仓库标题
  907.    @title_window = Window_Warehouse_Title.new
  908.    # 生成分类窗口
  909.    @sorting_window = Window_Warehouse_Sorting.new
  910.    @sorting_window.index = -1
  911.    @sorting_window.active = false
  912.    # 生成物品窗口
  913.    @item_window = Window_Warehouse_Item.new
  914.    @item_window.active = false
  915.    @item_window.help_window = @help_window
  916.    # 生成数量输入窗口
  917.    @number_window = Window_Warehouse_Number.new
  918.    @number_window.active = false
  919.    @number_window.visible = false
  920.    # 初始化项目
  921.    @item_index = -1
  922.    # 执行过渡
  923.    Graphics.transition
  924.    # 主循环
  925.    loop do
  926.      # 刷新游戏画面
  927.      Graphics.update
  928.      # 刷新输入信息
  929.      Input.update
  930.      # 刷新画面
  931.      update
  932.      # 如果画面切换的话就中断循环
  933.      if $scene != self
  934.        break
  935.      end
  936.    end
  937.    # 准备过渡
  938.    Graphics.freeze
  939.    # 释放窗口
  940.    @help_window.dispose
  941.    @action_window.dispose
  942.    @title_window.dispose
  943.    @sorting_window.dispose
  944.    @item_window.dispose
  945.    @number_window.dispose
  946. end


  947.   #--------------------------------------------------------------------------
  948.   # 更新画面
  949.   #--------------------------------------------------------------------------
  950. def update
  951.    # 更新窗口内容
  952.      @help_window.update
  953.      @action_window.update
  954.      @title_window.update
  955.    # 更新动作窗口
  956.      if @action_window.active
  957.        update_action_window
  958.        return
  959.      end
  960.    # 更新分类窗口
  961.      if @sorting_window.active
  962.        update_sorting_window
  963.      end
  964.    # 更新物品窗口  
  965.      if @item_window.active
  966.        update_item_window
  967.       return
  968.      end
  969.    # 更新数量输入窗口
  970.      if @number_window.active
  971.        update_number_window
  972.      end
  973.      
  974. end
  975.   #--------------------------------------------------------------------------
  976.   # 更新动作窗口
  977.   #--------------------------------------------------------------------------
  978. def update_action_window
  979.       # 按下 B 键的情况下
  980.    if Input.trigger?(Input::B)
  981.      # 演奏取消 SE
  982.      $game_system.se_play($data_system.cancel_se)
  983.      # 切换到地图画面
  984.      $scene = Scene_Map.new
  985.      return
  986.    end
  987.       # 按下 C 键的情况下
  988.    if Input.trigger?(Input::C)
  989.      # 命令窗口光标位置分支
  990.      case @action_window.index
  991.      when 0  # 存入
  992.        # 演奏确定 SE
  993.        $game_system.se_play($data_system.decision_se)
  994.        @action_window.active = false
  995.        @sorting_window.active = true
  996.        @sorting_window.index = 0
  997.        when 1  # 取出
  998.        # 演奏确定 SE
  999.        $game_system.se_play($data_system.decision_se)
  1000.        @action_window.active = false
  1001.        @sorting_window.active = true
  1002.        @sorting_window.index = 0
  1003.        @sorting_window.refresh(1)
  1004.      when 2  # 取消
  1005.        # 演奏确定 SE
  1006.        $game_system.se_play($data_system.decision_se)
  1007.        # 切换到地图画面
  1008.        $scene = Scene_Map.new
  1009.      end
  1010.      return
  1011.    end
  1012.    @sorting_window.refresh(@action_window.index)
  1013. end

  1014.   #--------------------------------------------------------------------------
  1015.   # 更新分类窗口
  1016.   #--------------------------------------------------------------------------

  1017. def update_sorting_window
  1018.          # 按下 B 键的情况下
  1019.    if Input.trigger?(Input::B)
  1020.      # 演奏取消 SE
  1021.      $game_system.se_play($data_system.cancel_se)
  1022.      # 切换到地图画面
  1023.        @sorting_window.index = -1
  1024.        @sorting_window.update
  1025.        @action_window.active = true
  1026.        @sorting_window.active = false
  1027.        @item_window.set_item("")
  1028.      return
  1029.    end
  1030.       # 按下 C 键的情况下
  1031.      if Input.trigger?(Input::C)
  1032.        if @action_window.index == 0
  1033.          if @sorting_window.have_item(@sorting_window.index) != @sorting_window.disabled_color
  1034.           $game_system.se_play($data_system.decision_se)
  1035.           @sorting_window.active = false
  1036.           @item_window.active = true
  1037.           @item_window.index = 0
  1038.          else
  1039.           $game_system.se_play($data_system.buzzer_se)
  1040.         end
  1041.       else
  1042.         if @sorting_window.have_item_w(@sorting_window.index) != @sorting_window.disabled_color
  1043.           $game_system.se_play($data_system.decision_se)
  1044.           @sorting_window.active = false
  1045.           @item_window.active = true
  1046.           @item_window.index = 0
  1047.         else
  1048.           $game_system.se_play($data_system.buzzer_se)
  1049.         end
  1050.       end
  1051.     end
  1052.    
  1053.       # 更新物品窗口
  1054.         if @action_window.index == 0
  1055.           @item_window.set_item(@sorting_window.commands[@sorting_window.index])
  1056.         elsif @action_window.index ==1
  1057.           @item_window.set_item_w(@sorting_window.commands[@sorting_window.index])
  1058.         end
  1059.       @sorting_window.update
  1060. end

  1061.   #--------------------------------------------------------------------------
  1062.   # 更新物品窗口
  1063.   #--------------------------------------------------------------------------
  1064.   def update_item_window
  1065.    if Input.trigger?(Input::B)
  1066.      # 演奏取消 SE
  1067.      $game_system.se_play($data_system.cancel_se)
  1068.      @sorting_window.active = true
  1069.      @item_window.active = false
  1070.      @item_window.index = -1
  1071.      @help_window.set_text("")
  1072.      return
  1073.    end
  1074.    # 按下确定键
  1075.    if Input.trigger?(Input::C)
  1076.      # 获取物品数量
  1077.        $game_system.se_play($data_system.decision_se)
  1078.        if @item_window.item.is_a?(RPG::Item)
  1079.            if @action_window.index == 0
  1080.              i = $game_party.item_number(@item_window.item.id)
  1081.            else
  1082.              i = $game_party.get_warehouse(@item_window.item.id,"I")
  1083.            end
  1084.          elsif @item_window.item.is_a?(RPG::Weapon)
  1085.            if @action_window.index == 0
  1086.              i = $game_party.weapon_number(@item_window.item.id)
  1087.            else
  1088.              i = $game_party.get_warehouse(@item_window.item.id,"W")
  1089.            end
  1090.          else
  1091.            if @action_window.index == 0
  1092.              i = $game_party.armor_number(@item_window.item.id)
  1093.            else
  1094.              i = $game_party.get_warehouse(@item_window.item.id,"A")
  1095.            end
  1096.         end
  1097.      @number_window.set(@item_window.item, i)      
  1098.      @number_window.active = true
  1099.      @number_window.visible = true
  1100.      @item_window.active = false
  1101.    end
  1102.    @item_window.update
  1103.         if @action_window.index == 0
  1104.           @item_window.set_item(@sorting_window.commands[@sorting_window.index])
  1105.         elsif @action_window.index ==1
  1106.           @item_window.set_item_w(@sorting_window.commands[@sorting_window.index])
  1107.         end
  1108.         
  1109.   end
  1110.   #--------------------------------------------------------------------------
  1111.   # 更新输入窗口
  1112.   #--------------------------------------------------------------------------
  1113.   def update_number_window
  1114.     @number_window.update
  1115.     if Input.trigger?(Input::B)
  1116.      # 演奏取消 SE
  1117.      $game_system.se_play($data_system.cancel_se)
  1118.      @number_window.active = false
  1119.      @number_window.visible = false
  1120.      @item_window.active = true
  1121.      return
  1122.    end
  1123.    if Input.trigger?(Input::C)
  1124.      $game_system.se_play($data_system.decision_se)
  1125.      @number_window.active = false
  1126.      @number_window.visible = false
  1127.      @item_window.active = true
  1128.      #处理存储操作
  1129.      if @action_window.index == 0
  1130.         if @number_window.get_item.is_a?(RPG::Item)
  1131.            $game_party.add_warehouse(@number_window.get_item.id,@number_window.number,"I")
  1132.            $game_party.lose_item(@number_window.get_item.id, @number_window.number)
  1133.         elsif @number_window.get_item.is_a?(RPG::Weapon)
  1134.            $game_party.add_warehouse(@number_window.get_item.id,@number_window.number,"W")
  1135.            $game_party.lose_weapon(@number_window.get_item.id, @number_window.number)
  1136.         else
  1137.            $game_party.add_warehouse(@number_window.get_item.id,@number_window.number,"A")
  1138.            $game_party.lose_armor(@number_window.get_item.id, @number_window.number)
  1139.          end
  1140.         #判读储存后状态
  1141.         if @sorting_window.have_item(@sorting_window.index) == @sorting_window.disabled_color
  1142.           @item_window.index = -1
  1143.           @item_window.active = false
  1144.           @sorting_window.active = true
  1145.           @sorting_window.refresh
  1146.           @help_window.set_text("")
  1147.         end
  1148.       elsif @action_window.index == 1
  1149.         if @number_window.get_item.is_a?(RPG::Item)
  1150.            $game_party.del_warehouse(@number_window.get_item.id,@number_window.number,"I")
  1151.            $game_party.gain_item(@number_window.get_item.id, @number_window.number)
  1152.         elsif @number_window.get_item.is_a?(RPG::Weapon)
  1153.            $game_party.del_warehouse(@number_window.get_item.id,@number_window.number,"W")
  1154.            $game_party.gain_weapon(@number_window.get_item.id, @number_window.number)
  1155.         else
  1156.            $game_party.del_warehouse(@number_window.get_item.id,@number_window.number,"A")
  1157.            $game_party.gain_armor(@number_window.get_item.id, @number_window.number)
  1158.          end
  1159.         #判读储存后状态
  1160.         if @sorting_window.have_item_w(@sorting_window.index) == @sorting_window.disabled_color
  1161.           @item_window.index = -1
  1162.           @item_window.active = false
  1163.           @sorting_window.active = true
  1164.           @sorting_window.refresh(1)
  1165.           @help_window.set_text("")
  1166.         end

  1167.        end
  1168.    end
  1169.   end
  1170.   
  1171. end
  1172. #==============================================================================
  1173. # ■ Game_System
  1174. #------------------------------------------------------------------------------
  1175. #  追加仓库物品
  1176. #==============================================================================

  1177. class Game_Party
  1178.     attr_accessor :Warehouse
  1179.     alias o_initialize initialize
  1180.   def initialize
  1181.       o_initialize
  1182.       @Warehouse_Item = []
  1183.       @Warehouse_Weapon = []
  1184.       @Warehouse_Armor = []
  1185.       for i in 1...$data_armors.size
  1186.         @Warehouse_Armor.push($data_armors[i])
  1187.         @Warehouse_Armor[i] = 0
  1188.       end
  1189.       
  1190.       for i in 1...$data_items.size
  1191.         @Warehouse_Item.push($data_items[i])
  1192.         @Warehouse_Item[i] = 0
  1193.       end
  1194.       
  1195.       for i in 1...$data_weapons.size
  1196.         @Warehouse_Weapon.push($data_weapons[i])
  1197.         @Warehouse_Weapon[i] = 0
  1198.       end
  1199.    
  1200.   end
  1201.    
  1202.   def add_warehouse(item,num,type)
  1203.       if type == "I"
  1204.           @Warehouse_Item[item] += num
  1205.       elsif type == "W"
  1206.           @Warehouse_Weapon[item] += num
  1207.       elsif type == "A"
  1208.           @Warehouse_Armor[item] += num
  1209.       end
  1210.   end
  1211.    
  1212.   def get_warehouse(item,type)
  1213.       if type == "I"
  1214.           return @Warehouse_Item[item]
  1215.       elsif type == "W"
  1216.           return @Warehouse_Weapon[item]
  1217.       elsif type == "A"
  1218.           return @Warehouse_Armor[item]
  1219.       end

  1220.       return @Warehouse[item]
  1221.   end
  1222.    
  1223.   def del_warehouse(item,num,type)
  1224.       if type == "I"
  1225.           @Warehouse_Item[item] -= num
  1226.       elsif type == "W"
  1227.           @Warehouse_Weapon[item] -= num
  1228.       elsif type == "A"
  1229.           @Warehouse_Armor[item] -= num
  1230.       end
  1231.   end

  1232. end

  1233. #==============================================================================
  1234. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  1235. #==============================================================================
  1236. #
  1237. # 脚本功能:给不同物品显示不同颜色,类似暗黑破坏神,比如套装为绿色,超级为金色
  1238. #           可以更改的种类包括物品、防具、特技、武器。
  1239. #
  1240. # 使用方法:对于不想为白色表示的物品,在描述中最后添加@6,@4一类的即可。
  1241. #           数字为颜色编号,和对话框中的一样。
  1242. # ——————————————————————————————————————
  1243. module RPG
  1244.   class Skill
  1245.     def description
  1246.       description = @description.split(/:/)[0]
  1247.       return description != nil ? description : ''
  1248.     end
  1249.     def name_color_66RPG
  1250.       name_color = @description.split(/:/)[1]
  1251.       return name_color != nil ? name_color.to_i : 0
  1252.     end
  1253.   end
  1254.   class Weapon
  1255.     def description
  1256.       description = @description.split(/:/)[0]
  1257.       return description != nil ? description : ''
  1258.     end
  1259.     def name_color_66RPG
  1260.       name_color = @description.split(/:/)[1]
  1261.       return name_color != nil ? name_color.to_i : 0
  1262.     end
  1263.   end
  1264.   class Item
  1265.     def description
  1266.       description = @description.split(/:/)[0]
  1267.       return description != nil ? description : ''
  1268.     end
  1269.     def name_color_66RPG
  1270.       name_color = @description.split(/:/)[1]
  1271.       return name_color != nil ? name_color.to_i : 0
  1272.     end
  1273.   end
  1274.   class Armor
  1275.     def description
  1276.       description = @description.split(/:/)[0]
  1277.       return description != nil ? description : ''
  1278.     end
  1279.     def name_color_66RPG
  1280.       name_color = @description.split(/:/)[1]
  1281.       return name != nil ? name_color.to_i : 0
  1282.     end
  1283.   end
  1284. end
  1285. # ——————————————————————————————————————
  1286. # 本脚本原创自www.66rpg.com,转载请保留此信息
  1287. # ——————————————————————————————————————
  1288. class Window_Base < Window
  1289.   #--------------------------------------------------------------------------
  1290.   # ● 描绘物品名
  1291.   #     item : 物品
  1292.   #     x    : 描画目标 X 坐标
  1293.   #     y    : 描画目标 Y 坐标
  1294.   #--------------------------------------------------------------------------
  1295.   def draw_item_name(item, x, y)
  1296.     if item == nil
  1297.       return
  1298.     end
  1299.     bitmap = RPG::Cache.icon(item.icon_name)
  1300.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 32, 32))
  1301.     self.contents.font.color = text_color(item.name_color_66RPG)
  1302.     self.contents.draw_text(x + 28, y, 212, 32, item.name.to_s)
  1303.   end
  1304. end
  1305. # ——————————————————————————————————————
  1306. # 本脚本原创自www.66rpg.com,转载请保留此信息
  1307. # ——————————————————————————————————————
  1308. class Window_Item
  1309.   #--------------------------------------------------------------------------
  1310.   # ● 描绘项目
  1311.   #     index : 项目编号
  1312.   #--------------------------------------------------------------------------
  1313.   def draw_item(index)
  1314.     item = @data[index]
  1315.     case item
  1316.     when RPG::Item
  1317.       number = $game_party.item_number(item.id)
  1318.     when RPG::Weapon
  1319.       number = $game_party.weapon_number(item.id)
  1320.     when RPG::Armor
  1321.       number = $game_party.armor_number(item.id)
  1322.     end
  1323. #    if item.is_a?(RPG::Item) and
  1324. #      $game_party.item_can_use?(item.id)
  1325.   #    self.contents.font.color = text_color(item.name_color_66RPG)
  1326.    # else
  1327.     #  self.contents.font.color = disabled_color
  1328.     #end
  1329.     self.contents.font.color = text_color(item.name_color_66RPG)
  1330.     x = 4 + index % 2 * (288 + 32)
  1331.     y = index / 2 * 32
  1332.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  1333.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1334.     bitmap = RPG::Cache.icon(item.icon_name)
  1335.     opacity = self.contents.font.color == disabled_color ? 128 : 255
  1336.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 32, 32), opacity)
  1337.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  1338.     self.contents.draw_text(x + 240, y, 16, 32, "×", 1)
  1339.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  1340.   end
  1341. end
  1342. # ——————————————————————————————————————
  1343. # 本脚本原创自www.66rpg.com,转载请保留此信息
  1344. # ——————————————————————————————————————
  1345. class Window_EquipItem < Window_Selectable
  1346.   #--------------------------------------------------------------------------
  1347.   # ● 项目的描绘
  1348.   #     index : 项目符号
  1349.   #--------------------------------------------------------------------------
  1350.   def draw_item(index)
  1351.     item = @data[index]
  1352.     x = 4 + index % 2 * (288 + 32)
  1353.     y = index / 2 * 32
  1354.     case item
  1355.     when RPG::Weapon
  1356.       number = $game_party.weapon_number(item.id)
  1357.     when RPG::Armor
  1358.       number = $game_party.armor_number(item.id)
  1359.     end
  1360.     bitmap = RPG::Cache.icon(item.icon_name)
  1361.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 32, 32))
  1362.     self.contents.font.color = text_color(item.name_color_66RPG)
  1363.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  1364.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  1365.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  1366.   end
  1367. end
  1368. # ——————————————————————————————————————
  1369. # 本脚本原创自www.66rpg.com,转载请保留此信息
  1370. # ——————————————————————————————————————
  1371. class Window_ShopBuy < Window_Selectable
  1372.   #--------------------------------------------------------------------------
  1373.   # ● 描绘羡慕
  1374.   #     index : 项目编号
  1375.   #--------------------------------------------------------------------------
  1376.   def draw_item(index)
  1377.     item = @data[index]
  1378.     # 获取物品所持数
  1379.     case item
  1380.     when RPG::Item
  1381.       number = $game_party.item_number(item.id)
  1382.     when RPG::Weapon
  1383.       number = $game_party.weapon_number(item.id)
  1384.     when RPG::Armor
  1385.       number = $game_party.armor_number(item.id)
  1386.     end
  1387.     # 价格在所持金以下、并且所持数不是 99 的情况下为普通颜色
  1388.     # 除此之外的情况设置为无效文字色
  1389. #    if item.price <= $game_party.gold and number < 99
  1390. #     self.contents.font.color = text_color(item.name_color_66RPG)
  1391.   #  else
  1392.    #   self.contents.font.color = disabled_color
  1393.     #end
  1394.     self.contents.font.color = text_color(item.name_color_66RPG)
  1395.     x = 4
  1396.     y = index * 32
  1397.     rect = Rect.new(x, y, self.width - 32, 32)
  1398.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1399.     bitmap = RPG::Cache.icon(item.icon_name)
  1400.     opacity = self.contents.font.color == disabled_color ? 128 : 255
  1401.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 32, 32), opacity)
  1402.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  1403.     self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2)
  1404.   end
  1405. end
  1406. # ——————————————————————————————————————
  1407. # 本脚本原创自www.66rpg.com,转载请保留此信息
  1408. # ——————————————————————————————————————
  1409. class Window_ShopSell < Window_Selectable
  1410.   #--------------------------------------------------------------------------
  1411.   # ● 描绘项目
  1412.   #     index : 项目标号
  1413.   #--------------------------------------------------------------------------
  1414.   def draw_item(index)
  1415.     item = @data[index]
  1416.     case item
  1417.     when RPG::Item
  1418.       number = $game_party.item_number(item.id)
  1419.     when RPG::Weapon
  1420.       number = $game_party.weapon_number(item.id)
  1421.     when RPG::Armor
  1422.       number = $game_party.armor_number(item.id)
  1423.     end
  1424.     # 可以卖掉的显示为普通颜色、除此之外设置成无效文字颜色
  1425. #    if item.price > 0
  1426. #     self.contents.font.color = text_color(item.name_color_66RPG)
  1427.   #  else
  1428.    #   self.contents.font.color = disabled_color
  1429.     #end
  1430.     self.contents.font.color = text_color(item.name_color_66RPG)
  1431.     x = 4 + index % 2 * (288 + 32)
  1432.     y = index / 2 * 32
  1433.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  1434.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1435.     bitmap = RPG::Cache.icon(item.icon_name)
  1436.     opacity = self.contents.font.color == disabled_color ? 128 : 255
  1437.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 32, 32), opacity)
  1438.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  1439.     self.contents.draw_text(x + 240, y, 16, 32, "×", 1)
  1440.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  1441.   end
  1442. end
  1443.    
  1444. # ——————————————————————————————————————
  1445. # 本脚本原创自www.66rpg.com,转载请保留此信息
  1446. # ——————————————————————————————————————
  1447. class Window_Skill
  1448.   #--------------------------------------------------------------------------
  1449.   # ● 描绘项目
  1450.   #     index : 项目编号
  1451.   #--------------------------------------------------------------------------
  1452.   def draw_item(index)
  1453.     skill = @data[index]
  1454.     if @actor.skill_can_use?(skill.id)
  1455.       self.contents.font.color = text_color(skill.name_color_66RPG)
  1456.     else
  1457.       self.contents.font.color = disabled_color
  1458.     end
  1459.     x = 4 + index % 2 * (288 + 32)
  1460.     y = index / 2 * 32
  1461.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  1462.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1463.     bitmap = RPG::Cache.icon(skill.icon_name)
  1464.     opacity = self.contents.font.color == disabled_color ? 128 : 255
  1465.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  1466.     self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
  1467.     self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  1468.   end
  1469. end
  1470. #==============================================================================
  1471. # ■ Harts_Window_ItemTitle
  1472. #==============================================================================
  1473. class Harts_Window_ItemTitle < Window_Base
  1474.   #--------------------------------------------------------------------------
  1475.   # ● 描绘羡慕
  1476.   #     index : 项目编号
  1477.   #--------------------------------------------------------------------------
  1478.   def draw_item(index)
  1479.     item = @data[index]
  1480.     # 获取物品所持数
  1481.     case item
  1482.     when RPG::Item
  1483.       number = $game_party.item_number(item.id)
  1484.     when RPG::Weapon
  1485.       number = $game_party.weapon_number(item.id)
  1486.     when RPG::Armor
  1487.       number = $game_party.armor_number(item.id)
  1488.     end
  1489.     # 价格在所持金以下、并且所持数不是 99 的情况下为普通颜色
  1490.     # 除此之外的情况设置为无效文字色
  1491. #    if item.price <= $game_party.gold and number < 99
  1492. #     self.contents.font.color = text_color(item.name_color_66RPG)
  1493.   #  else
  1494.    #   self.contents.font.color = disabled_color
  1495.     #end
  1496.     self.contents.font.color = text_color(item.name_color_66RPG)
  1497.     x = 4
  1498.     y = index * 32
  1499.     rect = Rect.new(x, y, self.width - 32, 32)
  1500.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1501.     bitmap = RPG::Cache.icon(item.icon_name)
  1502.     opacity = self.contents.font.color == text_color(item.name_color_66RPG) ? 128 : 255
  1503.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 32, 32), opacity)
  1504.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  1505.     self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2)
  1506.   end
  1507. end
  1508. #==============================================================================
  1509. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  1510. #==============================================================================
复制代码
使用方法:复制脚本搽到脚本编辑器MAIN前
脚本功能:分类仓库、物品品质、物品背包分类
我把收集的脚本做了点修改,所以达到如此效果:

评分

参与人数 2星屑 +1200 梦石 +6 +10 收起 理由
论坛助理 + 6 参赛奖励
小传子 + 1200 + 6 + 4 不修改排版之前不会有第二波奖励.

查看全部评分

[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png

Lv2.观梦者


  • 更新完成啦

梦石
0
星屑
769
在线时间
6267 小时
注册时间
2006-6-7
帖子
8462
2
发表于 2012-6-28 12:14:10 | 只看该作者
最好是附带工程,从你的截图我就看到了坐标的BUG,建议你改改

点评

“不修改排版之前不会有第二波奖励”是什么意思?第一波第二波又是什么?  发表于 2012-8-5 15:20
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9275
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

3
 楼主| 发表于 2012-6-28 12:22:52 | 只看该作者
传说VS天涯 发表于 2012-6-28 12:14
最好是附带工程,从你的截图我就看到了坐标的BUG,建议你改改

我知道你是说下面那个载重,可是我实在是想不到更好的地方了···凑合着用吧一般物品介绍不长的话是不会被挡住的···除非有人无聊什么的把物品介绍写到无限长···
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
56 小时
注册时间
2012-6-23
帖子
156
4
发表于 2012-6-29 16:31:20 | 只看该作者
话说,程序语言调成Ruby好不。。我觉得高亮看比较舒服。

另,仓库分类的那个背包总量调右边点不是比较好看吗
http://SRKF.tk 暗影の森,只属于自己的一片森林。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9275
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

5
 楼主| 发表于 2012-6-29 16:42:46 | 只看该作者
约修亚_RK 发表于 2012-6-29 16:31
话说,程序语言调成Ruby好不。。我觉得高亮看比较舒服。

另,仓库分类的那个背包总量调右边点不是比较好看 ...

如果载重是9E的话调到右边会很难看
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
56 小时
注册时间
2012-6-23
帖子
156
6
发表于 2012-6-29 16:44:22 | 只看该作者
chd114 发表于 2012-6-29 16:42
如果载重是9E的话调到右边会很难看

话说什么叫E……(怎么想都不可能有那么多的容量好吧。。)

点评

个人觉得中间比较好看  发表于 2012-6-30 15:53
http://SRKF.tk 暗影の森,只属于自己的一片森林。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9275
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

7
 楼主| 发表于 2012-6-29 17:45:34 | 只看该作者
约修亚_RK 发表于 2012-6-29 16:44
话说什么叫E……(怎么想都不可能有那么多的容量好吧。。)

E是亿···网游中,W=万,E=亿

点评

= =那么右对齐呗  发表于 2012-6-30 15:25
右对齐啊 亲爱的  发表于 2012-6-30 09:48
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1624
在线时间
1609 小时
注册时间
2007-8-28
帖子
3253

第3届短篇游戏大赛主流游戏组冠军第1届Title华丽大赛新人奖

8
发表于 2012-6-30 16:34:42 | 只看该作者
魔塔樣本大亮,醒目的說
“我推荐你一个游戏吧,avg的,剧情特感人”
“我擦,都是文字图片的游戏有啥好玩的,连个战斗都没有!”
“我推荐你一个游戏吧,rpg的,战斗也新颖”
“我擦,怎么米有作i弊器?“
”你不是喜欢战斗么?”
“不,我是剧情党!!”

继续阅读请点击
http://rpg.blue/blog-53316-10027.html
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9275
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

9
 楼主| 发表于 2012-6-30 16:39:18 | 只看该作者
柳之一 发表于 2012-6-30 16:34
魔塔樣本大亮,醒目的說

我做的···几乎所有以前的样板的功能都集中到我这一个样板了···同时这样板还有ARPG游戏APRP的直线伤害与光环功能···
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
47
在线时间
412 小时
注册时间
2012-6-1
帖子
1021
10
发表于 2012-6-30 22:23:01 | 只看该作者
额额连个游戏工程范例都没有呀
看到这么多脚本内容就没有心思读下去了啊啊
建议上传工程后更新主楼
这里是新人 明特·布兰马修
脚本盲 事件盲 美工盲
还是色盲ORZ
XP\VX略懂VA无助很抱歉
所以问题什么如果答不好就不要提醒我了
短篇7已经放弃,但是坑在继续补上。所以回答和现身次数少之。
有事烧纸或者留言即可。

还有我不是正太啊ORZ
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

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

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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