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

Project1

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

[RMVX发布] [更新][两个版本]物品种类限制 + 物品丢弃

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
65
在线时间
433 小时
注册时间
2007-5-1
帖子
993
跳转到指定楼层
1
发表于 2008-8-10 01:00:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 水镜风生 于 2009-8-28 10:25 编辑

12.20更新,修正点击空物品时出错的BUG,并新增一个版本。

所谓种类限制,就是仿照网游的物品格,一种物品算占一格,格子数量有限。
而这里没有格子,只有显示【当前物品种数/最大种数】的窗口……


使用方法:
1.复制脚本插入main前。
2.默认丢弃物品的音效是回避音效,要修改的话请用新SE的名称代替第一行的Evasion。
3.默认用12号变量来储存物品最大种类数,需要在游戏开始时给此变量赋初值。
4.价格为0的物品认定为任务物品,不可丢弃。

注意:
1.物品名称超过7个字时会发生字体重叠。
2.物品种类超过999个时会发生字体重叠。
3.最大种数超过999个时其数量将不能完全显示。



这是物品界面提示版,当前物品种数超过最大种数时会提示背包已满且不能退出物品画面。
  1. #==============================================================================
  2. # ■ 物品丢弃 + 物品种类数限制 —— by 水镜风生
  3. #------------------------------------------------------------------------------
  4. LOSE_ITEM_SE_NAME = "Evasion"         # 丢弃物品时播放的SE
  5. ITEM_MAX_N = 12    # 储存物品最大种类数的事件变量的编号

  6. #==============================================================================
  7. # ■ Scene_Item
  8. #------------------------------------------------------------------------------
  9. #  处理物品画面的类。
  10. #==============================================================================

  11. class Scene_Item < Scene_Base
  12.   #--------------------------------------------------------------------------
  13.   # ● 开始处理
  14.   #--------------------------------------------------------------------------
  15.   def start
  16.     super
  17.     create_menu_background
  18.     @viewport = Viewport.new(0, 0, 544, 416)
  19.     @help_window = Window_Help.new
  20.     @help_window.viewport = @viewport
  21.     @item_window = Window_Item.new(0, 67, 544, 280)
  22.     @item_window.viewport = @viewport
  23.     @item_window.help_window = @help_window
  24.     @item_window.active = false
  25.     @target_window = Window_MenuStatus.new(0, 0)
  26.     @max_window = Window_Item_Max.new
  27.     @max_window.viewport = @viewport
  28.     @number_window = Window_LoseNumber.new(142, 156)
  29.     @number_window.viewport = @viewport
  30.     @command_window = Window_Command.new(145, ["   使用","   丢弃"], 1, 2)
  31.     @command_window.x = 200
  32.     @command_window.y = 160
  33.     @over_window = Window_Help.new
  34.     @over_window.set_text("背包放不下了,丢弃一些没用的物品吧。")
  35.     @over_window.visible = false
  36.     hide_command_window
  37.     hide_number_window
  38.     hide_target_window
  39.   end
  40.   #--------------------------------------------------------------------------
  41.   # ● 结束处理
  42.   #--------------------------------------------------------------------------
  43.   def terminate
  44.     super
  45.     dispose_menu_background
  46.     @viewport.dispose
  47.     @help_window.dispose
  48.     @item_window.dispose
  49.     @target_window.dispose
  50.     @max_window.dispose
  51.     @command_window.dispose
  52.     @number_window.dispose
  53.     @over_window.dispose
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # ● 回到原画面
  57.   #--------------------------------------------------------------------------
  58.   def return_scene
  59.     $scene = Scene_Menu.new(0)
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● 更新画面
  63.   #--------------------------------------------------------------------------
  64.   def update
  65.     super
  66.     update_menu_background
  67.     @over_window.update
  68.     @help_window.update
  69.     @item_window.update
  70.     @target_window.update
  71.     @max_window.update
  72.     @command_window.update
  73.     @number_window.update
  74.     if @item_window.active
  75.       update_item_selection
  76.     elsif @target_window.active
  77.       update_target_selection
  78.     elsif @command_window.active
  79.       update_command_selection
  80.     elsif @number_window.active
  81.       update_number_selection
  82.     end
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● 更新物品选择
  86.   #--------------------------------------------------------------------------
  87.   def update_item_selection
  88.     if Input.trigger?(Input::B)
  89.       item_max = $game_variables[ITEM_MAX_N]
  90.       item_max = 0 if item_max == nil
  91.       if  $game_party.items.size >  item_max # 如果物品种类超过限制
  92.         Sound.play_buzzer
  93.         @over_window.visible = true
  94.         @item_window.help_window.visible = false
  95.       else
  96.         Sound.play_cancel
  97.         return_scene
  98.       end
  99.     elsif Input.trigger?(Input::C)
  100.       @item_window.help_window.visible = true
  101.       @over_window.visible = false
  102.       @item = @item_window.item
  103.       if @item != nil
  104.         $game_party.last_item_id = @item.id
  105.         Sound.play_decision
  106.           if $game_party.item_can_use?(@item)     # 物品是否可用
  107.             @command_window.draw_item(0,true)      
  108.           else  @command_window.draw_item(0,false) # 不可用的话【使用】选项颜色无效
  109.           end
  110.           if @item.price == 0                     # 物品价格是否为0   
  111.              @command_window.draw_item(1,false)    # 是的话【丢弃】选项无效
  112.           else  
  113.              @command_window.draw_item(1,true)
  114.           end
  115.              show_command_window
  116.        else
  117.          Sound.play_buzzer
  118.        end
  119.     end
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # ● 更新目标选择
  123.   #--------------------------------------------------------------------------
  124.   def update_target_selection
  125.     if Input.trigger?(Input::B)
  126.       Sound.play_cancel
  127.       if $game_party.item_number(@item) == 0    # 判断物品是否耗尽
  128.         @item_window.refresh                    # 刷新窗口内容      
  129.         @max_window.refresh                     # 刷新物品种类窗口
  130.       end
  131.       hide_target_window
  132.     elsif Input.trigger?(Input::C)
  133.       if not $game_party.item_can_use?(@item)
  134.         Sound.play_buzzer
  135.       else
  136.         determine_target
  137.       end
  138.     end
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ★ 更新指令选择
  142.   #--------------------------------------------------------------------------
  143.   def update_command_selection
  144.     if Input.trigger?(Input::B)
  145.       Sound.play_cancel
  146.       hide_command_window
  147.     elsif Input.trigger?(Input::C)
  148.       if @command_window.index == 0
  149.         if $game_party.item_can_use?(@item)
  150.           Sound.play_decision
  151.           @command_window.active = false
  152.           @command_window.visible =false
  153.           determine_item
  154.         else
  155.           Sound.play_buzzer
  156.         end
  157.       elsif  @item == nil or @item.price == 0
  158.         Sound.play_buzzer
  159.       else
  160.         Sound.play_decision
  161.         @command_window.active = false
  162.         @command_window.visible =false        
  163.         max = $game_party.item_number(@item)
  164.         @number_window.set(@item, max)
  165.         show_number_window
  166.       end
  167.     end
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ★ 更新数量输入
  171.   #--------------------------------------------------------------------------
  172.   def update_number_selection   
  173.     if Input.trigger?(Input::B)
  174.       Sound.play_cancel
  175.       hide_number_window
  176.     elsif Input.trigger?(Input::C)
  177.       Audio.se_play("Audio/SE/#{LOSE_ITEM_SE_NAME}", 80, 100)
  178.       $game_party.lose_item(@item, @number_window.number)
  179.       @item_window.refresh
  180.       @max_window.refresh  
  181.       hide_number_window
  182.     end  
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ★ 显示指令选择窗口
  186.   #--------------------------------------------------------------------------
  187.   def show_command_window
  188.     @command_window.index = 0
  189.     @item_window.active = false
  190.     @command_window.visible = true
  191.     @command_window.active = true
  192.   end
  193.   #--------------------------------------------------------------------------
  194.   # ★ 显示数量窗口
  195.   #--------------------------------------------------------------------------
  196.   def show_number_window
  197.     @command_window.active = false
  198.     @number_window.visible = true
  199.     @number_window.active = true
  200.   end
  201.   #--------------------------------------------------------------------------
  202.   # ★ 隐藏指令选择窗口
  203.   #--------------------------------------------------------------------------
  204.   def hide_command_window
  205.     @item_window.active = true
  206.     @command_window.visible = false
  207.     @command_window.active = false
  208.     @viewport.rect.set(0, 0, 544, 416)
  209.     @viewport.ox = 0
  210.   end
  211.   #--------------------------------------------------------------------------
  212.   # ★ 隐藏数量窗口
  213.   #--------------------------------------------------------------------------
  214.   def hide_number_window
  215.     @item_window.active = true
  216.     @number_window.visible = false
  217.     @number_window.active = false
  218.     @viewport.rect.set(0, 0, 544, 416)
  219.     @viewport.ox = 0
  220.   end  
  221. end
  222. #==============================================================================
  223. # ■ Window_lost_item  
  224. #------------------------------------------------------------------------------
  225. #  显示物品丢弃数量的窗口,仿 Window_ShopNumber。
  226. #==============================================================================

  227. class Window_LoseNumber < Window_Base
  228.   #--------------------------------------------------------------------------
  229.   # ★ 初始化对像
  230.   #     x      : 窗口 X 座标
  231.   #     y      : 窗口 Y 座标
  232.   #--------------------------------------------------------------------------
  233.   def initialize(x, y)
  234.     super(x, y, 260, 104)
  235.     @item = nil
  236.     @max = 1
  237.     @number = 1
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ★ 设置物品、最大数量
  241.   #--------------------------------------------------------------------------
  242.   def set(item, max)
  243.     @item = item
  244.     @max = max
  245.     @number = 1
  246.     refresh
  247.   end
  248.   #--------------------------------------------------------------------------
  249.   # ★ 设置数量输入
  250.   #--------------------------------------------------------------------------
  251.   def number
  252.     return @number
  253.   end
  254.   #--------------------------------------------------------------------------
  255.   # ★ 刷新
  256.   #--------------------------------------------------------------------------
  257.   def refresh
  258.     y = 24
  259.     self.contents.clear
  260.     draw_item_name(@item, 0, y)
  261.     self.contents.font.color = normal_color
  262.     self.contents.draw_text(164, y, 20, WLH, "×")
  263.     self.contents.draw_text(190, y, 20, WLH, @number, 2)
  264.     self.cursor_rect.set(186, y, 28, WLH)
  265.   end
  266.   #--------------------------------------------------------------------------
  267.   # ★ 更新画面
  268.   #--------------------------------------------------------------------------
  269.   def update
  270.     super
  271.     if self.active
  272.       last_number = @number
  273.       if Input.repeat?(Input::RIGHT) and @number < @max
  274.         @number += 1
  275.       end
  276.       if Input.repeat?(Input::LEFT) and @number > 1
  277.         @number -= 1
  278.       end
  279.       if Input.repeat?(Input::UP) and @number < @max
  280.         @number = [@number + 10, @max].min
  281.       end
  282.       if Input.repeat?(Input::DOWN) and @number > 1
  283.         @number = [@number - 10, 1].max
  284.       end
  285.       if @number != last_number
  286.         Sound.play_cursor
  287.         refresh
  288.       end
  289.     end
  290.   end
  291. end
  292. #==============================================================================
  293. # ■ Window_Item_Max
  294. #-----------------------------------------------------------------------------
  295. #   显示背包容量和当前物品数的窗口
  296. #============================================================================


  297. class Window_Item_Max < Window_Base
  298.   #--------------------------------------------------------------------------
  299.   # ★ 初始化对像
  300.   #--------------------------------------------------------------------------
  301.   def initialize
  302.     super(290, 360, 254, 56)
  303.     refresh
  304.   end
  305.   
  306.   #--------------------------------------------------------------------------
  307.   # ★ 刷新
  308.   #--------------------------------------------------------------------------  
  309.   def refresh
  310.     self.contents.clear
  311.     draw_icon(144, 0, 0)
  312.     self.contents.draw_text(36, 0, 100, 24, "背包容量:")
  313.     item = $game_party.items
  314.     string = item.size.to_s
  315.     item_max = $game_variables[ITEM_MAX_N]
  316.     item_max = 0 if item_max == nil
  317.     self.contents.font.color = knockout_color if item.size > item_max
  318.     self.contents.draw_text(135, 0, 30, 24, string, 2)
  319.     self.contents.font.color = normal_color
  320.     string = "/ " + item_max.to_s
  321.     self.contents.draw_text(173, 0, 100, 24, string )
  322.   end
  323.   
  324. end
复制代码
这是负重版,当物品超过限制时将在地图上显示超重信息并减速。在物品界面没有提示并且没有限制退出物品界面。
  1. #==============================================================================
  2. # ■ 物品丢弃 + 物品种类数限制 —— by 水镜风生
  3. #------------------------------------------------------------------------------
  4. LOSE_ITEM_SE_NAME = "Evasion"         # 丢弃物品时播放的SE
  5. LOW_SPEED = 2                         # 物品超重时的移动速度
  6. USUAL_SPEED = 4                      # 平时的移动速度
  7. ITEM_MAX_N = 12                      # 储存物品最大种类数的事件变量的编号

  8. #==============================================================================
  9. # ■ Scene_Item
  10. #------------------------------------------------------------------------------
  11. #  处理物品画面的类。
  12. #==============================================================================

  13. class Scene_Item < Scene_Base
  14.   #--------------------------------------------------------------------------
  15.   # ● 开始处理
  16.   #--------------------------------------------------------------------------
  17.   def start
  18.     super
  19.     create_menu_background
  20.     @viewport = Viewport.new(0, 0, 544, 416)
  21.     @help_window = Window_Help.new
  22.     @help_window.viewport = @viewport
  23.     @item_window = Window_Item.new(0, 67, 544, 280)
  24.     @item_window.viewport = @viewport
  25.     @item_window.help_window = @help_window
  26.     @item_window.active = false
  27.     @target_window = Window_MenuStatus.new(0, 0)
  28.     @max_window = Window_Item_Max.new
  29.     @max_window.viewport = @viewport
  30.     @number_window = Window_LoseNumber.new(142, 156)
  31.     @number_window.viewport = @viewport
  32.     @command_window = Window_Command.new(145, ["   使用","   丢弃"], 1, 2)
  33.     @command_window.x = 200
  34.     @command_window.y = 160
  35.     hide_command_window
  36.     hide_number_window
  37.     hide_target_window
  38.   end
  39.   #--------------------------------------------------------------------------
  40.   # ● 结束处理
  41.   #--------------------------------------------------------------------------
  42.   def terminate
  43.     super
  44.     dispose_menu_background
  45.     @viewport.dispose
  46.     @help_window.dispose
  47.     @item_window.dispose
  48.     @target_window.dispose
  49.     @max_window.dispose
  50.     @command_window.dispose
  51.     @number_window.dispose
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # ● 回到原画面
  55.   #--------------------------------------------------------------------------
  56.   def return_scene
  57.     $scene = Scene_Menu.new(0)
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # ● 更新画面
  61.   #--------------------------------------------------------------------------
  62.   def update
  63.     super
  64.     update_menu_background
  65.     @help_window.update
  66.     @item_window.update
  67.     @target_window.update
  68.     @max_window.update
  69.     @command_window.update
  70.     @number_window.update
  71.     if @item_window.active
  72.       update_item_selection
  73.     elsif @target_window.active
  74.       update_target_selection
  75.     elsif @command_window.active
  76.       update_command_selection
  77.     elsif @number_window.active
  78.       update_number_selection
  79.     end
  80.   end
  81.   #--------------------------------------------------------------------------
  82.   # ● 更新物品选择
  83.   #--------------------------------------------------------------------------
  84.   def update_item_selection
  85.     if Input.trigger?(Input::B)
  86.       item_max = $game_variables[ITEM_MAX_N]
  87.       item_max = 0 if item_max == nil
  88.       if  $game_party.items.size <= item_max # 如果物品种类没超过限制
  89.         $game_player.change_move_speed(USUAL_SPEED)
  90.       end
  91.         Sound.play_cancel
  92.         return_scene
  93.     elsif Input.trigger?(Input::C)
  94.       @item = @item_window.item
  95.       if @item != nil
  96.         $game_party.last_item_id = @item.id
  97.         Sound.play_decision
  98.           if $game_party.item_can_use?(@item)     # 物品是否可用
  99.             @command_window.draw_item(0,true)      
  100.           else  @command_window.draw_item(0,false) # 不可用的话【使用】选项颜色无效
  101.           end
  102.           if @item.price == 0                     # 物品价格是否为0   
  103.              @command_window.draw_item(1,false)    # 是的话【丢弃】选项无效
  104.           else  
  105.              @command_window.draw_item(1,true)
  106.           end
  107.              show_command_window
  108.        else
  109.          Sound.play_buzzer
  110.        end
  111.     end
  112.   end
  113.   #--------------------------------------------------------------------------
  114.   # ● 更新目标选择
  115.   #--------------------------------------------------------------------------
  116.   def update_target_selection
  117.     if Input.trigger?(Input::B)
  118.       Sound.play_cancel
  119.       if $game_party.item_number(@item) == 0    # 判断物品是否耗尽
  120.         @item_window.refresh                    # 刷新窗口内容      
  121.         @max_window.refresh                     # 刷新物品种类窗口
  122.       end
  123.       hide_target_window
  124.     elsif Input.trigger?(Input::C)
  125.       if not $game_party.item_can_use?(@item)
  126.         Sound.play_buzzer
  127.       else
  128.         determine_target
  129.       end
  130.     end
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ★ 更新指令选择
  134.   #--------------------------------------------------------------------------
  135.   def update_command_selection
  136.     if Input.trigger?(Input::B)
  137.       Sound.play_cancel
  138.       hide_command_window
  139.     elsif Input.trigger?(Input::C)
  140.       if @command_window.index == 0
  141.         if $game_party.item_can_use?(@item)
  142.           Sound.play_decision
  143.           @command_window.active = false
  144.           @command_window.visible =false
  145.           determine_item
  146.         else
  147.           Sound.play_buzzer
  148.         end
  149.       elsif  @item == nil or @item.price == 0
  150.         Sound.play_buzzer
  151.       else
  152.         Sound.play_decision
  153.         @command_window.active = false
  154.         @command_window.visible =false        
  155.         max = $game_party.item_number(@item)
  156.         @number_window.set(@item, max)
  157.         show_number_window
  158.       end
  159.     end
  160.   end
  161.   #--------------------------------------------------------------------------
  162.   # ★ 更新数量输入
  163.   #--------------------------------------------------------------------------
  164.   def update_number_selection   
  165.     if Input.trigger?(Input::B)
  166.       Sound.play_cancel
  167.       hide_number_window
  168.     elsif Input.trigger?(Input::C)
  169.       Audio.se_play("Audio/SE/#{LOSE_ITEM_SE_NAME}", 80, 100)
  170.       $game_party.lose_item(@item, @number_window.number)
  171.       @item_window.refresh
  172.       @max_window.refresh  
  173.       hide_number_window
  174.     end  
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ★ 显示指令选择窗口
  178.   #--------------------------------------------------------------------------
  179.   def show_command_window
  180.     @command_window.index = 0
  181.     @item_window.active = false
  182.     @command_window.visible = true
  183.     @command_window.active = true
  184.   end
  185.   #--------------------------------------------------------------------------
  186.   # ★ 显示数量窗口
  187.   #--------------------------------------------------------------------------
  188.   def show_number_window
  189.     @command_window.active = false
  190.     @number_window.visible = true
  191.     @number_window.active = true
  192.   end
  193.   #--------------------------------------------------------------------------
  194.   # ★ 隐藏指令选择窗口
  195.   #--------------------------------------------------------------------------
  196.   def hide_command_window
  197.     @item_window.active = true
  198.     @command_window.visible = false
  199.     @command_window.active = false
  200.     @viewport.rect.set(0, 0, 544, 416)
  201.     @viewport.ox = 0
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ★ 隐藏数量窗口
  205.   #--------------------------------------------------------------------------
  206.   def hide_number_window
  207.     @item_window.active = true
  208.     @number_window.visible = false
  209.     @number_window.active = false
  210.     @viewport.rect.set(0, 0, 544, 416)
  211.     @viewport.ox = 0
  212.   end  
  213. end
  214. #==============================================================================
  215. # ■ Window_lost_item  
  216. #------------------------------------------------------------------------------
  217. #  显示物品丢弃数量的窗口,仿 Window_ShopNumber。
  218. #==============================================================================

  219. class Window_LoseNumber < Window_Base
  220.   #--------------------------------------------------------------------------
  221.   # ★ 初始化对像
  222.   #     x      : 窗口 X 座标
  223.   #     y      : 窗口 Y 座标
  224.   #--------------------------------------------------------------------------
  225.   def initialize(x, y)
  226.     super(x, y, 260, 104)
  227.     @item = nil
  228.     @max = 1
  229.     @number = 1
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # ★ 设置物品、最大数量
  233.   #--------------------------------------------------------------------------
  234.   def set(item, max)
  235.     @item = item
  236.     @max = max
  237.     @number = 1
  238.     refresh
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ★ 设置数量输入
  242.   #--------------------------------------------------------------------------
  243.   def number
  244.     return @number
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ★ 刷新
  248.   #--------------------------------------------------------------------------
  249.   def refresh
  250.     y = 24
  251.     self.contents.clear
  252.     draw_item_name(@item, 0, y)
  253.     self.contents.font.color = normal_color
  254.     self.contents.draw_text(164, y, 20, WLH, "×")
  255.     self.contents.draw_text(190, y, 20, WLH, @number, 2)
  256.     self.cursor_rect.set(186, y, 28, WLH)
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ★ 更新画面
  260.   #--------------------------------------------------------------------------
  261.   def update
  262.     super
  263.     if self.active
  264.       last_number = @number
  265.       if Input.repeat?(Input::RIGHT) and @number < @max
  266.         @number += 1
  267.       end
  268.       if Input.repeat?(Input::LEFT) and @number > 1
  269.         @number -= 1
  270.       end
  271.       if Input.repeat?(Input::UP) and @number < @max
  272.         @number = [@number + 10, @max].min
  273.       end
  274.       if Input.repeat?(Input::DOWN) and @number > 1
  275.         @number = [@number - 10, 1].max
  276.       end
  277.       if @number != last_number
  278.         Sound.play_cursor
  279.         refresh
  280.       end
  281.     end
  282.   end
  283. end
  284. #==============================================================================
  285. # ■ Window_Item_Max
  286. #-----------------------------------------------------------------------------
  287. #   显示背包容量和当前物品数的窗口
  288. #============================================================================


  289. class Window_Item_Max < Window_Base
  290.   #--------------------------------------------------------------------------
  291.   # ★ 初始化对像
  292.   #--------------------------------------------------------------------------
  293.   def initialize
  294.     super(290, 360, 254, 56)
  295.     refresh
  296.   end
  297.   
  298.   #--------------------------------------------------------------------------
  299.   # ★ 刷新
  300.   #--------------------------------------------------------------------------  
  301.   def refresh
  302.     self.contents.clear
  303.     draw_icon(144, 0, 0)
  304.     self.contents.draw_text(36, 0, 100, 24, "背包容量:")
  305.     item = $game_party.items
  306.     string = item.size.to_s
  307.     item_max = $game_variables[ITEM_MAX_N]
  308.     item_max = 0 if item_max == nil
  309.     self.contents.font.color = knockout_color if item.size > item_max
  310.     self.contents.draw_text(135, 0, 30, 24, string, 2)
  311.     self.contents.font.color = normal_color
  312.     string = "/ " + item_max.to_s
  313.     self.contents.draw_text(173, 0, 100, 24, string )
  314.   end
  315. end
  316. #==============================================================================
  317. # ■ Window_Waring
  318. #-----------------------------------------------------------------------------
  319. #   显示超重警告的窗口
  320. #============================================================================
  321. class Window_Waring  < Window_Base
  322.   def initialize
  323.     super(544 - 180, 416 - 56, 180, 56)
  324.     refresh
  325.   end
  326.   
  327.   def refresh
  328.     self.contents.clear
  329.     self.contents.draw_text(0, -4, 150, 32, "你已经超重了。")
  330.   end
  331. end
  332. #==============================================================================
  333. # Game_Player 添加更改移动速度的方法
  334. #============================================================================
  335. class Game_Player   
  336.   def change_move_speed(n)
  337.     @move_speed = n
  338.   end
  339. end

  340. #==============================================================================
  341. # Scene_Map  添加在地图上显示警告窗口的处理
  342. #============================================================================
  343. class Scene_Map
  344.   #--------------------------------------------------------------------------
  345.   # ● 开始处理
  346.   #--------------------------------------------------------------------------
  347.   def start
  348.     super
  349.     $game_map.refresh
  350.     @spriteset = Spriteset_Map.new
  351.     @message_window = Window_Message.new
  352.     @waring_window = Window_Waring.new
  353.     @waring_window.visible = false
  354.   end  
  355.   #--------------------------------------------------------------------------
  356.   # ● 结束处理
  357.   #--------------------------------------------------------------------------
  358.   def terminate
  359.     super
  360.     if $scene.is_a?(Scene_Battle)     # 正在切换战斗画面的情况下
  361.       @spriteset.dispose_characters   # 为了生成背景隐藏角色
  362.     end
  363.     snapshot_for_background
  364.     @spriteset.dispose
  365.     @message_window.dispose
  366.     @waring_window.dispose
  367.     if $scene.is_a?(Scene_Battle)     # 正在切换战斗画面的情况下
  368.       perform_battle_transition       # 执行战斗前变换
  369.     end
  370.   end
  371.   #--------------------------------------------------------------------------
  372.   # ● フレーム更新
  373.   #--------------------------------------------------------------------------
  374.   def update
  375.     super
  376.     $game_map.interpreter.update      # 更新解释器
  377.     $game_map.update                  # 更新滴入
  378.     $game_player.update               # 更新玩家
  379.     $game_system.update               # 更新计时器
  380.     @spriteset.update                 # 更新活动块元件
  381.     @message_window.update            # 更新消息窗口
  382.     unless $game_message.visible      # 正在显示消息以外的情况
  383.       update_transfer_player
  384.       update_encounter
  385.       update_call_menu
  386.       update_call_debug
  387.       update_scene_change
  388.       update_over_item
  389.     end
  390.   end
  391.   #--------------------------------------------------------------------------
  392.   # ● 更新物品超限判定
  393.   #--------------------------------------------------------------------------  
  394.   def update_over_item
  395.     item_max = $game_variables[ITEM_MAX_N]
  396.     item_max = 0 if item_max == nil
  397.     if $game_party.items.size > item_max
  398.       @waring_window.visible = true
  399.       $game_player.change_move_speed(LOW_SPEED)
  400.     else
  401.       @waring_window.visible = false
  402.     end
  403.   end
  404. end
复制代码

此贴于 2008-12-19 23:27:14 被版主66RPG发布员提醒,请楼主看到后对本贴做出回应。

嗯,不能浪费签名了,打广告。本人的悲剧作品:
坑化游戏《龙之影》      R剧《星空》     小游戏《剑与拳头》

Lv3.寻梦者 (暗夜天使)

名侦探小柯

梦石
0
星屑
3263
在线时间
3616 小时
注册时间
2006-9-6
帖子
37399

开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

2
发表于 2008-8-10 05:48:35 | 只看该作者
满好的。
其实我觉得要是像网游那样能有的格子数全部显示出来就好了。
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
46
在线时间
10 小时
注册时间
2007-5-27
帖子
2558

第1届Title华丽大赛新人奖

3
发表于 2008-8-10 06:11:18 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

忆颐

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-4-26
帖子
2048
4
发表于 2008-8-18 14:00:56 | 只看该作者
收下了。LZ辛苦了。
我已经没有当时刚来6R时的那种激情了啊。
看来6R中的人又变了一轮,让我很陌生。
当时我只是路过,什么都没留下。
因为记得我的人已经不多了吧。
http://hi.baidu.com/fantasylen
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-9-3
帖子
67
5
发表于 2008-8-31 04:17:25 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-8-29
帖子
13
6
发表于 2008-9-1 20:43:29 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-9-3
帖子
67
7
发表于 2008-9-23 04:03:02 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-1-17
帖子
104
8
发表于 2008-11-14 10:16:15 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
112 小时
注册时间
2008-12-9
帖子
166
9
发表于 2008-12-18 05:45:26 | 只看该作者
是的,我就是在没有物品的时候点了下就错误了!!希望LZ纠正!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
138 小时
注册时间
2008-11-28
帖子
73
10
发表于 2008-12-18 23:11:43 | 只看该作者
這個貌似跟物品分类起衝突啊
放上面沒反應,放下面點物品菜單會error
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-24 19:05

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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