self.note.split(/[\r\n]+/).each { |line|
case line
when KGC::ExtraDropItem::Regexp::Enemy::DROP_ITEM
# 掉落物品
item = RPG::Enemy::DropItem.new
case $1.upcase
when "I" # 物品
item.kind = 1
item.item_id = $2.to_i
when "W" # 武器
item.kind = 2
item.weapon_id = $2.to_i
when "A" # 防具
item.kind = 3
item.armor_id = $2.to_i
else
next
end
# 掉落率
if $4 != nil
item.drop_prob = $3.to_i
else
item.denominator = $3.to_i
end
@__extra_drop_items << item
end
}
end
#--------------------------------------------------------------------------
# ○ 扩张掉落物品
#--------------------------------------------------------------------------
def extra_drop_items
create_extra_drop_item_cache if @__extra_drop_items == nil
return @__extra_drop_items
end
end
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ○ 扩张掉落物品的取得
#--------------------------------------------------------------------------
def extra_drop_items
return enemy.extra_drop_items
end
end
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
for enemy in dead_members
for di in enemy.extra_drop_items
next if di.kind == 0
if di.drop_prob > 0
# 概率指定
next if di.drop_prob < rand(100)
else
# 分母指定
next if rand(di.denominator) != 0
end
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
end
end
return drop_items
end
end