sonicfan7895
Just a dude, I guess
- 120
- Posts
- 14
- Years
- He/Him/His
- Akala Island, Alola
- Seen Feb 22, 2025
So I've been having a problem with this particular move that I'm creating for a game with my team... and one of the new custom moves we have planned is a move a lot like Mat Block or King's Shield, but on contact it's supposed to raise the user's Special Defense by one stage, kind of like how King's Shield lowers an attacker's Attack by two stages upon contact.
If it helps, I will provide all codes relating to this move. I will be going down the line in the Scripts. Keep in mind all of these scripts are in my current game, so the lines will differ from the vanilla Essentials 16.2.
Firstly, in PokeBattle_ActiveSideField (lines 5-7):
This is for the script in PokeBattle_Battler and PokeBattle_MoveEffects so those two have somewhere to point to in regards to similarity with Mat Block's code.
Secondy, in PokeBattle_Battler (lines 2373-2382):
This is the actual code that my effect in PokeBattle_MoveEffects (listed below) is being pointed to. My intention is for the Special Defense of the user to rise by one stage upon contact of the wall.
Lastly, in PokeBattle_MoveEffects (lines 9709-9720):
This is the actual effect that Blue Eagle (the move name) is using.
If you could give me any pointers on what to do, that would be fantastic.
Thank you very much for any help you can provide!
If it helps, I will provide all codes relating to this move. I will be going down the line in the Scripts. Keep in mind all of these scripts are in my current game, so the lines will differ from the vanilla Essentials 16.2.
Firstly, in PokeBattle_ActiveSideField (lines 5-7):
Code:
def initialize
@effects = []
@effects[PBEffects::BlueEagle] = false
Secondy, in PokeBattle_Battler (lines 2373-2382):
Code:
if target.pbOwnSide.effects[PBEffects::BlueEagle] && !thismove.pbIsStatus? &&
thismove.canProtectAgainst? && !target.effects[PBEffects::ProtectNegation]
@battle.pbDisplay(_INTL("{1} was blocked by the water wall!",thismove.name))
@battle.successStates[user.index].protected=true
PBDebug.log("[Move failed] #{target.pbThis}'s Blue Eagle wall stopped the attack")
[I][COLOR="Red"]if thismove.isContactMove?
attacker.pbIncreaseStat(PBStats::SPDEF,1,nil,false) <---------- Important part
end[/COLOR][/I]
return false
end
Lastly, in PokeBattle_MoveEffects (lines 9709-9720):
Code:
class PokeBattle_Move_163 < PokeBattle_Move
def pbMoveFailed(attacker,opponent)
return (attacker.turncount>1)
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
attacker.pbOwnSide.effects[PBEffects::BlueEagle]=true
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
@battle.pbDisplay(_INTL("{1} intends to raise a wall and block incoming attacks!",attacker.pbThis))
return 0
end
end
If you could give me any pointers on what to do, that would be fantastic.
Thank you very much for any help you can provide!
Last edited: