- 32
- Posts
- 7
- Years
- Far, far away
- Seen May 1, 2023
Hello!
I've already managed to create an ability called "Wonder Mirror" for Cryogonal. Normally, Cryogonal is weak to Fire/Rock/Steel/Fighting due to its ice type. With "Wonder Mirror", however, it resists these types and is only weak to ice.
This is the code I put in PokéBattle_Move
if opponent.hasWorkingAbility(:WONDERMIRROR)
inmod1=mod1
inmod2=mod2
inmod3=mod3
mod1=4 if inmod1<2
mod1=1 if inmod1>2
mod2=4 if inmod2<2
mod2=1 if inmod2>2
mod3=4 if inmod3<2
mod3=1 if inmod3>2
end
Now, my problem is that despite its new ability, it still takes "effective" damage from Stealth Rock. I know that I probably have to add or change something in PokéBattle_Battle. I looked at Stealth Rock and noticed that it would take into account four aspects:
eff=PBTypes.getCombinedEffectiveness(atype,pkmn.type1,pkmn.type2,pkmn.effects[PBEffects::Type3])
I tried to include the custom ability, but I still get the following message and don't know how to make the ability work for Stealth Rock.
Message: wrong number of arguments(5 for 4)
PokeBattle_Battle:2127:in `getCombinedEffectiveness'
PokeBattle_Battle:2127:in `pbOnActiveOne'
PokeBattle_Battle:1332:in `pbRecallAndReplace'
PokeBattle_Battle:1259:in `pbSwitch'
PokeBattle_Battle:1230:in `each'
PokeBattle_Battle:1230:in `pbSwitch'
PokeBattle_Battle:3969:in `__clauses__pbEndOfRoundPhase'
PokeBattle_Clauses:42:in `pbEndOfRoundPhase'
PokeBattle_Battle:2584:in `pbStartBattleCore'
PokeBattle_Battle:2583:in `logonerr'
I've already managed to create an ability called "Wonder Mirror" for Cryogonal. Normally, Cryogonal is weak to Fire/Rock/Steel/Fighting due to its ice type. With "Wonder Mirror", however, it resists these types and is only weak to ice.
This is the code I put in PokéBattle_Move
Spoiler:
if opponent.hasWorkingAbility(:WONDERMIRROR)
inmod1=mod1
inmod2=mod2
inmod3=mod3
mod1=4 if inmod1<2
mod1=1 if inmod1>2
mod2=4 if inmod2<2
mod2=1 if inmod2>2
mod3=4 if inmod3<2
mod3=1 if inmod3>2
end
Now, my problem is that despite its new ability, it still takes "effective" damage from Stealth Rock. I know that I probably have to add or change something in PokéBattle_Battle. I looked at Stealth Rock and noticed that it would take into account four aspects:
Spoiler:
eff=PBTypes.getCombinedEffectiveness(atype,pkmn.type1,pkmn.type2,pkmn.effects[PBEffects::Type3])
I tried to include the custom ability, but I still get the following message and don't know how to make the ability work for Stealth Rock.
Spoiler:
Message: wrong number of arguments(5 for 4)
PokeBattle_Battle:2127:in `getCombinedEffectiveness'
PokeBattle_Battle:2127:in `pbOnActiveOne'
PokeBattle_Battle:1332:in `pbRecallAndReplace'
PokeBattle_Battle:1259:in `pbSwitch'
PokeBattle_Battle:1230:in `each'
PokeBattle_Battle:1230:in `pbSwitch'
PokeBattle_Battle:3969:in `__clauses__pbEndOfRoundPhase'
PokeBattle_Clauses:42:in `pbEndOfRoundPhase'
PokeBattle_Battle:2584:in `pbStartBattleCore'
PokeBattle_Battle:2583:in `logonerr'
Last edited: