- 55
- Posts
- 11
- Years
- Seen Jun 12, 2018
Hello pokecommunity!
I'm trying to add some of the new games features into my project.
I managed to add:
-MegaEvolutions.
-Grass inmunity to Spore, StunSpore, SleepPowder and PoisonPowder.
-Electric inmunity to be paralized.
-The ability Pixilate.
-Sylveon and its evolution method.
-Some fairy type moves.
And more, but I'm having problem making sound based moves bypass substitute, can someone give me a hand?
I know this code checks if the move has the sound flag.
And I know this code handles the damage taken by the substitute
Greetings!
I'm trying to add some of the new games features into my project.
I managed to add:
-MegaEvolutions.
-Grass inmunity to Spore, StunSpore, SleepPowder and PoisonPowder.
-Electric inmunity to be paralized.
-The ability Pixilate.
-Sylveon and its evolution method.
-Some fairy type moves.
And more, but I'm having problem making sound based moves bypass substitute, can someone give me a hand?
I know this code checks if the move has the sound flag.
Code:
(thismove.flags&0x400)!=0 && # flag k: Is sound-based move
Code:
def pbReduceHPDamage(damage,attacker,opponent)
endure=false
if opponent.effects[PBEffects::Substitute]>0 && (!attacker || attacker.index!=opponent.index)
damage=opponent.effects[PBEffects::Substitute] if damage>opponent.effects[PBEffects::Substitute]
opponent.effects[PBEffects::Substitute]-=damage
opponent.damagestate.substitute=true
@battle.scene.pbDamageAnimation(opponent,0)
@battle.pbDisplayPaused(_INTL("The substitute took damage for {1}!",opponent.name))
if opponent.effects[PBEffects::Substitute]<=0
opponent.effects[PBEffects::Substitute]=0
@battle.pbDisplayPaused(_INTL("{1}'s substitute faded!",opponent.name))
end
opponent.damagestate.hplost=damage
damage=0
(...)
Greetings!