赞 | 0 |
VIP | 3 |
好人卡 | 7 |
积分 | 7 |
经验 | 34794 |
最后登录 | 2024-2-21 |
在线时间 | 684 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 719
- 在线时间
- 684 小时
- 注册时间
- 2009-5-29
- 帖子
- 461
|
8楼
楼主 |
发表于 2010-10-14 20:51:08
|
只看该作者
- class Game_Troop < Game_Unit
- #--------------------------------------------------------------------------
- # ● ドロップアイテムの配列作成
- #--------------------------------------------------------------------------
- alias make_drop_items_KGC_ExtraDropItem make_drop_items
- def make_drop_items
- drop_items = make_drop_items_KGC_ExtraDropItem
- drop_count = 0
- drop_piece = 0
- drop_make = 0
- drop_price = 0
- dead_members.each { |enemy|
- enemy.extra_drop_items.each_with_index { |di, i|
- drop_count += i
- next if di.kind == 0
- #判断掉落件数
- if drop_count <= 100
- drop_piece = drop_count > rand(100)? 1:0
- elsif drop_count <= 200
- drop_piece = drop_count > rand(200)? 2:1
- else
- drop_piece = drop_count > rand(300)? 3:2
- end
- #根据件数判断物品
- case drop_piece
- when 0
- return
- when 1
- drop_price = rand(100)
- enemy.extra_drop_items.each_with_index { |di, i|
- drop_make += i
- next if drop_make < drop_price
- if di.kind == 1
- drop_items.push($data_items[di.item_id])
- elsif di.kind == 2
- drop_items.push($data_weapons[di.weapon_id])
- elsif di.kind == 3
- drop_items.push($data_armors[di.armor_id])
- end
- }
- when 2
- for a in 1..2
- drop_price = rand(200)
- enemy.extra_drop_items.each_with_index { |di, i|
- drop_make += i
- next if drop_make < drop_price
- if di.kind == 1
- drop_items.push($data_items[di.item_id])
- elsif di.kind == 2
- drop_items.push($data_weapons[di.weapon_id])
- elsif di.kind == 3
- drop_items.push($data_armors[di.armor_id])
- end
- }
- next
- end
- when 3
- for a in 1..3
- drop_price = rand(300)
- enemy.extra_drop_items.each_with_index { |di, i|
- drop_make += i
- next if drop_make < drop_price
- if di.kind == 1
- drop_items.push($data_items[di.item_id])
- elsif di.kind == 2
- drop_items.push($data_weapons[di.weapon_id])
- elsif di.kind == 3
- drop_items.push($data_armors[di.armor_id])
- end
- }
- next
- end
- end
- if $imported["EnemyGuide"]
- KGC::Commands.set_enemy_item_dropped(enemy.enemy.id, i + 2)
- end
- }
- }
- return drop_items
- end
- end
复制代码 我照着改了一下,然后出现 未定义 each 方法,请各位大师指点一下要怎么修改。。 |
|