Revamped classes Pokemon, PBMove and PokemonMail

This commit is contained in:
Maruno17
2021-01-21 23:04:51 +00:00
parent 94ce80c183
commit 8a89ef1220
40 changed files with 1016 additions and 1038 deletions

View File

@@ -686,17 +686,16 @@ def pbPickup(pkmn)
chances.each_with_index do |c,i|
cumul += c
next if rnd>=cumul
pkmn.setItem(items[i])
pkmn.item = items[i]
break
end
end
# Try to gain a Honey item after a battle if a Pokemon has the ability Honey Gather.
def pbHoneyGather(pkmn)
return if pkmn.egg? || !pkmn.hasAbility?(:HONEYGATHER)
return if pkmn.hasItem?
return if !GameData::Item.exists?(:HONEY)
chance = 5+((pkmn.level-1)/10)*5
return unless rand(100)<chance
pkmn.setItem(:HONEY)
return if pkmn.egg? || !pkmn.hasAbility?(:HONEYGATHER) || pkmn.hasItem?
chance = 5 + ((pkmn.level - 1) / 10) * 5
return unless rand(100) < chance
pkmn.item = :HONEY
end