- 59
- Posts
- 9
- Years
- Seen Aug 9, 2020
I've succesfully implemented an option in EncounterModifiers so that unlocking X switch, in my example, badges, will increase the Wild mon's levels. Cool. My issue starts when I try to do the same under PokeBattle_Battler.
I changed def pbUpdate and it worked (adding rand5 to the Pokémon levels) but that also increased the level of the Player's Pokémon.
I tried changing def pbInitPokemon(pkmn,pkmnIndex) and def pbInitBlank (if $game_switches[11] etc) but those did not work at all. Yeah, the switch is turned on.
Can someone with more experience guide me? The best way to go around this would be separating player and enemy Pokémon levels as separate variables, but that seems extremely tedious and out of my reach.
I changed def pbUpdate and it worked (adding rand5 to the Pokémon levels) but that also increased the level of the Player's Pokémon.
Code:
def pbUpdate(fullchange=false)
if @pokemon
@pokemon.calcStats
if $game_switches[11]
@level = @pokemon.level + rand(5)
else
@level = @pokemon.level
end
@hp = @pokemon.hp
@totalhp = @pokemon.totalhp
if !@effects[PBEffects::Transform]
@attack = @pokemon.attack
@defense = @pokemon.defense
@speed = @pokemon.speed
@spatk = @pokemon.spatk
@spdef = @pokemon.spdef
if fullchange
@ability = @pokemon.ability
@type1 = @pokemon.type1
@type2 = @pokemon.type2
end
I tried changing def pbInitPokemon(pkmn,pkmnIndex) and def pbInitBlank (if $game_switches[11] etc) but those did not work at all. Yeah, the switch is turned on.
Code:
def pbInitPokemon(pkmn,pkmnIndex)
if pkmn.egg?
raise _INTL("An EGG can't be an active POKéMON")
end
@name = pkmn.name
@species = pkmn.species
if $game_switches[11]
@level = pkmn.level + 20
else @level = pkmn.level
end
(...)
end
def pbInitBlank
@name = ""
@species = 0
if $game_switches[11]
@level = 0 + 20
else
@level = 0
end
(...)
end
Can someone with more experience guide me? The best way to go around this would be separating player and enemy Pokémon levels as separate variables, but that seems extremely tedious and out of my reach.