Implemented usage of GameData::Item

This commit is contained in:
Maruno17
2020-11-08 22:45:59 +00:00
parent ff70791104
commit 1955d3698e
82 changed files with 1986 additions and 2195 deletions

View File

@@ -338,9 +338,10 @@ class PokemonEncounters
end
firstPkmn = $Trainer.firstPokemon
if firstPkmn
if firstPkmn.hasItem?(:CLEANSETAG)
case firstPkmn.item_id
when :CLEANSETAG
encount *= 2.0 / 3
elsif firstPkmn.hasItem?(:PUREINCENSE)
when :PUREINCENSE
encount *= 2.0 / 3
else # Ignore ability effects if an item effect applies
case firstPkmn.ability_id
@@ -411,7 +412,7 @@ def pbGenerateWildPokemon(species,level,isRoamer=false)
genwildpoke.setItem(items[2])
end
# Shiny Charm makes shiny Pokémon more likely to generate
if hasConst?(PBItems,:SHINYCHARM) && $PokemonBag.pbHasItem?(:SHINYCHARM)
if GameData::Item.exists?(:SHINYCHARM) && $PokemonBag.pbHasItem?(:SHINYCHARM)
2.times do # 3 times as likely
break if genwildpoke.shiny?
genwildpoke.personalID = rand(65536)|(rand(65536)<<16)