def drop_condition?
return false unless drop_notes
$game_troop.troop_id == drop_notes[0].to_i
end
alias exp_for_custom exp
def exp
drop_condition? ? custom_exp : exp_for_custom
end
def custom_exp
drop_notes[1] =~ CUSTOM_EXP_REG ? $1.to_i : exp_for_custom
end
alias gold_for_custom gold
def gold
drop_condition? ? custom_gold : gold_for_custom
end
def custom_gold
drop_notes[1] =~ CUSTOM_GOLD_REG ? $1.to_i : gold_for_custom
end
alias drop_items_for_custom drop_items
def drop_items
drop_condition? ? custom_drop_items : drop_items_for_custom
end
def custom_drop_items
droping_items = drop_notes[1].scan(CUSTOM_ITEM_REG)
return drop_items_for_custom if droping_items.empty?
droping_items.inject([]) do |r,s|
item = RPG::Enemy::DropItem.new
if s =~ /物品|item/ then item.kind = 1
elsif s =~ /武器|weapon/ then item.kind = 2
elsif s =~ /防具|armor/ then item.kind = 3
end
item.data_id = $1.to_i if s =~ /(\d+)/
item.denominator = $1.to_i if s =~ /\((\d+)\)/
r << item
end
end