Hi everyone!
I'm new to Essentials and i am still trying to learn some basics.
I am trying to write an ability that does:
-increase defense by one upon entering into battle.
-set the [PBEffects::DefenseCurl] to true
In practice: the pokemon casts defense curl upon switching in. (useful for pokémon with rollout or ice ball like Spheal evolution line).
The code is the following:
# Iron Curl
if self.hasWorkingAbility(:IRONCURL) && onactive
self.effects[PBEffects::DefenseCurl]=true
if pbIncreaseStatWithCause(PBStats::DEFENSE,1,self,PBAbilities.getName(ability))
PBDebug.log("[Ability triggered] #{pbThis}'s Iron curl raises Defense")
end
end
The increase of defense works fine (at least the animation works, i am not sure if the defense really grows). BUT the defense curl doesn't seem to work!
I really don't know why.. Anyone got an idea?
I'm new to Essentials and i am still trying to learn some basics.
I am trying to write an ability that does:
-increase defense by one upon entering into battle.
-set the [PBEffects::DefenseCurl] to true
In practice: the pokemon casts defense curl upon switching in. (useful for pokémon with rollout or ice ball like Spheal evolution line).
The code is the following:
# Iron Curl
if self.hasWorkingAbility(:IRONCURL) && onactive
self.effects[PBEffects::DefenseCurl]=true
if pbIncreaseStatWithCause(PBStats::DEFENSE,1,self,PBAbilities.getName(ability))
PBDebug.log("[Ability triggered] #{pbThis}'s Iron curl raises Defense")
end
end
The increase of defense works fine (at least the animation works, i am not sure if the defense really grows). BUT the defense curl doesn't seem to work!
I really don't know why.. Anyone got an idea?
Last edited: