Hello!
I've set up a couple of moves myself for a game I'm working on, but this one is proving more difficult.
I'm trying to sort of merge Geomancy and Relic Song. My goal is to have a move that takes two turns, but instead of giving stat buffs on the second turn, it changes the Pokemon's form. (Also- for clarity, the form change is the Pokemon being joined by a group of them, kind of like Wishiwashi's ability)
(Also, for a little extra information, I think an additional problem I was having was that in the moves.pbs, Status moves have a power of 0, which was making the Relic Song after effect fail. While trying to replace it as the main effect was causing the two turn aspect of the move to break.)
I've tried this in a number of ways, but I figured it would be more helpful to just post the original code here (With the text changed), as mine was getting pretty messy and convoluted. Would anybody be able to help me merge these? I would be very thankful.
I've set up a couple of moves myself for a game I'm working on, but this one is proving more difficult.
I'm trying to sort of merge Geomancy and Relic Song. My goal is to have a move that takes two turns, but instead of giving stat buffs on the second turn, it changes the Pokemon's form. (Also- for clarity, the form change is the Pokemon being joined by a group of them, kind of like Wishiwashi's ability)
Code:
class PokeBattle_Move_644 < PokeBattle_Move
def pbTwoTurnAttack(attacker)
@immediate=false
if !@immediate && attacker.hasWorkingItem(:POWERHERB)
@immediate=true
end
return false if @immediate
return attacker.effects[PBEffects::TwoTurnAttack]==0
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if @immediate || attacker.effects[PBEffects::TwoTurnAttack]>0
pbShowAnimation(@id,attacker,opponent,1,alltargets,showanimation) # Charging anim
@battle.pbDisplay(_INTL("{1} is preparing something!",attacker.pbThis))
end
if @immediate
@battle.pbCommonAnimation("UseItem",attacker,nil)
@battle.pbDisplay(_INTL("{1} is ready due to its Power Herb!",attacker.pbThis))
attacker.pbConsumeItem
end
return 0 if attacker.effects[PBEffects::TwoTurnAttack]>0
if !attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self) &&
!attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self) &&
!attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
@battle.pbDisplay(_INTL("{1}'s stats won't go any higher!",attacker.pbThis))
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
showanim=true
if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
attacker.pbIncreaseStat(PBStats::SPATK,2,attacker,false,self,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
attacker.pbIncreaseStat(PBStats::SPDEF,2,attacker,false,self,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
attacker.pbIncreaseStat(PBStats::SPEED,2,attacker,false,self,showanim)
showanim=false
end
return 0
end
end
Code:
class PokeBattle_Move_644 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if pbIsDamaging?
return super(attacker,opponent,hitnum,alltargets,showanimation)
else
@battle.pbDisplay("But it failed!")
return -1
end
end
def pbEffectAfterHit(attacker,opponent,turneffects)
if isConst?(@id,PBMoves,:CALLTOARMS)
if isConst?(attacker.species,PBSpecies,:TAENL) &&
!attacker.effects[PBEffects::Transform] &&
!(attacker.hasWorkingAbility(:SHEERFORCE) && self.addlEffect>0) &&
!attacker.fainted?
attacker.form=1
attacker.pbUpdate(true)
@battle.scene.pbChangePokemon(attacker,attacker.pokemon)
@battle.pbDisplay(_INTL("{1} called its posse!",attacker.pbThis))
PBDebug.log("[Form changed] #{attacker.pbThis} changed to form #{attacker.form}")
end
end
end
end
(Also, for a little extra information, I think an additional problem I was having was that in the moves.pbs, Status moves have a power of 0, which was making the Relic Song after effect fail. While trying to replace it as the main effect was causing the two turn aspect of the move to break.)
I've tried this in a number of ways, but I figured it would be more helpful to just post the original code here (With the text changed), as mine was getting pretty messy and convoluted. Would anybody be able to help me merge these? I would be very thankful.