Let's start it!
All Generation Cries (1-8) in .OGG format
Gen.VIII Footprints
Gen.VIII Battler Sprite (BW/Gen.V Style)
Isle of Armor:
Items:
Evo Methods:
Zacian/ Zamazenta Crowned Formes (V2.0);
Ability codes:
Pastel Veil
Neutralizing Gas (V2.0)
Gorilla Tactics
Mimicry
Libero
Mirror Armor
Cotton Down
Ball Fetch
Steam Engine
Ripen
Sand Spit
Gulp Missile
Propeller Tail/ Stalwart
Punk Rock
Steely Spirit
Perish Body
Screen Cleaner
Wandering Spirit
Ice Scales
Power Spot
Ice Face
Hunger Switch
Intrepid Sword
Dauntless Shield
Steam Engine:
Paste into abilities.txt:
235 is my last number. Pay attention with yours.
Then, inside script, find 'PokeBattle_Battler' and paste above Air Ballon's code, like:
Libero (Cinderace's Hidden Ability):
Add inside ability.txt ("XXX" will be your last number):
In 'PokeBattle_Battler' script, look for PROTEAN script and add LIBERO, like:
About Gen.VIII Move Script:
For move.txt:
For Body Press:
In 'PokeBattle_Move' script, add below Foul Play:
For Dragon Darts:
P.S:
I wrote its function as '180' from move.txt:
Find 'PokeBattle_Battler' script and go to 'def pbProcessMoveAgainstTarget(thismove,user,target,numhits,turneffects,nocheck=false,alltargets=nil,showanimation=true)'. Then, add 'originalTarget=target' below 'destinybond=false';
Now, add this code below 'target.damagestate.reset' (just delete Baneful Bunker,Obstruct, Rage Powder and Spotlight if you don't have them):
Look for 'user.effects[PBEffects::ParentalBond]-=1 if user.effects[PBEffects::ParentalBond]>0' and add below it:
To won't appears the message about number of hits, use CTRL+SHIFT+F for '@battle.pbDisplay(_INTL("Hit {1} times!",realnumhits))' and replace to '@battle.pbDisplay(_INTL("Hit {1} times!",realnumhits)) if !isConst?(thismove.id,PBMoves,:DRAGONDARTS)', like:
Finally, inside 'PokeBattle_MoveEffects' script, paste the code for the move:
For Jaw Lock:
In 'PBEffects' script, add the new effects:
Now, inside 'PokeBattle_Battler' script, find 'if !batonpass' and paste below '@effects[PBEffects::Ingrain] = false', like:
Then, in 'PokeBattle_MoveEffects' script paste de code:
To prevent to run or switch, look for 'PokeBattle_Battle' script, then in 'def pbCanSwitch?(idxPokemon,pkmnidxTo,showMessages,ignoremeanlook=false)' paste below Ingrain's code, like:
Finally, in 'def pbCanRun?(idxPokemon)' paste below 'return true if thispkmn.hasWorkingAbility(:RUNAWAY)':
For Magic Powder:
Replace 'class PokeBattle_Move_061 < PokeBattle_Move' for:
For No Retreat:
In 'PBEffects' script, add a new effect:
Now, in 'PokeBattle_Battler' script, below '@effects[PBEffects::Ingrain] = false', paste, like:
Then, look for 'PokeBattle_MoveEffects' script and inside Octolock (if you have one) you need to add if opponent used No Retreat, will fail, like:
The code for the move:
To prevent to run or switch, in 'PokeBattle_Battle' script, inside 'def pbCanSwitch?(idxPokemon,pkmnidxTo,showMessages,ignoremeanlook=false)', paste below 'if thispkmn.effects[PBEffects::Ingrain]':
And inside 'def pbCanRun?(idxPokemon)' add to return false:
Finally, below 'if @cantescape' code, paste:
For Obstruct:
In 'PBEffects' add a new effect inside 'module PBEffects':
Now, in 'PokeBattle_Battler' script, inside 'def pbInitEffects(batonpass)', add the new effect:
Then, above '# Immunity to powder-based moves', paste:
And you need to add inside 'PokeBattle_Battle' script, 'def pbEndOfRoundPhase':
Finally, you need to add Obstruct in some cases in 'PokeBattle_MoveEffects' script. Just use CTRL+F to find '# Detect, Protect' or '# Quick Guard' and paste for Obstruct. Like:
For Octolock:
First, loock for 'PBEffects' script and add a new effect:
In 'PokeBattle_Battler' script, inside 'if !batonpass', paste below 'effects[PBEffects::Ingrain] = false', like:
Now, the code in 'PokeBattle_MoveEffects' script:
Then, inside 'PokeBattle_Battle' script, in 'def pbCanSwitch?(idxPokemon,pkmnidxTo,showMessages,ignoremeanlook=false)' paste below Ingrain's code:
Now, 'def pbCanRun?(idxPokemon)' below 'return true if thispkmn.hasWorkingAbility(:RUNAWAY)', paste:
Finally, look for 'def pbEndOfRoundPhase' and use CTRL+F to find '# Taunt' and then, paste above:
For Snap Trap:
Edit the function inside move.txt to '0CF':
Now in 'PokeBattle_MoveEffects' script, edit the function's code:
Then, if you have a custom animation for it, inside 'PokeBattle_Battle' script, look for '# Multi-turn attacks (Bind/Clamp/Fire Spin/Magma Storm/Sand Tomb/Whirlpool/Wrap)' and replace (if not skip this part to show Wrap's animation):
For Stuff Cheeks:
In 'PokeBattle_Battle' script, below 'if thismove.function==0x158 && # Belch', paste, like:
For Tar Shot:
First, edit the function inside move.txt to '044':
In 'PokeBattle_MoveEffects' script, replace 'class PokeBattle_Move_044 < PokeBattle_Move':
Now we need create a effect. Go in 'PBEffects' script to make one:
Same to 'PokeBattle_Battler' script:
Finally, inside 'PokeBattle_Move' script, 'def pbTypeModifier(type,attacker,opponent)', paste below Freeze-Dry's code, like (P.S: do the same for 'PokeBattle_AI' script):
The codes for the moves, inside 'PokeBattle_MoveEffects' script:
Also need to edit ' def ignoresSubstitute?(attacker)' and add Life Dew and Tea Time:
All Generation Cries (1-8) in .OGG format
Gen.VIII Footprints
Gen.VIII Battler Sprite (BW/Gen.V Style)
Isle of Armor:
Spoiler:
Items:
Spoiler:
Evo Methods:
Zacian/ Zamazenta Crowned Formes (V2.0);
Ability codes:
Spoiler:
Pastel Veil
Neutralizing Gas (V2.0)
Gorilla Tactics
Mimicry
Libero
Mirror Armor
Cotton Down
Ball Fetch
Steam Engine
Ripen
Sand Spit
Gulp Missile
Propeller Tail/ Stalwart
Punk Rock
Steely Spirit
Perish Body
Screen Cleaner
Wandering Spirit
Ice Scales
Power Spot
Ice Face
Hunger Switch
Intrepid Sword
Dauntless Shield
Steam Engine:
Paste into abilities.txt:
Code:
232,PRISMARMOR,Prism Armor,"Reduces the power of supereffective attacks taken."
233,NEUROFORCE,Neuroforce,"Powers up moves that are super effective."
234,BALLFETCH,Ball Fetch,"If the Pokémon is not holding an item, it will fetch the Poké Ball from the first failed throw of the battle."
[B][COLOR="Red"]235[/COLOR],STEAMENGINE,Steam Engine,"A Pokémon with this Ability will get a Speed stat boost if it's hit with a Fire- or Water-type move during battle."[/B]
Then, inside script, find 'PokeBattle_Battler' and paste above Air Ballon's code, like:
Spoiler:
Code:
if target.hasWorkingAbility(:STEAMENGINE) &&
(isConst?(movetype,PBTypes,:WATER) || isConst?(movetype,PBTypes,:FIRE))
if target.pbIncreaseStatWithCause(PBStats::SPEED,6,target,PBAbilities.getName(target.ability))
PBDebug.log("[Ability triggered] #{target.pbThis}'s Steam Engine")
end
end
if target.hasWorkingItem(:AIRBALLOON,true)
PBDebug.log("[Item triggered] #{target.pbThis}'s Air Balloon popped")
Libero (Cinderace's Hidden Ability):
Add inside ability.txt ("XXX" will be your last number):
Code:
XXX,LIBERO,Libero,"Changes the Pokémon's type to the type of the move it's about to use."
Code:
# Protean / Libero
if (user.hasWorkingAbility(:PROTEAN) || user.hasWorkingAbility(:LIBERO)) &&
thismove.function!=0xAE && # Mirror Move
thismove.function!=0xAF && # Copycat
thismove.function!=0xB0 && # Me First
thismove.function!=0xB3 && # Nature Power
thismove.function!=0xB4 && # Sleep Talk
thismove.function!=0xB5 && # Assist
thismove.function!=0xB6 # Metronome
movetype=thismove.pbType(thismove.type,user,nil)
if !user.pbHasType?(movetype)
typename=PBTypes.getName(movetype)
PBDebug.log("[Ability triggered] #{pbThis}'s Protean made it #{typename}-type")
user.type1=movetype; user.type2=movetype
user.effects[PBEffects::Type3]=-1
About Gen.VIII Move Script:
Spoiler:
For move.txt:
Spoiler:
Code:
677,APPLEACID,Apple Acid,046,80,GRASS,Special,100,10,100,00,0,bef,"The user attacks the target with an acidic liquid created from tart apples. This also lowers the target's Sp. Def stat."
678,AURAWHEEL,Aura Wheel,174,110,ELECTRIC,Physical,100,10,100,00,0,bef,"Morpeko attacks and raises its Speed with the energy stored in its cheeks. This move's type changes depending on the user's form."
679,BEHEMOTHBASH,Behemoth Bash,000,100,STEEL,Physical,100,5,0,00,0,abef,"The user becomes a gigantic shield and slams into the target. This move deals twice the damage is the target is Dynamaxed."
680,BEHEMOTHBLADE,Behemoth Blade,000,100,STEEL,Physical,100,5,0,00,0,abef,"The user becomes a gigantic sword and cuts the target. This move deals twice the damage is the target is Dynamaxed."
681,BODYPRESS,Body Press,175,80,FIGHTING,Physical,100,10,0,00,0,abef,"The user attacks by slamming its body into the target. The higher the user's Defense, the more damage it can inflict on the target."
682,BOLTBEAK,Bolt Beak,176,85,ELECTRIC,Physical,100,10,0,00,0,abef,"The user stabs the target with its electrified beak. If the user attacks before the target, the power of this move is doubled."
683,BRANCHPOKE,Branch Poke,000,40,GRASS,Physical,100,40,0,00,0,abef,"The user attacks the target by poking it with a sharply pointed branch."
684,BREAKINGSWIPE,Breaking Swipe,042,60,DRAGON,Physical,100,15,100,04,0,abef,"The user swings its tough tail wildly and attacks opposing Pokémon. This also lowers their Attack stats."
685,CLANGOROUSSOUL,Clangorous Soul,177,0,DRAGON,Status,100,5,0,10,0,dk,"The user raises all its stats by using some of its HP."
686,COURTCHANGE,Court Change,178,0,NORMAL,Status,100,10,0,20,0,e,"With its mysterious power, the user swaps the effects on either side of the field."
687,DECORATE,Decorate,179,0,FAIRY,Status,0,15,0,00,0,,"The user sharply raises the target's Attack and Sp. Atk stats by decorating the target."
688,DRAGONDARTS,Dragon Darts,180,50,DRAGON,Physical,100,10,0,00,0,bef,"The user attacks twice using Dreepy. If there are two targets, this move hits each target once."
689,DRUMBEATING,Drum Beating,044,80,GRASS,Physical,100,10,100,00,0,bef,"The user plays its drum, controlling the drum's roots to attack the target. This also lowers the target's Speed stat."
690,DYNAMAXCANNON,Dynamax Cannon,000,100,DRAGON,Special,100,5,0,00,0,bf,"The user unleashes a strong beam from its core. This move deals twice the damage if the target is Dynamaxed."
691,ETERNABEAM,Eterna Beam,0C2,160,DRAGON,Special,90,5,0,00,0,bef,"This is Eternatus's most powerful attack in its original form. The user can't move on the next turn."
692,FALSESURRENDER,False Surrender,0A5,80,DARK,Physical,0,10,0,00,0,abef,"The user pretends to bow its head, but then it stabs the target with its disheveled hair. This attack never misses."
693,FISHIOUSREND,Fishion Rend,176,85,WATER,Physical,100,10,0,00,0,abefi,"The user rends the target with its hard fills. If the user attacks before the target, the power of this move is doubled."
694,GRAVAPPLE,Grav Apple,043,80,GRASS,Physical,100,10,100,00,0,bef,"The user inflicts damage by dropping an apple from high above. This also lowers the target's Defense stat."
695,JAWLOCK,Jaw Lock,181,80,DARK,Physical,100,10,0,00,0,abef,"This move prevents the user and the target from switching out until either of them faints. The effect goes away if either of the Pokémon leaves the field."
696,LIFEDEW,Life Dew,182,0,WATER,Status,0,10,0,01,0,d,"The user scatters mysterious water around and restores the HP of itself and its ally Pokémon in the battle."
697,MAGICPOWDER,Magic Powder,061,0,PSYCHIC,Status,100,20,0,00,0,bcel,"The user scatters a cloud of magic powder that changes the target to Psychic Type."
698,METEORASSAULT,Meteor Assault,0C2,150,FIGHTING,Physical,100,5,0,00,0,bef,"The user attacks wildly with its thick leek. The user can't move on the next turn, because the force of this move makes it stagger."
699,NORETREAT,No Retreat,183,0,FIGHTING,Status,0,5,0,10,0,d,"This move raises all the user's stats but prevents the user from switching out or fleeing."
700,OBSTRUCT,Obstruct,184,0,DARK,Status,100,10,0,10,4,,"This move enables the user to protect itself from all attacks. Its chance of failing rises if it is used in succession. Direct contact harshly lowers the attacker's Defense stat."
701,OCTOLOCK,Octolock,185,0,FIGHTING,Status,100,15,0,00,0,be,"The user locks the target in and prevents it from fleeing. This move also lowers the target's Defense and Sp. Def every turn."
702,OVERDRIVE,Overdrive,000,80,ELECTRIC,Special,100,10,0,04,0,befk,"The user attacks opposing Pokémon by twanging a guitar or bass guitar, causing a huge echo and strong vibration."
703,PYROBALL,Pyro Ball,00A,120,FIRE,Physical,90,5,10,00,0,bef,"The user attacks by igniting a small stone and launching it as a fiery ball at the target. This may also leave the target with a burn."
704,SNAPTRAP,Snap Trap,0CF,35,GRASS,Physical,100,15,0,00,0,abef,"The user snares the target in a snap trap for four to five turns."
705,SNIPESHOT,Snipe Shot,186,80,WATER,Special,100,15,0,00,0,befh,"The user ignores the effects of opposing Pokémon's moves and Abilities that draw in moves, allowing this move to hit the chosen target."
706,SPIRITBREAK,Spirit Break,045,75,FAIRY,Physical,100,15,100,00,0,abef,"The user attacks the target with so much force that it could break the target's spirit. This also lowers the target's Sp. Atk stat."
707,STEELBEAM,Steel Beam,0FC,140,STEEL,Special,95,5,0,00,0,bef,"The user fires a beam of steel that it collected from its entire body. This also damages the user."
708,STRANGESTEAM,Strange Steam,013,90,FAIRY,Special,95,10,20,00,0,bef,"The user attacks the target by emitting steam. This may also confuse the target."
709,STUFFCHEEKS,Stuff Cheeks,187,0,NORMAL,Status,0,10,0,10,0,d,"The user eats its held Berry, then sharply raises its Defense stat."
710,TARSHOT,Tar Shot,044,0,ROCK,Status,100,15,0,00,0,bce,"The user pours sticky tar over the target, lowering the target's Speed stat. The target becomes weaker to Fire-type moves."
711,TEATIME,Teatime,188,0,NORMAL,Status,0,10,0,20,0,,"The user has teatime with all the Pokémon in the battle. Each Pokémon eats its held Berry."
For Body Press:
Spoiler:
In 'PokeBattle_Move' script, add below Foul Play:
Code:
##### Calculate attacker's attack stat #####
atk=attacker.attack
atkstage=attacker.stages[PBStats::ATTACK]+6
if @function==0x121 # Foul Play
atk=opponent.attack
atkstage=opponent.stages[PBStats::ATTACK]+6
end
if type>=0 && pbIsSpecial?(type)
atk=attacker.spatk
atkstage=attacker.stages[PBStats::SPATK]+6
if @function==0x121 # Foul Play
atk=opponent.spatk
atkstage=opponent.stages[PBStats::SPATK]+6
end
end
if @function==0x175 # Body Press
atk=attacker.defense
atkstage=attacker.stages[PBStats::DEFENSE]+6
end
For Dragon Darts:
Spoiler:
P.S:
I wrote its function as '180' from move.txt:
Code:
XXX,DRAGONDARTS,Dragon Darts,180,50,DRAGON,Physical,100,10,0,00,0,bef,"The user attacks twice using Dreepy. If there are two targets, this move hits each target once."
Find 'PokeBattle_Battler' script and go to 'def pbProcessMoveAgainstTarget(thismove,user,target,numhits,turneffects,nocheck=false,alltargets=nil,showanimation=true)'. Then, add 'originalTarget=target' below 'destinybond=false';
Now, add this code below 'target.damagestate.reset' (just delete Baneful Bunker,Obstruct, Rage Powder and Spotlight if you don't have them):
Code:
#for i in 0...numhits
#target.damagestate.reset
if thismove.function==0x180 && @battle.doublebattle && target!=user.pbPartner && # Dragon Darts
!target.pbPartner.fainted?
changetarget=false
for i in @battle.pbPriority
next if !user.pbIsOpposing?(i.index)
changetarget=true if i.effects[PBEffects::FollowMe]>0 || i.effects[PBEffects::RagePowder]>0 ||
i.effects[PBEffects::Spotlight]
end
if (thismove.pbTypeModifier(thismove.pbType(thismove.type,user,originalTarget),user,originalTarget)==0 ||
thismove.pbTypeImmunityByAbility(thismove.pbType(thismove.type,user,originalTarget),user,originalTarget) ||
(originalTarget.effects[PBEffects::Protect] ||
(originalTarget.pbOwnSide.effects[PBEffects::QuickGuard] && thismove.priority>0) ||
originalTarget.effects[PBEffects::SpikyShield] ||
originalTarget.effects[PBEffects::BanefulBunker] ||
originalTarget.effects[PBEffects::Obstruct]) ||
originalTarget.effects[PBEffects::TwoTurnAttack]>0 ||
!thismove.pbAccuracyCheck(user,originalTarget)) && !changetarget
target=originalTarget.pbPartner
end
end
# Check success (accuracy/evasion calculation)
Look for 'user.effects[PBEffects::ParentalBond]-=1 if user.effects[PBEffects::ParentalBond]>0' and add below it:
Code:
# Count a hit for Dragon Darts if it hits first time
if thismove.function==0x180 && @battle.doublebattle && realnumhits>0
secondTarget=target.pbPartner
changetarget=false
for i in @battle.pbPriority
next if !user.pbIsOpposing?(i.index)
changetarget=true if i.effects[PBEffects::FollowMe]>0 || i.effects[PBEffects::RagePowder]>0 ||
i.effects[PBEffects::Spotlight]
end
if (thismove.pbTypeModifier(thismove.pbType(thismove.type,user,secondTarget),user,secondTarget)==0 ||
thismove.pbTypeImmunityByAbility(thismove.pbType(thismove.type,user,secondTarget),user,secondTarget) ||
(secondTarget.effects[PBEffects::Protect] ||
(secondTarget.pbOwnSide.effects[PBEffects::QuickGuard] && thismove.priority>0) ||
secondTarget.effects[PBEffects::SpikyShield] ||
secondTarget.effects[PBEffects::BanefulBunker] ||
secondTarget.effects[PBEffects::Obstruct]) ||
secondTarget.effects[PBEffects::TwoTurnAttack]>0 ||
!thismove.pbAccuracyCheck(user,secondTarget)) && !changetarget
target=secondTarget.pbPartner if secondTarget.pbPartner!=user.pbPartner
else
target=secondTarget.pbPartner if secondTarget.pbPartner!=user.pbPartner
if target.hasWorkingAbility(:PRESSURE) && !originalTarget.hasWorkingAbility(:PRESSURE)
PBDebug.log("[Ability triggered] #{target.pbThis}'s Pressure (in pbChangeTarget)")
user.pbReducePP(thismove) # Reduce PP
end
end
end
# This hit will happen; count it
To won't appears the message about number of hits, use CTRL+SHIFT+F for '@battle.pbDisplay(_INTL("Hit {1} times!",realnumhits))' and replace to '@battle.pbDisplay(_INTL("Hit {1} times!",realnumhits)) if !isConst?(thismove.id,PBMoves,:DRAGONDARTS)', like:
Code:
if realnumhits==1
@battle.pbDisplay(_INTL("Hit {1} time!",realnumhits))
else
@battle.pbDisplay(_INTL("Hit {1} times!",realnumhits)) if !isConst?(thismove.id,PBMoves,:DRAGONDARTS)
end
end
PBDebug.log("Move did #{numhits} hit(s), total damage=#{turneffects[PBEffects::TotalDamage]}")
Finally, inside 'PokeBattle_MoveEffects' script, paste the code for the move:
Code:
################################################################################
# In singles, this move hits the target twice. In doubles, this move hits each
# target once. If one of the two opponents protects or while semi-invulnerable
# or is a Fairy-type Pokémon, it hits the opponent that doesn't protect twice.
# (Dragon Darts)
################################################################################
class PokeBattle_Move_180 < PokeBattle_Move
def pbIsMultiHit
return true
end
def pbNumHits(attacker)
return 2
end
end
For Jaw Lock:
Spoiler:
In 'PBEffects' script, add the new effects:
Code:
Yawn = 108
JawLock = 109
JawLockUser = 110
Now, inside 'PokeBattle_Battler' script, find 'if !batonpass' and paste below '@effects[PBEffects::Ingrain] = false', like:
Code:
@effects[PBEffects::JawLock] = false
@effects[PBEffects::JawLockUser] = -1
for i in 0...4
next if [email protected][i]
if @battle.battlers[i].effects[PBEffects::JawLockUser]==@index &&
@battle.battlers[i].effects[PBEffects::JawLock]
@battle.battlers[i].effects[PBEffects::JawLock]=false
@battle.battlers[i].effects[PBEffects::JawLockUser]=-1
end
end
Then, in 'PokeBattle_MoveEffects' script paste de code:
Code:
################################################################################
# Prevents both the user and the target from escaping. (Jaw Lock)
################################################################################
class PokeBattle_Move_181 < PokeBattle_Move
def pbEffectAfterHit(attacker,opponent,turneffects)
if (opponent.effects[PBEffects::JawLockUser]<0 && !opponent.effects[PBEffects::JawLock] &&
attacker.effects[PBEffects::JawLockUser]<0 && !attacker.effects[PBEffects::JawLock])
opponent.effects[PBEffects::JawLockUser]=attacker.index
attacker.effects[PBEffects::JawLockUser]=attacker.index
opponent.effects[PBEffects::JawLock]=true
attacker.effects[PBEffects::JawLock]=true
@battle.pbDisplay(_INTL("Neither Pokémon can run away!"))
end
end
end
To prevent to run or switch, look for 'PokeBattle_Battle' script, then in 'def pbCanSwitch?(idxPokemon,pkmnidxTo,showMessages,ignoremeanlook=false)' paste below Ingrain's code, like:
Code:
if thispkmn.effects[PBEffects::Ingrain]
pbDisplayPaused(_INTL("{1} can't be switched out!",thispkmn.pbThis)) if showMessages
return false
end
if thispkmn.effects[PBEffects::JawLock]
for i in battlers
if i.pokemonIndex==thispkmn.effects[PBEffects::JawLockUser] && !i.fainted?
pbDisplayPaused(_INTL("{1} can't be switched out!",thispkmn.pbThis)) if showMessages
return false
end
end
end
Finally, in 'def pbCanRun?(idxPokemon)' paste below 'return true if thispkmn.hasWorkingAbility(:RUNAWAY)':
Code:
return true if thispkmn.hasWorkingAbility(:RUNAWAY)
if thispkmn.effects[PBEffects::JawLock]
for i in battlers
if i.pokemonIndex==thispkmn.effects[PBEffects::JawLockUser] && !i.fainted?
return false
end
end
end
For Magic Powder:
Spoiler:
Replace 'class PokeBattle_Move_061 < PokeBattle_Move' for:
Code:
class PokeBattle_Move_061 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if opponent.effects[PBEffects::Substitute]>0 && !ignoresSubstitute?(attacker)
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
return -1 if pbTypeImmunityByAbility(pbType(@type,attacker,opponent),attacker,opponent)
if isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
isConst?(opponent.ability,PBAbilities,:RKSSYSTEM)
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
if isConst?(@id,PBMoves,:SOAK)
if opponent.type1==getConst(PBTypes,:WATER) &&
opponent.type2==getConst(PBTypes,:WATER) &&
(opponent.effects[PBEffects::Type3]<0 ||
opponent.effects[PBEffects::Type3]==getConst(PBTypes,:WATER))
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
elsif isConst?(@id,PBMoves,:MAGICPOWDER)
if opponent.type1==getConst(PBTypes,:PSYCHIC) &&
opponent.type2==getConst(PBTypes,:PSYCHIC) &&
(opponent.effects[PBEffects::Type3]<0 ||
opponent.effects[PBEffects::Type3]==getConst(PBTypes,:PSYCHIC))
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
end
if isConst?(@id,PBMoves,:SOAK)
opponent.type1=getConst(PBTypes,:WATER)
opponent.type2=getConst(PBTypes,:WATER)
opponent.effects[PBEffects::Type3]=-1
typename=PBTypes.getName(getConst(PBTypes,:WATER))
elsif isConst?(@id,PBMoves,:MAGICPOWDER)
opponent.type1=getConst(PBTypes,:PSYCHIC)
opponent.type2=getConst(PBTypes,:PSYCHIC)
opponent.effects[PBEffects::Type3]=-1
typename=PBTypes.getName(getConst(PBTypes,:PSYCHIC))
end
@battle.pbDisplay(_INTL("{1} transformed into the {2} type!",opponent.pbThis,typename))
return 0
end
end
For No Retreat:
Spoiler:
In 'PBEffects' script, add a new effect:
Code:
Yawn = 108
NoRetreat = 109
Now, in 'PokeBattle_Battler' script, below '@effects[PBEffects::Ingrain] = false', paste, like:
Code:
@effects[PBEffects::Ingrain] = false
@effects[PBEffects::NoRetreat] = false
Then, look for 'PokeBattle_MoveEffects' script and inside Octolock (if you have one) you need to add if opponent used No Retreat, will fail, like:
Code:
if opponent.effects[PBEffects::Octolock] || opponent.effects[PBEffects::NoRetreat] ||
(opponent.effects[PBEffects::Substitute]>0 && !ignoresSubstitute?(attacker))
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
The code for the move:
Spoiler:
Code:
################################################################################
# Increases each stat by 1 stage. Prevents user from fleeing. (No Retreat)
################################################################################
class PokeBattle_Move_183 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
meanlook=false; meanlook=true if attacker.effects[PBEffects::MeanLook]>=0
if attacker.effects[PBEffects::NoRetreat] && !meanlook
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
if !attacker.pbCanIncreaseStatStage?(PBStats::SPATK,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::SPEED,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,false)
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
showanim=true
if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,false)
attacker.pbIncreaseStat(PBStats::ATTACK,1,false,true,nil,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,false)
attacker.pbIncreaseStat(PBStats::DEFENSE,1,false,true,nil,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,false)
attacker.pbIncreaseStat(PBStats::SPATK,1,false,true,nil,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,false)
attacker.pbIncreaseStat(PBStats::SPDEF,1,false,true,nil,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,false)
attacker.pbIncreaseStat(PBStats::SPEED,1,false,true,nil,showanim)
showanim=false
end
@battle.pbDisplay(_INTL("{1} can no longer escape because it used {2}!",attacker.pbThis,@name)) if !meanlook
attacker.effects[PBEffects::NoRetreat]=true if !attacker.effects[PBEffects::NoRetreat]
return 0
end
end
To prevent to run or switch, in 'PokeBattle_Battle' script, inside 'def pbCanSwitch?(idxPokemon,pkmnidxTo,showMessages,ignoremeanlook=false)', paste below 'if thispkmn.effects[PBEffects::Ingrain]':
Code:
if thispkmn.effects[PBEffects::Ingrain]
pbDisplayPaused(_INTL("{1} can't be switched out!",thispkmn.pbThis)) if showMessages
return false
end
if thispkmn.effects[PBEffects::NoRetreat]
pbDisplayPaused(_INTL("{1} can't be switched out!",thispkmn.pbThis)) if showMessages
return false
end
And inside 'def pbCanRun?(idxPokemon)' add to return false:
Code:
def pbCanRun?(idxPokemon)
return false if @opponent
return false if @cantescape && !pbIsOpposing?(idxPokemon)
thispkmn=@battlers[idxPokemon]
return true if thispkmn.pbHasType?(:GHOST) && USENEWBATTLEMECHANICS
return true if thispkmn.hasWorkingItem(:SMOKEBALL)
return true if thispkmn.hasWorkingAbility(:RUNAWAY)
return false if thispkmn.effects[PBEffects::Octolock] && thispkmn.effects[PBEffects::OctolockUser]>=0
return false if thispkmn.effects[PBEffects::NoRetreat]
return pbCanSwitch?(idxPokemon,-1,false)
end
Finally, below 'if @cantescape' code, paste:
Code:
if @cantescape
pbDisplayPaused(_INTL("Can't escape!"))
return 0
end
if thispkmn.effects[PBEffects::NoRetreat]
pbDisplayPaused(_INTL("You can't flee!"))
return 0
end
For Obstruct:
Spoiler:
In 'PBEffects' add a new effect inside 'module PBEffects':
Code:
Obstruct = XXX # Will be your last number
############################################################################
# These effects apply to a side
Now, in 'PokeBattle_Battler' script, inside 'def pbInitEffects(batonpass)', add the new effect:
Code:
@effects[PBEffects::Yawn] = 0
@effects[PBEffects::Obstruct] = false
end
Then, above '# Immunity to powder-based moves', paste:
Code:
# Obstruct
if target.effects[PBEffects::Obstruct] && thismove.canProtectAgainst? && !target.effects[PBEffects::ProtectNegation]
@battle.pbDisplay(_INTL("{1} protected itself!",target.pbThis))
@battle.successStates[user.index].protected=true
PBDebug.log("[Move failed] #{target.pbThis}'s Obstruct stopped the attack")
if thismove.isContactMove?(user) && !user.hasWorkingAbility(:LONGREACH) && !user.hasWorkingItem(:PROTECTIVEPADS)
user.pbReduceStat(PBStats::DEFENSE,2,nil,false)
end
return false
end
# Immunity to powder-based moves
And you need to add inside 'PokeBattle_Battle' script, 'def pbEndOfRoundPhase':
Code:
def pbEndOfRoundPhase
PBDebug.log("[End of round]")
for i in 0...4
@battlers[i].effects[PBEffects::Electrify]=false
@battlers[i].effects[PBEffects::Endure]=false
@battlers[i].effects[PBEffects::FirstPledge]=0
@battlers[i].effects[PBEffects::HyperBeam]-=1 if @battlers[i].effects[PBEffects::HyperBeam]>0
@battlers[i].effects[PBEffects::KingsShield]=false
@battlers[i].effects[PBEffects::LifeOrb]=false
@battlers[i].effects[PBEffects::MoveNext]=false
@battlers[i].effects[PBEffects::Powder]=false
@battlers[i].effects[PBEffects::Protect]=false
@battlers[i].effects[PBEffects::ProtectNegation]=false
@battlers[i].effects[PBEffects::Quash]=false
@battlers[i].effects[PBEffects::Roost]=false
@battlers[i].effects[PBEffects::SpikyShield]=false
@battlers[i].effects[PBEffects::Obstruct]=false
end
@usepriority=false # recalculate priority
Finally, you need to add Obstruct in some cases in 'PokeBattle_MoveEffects' script. Just use CTRL+F to find '# Detect, Protect' or '# Quick Guard' and paste for Obstruct. Like:
Code:
################################################################################
# User is protected against moves with the "B" flag this round. (Detect, Protect)
################################################################################
class PokeBattle_Move_0AA < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
ratesharers=[
0xAA, # Detect, Protect
0xAB, # Quick Guard
0xAC, # Wide Guard
0xE8, # Endure
0x14B, # King's Shield
0x14C, # Spiky Shield
0x184 # Obstruct
]
For Octolock:
Spoiler:
First, loock for 'PBEffects' script and add a new effect:
Code:
Yawn = 108
Octolock = 109
OctolockUser = 110
In 'PokeBattle_Battler' script, inside 'if !batonpass', paste below 'effects[PBEffects::Ingrain] = false', like:
Code:
@effects[PBEffects::Ingrain] = false
@effects[PBEffects::Octolock] = false
@effects[PBEffects::OctolockUser]= -1
for i in 0...4
next if [email protected][i]
if @battle.battlers[i].effects[PBEffects::OctolockUser]==@index &&
@battle.battlers[i].effects[PBEffects::Octolock]
@battle.battlers[i].effects[PBEffects::Octolock]=false
@battle.battlers[i].effects[PBEffects::OctolockUser]=-1
end
end
Now, the code in 'PokeBattle_MoveEffects' script:
Spoiler:
Code:
################################################################################
# Lowers target's Defense and Special Defense by 1 stage at the end of each
# turn. Prevents target from retreating. (Octolock)
################################################################################
class PokeBattle_Move_185 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if opponent.effects[PBEffects::Octolock] ||
(opponent.effects[PBEffects::Substitute]>0 && !ignoresSubstitute?(attacker))
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
if USENEWBATTLEMECHANICS && opponent.pbHasType?(:GHOST)
@battle.pbDisplay(_INTL("It doesn't affect {1}...",opponent.pbThis(true)))
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.effects[PBEffects::OctolockUser]=attacker.index
opponent.effects[PBEffects::Octolock]=true
@battle.pbDisplay(_INTL("{1} can no longer escape because of {2}!",opponent.pbThis,@name))
return 0
end
end
Then, inside 'PokeBattle_Battle' script, in 'def pbCanSwitch?(idxPokemon,pkmnidxTo,showMessages,ignoremeanlook=false)' paste below Ingrain's code:
Code:
if thispkmn.effects[PBEffects::Ingrain]
pbDisplayPaused(_INTL("{1} can't be switched out!",thispkmn.pbThis)) if showMessages
return false
end
if thispkmn.effects[PBEffects::OctolockUser]>=0
pbDisplayPaused(_INTL("{1} can't be switched out!",thispkmn.pbThis)) if showMessages
return false
end
Now, 'def pbCanRun?(idxPokemon)' below 'return true if thispkmn.hasWorkingAbility(:RUNAWAY)', paste:
Code:
return true if thispkmn.hasWorkingAbility(:RUNAWAY)
return false if thispkmn.effects[PBEffects::OctolockUser]>=0
return pbCanSwitch?(idxPokemon,-1,false)
end
Finally, look for 'def pbEndOfRoundPhase' and use CTRL+F to find '# Taunt' and then, paste above:
Code:
# Octolock
for i in priority
next if i.fainted?
if i.effects[PBEffects::Octolock]
octolock=@battlers[i.effects[PBEffects::OctolockUser]]
if octolock && !octolock.fainted?
downanim=true
if i.pbCanReduceStatStage?(PBStats::DEFENSE,i,false,self)
i.pbReduceStat(PBStats::DEFENSE,1,i,false,self,downanim)
downanim=false
end
if i.pbCanReduceStatStage?(PBStats::SPDEF,i,false,self)
i.pbReduceStat(PBStats::SPDEF,1,i,false,self,downanim)
downanim=false
end
end
end
end
# Taunt
for i in priority
For Snap Trap:
Spoiler:
Edit the function inside move.txt to '0CF':
Code:
XXX,SNAPTRAP,Snap Trap,0CF,35,GRASS,Physical,100,15,0,00,0,abef,"The user snares the target in a snap trap for four to five turns."
Now in 'PokeBattle_MoveEffects' script, edit the function's code:
Spoiler:
Code:
################################################################################
# Trapping move. Traps for 5 or 6 rounds. Trapped Pokémon lose 1/16 of max HP
# at end of each round.
################################################################################
class PokeBattle_Move_0CF < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
ret=super(attacker,opponent,hitnum,alltargets,showanimation)
if opponent.damagestate.calcdamage>0 && !opponent.fainted? &&
!opponent.damagestate.substitute
if opponent.effects[PBEffects::MultiTurn]==0
opponent.effects[PBEffects::MultiTurn][email protected](2)
if attacker.hasWorkingItem(:GRIPCLAW)
opponent.effects[PBEffects::MultiTurn]=(USENEWBATTLEMECHANICS) ? 8 : 6
end
opponent.effects[PBEffects::MultiTurnAttack]=@id
opponent.effects[PBEffects::MultiTurnUser]=attacker.index
if isConst?(@id,PBMoves,:BIND)
@battle.pbDisplay(_INTL("{1} was squeezed by {2}!",opponent.pbThis,attacker.pbThis(true)))
elsif isConst?(@id,PBMoves,:CLAMP)
@battle.pbDisplay(_INTL("{1} clamped {2}!",attacker.pbThis,opponent.pbThis(true)))
elsif isConst?(@id,PBMoves,:FIRESPIN)
@battle.pbDisplay(_INTL("{1} was trapped in the fiery vortex!",opponent.pbThis))
elsif isConst?(@id,PBMoves,:MAGMASTORM)
@battle.pbDisplay(_INTL("{1} became trapped by Magma Storm!",opponent.pbThis))
elsif isConst?(@id,PBMoves,:SANDTOMB)
@battle.pbDisplay(_INTL("{1} became trapped by Sand Tomb!",opponent.pbThis))
elsif isConst?(@id,PBMoves,:WRAP)
@battle.pbDisplay(_INTL("{1} was wrapped by {2}!",opponent.pbThis,attacker.pbThis(true)))
elsif isConst?(@id,PBMoves,:INFESTATION)
@battle.pbDisplay(_INTL("{1} has been afflicted with an infestation by {2}!",opponent.pbThis,attacker.pbThis(true)))
elsif isConst?(@id,PBMoves,:SNAPTRAP)
opponent.effects[PBEffects::MultiTurn]-=1 # Traps for 4 or 5 rounds (or 7 if holding Grip Claw)
@battle.pbDisplay(_INTL("{1} got trapped by a snap trap!",opponent.pbThis))
else
@battle.pbDisplay(_INTL("{1} was trapped in the vortex!",opponent.pbThis))
end
end
end
return ret
end
end
Then, if you have a custom animation for it, inside 'PokeBattle_Battle' script, look for '# Multi-turn attacks (Bind/Clamp/Fire Spin/Magma Storm/Sand Tomb/Whirlpool/Wrap)' and replace (if not skip this part to show Wrap's animation):
Spoiler:
Code:
# Multi-turn attacks (Bind/Clamp/Fire Spin/Magma Storm/Sand Tomb/Whirlpool/Snap Trap/Wrap)
for i in priority
next if i.fainted?
if i.effects[PBEffects::MultiTurn]>0
i.effects[PBEffects::MultiTurn]-=1
movename=PBMoves.getName(i.effects[PBEffects::MultiTurnAttack])
if i.effects[PBEffects::MultiTurn]==0
PBDebug.log("[End of effect] Trapping move #{movename} affecting #{i.pbThis} ended")
pbDisplay(_INTL("{1} was freed from {2}!",i.pbThis,movename))
else
if isConst?(i.effects[PBEffects::MultiTurnAttack],PBMoves,:BIND)
pbCommonAnimation("Bind",i,nil)
elsif isConst?(i.effects[PBEffects::MultiTurnAttack],PBMoves,:CLAMP)
pbCommonAnimation("Clamp",i,nil)
elsif isConst?(i.effects[PBEffects::MultiTurnAttack],PBMoves,:FIRESPIN)
pbCommonAnimation("FireSpin",i,nil)
elsif isConst?(i.effects[PBEffects::MultiTurnAttack],PBMoves,:MAGMASTORM)
pbCommonAnimation("MagmaStorm",i,nil)
elsif isConst?(i.effects[PBEffects::MultiTurnAttack],PBMoves,:SANDTOMB)
pbCommonAnimation("SandTomb",i,nil)
elsif isConst?(i.effects[PBEffects::MultiTurnAttack],PBMoves,:WRAP)
pbCommonAnimation("Wrap",i,nil)
elsif isConst?(i.effects[PBEffects::MultiTurnAttack],PBMoves,:INFESTATION)
pbCommonAnimation("Infestation",i,nil)
elsif isConst?(i.effects[PBEffects::MultiTurnAttack],PBMoves,:SNAPTRAP)
pbCommonAnimation("SnapTrap",i,nil)
else
pbCommonAnimation("Wrap",i,nil)
end
if !i.hasWorkingAbility(:MAGICGUARD)
PBDebug.log("[Lingering effect triggered] #{i.pbThis} took damage from trapping move #{movename}")
@scene.pbDamageAnimation(i,0)
amt=(USENEWBATTLEMECHANICS) ? (i.totalhp/8).floor : (i.totalhp/16).floor
if @battlers[i.effects[PBEffects::MultiTurnUser]].hasWorkingItem(:BINDINGBAND)
amt=(USENEWBATTLEMECHANICS) ? (i.totalhp/6).floor : (i.totalhp/8).floor
end
i.pbReduceHP(amt)
pbDisplay(_INTL("{1} is hurt by {2}!",i.pbThis,movename))
end
end
end
if i.fainted?
return if !i.pbFaint
end
end
For Stuff Cheeks:
Spoiler:
In 'PokeBattle_Battle' script, below 'if thismove.function==0x158 && # Belch', paste, like:
Code:
if thismove.function==0x158 && # Belch
(!thispkmn.pokemon || !thispkmn.pokemon.belch)
if showMessages
pbDisplayPaused(_INTL("{1} hasn't eaten any held berry, so it can't possibly belch!",thispkmn.pbThis))
end
return false
end
if thismove.function==0x188 && # Stuff Cheeks
!pbIsBerry?(thispkmn.item)
if showMessages
pbDisplayPaused(_INTL("The Pokémon can't use that move because it doesn't have any berry!",thispkmn.pbThis))
end
return false
end
For Tar Shot:
Spoiler:
First, edit the function inside move.txt to '044':
Code:
XXX,TARSHOT,Tar Shot,044,0,ROCK,Status,100,15,0,00,0,bce,"The user pours sticky tar over the target, lowering the target's Speed stat. The target becomes weaker to Fire-type moves."
Spoiler:
Code:
################################################################################
# Decreases the target's Speed by 1 stage.
################################################################################
class PokeBattle_Move_044 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
return -1 if !opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,true,self)
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
ret=opponent.pbReduceStat(PBStats::SPEED,1,attacker,false,self)
return ret ? 0 : -1
end
def pbAdditionalEffect(attacker,opponent)
return if opponent.damagestate.substitute
if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
opponent.pbReduceStat(PBStats::SPEED,1,attacker,false,self)
end
end
def pbEffectAfterHit(attacker,opponent,turneffects)
if isConst?(@id,PBMoves,:TARSHOT) && !opponent.effects[PBEffects::TarShot]
opponent.effects[PBEffects::TarShot]=true
@battle.pbDisplay(_INTL("{1} became weaker to fire!",opponent.pbThis))
end
end
def pbModifyDamage(damagemult,attacker,opponent)
if isConst?(@id,PBMoves,:BULLDOZE) &&
@battle.field.effects[PBEffects::GrassyTerrain]>0
return (damagemult/2.0).round
end
return damagemult
end
end
Now we need create a effect. Go in 'PBEffects' script to make one:
Code:
Yawn = 108
TarShot = 109
Same to 'PokeBattle_Battler' script:
Code:
@effects[PBEffects::Yawn] = 0
@effects[PBEffects::TarShot] = false
Finally, inside 'PokeBattle_Move' script, 'def pbTypeModifier(type,attacker,opponent)', paste below Freeze-Dry's code, like (P.S: do the same for 'PokeBattle_AI' script):
Code:
if @function==0x135 && !attacker.effects[PBEffects::Electrify] # Freeze-Dry
mod1=4 if isConst?(otype1,PBTypes,:WATER)
if isConst?(otype2,PBTypes,:WATER)
mod2=(otype1==otype2) ? 2 : 4
end
if isConst?(otype3,PBTypes,:WATER)
mod3=(otype1==otype3 || otype2==otype3) ? 2 : 4
end
end
if opponent.effects[PBEffects::TarShot] && isConst?(atype,PBTypes,:FIRE) # Tar Shot
weakness=mod1
mod1=weakness+1
end
return mod1*mod2*mod3
end
def pbTypeModMessages(type,attacker,opponent)
The codes for the moves, inside 'PokeBattle_MoveEffects' script:
Spoiler:
Code:
################################################################################
# Increases the user's Speed by 1 stage. Fail if the user is not a Morpeko.
# If the user is a Morpeko-Hangry, this move will be Dark type. (Aura Wheel)
################################################################################
class PokeBattle_Move_174 < PokeBattle_Move
def pbMoveFailed(attacker,opponent)
return !isConst?(attacker.species,PBSpecies,:MORPEKO)
end
def pbModifyType(type,attacker,opponent)
type=getConst(PBTypes,:ELECTRIC) || 0
if attacker.form!=0
type=getConst(PBTypes,:DARK) || 0
end
return type
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
return -1 if !attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,true,self)
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
ret=attacker.pbIncreaseStat(PBStats::SPEED,1,attacker,false,self)
return ret ? 0 : -1
end
def pbAdditionalEffect(attacker,opponent)
if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
attacker.pbIncreaseStat(PBStats::SPEED,1,attacker,false,self)
end
end
end
################################################################################
# User's Defense is used instead of user's Attack for this move's calculations.
# (Body Press)
################################################################################
class PokeBattle_Move_175 < PokeBattle_Move
# Handled in superclass def pbCalcDamage, do not edit!
end
################################################################################
# If the user moves before the target, this move's power is doubled (Bolt Beak,
# Fishious Rend)
################################################################################
class PokeBattle_Move_176 < PokeBattle_Move
def pbBaseDamage(basedmg,attacker,opponent)
if @battle.choices[opponent.index][0]==1 && # Chose a move
!opponent.hasMovedThisRound?
return basedmg*2
end
return basedmg
end
end
################################################################################
# Raises all user's stats by 1 stage in exchange for the user losing 1/3 of its
# maximum HP, rounded down. Fails if the user would faint. (Clangorous Soul)
################################################################################
class PokeBattle_Move_177 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.hp<=(attacker.totalhp/3).floor ||
!attacker.pbCanIncreaseStatStage?(PBStats::SPATK,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::SPEED,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,false)
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
showanim=true
if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,false)
attacker.pbIncreaseStat(PBStats::ATTACK,1,false,true,nil,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,false)
attacker.pbIncreaseStat(PBStats::DEFENSE,1,false,true,nil,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,false)
attacker.pbIncreaseStat(PBStats::SPATK,1,false,true,nil,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,false)
attacker.pbIncreaseStat(PBStats::SPDEF,1,false,true,nil,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,false)
attacker.pbIncreaseStat(PBStats::SPEED,1,false,true,nil,showanim)
showanim=false
end
attacker.pbReduceHP((attacker.totalhp/3).round)
return 0
end
end
################################################################################
# Swaps barriers, veils and other effects between each side of the battlefield.
# (Court Change)
################################################################################
class PokeBattle_Move_178 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
changeside=false
for i in 0...2
next if @battle.sides[i].effects[PBEffects::Reflect]==0 &&
@battle.sides[i].effects[PBEffects::LightScreen]==0 &&
@battle.sides[i].effects[PBEffects::AuroraVeil]==0 &&
@battle.sides[i].effects[PBEffects::SeaOfFire]==0 && # Fire Pledge
@battle.sides[i].effects[PBEffects::Swamp]==0 && # Grass Pledge
@battle.sides[i].effects[PBEffects::Rainbow]==0 && # Water Pledge
@battle.sides[i].effects[PBEffects::Mist]==0 &&
@battle.sides[i].effects[PBEffects::Safeguard]==0 &&
[email protected][i].effects[PBEffects::StealthRock] &&
@battle.sides[i].effects[PBEffects::Spikes]==0 &&
[email protected][i].effects[PBEffects::StickyWeb] &&
@battle.sides[i].effects[PBEffects::ToxicSpikes]==0 &&
@battle.sides[i].effects[PBEffects::Tailwind]==0
changeside=true
end
if !changeside
@battle.pbDisplay(_INTL("But it failed!"))
return -1
else
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
[email protected][0]; [email protected][1]
reflect=ownside.effects[PBEffects::Reflect]
ownside.effects[PBEffects::Reflect]=oppside.effects[PBEffects::Reflect]
oppside.effects[PBEffects::Reflect]=reflect
lightscreen=ownside.effects[PBEffects::LightScreen]
ownside.effects[PBEffects::LightScreen]=oppside.effects[PBEffects::LightScreen]
oppside.effects[PBEffects::LightScreen]=lightscreen
auroraveil=ownside.effects[PBEffects::AuroraVeil]
ownside.effects[PBEffects::AuroraVeil]=oppside.effects[PBEffects::AuroraVeil]
oppside.effects[PBEffects::AuroraVeil]=auroraveil
firepledge=ownside.effects[PBEffects::SeaOfFire]
ownside.effects[PBEffects::SeaOfFire]=oppside.effects[PBEffects::SeaOfFire]
oppside.effects[PBEffects::SeaOfFire]=firepledge
grasspledge=ownside.effects[PBEffects::Swamp]
ownside.effects[PBEffects::Swamp]=oppside.effects[PBEffects::Swamp]
oppside.effects[PBEffects::Swamp]=grasspledge
waterpledge=ownside.effects[PBEffects::Rainbow]
ownside.effects[PBEffects::Rainbow]=oppside.effects[PBEffects::Rainbow]
oppside.effects[PBEffects::Rainbow]=waterpledge
mist=ownside.effects[PBEffects::Mist]
ownside.effects[PBEffects::Mist]=oppside.effects[PBEffects::Mist]
oppside.effects[PBEffects::Mist]=mist
spikes=ownside.effects[PBEffects::Spikes]
ownside.effects[PBEffects::Spikes]=oppside.effects[PBEffects::Spikes]
oppside.effects[PBEffects::Spikes]=spikes
toxicspikes=ownside.effects[PBEffects::ToxicSpikes]
ownside.effects[PBEffects::ToxicSpikes]=oppside.effects[PBEffects::ToxicSpikes]
oppside.effects[PBEffects::ToxicSpikes]=toxicspikes
stealthrock=ownside.effects[PBEffects::StealthRock]
ownside.effects[PBEffects::StealthRock]=oppside.effects[PBEffects::StealthRock]
oppside.effects[PBEffects::StealthRock]=stealthrock
stickyweb=ownside.effects[PBEffects::StickyWeb]
ownside.effects[PBEffects::StickyWeb]=oppside.effects[PBEffects::StickyWeb]
oppside.effects[PBEffects::StickyWeb]=stickyweb
tailwind=ownside.effects[PBEffects::Tailwind]
ownside.effects[PBEffects::Tailwind]=oppside.effects[PBEffects::Tailwind]
oppside.effects[PBEffects::Tailwind]=tailwind
@battle.pbDisplay(_INTL("{1} swapped the battle effects affecting each side of the field!",attacker.pbThis))
return 0
end
end
end
################################################################################
# Sharply raises the target's Attack and Sp. Atk stats. (Decorate)
################################################################################
class PokeBattle_Move_179 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if !opponent.pbCanIncreaseStatStage?(PBStats::ATTACK,opponent,false,self) &&
!opponent.pbCanIncreaseStatStage?(PBStats::SPEED,opponent,false,self)
@battle.pbDisplay(_INTL("{1}'s stats won't go any higher!",opponent.pbThis))
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
showanim=true
if opponent.pbCanIncreaseStatStage?(PBStats::ATTACK,opponent,false,self)
opponent.pbIncreaseStat(PBStats::ATTACK,2,opponent,false,self,showanim)
showanim=false
end
if opponent.pbCanIncreaseStatStage?(PBStats::SPATK,opponent,false,self)
opponent.pbIncreaseStat(PBStats::SPATK,2,opponent,false,self,showanim)
showanim=false
end
return 0
end
end
################################################################################
# In singles, this move hits the target twice. In doubles, this move hits each
# target once. If one of the two opponents protects or while semi-invulnerable
# or is a Fairy-type Pokémon, it hits the opponent that doesn't protect twice.
# (Dragon Darts)
################################################################################
class PokeBattle_Move_180 < PokeBattle_Move
def pbIsMultiHit
return true
end
def pbNumHits(attacker)
return 2
end
end
################################################################################
# Prevents both the user and the target from escaping. (Jaw Lock)
################################################################################
class PokeBattle_Move_181 < PokeBattle_Move
def pbEffectAfterHit(attacker,opponent,turneffects)
if (opponent.effects[PBEffects::JawLockUser]<0 && !opponent.effects[PBEffects::JawLock] &&
attacker.effects[PBEffects::JawLockUser]<0 && !attacker.effects[PBEffects::JawLock])
opponent.effects[PBEffects::JawLockUser]=attacker.index
attacker.effects[PBEffects::JawLockUser]=attacker.index
opponent.effects[PBEffects::JawLock]=true
attacker.effects[PBEffects::JawLock]=true
@battle.pbDisplay(_INTL("Neither Pokémon can run away!"))
end
end
end
################################################################################
# The user restores 1/4 of its maximum HP, rounded half up. If there is and
# adjacent ally, the user restores 1/4 of both its and its ally's maximum HP,
# rounded up. (Life Dew)
################################################################################
class PokeBattle_Move_182 < PokeBattle_Move
def isHealingMove?
return true
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
didsomething=false
fullHP=false
for i in [attacker,attacker.pbPartner]
next if !i || i.fainted?
if i.hp==i.totalhp
@battle.pbDisplay(_INTL("{1}'s HP is full!",i.pbThis))
fullHP=true
next
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation) if !didsomething
didsomething=true
showanim=true
i.pbRecoverHP((i.totalhp/4).round,true)
@battle.pbDisplay(_INTL("{1}'s HP was restored.",i.pbThis))
end
return -1 if fullHP
if !didsomething
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
return 0
end
end
################################################################################
# Increases each stat by 1 stage. Prevents user from fleeing. (No Retreat)
################################################################################
class PokeBattle_Move_183 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
meanlook=false; meanlook=true if attacker.effects[PBEffects::MeanLook]>=0
if attacker.effects[PBEffects::NoRetreat] && !meanlook
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
if !attacker.pbCanIncreaseStatStage?(PBStats::SPATK,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::SPEED,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,false)
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
showanim=true
if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,false)
attacker.pbIncreaseStat(PBStats::ATTACK,1,false,true,nil,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,false)
attacker.pbIncreaseStat(PBStats::DEFENSE,1,false,true,nil,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,false)
attacker.pbIncreaseStat(PBStats::SPATK,1,false,true,nil,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,false)
attacker.pbIncreaseStat(PBStats::SPDEF,1,false,true,nil,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,false)
attacker.pbIncreaseStat(PBStats::SPEED,1,false,true,nil,showanim)
showanim=false
end
@battle.pbDisplay(_INTL("{1} can no longer escape because it used {2}!",attacker.pbThis,@name)) if !meanlook
attacker.effects[PBEffects::NoRetreat]=true if !attacker.effects[PBEffects::NoRetreat]
return 0
end
end
################################################################################
# User is protected against damaging moves this round. Decreases the Defense of
# the user of a stopped contact move by 2 stages. (Obstruct)
################################################################################
class PokeBattle_Move_184 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.effects[PBEffects::Obstruct]
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
ratesharers=[
0xAA, # Detect, Protect
0xAB, # Quick Guard
0xAC, # Wide Guard
0xE8, # Endure
0x14B, # King's Shield
0x14C, # Spiky Shield
0x15C, # Baneful Bunker
0x184 # Obstruct
]
if !ratesharers.include?(PBMoveData.new(attacker.lastMoveUsed).function)
attacker.effects[PBEffects::ProtectRate]=1
end
unmoved=false
for poke in @battle.battlers
next if poke.index==attacker.index
if @battle.choices[poke.index][0]==1 && # Chose a move
!poke.hasMovedThisRound?
unmoved=true; break
end
end
if !unmoved ||
(!USENEWBATTLEMECHANICS &&
@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::Obstruct]=true
attacker.effects[PBEffects::ProtectRate]*=2
@battle.pbDisplay(_INTL("{1} protected itself!",attacker.pbThis))
return 0
end
end
################################################################################
# Lowers target's Defense and Special Defense by 1 stage at the end of each
# turn. Prevents target from retreating. (Octolock)
################################################################################
class PokeBattle_Move_185 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if opponent.effects[PBEffects::Octolock] || opponent.effects[PBEffects::NoRetreat] ||
(opponent.effects[PBEffects::Substitute]>0 && !ignoresSubstitute?(attacker))
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
if USENEWBATTLEMECHANICS && opponent.pbHasType?(:GHOST)
@battle.pbDisplay(_INTL("It doesn't affect {1}...",opponent.pbThis(true)))
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.effects[PBEffects::OctolockUser]=attacker.index
opponent.effects[PBEffects::Octolock]=true
@battle.pbDisplay(_INTL("{1} can no longer escape because of {2}!",opponent.pbThis,@name))
return 0
end
end
################################################################################
# Ignores move redirection from abilities and moves. (Snipe Shot)
################################################################################
class PokeBattle_Move_186 < PokeBattle_Move
end
################################################################################
# Consumes berry and raises the user's Defense by 2 stages. (Stuff Cheeks)
################################################################################
class PokeBattle_Move_187 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if !pbIsBerry?(attacker.item) ||
attacker.pbOpposing1.hasWorkingAbility(:UNNERVE) ||
attacker.pbOpposing2.hasWorkingAbility(:UNNERVE)
@battle.pbDisplay("But it failed!")
return -1
end
return -1 if !attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,true,self)
attacker.pbActivateBerryEffect
attacker.pbConsumeItem
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
ret=attacker.pbIncreaseStat(PBStats::DEFENSE,2,attacker,false,self)
return ret ? 0 : -1
end
end
################################################################################
# Forces all active Pokémon to consume their held berries. This move bypasses
# Substitutes. (Tea Time)
################################################################################
class PokeBattle_Move_188 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
@battle.pbDisplay(_INTL("It's teatime! Everyone dug in to their Berries!"))
for i in 0...4
if !pbIsBerry?(@battle.battlers[i].item)
@battle.pbDisplay(_INTL("But nothing happened!"))
return -1
else
@battle.battlers[i].pbActivateBerryEffect
@battle.battlers[i].pbConsumeItem
return 0
end
end
end
end
Also need to edit ' def ignoresSubstitute?(attacker)' and add Life Dew and Tea Time:
Spoiler:
Code:
def ignoresSubstitute?(attacker)
if USENEWBATTLEMECHANICS
return true if isSoundBased?
return true if attacker && attacker.hasWorkingAbility(:INFILTRATOR)
return true if attacker && isConst?(thismove.id,PBMoves,:AFTERYOU)
return true if attacker && isConst?(thismove.id,PBMoves,:AROMATICMIST)
return true if attacker && isConst?(thismove.id,PBMoves,:ATTRACT)
return true if attacker && isConst?(thismove.id,PBMoves,:BESTOW)
return true if attacker && isConst?(thismove.id,PBMoves,:BOOMBURST)
return true if attacker && isConst?(thismove.id,PBMoves,:BUGBUZZ)
return true if attacker && isConst?(thismove.id,PBMoves,:CHATTER)
return true if attacker && isConst?(thismove.id,PBMoves,:CLANGINGSCALES)
return true if attacker && isConst?(thismove.id,PBMoves,:CONFIDE)
return true if attacker && isConst?(thismove.id,PBMoves,:CONVERSION2)
return true if attacker && isConst?(thismove.id,PBMoves,:CURSE)
return true if attacker && isConst?(thismove.id,PBMoves,:DESTINYBOND)
return true if attacker && isConst?(thismove.id,PBMoves,:DISABLE)
return true if attacker && isConst?(thismove.id,PBMoves,:DISARMINGVOICE)
return true if attacker && isConst?(thismove.id,PBMoves,:ECHOEDVOICE)
return true if attacker && isConst?(thismove.id,PBMoves,:ENCORE)
return true if attacker && isConst?(thismove.id,PBMoves,:FAIRYLOCK)
return true if attacker && isConst?(thismove.id,PBMoves,:FORESIGHT)
return true if attacker && isConst?(thismove.id,PBMoves,:GEARUP)
return true if attacker && isConst?(thismove.id,PBMoves,:GRASSWHISTLE)
return true if attacker && isConst?(thismove.id,PBMoves,:GROWL)
return true if attacker && isConst?(thismove.id,PBMoves,:GRUDGE)
return true if attacker && isConst?(thismove.id,PBMoves,:GUARDSWAP)
return true if attacker && isConst?(thismove.id,PBMoves,:HAZE)
return true if attacker && isConst?(thismove.id,PBMoves,:HEALBELL)
return true if attacker && isConst?(thismove.id,PBMoves,:HEARTSWAP)
return true if attacker && isConst?(thismove.id,PBMoves,:HELPINGHAND)
return true if attacker && isConst?(thismove.id,PBMoves,:HYPERSPACEFURY)
return true if attacker && isConst?(thismove.id,PBMoves,:HYPERSPACEHOLY)
return true if attacker && isConst?(thismove.id,PBMoves,:HYPERVOICE)
return true if attacker && isConst?(thismove.id,PBMoves,:IMPRISON)
return true if attacker && isConst?(thismove.id,PBMoves,:INSTRUCT)
return true if attacker && isConst?(thismove.id,PBMoves,:MAGNETICFLUX)
return true if attacker && isConst?(thismove.id,PBMoves,:METALSOUND)
return true if attacker && isConst?(thismove.id,PBMoves,:MIRACLEEYE)
return true if attacker && isConst?(thismove.id,PBMoves,:NOBLEROAR)
return true if attacker && isConst?(thismove.id,PBMoves,:ODORSLEUTH)
return true if attacker && isConst?(thismove.id,PBMoves,:PARTINGSHOT)
return true if attacker && isConst?(thismove.id,PBMoves,:PERISHSONG)
return true if attacker && isConst?(thismove.id,PBMoves,:PLAYNICE)
return true if attacker && isConst?(thismove.id,PBMoves,:POWDER)
return true if attacker && isConst?(thismove.id,PBMoves,:POWERSWAP)
return true if attacker && isConst?(thismove.id,PBMoves,:PSYCHUP)
return true if attacker && isConst?(thismove.id,PBMoves,:RECLECTTYPE)
return true if attacker && isConst?(thismove.id,PBMoves,:RELICSONG)
return true if attacker && isConst?(thismove.id,PBMoves,:ROAR)
return true if attacker && isConst?(thismove.id,PBMoves,:ROLEPLAY)
return true if attacker && isConst?(thismove.id,PBMoves,:ROUND)
return true if attacker && isConst?(thismove.id,PBMoves,:SCREECH)
return true if attacker && isConst?(thismove.id,PBMoves,:SING)
return true if attacker && isConst?(thismove.id,PBMoves,:SKILLSWAP)
return true if attacker && isConst?(thismove.id,PBMoves,:SNARL)
return true if attacker && isConst?(thismove.id,PBMoves,:SNORE)
return true if attacker && isConst?(thismove.id,PBMoves,:SPARKLINGARIA)
return true if attacker && isConst?(thismove.id,PBMoves,:SPECTRALTHIEF)
return true if attacker && isConst?(thismove.id,PBMoves,:SPEEDSWAP)
return true if attacker && isConst?(thismove.id,PBMoves,:SPITE)
return true if attacker && isConst?(thismove.id,PBMoves,:SUPERSONIC)
return true if attacker && isConst?(thismove.id,PBMoves,:TAUNT)
return true if attacker && isConst?(thismove.id,PBMoves,:TORMENT)
return true if attacker && isConst?(thismove.id,PBMoves,:UPROAR)
return true if attacker && isConst?(thismove.id,PBMoves,:WHIRLWIND)
return true if attacker && isConst?(thismove.id,PBMoves,:LIFEDEW)
return true if attacker && isConst?(thismove.id,PBMoves,:TEATIME)
end
return false
end
Last edited: