Arkadious
Developer of Fragmentum
- 50
- Posts
- 9
- Years
- Age 27
- New Zealand
- Seen Apr 30, 2021
Hi everyone,
I'm trying to make a move variant of spike which, when a pokemon enters the battlefield, instead of taking damage or being poisoned, becomes paralyzed instead. I'm using Essentials 17.1
The code for the move is here:
and the code for the part in PokeBattle_Battle is here:
However, when I use the move, and when an opponent sends out a Pokemon after it faints, I get two errors:
What exactly have I done wrong, and how can I fix it. Any help is appreciated. Thanks.
I'm trying to make a move variant of spike which, when a pokemon enters the battlefield, instead of taking damage or being poisoned, becomes paralyzed instead. I'm using Essentials 17.1
The code for the move is here:
Code:
################################################################################
# Entry hazard. Lays poison spikes on the opposing side (max. 1 layer).
# (Charged Spikes)
################################################################################
class PokeBattle_Move_160 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.pbOpposingSide.effects[PBEffects::ChargedSpikes]>=1
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
attacker.pbOpposingSide.effects[PBEffects::ChargedSpikes]=true
if [email protected]?(attacker.index)
@battle.pbDisplay(_INTL("Charged spikes were scattered all around the opposing team's feet!"))
else
@battle.pbDisplay(_INTL("Charged spikes were scattered all around your team's feet!"))
end
return 0
end
end
and the code for the part in PokeBattle_Battle is here:
Code:
# Charged Spikes
if pkmn.OwnSide.effects[PBEffects::ChargedSpikes] && !pkmn.isFainted?
if !pkmn.isAirborne?(moldbreaker)
if pkmn.pbCanParalyze?(moldbreaker)
PBDebug.log("[Entry hazard] #{pkmn.pbThis} triggered Charged Spikes")
pkmn.pbParalyze(nil,_INTL("{1} was paralyzed by the charged spikes!",pkmn.pbThis))
end
end
end
However, when I use the move, and when an opponent sends out a Pokemon after it faints, I get two errors:
Code:
Exception: NoMethodError
Message: undefined method `>=' for false:FalseClass
PokeBattle_MoveEffects:1751:in `pbEffect'
PokeBattle_Battler:3146:in `pbUseMove'
PokeBattle_Battler:3145:in `logonerr'
PokeBattle_Battler:3145:in `pbUseMove'
PokeBattle_Battler:3378:in `pbProcessTurn'
PokeBattle_Battler:3377:in `logonerr'
PokeBattle_Battler:3377:in `pbProcessTurn'
PokeBattle_Battle:2838:in `pbAttackPhase'
PokeBattle_Battle:2835:in `each'
PokeBattle_Battle:2835:in `pbAttackPhase'
Exception: NoMethodError
Message: undefined method `OwnSide' for # PokeBattle_Battler:0xcf145d8
PokeBattle_Battle:2155:in `pbOnActiveOne'
PokeBattle_Battle:1332:in `pbRecallAndReplace'
PokeBattle_Battle:1259:in `pbSwitch'
PokeBattle_Battle:1230:in `each'
PokeBattle_Battle:1230:in `pbSwitch'
PokeBattle_Battle:3862:in `__clauses__pbEndOfRoundPhase'
PokeBattle_Clauses:42:in `pbEndOfRoundPhase'
PokeBattle_Battle:2545:in `pbStartBattleCore'
PokeBattle_Battle:2544:in `logonerr'
PokeBattle_Battle:2544:in `pbStartBattleCore'
What exactly have I done wrong, and how can I fix it. Any help is appreciated. Thanks.
Last edited: