赞 | 0 |
VIP | 6 |
好人卡 | 0 |
积分 | 1 |
经验 | 3055 |
最后登录 | 2013-11-18 |
在线时间 | 5 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 5 小时
- 注册时间
- 2008-4-22
- 帖子
- 34
|
刚写好...先用用, 基本上和刚刚构想的差不多, 改了五行左右. 写了我一个半小时...看来还是要多练习...{/ll}
- #==============================================================================
- # 作者: westbugs
- #------------------------------------------------------------------------------
- # 回应yangli2005
- #
- # 按物品种类限制数量的修改方法.
- # 例: 只许带三瓶药品的情况下
- # 药品 = {"A","B","C","D"}
- # 组合任挑
- #==============================================================================
- class Game_Party < Game_Unit
-
- #--------------------------------------------------------------------------
- # ● 增加物品(减少)
- # item : 物品
- # n : 个数
- # include_equip : 包括装备
- #--------------------------------------------------------------------------
- def gain_item(item, n, include_equip = false)
- number = item_number(item)
- case item
- when RPG::Item
- @items[item.id] = [[number + n, 0].max, 99].min
- when RPG::Weapon
- @weapons[item.id] = [[number + n, 0].max, 99].min
- when RPG::Armor
- @armors[item.id] = [[number + n, 0].max, 99].min
- end
- n += number
- if include_equip and n < 0
- for actor in members
- while n < 0 and actor.equips.include?(item)
- actor.discard_equip(item)
- n += 1
- end
- end
- end
- #插入处, 道具种类 = {"1","2","3","4"}
- temp = $game_party.item_no(1) + $game_party.item_no(2) + $game_party.item_no(3) + $game_party.item_no(4)
- if temp >3
- $game_party.lose_item(item,1)
- end
- #插入处, 道具种类 = {"1","2","3","4"}
- end
- end
- class Game_Party < Game_Unit
- def item_no(n)
- return item_number($data_items[n])
- end
- end
复制代码
改中间描述那一段就好了 |
|