• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Is it possible to have Stance Change work?

1,224
Posts
10
Years
After I put all his codes in nothing happened. So I took the code you made and put it below his in
PokeBattle_Battler.

Problem being he doesn't change back to shield form when using king's shield. Not sure where I messed up ether.

Code:
#Agislash Form Change
    if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
       isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.basedamage > 0
        @pokemon.form=1
        pbCheckForm
      end    
    #Agislash Form Change
   if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
      isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==135 #Where XXX is the function number 
      @pokemon.form=0
      pbCheckForm
    end

This code you posted. I didn't put it in. What dies it do? Is it necessary for this to work properly?
Code:
if $game_switches[68]==true && (thismove.flags&0x01)!=0 #King's Shield
      if isConst?(opponent.ability,PBAbilities,:CONTRARY)
        if opponent.pbCanIncreaseStatStage?(PBStats::ATTACK,false)
      opponent.pbIncreaseStat(PBStats::ATTACK,1,false,showanim)
      @battle.pbDisplay(_INTL("{1} protected itself!",target.pbThis))
      @battle.successStates[user.index].protected=true
      return false
    end 
        elsif !isConst?(opponent.ability,PBAbilities,:CONTRARY)
      if opponent.pbCanReduceStatStage?(PBStats::ATTACK,false)
      opponent.pbReduceStat(PBStats::ATTACK,1,false,showanim)
      @battle.pbDisplay(_INTL("{1} protected itself!",target.pbThis))
      @battle.successStates[user.index].protected=true
      return false
    end 
    end
  end

No, it's just the coding I made for King's Shield itself. I don't think it work properly on second thought.
 
1,224
Posts
10
Years
You are able to change back to shield mode using King's Shield right? I just messed up somewhere?

That's the intention, I feel as though it's not going to work since I think I messed up the move effect somehow. It "fails" every time so it's not going to change back as is.
 
95
Posts
9
Years
  • Age 34
  • Seen Jun 18, 2016
This is the code i used for King Shield, and it's working fine:

Code:
class PokeBattle_Move_137 < PokeBattle_Move
  def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    ratesharers=[
       0xAA,   # Detect, Protect
       0xAB,   # Quick Guard
       0xAC,   # Wide Guard
       0xE8    # Endure
    ]
    if !ratesharers.include?(PBMoveData.new(attacker.lastMoveCalled).function)
      attacker.effects[PBEffects::ProtectRate]=1
    end
    if @battle.pbRandom(65536)>(65536/attacker.effects[PBEffects::ProtectRate]).floor
      attacker.effects[PBEffects::ProtectRate]=1
      @battle.pbDisplay(_INTL("But it failed!"))
      return -1
    end
    pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
    attacker.effects[PBEffects::Protect]=true
    attacker.effects[PBEffects::ProtectRate]*=2
    return 0
  end
end

The code to make it change back to shield form is this:

Code:
if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
       isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function == 137
       @pokemon.form=0
        pbCheckForm
        end

It's placed right under the one which makes Aegislash change to blade form. It's missing the part to lower the attack, though.

If the move still fails with this, then i don't know. In my game everything is perfect, Aegislash changes back to shield form when using King Shield, changing to another Pokémon or leaving battle (and when entering battle, obviously) and changes to blade form when using a move that causes damage.
 
1,405
Posts
11
Years
for me, the thismove.function code doesn't work

Code:
if isConst?(self.ability,PBAbilities,:FORMECHANGE) &&
       isConst?(self.species,PBSpecies,:DEOXYS) && hp>0 && thismove.function == 0AA
        @pokemon.form=2
        pbCheckForm
      end

it doesn't do anything, except for few function codes like 02A (Cosmic Power and Defend Order) where it gives a syntax error
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
0AA is not a number. 0x0AA is a number (a hexadecimal one, which is the kind of number you want).
 
8
Posts
9
Years
  • Age 26
  • Seen Jun 16, 2015
assuming you would create a new function for King's Shield, you would just have to add this right?
Code:
if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
      isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==XXX #Where XXX is the function number 
      @pokemon.form=0
      pbCheckForm
    end

What script do I put this in? I can't find it anywhere in the RGSS Editor.
 
1,405
Posts
11
Years
What script do I put this in? I can't find it anywhere in the RGSS Editor.

in PokeBattle_Battler right after
Code:
if status==PBStatuses::FROZEN && (thismove.flags&0x40)!=0 # flag g: Thaws user before moving
      self.status=0
      pbCheckForm
      @battle.pbDisplay(_INTL("{1} was defrosted by {2}!",pbThis,thismove.name))
    end
 
3
Posts
9
Years
  • Age 24
  • Seen Jun 22, 2019
Aegislash's kings shield works, but doesn't turn him back into shield form




class PokeBattle_Move_140 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
ratesharers=[
0xAA, # Detect, Protect
0xAB, # Quick Guard
0xAC, # Wide Guard
0xE8 # Endure
]
if !ratesharers.include?(PBMoveData.new(attacker.lastMoveCalled).function)
attacker.effects[PBEffects::ProtectRate]=1
end
if @battle.pbRandom(65536)>(65536/attacker.effects[PBEffects::ProtectRate]).floor
attacker.effects[PBEffects::ProtectRate]=1
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
attacker.effects[PBEffects::Protect]=true
attacker.effects[PBEffects::ProtectRate]*=2
return 0
end
end

for king's shield
and this for him changing formes


if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.basedamage > 0
@pokemon.form=1
pbCheckForm
end
if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function == 140
@pokemon.form=2
pbCheckForm
end

and yes, form 0 and 2 are both shield form. form 1 is blade.
It protects himself well, but doesn't turn into shield form.
(also i don't have the script for lowering the opponents attack in there)
 
Last edited:
95
Posts
9
Years
  • Age 34
  • Seen Jun 18, 2016
Aegislash's kings shield works, but doesn't turn him back into shield form




class PokeBattle_Move_140 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
ratesharers=[
0xAA, # Detect, Protect
0xAB, # Quick Guard
0xAC, # Wide Guard
0xE8 # Endure
]
if !ratesharers.include?(PBMoveData.new(attacker.lastMoveCalled).function)
attacker.effects[PBEffects::ProtectRate]=1
end
if @battle.pbRandom(65536)>(65536/attacker.effects[PBEffects::ProtectRate]).floor
attacker.effects[PBEffects::ProtectRate]=1
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
attacker.effects[PBEffects::Protect]=true
attacker.effects[PBEffects::ProtectRate]*=2
return 0
end
end

for king's shield
and this for him changing formes


if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.basedamage > 0
@pokemon.form=1
pbCheckForm
end
if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function == 140
@pokemon.form=2
pbCheckForm
end

and yes, form 0 and 2 are both shield form. form 1 is blade.
It protects himself well, but doesn't turn into shield form.
(also i don't have the script for lowering the opponents attack in there)

You don't need a 2nd form for the shield form after using King's Shield, just use @pokemon.form=0.

It doesn't work because of this:

Code:
 if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
       isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function == 140

Corrected:

Code:
 if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
       isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function == 0x140
 
Back
Top