- 143
- Posts
- 5
- Years
- Seen Mar 26, 2024
Hey there everyone!
While developing my fan game, I made some new moves and just wanted to share one of them for usage. So feel free to use it for your own game (No Credits needed).
Feedback and bug reports are always nice. :)
The move is a more competitively viable alternative of Metronome. It essentially chooses a semi random status move out of a pool that is determined by clauses in the individual battle (f.ex. weather, items, types...). I'm especially looking for ways to improve its "AI" and also make its code shorter so please tell me about any ideas you guys might have.
WARNING: Implementing this move could take some time and effort!
There are two versions of this because I'm using a field effect system similar to Reborn's and also added some custom stuff to my game.
Link to Reborn: https://www.rebornevo.com/forums/
Implementation
1.First add this to your moves.txt:
2.Change YYY to the next number following the previous move
3.Then add either the first or second code block at the bottom of your Move_Effects Script.
I couldn't find Aurora Veil or Sticky Web in the vanilla essentials script (probably mb) So you have to alter its function code in your sript, but that will be explained in the following step.
1. VERSION
Original (with custom stuff)
Use this version only if:
-Your game is up to date until gen 8
-has Reborns field effect system
Otherwise use the second batch of code!
After inserting the code, Press Ctrl+F to open the search window and type in : #$%
Then read, check and alter every line it found (else it won't work):
2. VERSION
Adapted for "normal essentials" (I hope so at least)
There could be some things I missed. If not, this should work with 17.2.(up to gen 5)
After inserting the code, Press Ctrl+F to open the search window and type in : #$%
Then read, check and alter every line it found (else it won't work):
Because I'm new to all this, general formatting advice is also appreciated . :)
Have a nice day!
While developing my fan game, I made some new moves and just wanted to share one of them for usage. So feel free to use it for your own game (No Credits needed).
Feedback and bug reports are always nice. :)
The move is a more competitively viable alternative of Metronome. It essentially chooses a semi random status move out of a pool that is determined by clauses in the individual battle (f.ex. weather, items, types...). I'm especially looking for ways to improve its "AI" and also make its code shorter so please tell me about any ideas you guys might have.
WARNING: Implementing this move could take some time and effort!
There are two versions of this because I'm using a field effect system similar to Reborn's and also added some custom stuff to my game.
Link to Reborn: https://www.rebornevo.com/forums/
Implementation
1.First add this to your moves.txt:
Spoiler:
YYY,ARTISTRY,Artistry,203,0,NORMAL,Status,0,20,0,01,0,,"The user analyzes the situation and then uses an advantageous move."
2.Change YYY to the next number following the previous move
3.Then add either the first or second code block at the bottom of your Move_Effects Script.
I couldn't find Aurora Veil or Sticky Web in the vanilla essentials script (probably mb) So you have to alter its function code in your sript, but that will be explained in the following step.
1. VERSION
Original (with custom stuff)
Use this version only if:
-Your game is up to date until gen 8
-has Reborns field effect system
Otherwise use the second batch of code!
After inserting the code, Press Ctrl+F to open the search window and type in : #$%
Then read, check and alter every line it found (else it won't work):
Spoiler:
Code:
################################################################################
# Artistry
################################################################################
class PokeBattle_Move_203 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
goodarray=[]
decentarray=[]
badarray=[343] # Acupressure
#badarray=[746] # Invigorate
opponent1=attacker.pbOpposing1
opponent2=attacker.pbOpposing2
#=========Aurora Veil=========#
if (@battle.weather==PBWeather::HAIL || $fefieldeffect==4 || $fefieldeffect==9 || $fefieldeffect==13 ||
$fefieldeffect==25 || $fefieldeffect==28 || $fefieldeffect==30 || $fefieldeffect==34) && #|| $fefieldeffect==38 custom field effect
attacker.pbOwnSide.effects[PBEffects::AuroraVeil]==0
if (attacker.pbOwnSide.effects[PBEffects::Reflect]==0 && attacker.pbOwnSide.effects[PBEffects::LightScreen]==0) &&
attacker.hasWorkingItem(:LIGHTCLAY) || $fefieldeffect==30
#$%change the "640" to the number of the move Aurora Veil in your moves.txt
goodarray.push(640)# Aurora Veil
elsif attacker.pbOwnSide.effects[PBEffects::Reflect]==0 && attacker.pbOwnSide.effects[PBEffects::LightScreen]==0
#$%change the "640" to the number of the move Aurora Veil in your moves.txt
decentarray.push(640)# Aurora Veil
else
#$%change the "640" to the number of the move Aurora Veil in your moves.txt
badarray.push(640)# Aurora Veil
end
end
#=========Reflect=========#
if attacker.pbOwnSide.effects[PBEffects::AuroraVeil]==0 && attacker.pbOwnSide.effects[PBEffects::Reflect]==0
if attacker.hasWorkingItem(:LIGHTCLAY) || $fefieldeffect==30
if opponent1.attack>opponent1.spatk || opponent2.attack>opponent2.spatk
goodarray.push(492)# Reflect
else
badarray.push(492)# Reflect
end
elsif opponent1.attack>opponent1.spatk || opponent2.attack>opponent2.spatk
decentarray.push(492)# Reflect
else
badarray.push(492)# Reflect
end
end
#=========Light Screen=========#
if attacker.pbOwnSide.effects[PBEffects::AuroraVeil]==0 && attacker.pbOwnSide.effects[PBEffects::LightScreen]==0
if attacker.hasWorkingItem(:LIGHTCLAY) || $fefieldeffect==30
if opponent1.attack<opponent1.spatk || opponent2.attack<opponent2.spatk
decentarray.push(482)# Light Screen
else
badarray.push(482)# Light Screen
end
elsif opponent1.attack<opponent1.spatk || opponent2.attack<opponent2.spatk
decentarray.push(482)# Light Screen
else
badarray.push(482)# Light Screen
end
end
#=========Heal Bell=========#
# if $fefieldeffect!=44 custom field effect
[email protected](attacker.index)
healbell=0
activepkmn=[]
for i in @battle.battlers
next if attacker.pbIsOpposing?(i.index)
if i.status!=0
healbell+=2
activepkmn.push(i.pokemonIndex)
end
end
for i in 0...party.length
next if activepkmn.include?(i)
next if !party[i] || party[i].isEgg?
if party[i].status!=0
healbell+=1
end
end
if healbell>=4
goodarray.push(371)# Heal Bell
elsif healbell>=2
decentarray.push(371)# Heal Bell
elsif healbell==2
badarray.push(371)# Heal Bell
end
#end
#=========Trick Room|Tail Wind|Thunder Wave=========#
typemod1=pbTypeModifier(PBTypes::ELECTRIC,attacker,opponent1)
typemod2=pbTypeModifier(PBTypes::ELECTRIC,attacker,opponent2)
if attacker.speed<opponent1.speed || attacker.speed<opponent2.speed
if @battle.trickroom==0
#$%remove Amplified Rock if it doesn't exist in your game
if attacker.hasWorkingItem(:ROOMSERVICE) || attacker.hasWorkingItem(:AMPLIFIELDROCK) ||
$fefieldeffect==5 || $fefieldeffect==35 || $fefieldeffect==37
goodarray.push(499)# Trick Room
else
decentarray.push(499)# Trick Room
end
end
if attacker.pbOwnSide.effects[PBEffects::Tailwind]==0
if $fefieldeffect==27 || $fefieldeffect==28
goodarray.push(173)# Tail Wind
else
decentarray.push(173)# Tail Wind
end
end
if (opponent1.status==0 && typemod1==0 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)) ||
(opponent2.status==0 && typemod2==0 && !opponent2.hasWorkingAbility(:MAGICBOUNCE))
decentarray.push(83)# Thunder Wave
end
end
#=========Psych Up #|False Hope #custom move=========#
opponentstages1=opponent1.stages[PBStats::ATTACK]+opponent1.stages[PBStats::DEFENSE]+
opponent1.stages[PBStats::SPATK]+opponent1.stages[PBStats::SPDEF]+
opponent1.stages[PBStats::SPEED]+opponent1.stages[PBStats::EVASION]+
opponent1.stages[PBStats::ACCURACY]
opponentstages2=opponent2.stages[PBStats::ATTACK]+opponent2.stages[PBStats::DEFENSE]+
opponent2.stages[PBStats::SPATK]+opponent2.stages[PBStats::SPDEF]+
opponent2.stages[PBStats::SPEED]+opponent2.stages[PBStats::EVASION]+
opponent2.stages[PBStats::ACCURACY]
if $fefieldeffect==20 && (attacker.status==PBStatuses::BURN || attacker.status==PBStatuses::POISON ||
attacker.status==PBStatuses::PARALYSIS)
opponentstages1+=2
opponentstages2+=2
end
if $fefieldeffect==37 && attacker.stages[PBStats::SPATK]<6 && attacker.spatk>attacker.attack
opponentstages1+=2
opponentstages2+=2
end
opponentstages1=0 if opponent1.hasWorkingAbility(:MAGICBOUNCE)
opponentstages2=0 if opponent2.hasWorkingAbility(:MAGICBOUNCE)
if opponentstages1>8 || opponentstages2>8
goodarray.push(392)# Psych Up
# goodarray.push(744)# False Hope # custom move
elsif opponentstages1>5 || opponentstages2>5
decentarray.push(392)# Psych Up
# decentarray.push(744)# False Hope # custom move
elsif opponentstages1>2 || opponentstages2>2
badarray.push(392)# Psych Up
#badarray.push(744)# False Hope # custom move
end
#=========Sandstorm=========#
sandstorm=0
if attacker.pbHasType?(:ROCK) || attacker.hasWorkingAbility(:SANDRUSH) || attacker.hasWorkingAbility(:SANDFORCE)
sandstorm+=2
elsif attacker.pbHasType?(:STEEL) || attacker.pbHasType?(:GROUND) || attacker.hasWorkingAbility(:SANDVEIL)
sandstorm+=1
end
if attacker.hasWorkingItem(:SMOOTHROCK)
sandstorm+=1
end
if @battle.weather!=0
sandstorm+=1
end
if @battle.weather==PBWeather::SANDSTORM || $fefieldeffect==12 || $fefieldeffect==22 || $fefieldeffect==35
sandstorm=0
end
if sandstorm==4
goodarray.push(513)# Sand Storm
elsif sandstorm>=2
decentarray.push(513)# Sand Storm
elsif sandstorm==1
badarray.push(513)# Sand Storm
end
#=========Hail=========#
hail=0
if attacker.hasWorkingAbility(:SLUSHRUSH) || attacker.hasWorkingAbility(:FORECAST)
hail+=2
elsif attacker.pbHasType?(:ICE) || attacker.hasWorkingAbility(:SNOWCLOAK) || attacker.hasWorkingAbility(:ICEBODY)
hail+=1
end
if attacker.hasWorkingItem(:ICYROCK)
hail+=1
end
if @battle.weather!=0
hail+=1
end
if @battle.weather==PBWeather::HAIL || $fefieldeffect==13 ||
$fefieldeffect==28 || $fefieldeffect==22 || $fefieldeffect==35 #|| $fefieldeffect==38 cstom field effect
hail=0
end
if hail==4
goodarray.push(257)# Hail
elsif hail>=2
decentarray.push(257)# Hail
elsif hail==1
badarray.push(257)# Hail
end
#=========Sunny Day=========#
sunny=0
if attacker.hasWorkingAbility(:FORECAST) || attacker.hasWorkingAbility(:FLOWERGIFT) ||
attacker.hasWorkingAbility(:CHLOROPHYLL) || attacker.hasWorkingAbility(:SOLARPOWER)
sunny+=2
elsif attacker.pbHasType?(:FIRE) || attacker.hasWorkingAbility(:LEAFGUARD) ||
attacker.hasWorkingAbility(:HARVEST)
sunny+=1
end
if attacker.hasWorkingItem(:HEATROCK)
sunny+=1
end
if @battle.weather==PBWeather::SUNNYDAY || attacker.hasWorkingItem(:UTILITYUMBRELLA) || attacker.hasWorkingAbility(:DRYSKIN) ||
attacker.pbHasType?(:WATER) || $fefieldeffect==22 || $fefieldeffect==35
sunny=0
end
if @battle.weather!=0
sunny+=1
end
if sunny==4
goodarray.push(150)# Sunny Day
elsif sunny>=2
decentarray.push(150)# Sunny Day
elsif sunny==1
badarray.push(150)# Sunny Day
end
#=========Rain Dance=========#
rain=0
if attacker.hasWorkingAbility(:FORECAST) || attacker.hasWorkingAbility(:SWIFTSWIM)
rain+=2
elsif attacker.pbHasType?(:WATER) || attacker.hasWorkingAbility(:DRYSKIN) ||
attacker.hasWorkingAbility(:HYDRATION) || attacker.hasWorkingAbility(:RAINDISH)
rain+=1
end
if attacker.hasWorkingItem(:DAMPROCK)
rain+=1
end
if @battle.weather==PBWeather::RAINDANCE || attacker.hasWorkingItem(:UTILITYUMBRELLA) ||
attacker.pbHasType?(:FIRE) || $fefieldeffect==22 || $fefieldeffect==35
rain=0
end
if @battle.weather!=0
rain+=1
end
if rain==4
goodarray.push(556)# Rain Dance
elsif rain>=2
decentarray.push(556)# Rain Dance
elsif rain==1
badarray.push(556)# Rain Dance
end
#=========Court Change=========#
courtchange=0
courtchange+=1 if attacker.pbOpposingSide.effects[PBEffects::Reflect]>0
courtchange+=1 if attacker.pbOpposingSide.effects[PBEffects::LightScreen]>0
courtchange+=1 if attacker.pbOpposingSide.effects[PBEffects::AuroraVeil]>0
courtchange+=1 if attacker.pbOpposingSide.effects[PBEffects::Tailwind]>0
courtchange+=1 if attacker.pbOwnSide.effects[PBEffects::Spikes]>0
courtchange+=1 if attacker.pbOwnSide.effects[PBEffects::ToxicSpikes]>0
courtchange+=1 if attacker.pbOwnSide.effects[PBEffects::StealthRock]
courtchange+=1 if attacker.pbOwnSide.effects[PBEffects::StickyWeb]
if courtchange>=2
#$%change the "705" to the number of the move Court Change in your moves.txt
goodarray.push(705)# Court Change
elsif courtchange>=1
#$%change the "705" to the number of the move Court Change in your moves.txt
decentarray.push(705)# Court Change
end
#=========Spikes|Toxic Spikes|Stealth Rock|Sticky Web=========#
if !opponent1.hasWorkingAbility(:MAGICBOUNCE) || !opponent2.hasWorkingAbility(:MAGICBOUNCE)
#$%change the "604" to the number of the move Sticky Web in your moves.txt
decentarray.push(604) if !attacker.pbOpposingSide.effects[PBEffects::StickyWeb] # Sticky Web
decentarray.push(514) if !attacker.pbOpposingSide.effects[PBEffects::StealthRock] # Stealth Rock
badarray.push(239) if attacker.pbOpposingSide.effects[PBEffects::Spikes]<3 # Spikes
if attacker.pbOpposingSide.effects[PBEffects::ToxicSpikes]<2 && !opponent1.pbHasType?(:STEEL) &&
!opponent2.pbHasType?(:STEEL) && !opponent1.pbHasType?(:POISON) && !opponent2.pbHasType?(:POISON)
badarray.push(447)# Toxic Spikes
end
end
#=========Electric Terrain=========#
electric=0
if attacker.hasWorkingAbility(:SURGESURFER)
electric+=2
#$%change the "ELEMENTALSEED" to "ELECTRICSEED" if it's not in your game files
elsif attacker.pbHasType?(:ELECTRIC) || attacker.hasWorkingItem(:ELEMENTALSEED) ||
attacker.hasWorkingAbility(:GALVANIZE)
electric+=1
end
#$%change the "AMPLIFIEDROCK" to "TERRAINEXTENDER" if it's not in your game files
if attacker.hasWorkingItem(:AMPLIFIEDROCK)
electric+=1
end
if $fefieldeffect==1
electric=0
end
if electric==3
#$%change the "571" to the number of the move Electric Terrain in your moves.txt
goodarray.push(571)# Electric Terrain
elsif electric==2
#$%change the "571" to the number of the move Electric Terrain in your moves.txt
decentarray.push(571)# Electric Terrain
elsif electric==1
#$%change the "571" to the number of the move Electric Terrain in your moves.txt
badarray.push(571)# Electric Terrain
end
#=========Misty Terrain=========#
misty=0
if attacker.pbHasType?(:FAIRY) || attacker.hasWorkingAbility(:MARVELSCALE) ||
attacker.hasWorkingAbility(:WATERCOMPACTION) || attacker.effects[PBEffects::AquaRing]
misty+=2
#$%change the "ELEMENTALSEED" to "MISTYSEED" if it's not in your game files
elsif opponent1.pbHasType?(:DRAGON) || opponent2.pbHasType?(:DRAGON) ||
attacker.hasWorkingItem(:ELEMENTALSEED) || attacker.hasWorkingAbility(:SOULHEART) ||
attacker.hasWorkingAbility(:DRYSKIN) || attacker.hasWorkingAbility(:PIXILATE)
misty+=1
end
#$%change the "AMPLIFIEDROCK" to "TERRAINEXTENDER" if it's not in your game files
if attacker.hasWorkingItem(:AMPLIFIEDROCK)
misty+=1
end
if $fefieldeffect==3
misty=0
end
if misty==3
#$%change the "588" to the number of the move Misty Terrain in your moves.txt
goodarray.push(588)# Misty Terrain
elsif misty==2
#$%change the "588" to the number of the move Misty Terrain in your moves.txt
decentarray.push(588)# Misty Terrain
elsif misty==1
#$%change the "588" to the number of the move Misty Terrain in your moves.txt
badarray.push(588)# Misty Terrain
end
#=========Psychic Terrain=========#
psychic=0
if attacker.hasWorkingAbility(:TELEPATHY)
psychic+=2
#$%change the "MAGICALSEED" to "PSYCHICSEED" if it's not in your game files
elsif attacker.pbHasType?(:PSYCHIC) || attacker.hasWorkingItem(:MAGICALSEED)
psychic+=1
end
#$%change the "AMPLIFIEDROCK" to "TERRAINEXTENDER" if it's not in your game files
if attacker.hasWorkingItem(:AMPLIFIEDROCK)
psychic+=1
end
if $fefieldeffect==37
psychic=0
end
if psychic==3
#$%change the "667" to the number of the move Psychic Terrain in your moves.txt
goodarray.push(667)# Psychic Terrain
elsif psychic==2
#$%change the "667" to the number of the move Psychic Terrain in your moves.txt
decentarray.push(667)# Psychic Terrain
elsif psychic==1
#$%change the "667" to the number of the move Psychic Terrain in your moves.txt
badarray.push(667)# Psychic Terrain
end
#=========Grassy Terrain=========#
grassy=0
if attacker.hasWorkingAbility(:GRASSPELT)
grassy+=2
#$%change the "ELEMENTALSEED" to "GRASSYSEED" if it's not in your game files
elsif attacker.pbHasType?(:FIRE) || attacker.pbHasType?(:GRASS) || attacker.hasWorkingItem(:ELEMENTALSEED)
grassy+=1
end
#$%change the "AMPLIFIEDROCK" to "TERRAINEXTENDER" if it's not in your game files
if attacker.hasWorkingItem(:AMPLIFIEDROCK)
grassy+=1
end
if $fefieldeffect==2
grassy=0
end
if grassy==3
#$%change the "581" to the number of the move Grassy Terrain in your moves.txt
goodarray.push(581)# Grassy Terrain
elsif grassy==2
#$%change the "581" to the number of the move Grassy Terrain in your moves.txt
decentarray.push(581)# Grassy Terrain
elsif grassy==1
#$%change the "581" to the number of the move Grassy Terrain in your moves.txt
badarray.push(581)# Grassy Terrain
end
#=========Baton Pass=========#
attackerstages=attacker.stages[PBStats::ATTACK]+attacker.stages[PBStats::DEFENSE]+
attacker.stages[PBStats::SPATK]+attacker.stages[PBStats::SPDEF]+
attacker.stages[PBStats::SPEED]+attacker.stages[PBStats::EVASION]+
attacker.stages[PBStats::ACCURACY]
attackerstages+=1 if attacker.effects[PBEffects::AquaRing]
attackerstages+=2 if attacker.effects[PBEffects::Substitute]
attackerstages+=1 if attacker.effects[PBEffects::Ingrain]
attackerstages+=2 if attacker.effects[PBEffects::FocusEnergy]
attackerstages-=1 if attacker.effects[PBEffects::LockOn]>0
attackerstages-=1 if attacker.effects[PBEffects::Confusion]>0
attackerstages-=2 if attacker.effects[PBEffects::Curse]
if attackerstages>8
goodarray.push(347)# Baton Pass
elsif attackerstages>5
decentarray.push(347)# Baton Pass
elsif attackerstages>2
badarray.push(347)# Baton Pass
end
#=========Recover=========#
if attacker.hp<=attacker.totalhp
if opponent1.status==PBStatuses::SLEEP || opponent1.status==PBStatuses::FROZEN ||
opponent1.effects[PBEffects::HyperBeam]>0 || opponent2.status==PBStatuses::SLEEP ||
opponent2.status==PBStatuses::FROZEN || opponent2.effects[PBEffects::HyperBeam]>0
goodarray.push(393)# Recover
elsif opponent1.status==PBStatuses::PARALYSIS || opponent1.effects[PBEffects::Confusion]>0 ||
opponent1.effects[PBEffects::Attract]>0 || opponent2.status==PBStatuses::PARALYSIS ||
opponent2.effects[PBEffects::Confusion]>0 || opponent2.effects[PBEffects::Attract]>0
decentarray.push(393)# Recover
end
end
#=========Pain Split=========#
goodarray.push(389) if attacker.hp<opponent1.hp/4 || attacker.hp<opponent2.hp/4 # Pain Split
decentarray.push(389) if attacker.hp<opponent1.hp/2 || attacker.hp<opponent2.hp/2 # Pain Split
#=========Spore=========#
if (opponent1.status==0 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)) ||
(opponent2.status==0 && !opponent2.hasWorkingAbility(:MAGICBOUNCE))
decentarray.push(219) # Spore
end
#=========Will-O-Wisp=========#
if (opponent1.status==0 && opponent1.attack>opponent1.spatk && !opponent1.hasWorkingAbility(:MAGICBOUNCE)) ||
(opponent2.status==0 && opponent2.attack>opponent1.spatk && !opponent2.hasWorkingAbility(:MAGICBOUNCE))
decentarray.push(151) # Will-O-Wisp
end
#=========Attract=========#
agender=attacker.gender
ogender1=opponent1.gender
ogender2=opponent2.gender
if ((agender==0 && ogender1==1) || (agender==1 && ogender1==0) &&
opponent1.effects[PBEffects::Attract]==-1 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)) ||
((agender==0 && ogender2==1) || (agender==1 && ogender2==0) &&
opponent2.effects[PBEffects::Attract]==-1 && !opponent2.hasWorkingAbility(:MAGICBOUNCE))
decentarray.push(346) if opponent1.status==PBStatuses::PARALYSIS || opponent2.status==PBStatuses::PARALYSIS # Attract
badarray.push(346) if !opponent1.status==PBStatuses::PARALYSIS && !opponent2.status==PBStatuses::PARALYSIS # Attract
end
#=========Aqua Ring=========#
if $fefieldeffect == 3 || $fefieldeffect == 8 || $fefieldeffect == 21 || $fefieldeffect == 22
decentarray.push(555)# Aqua Ring
end
if goodarray.length==0 && decentarray.length==0
artistrymove=badarray[@battle.pbRandom(badarray.length-1)]
elsif goodarray.length==0 && decentarray.length>0
if @battle.pbRandom(100)<=80
artistrymove=decentarray[@battle.pbRandom(decentarray.length-1)]
else
artistrymove=badarray[@battle.pbRandom(decentarray.length-1)]
end
elsif decentarray.length==0 && goodarray.length>0
if @battle.pbRandom(100)<=95
artistrymove=goodarray[@battle.pbRandom(decentarray.length-1)]
else
artistrymove=badarray[@battle.pbRandom(decentarray.length-1)]
end
else
[email protected](100)
if random<=5
artistrymove=badarray[@battle.pbRandom(goodarray.length-1)]
elsif random<=30
artistrymove=decentarray[@battle.pbRandom(goodarray.length-1)]
elsif random<=100
artistrymove=goodarray[@battle.pbRandom(goodarray.length-1)]
end
end
if @battle.doublebattle
targetopponent=0
case artistrymove
when 83 # Thunder Wave
if (opponent1.status==0 && typemod1!=0 && !opponent1.hasWorkingAbility(:MAGICBOUNCE))
targetopponent=1
elsif (opponent2.status==0 && typemod2!=0 && !opponent2.hasWorkingAbility(:MAGICBOUNCE))
targetopponent=2
end
when 392 # Psych Up
if opponentstages1>=opponentstages2
targetopponent=1
elsif opponentstages1<opponentstages2
targetopponent=2
end
# when 744 # False Hope #custom move
# if opponentstages1>=opponentstages2 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)
# targetopponent=1
# elsif opponentstages1<opponentstages2 && !opponent2.hasWorkingAbility(:MAGICBOUNCE)
# targetopponent=2
# end
when 389 # Pain Split
if opponent1.hp<=opponent2.hp
targetopponent=1
elsif opponent1.hp>opponent2.hp
targetopponent=2
end
when 219 # Spore
if opponent1.status==0 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=1
elsif opponent2.status==0 && !opponent2.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=2
end
when 151 # Will-O-Wisp
if opponent1.status==0 && opponent1.attack>opponent1.spatk && !opponent1.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=1
elsif opponent2.status==0 && opponent2.attack>opponent2.spatk && !opponent2.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=2
elsif opponent1.status==0 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=1
elsif opponent2.status==0 && !opponent2.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=2
end
when 346 # Attract
if (agender==0 && ogender1==1) || (agender==1 && ogender1==0) &&
opponent1.effects[PBEffects::Attract]==-1 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=1
elsif (agender==0 && ogender2==1) || (agender==1 && ogender2==0) &&
opponent2.effects[PBEffects::Attract]==-1 && !opponent2.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=2
end
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
if targetopponent==1
attacker.pbUseMoveSimple(artistrymove,-1,1)
elsif targetopponent==2
attacker.pbUseMoveSimple(artistrymove,-1,3)
end
else
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
attacker.pbUseMoveSimple(artistrymove)
end
return 0
end
end
Adapted for "normal essentials" (I hope so at least)
There could be some things I missed. If not, this should work with 17.2.(up to gen 5)
After inserting the code, Press Ctrl+F to open the search window and type in : #$%
Then read, check and alter every line it found (else it won't work):
Spoiler:
Code:
################################################################################
# Artistry
################################################################################
class PokeBattle_Move_203 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
goodarray=[]
decentarray=[]
badarray=[343] # Acupressure
opponent1=attacker.pbOpposing1
opponent2=attacker.pbOpposing2
#=========Aurora Veil=========#
if @battle.weather==PBWeather::HAIL && attacker.pbOwnSide.effects[PBEffects::AuroraVeil]==0
if attacker.pbOwnSide.effects[PBEffects::Reflect]==0 && attacker.pbOwnSide.effects[PBEffects::LightScreen]==0 &&
attacker.hasWorkingItem(:LIGHTCLAY)
#$%change the "640" to the number of the move Aurora Veil in your moves.txt
goodarray.push(640)# Aurora Veil
elsif attacker.pbOwnSide.effects[PBEffects::Reflect]==0 && attacker.pbOwnSide.effects[PBEffects::LightScreen]==0
#$%change the "640" to the number of the move Aurora Veil in your moves.txt
decentarray.push(640)# Aurora Veil
else
#$%change the "640" to the number of the move Aurora Veil in your moves.txt
badarray.push(640)# Aurora Veil
end
end
#=========Reflect=========#
if attacker.pbOwnSide.effects[PBEffects::AuroraVeil]==0 && attacker.pbOwnSide.effects[PBEffects::Reflect]==0
if attacker.hasWorkingItem(:LIGHTCLAY)
if opponent1.attack>opponent1.spatk || opponent2.attack>opponent2.spatk
goodarray.push(395)# Reflect
else
badarray.push(395)# Reflect
end
elsif opponent1.attack>opponent1.spatk || opponent2.attack>opponent2.spatk
decentarray.push(395)# Reflect
else
badarray.push(395)# Reflect
end
end
#=========Light Screen=========#
if attacker.pbOwnSide.effects[PBEffects::AuroraVeil]==0 && attacker.pbOwnSide.effects[PBEffects::LightScreen]==0
if attacker.hasWorkingItem(:LIGHTCLAY)
if opponent1.attack<opponent1.spatk || opponent2.attack<opponent2.spatk
decentarray.push(482)# Light Screen
else
badarray.push(482)# Light Screen
end
elsif opponent1.attack<opponent1.spatk || opponent2.attack<opponent2.spatk
decentarray.push(482)# Light Screen
else
badarray.push(482)# Light Screen
end
end
#=========Heal Bell=========#
[email protected](attacker.index)
healbell=0
activepkmn=[]
for i in @battle.battlers
next if attacker.pbIsOpposing?(i.index)
if i.status!=0
healbell+=2
activepkmn.push(i.pokemonIndex)
end
end
for i in 0...party.length
next if activepkmn.include?(i)
next if !party[i] || party[i].isEgg?
if party[i].status!=0
healbell+=1
end
end
if healbell>=4
goodarray.push(371)# Heal Bell
elsif healbell>=2
decentarray.push(371)# Heal Bell
elsif healbell==2
badarray.push(371)# Heal Bell
end
#=========Trick Room|Tail Wind|Thunder Wave=========#
typemod1=pbTypeModifier(PBTypes::ELECTRIC,attacker,opponent1)
typemod2=pbTypeModifier(PBTypes::ELECTRIC,attacker,opponent2)
if attacker.speed<opponent1.speed || attacker.speed<opponent2.speed
if @battle.trickroom==0
# if attacker.hasWorkingItem(:ROOMSERVICE) || #only if your game is compatible with gen 8
# goodarray.push(499)# Trick Room
# else
decentarray.push(499)# Trick Room
end
end
if attacker.pbOwnSide.effects[PBEffects::Tailwind]==0
decentarray.push(173)# Tail Wind
end
if (opponent1.status==0 && typemod1==0 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)) ||
(opponent2.status==0 && typemod2==0 && !opponent2.hasWorkingAbility(:MAGICBOUNCE))
decentarray.push(83)# Thunder Wave
end
end
#=========Psych Up=========#
opponentstages1=opponent1.stages[PBStats::ATTACK]+opponent1.stages[PBStats::DEFENSE]+
opponent1.stages[PBStats::SPATK]+opponent1.stages[PBStats::SPDEF]+
opponent1.stages[PBStats::SPEED]+opponent1.stages[PBStats::EVASION]+
opponent1.stages[PBStats::ACCURACY]
opponentstages2=opponent2.stages[PBStats::ATTACK]+opponent2.stages[PBStats::DEFENSE]+
opponent2.stages[PBStats::SPATK]+opponent2.stages[PBStats::SPDEF]+
opponent2.stages[PBStats::SPEED]+opponent2.stages[PBStats::EVASION]+
opponent2.stages[PBStats::ACCURACY]
opponentstages1=0 if opponent1.hasWorkingAbility(:MAGICBOUNCE)
opponentstages2=0 if opponent2.hasWorkingAbility(:MAGICBOUNCE)
if opponentstages1>8 || opponentstages2>8
goodarray.push(392)# Psych Up
elsif opponentstages1>5 || opponentstages2>5
decentarray.push(392)# Psych Up
elsif opponentstages1>2 || opponentstages2>2
badarray.push(392)# Psych Up
end
#=========Sandstorm=========#
sandstorm=0
if attacker.pbHasType?(:ROCK) || attacker.hasWorkingAbility(:SANDRUSH) || attacker.hasWorkingAbility(:SANDFORCE)
sandstorm+=2
elsif attacker.pbHasType?(:STEEL) || attacker.pbHasType?(:GROUND) || attacker.hasWorkingAbility(:SANDVEIL)
sandstorm+=1
end
if attacker.hasWorkingItem(:SMOOTHROCK)
sandstorm+=1
end
if @battle.weather!=0
sandstorm+=1
end
if @battle.weather==PBWeather::SANDSTORM
sandstorm=0
end
if sandstorm==4
goodarray.push(513)# Sand Storm
elsif sandstorm>=2
decentarray.push(513)# Sand Storm
elsif sandstorm==1
badarray.push(513)# Sand Storm
end
#=========Hail=========#
hail=0
if attacker.hasWorkingAbility(:FORECAST) || # attacker.hasWorkingAbility(:SLUSHRUSH) #only for gen 7 plus
hail+=2
elsif attacker.pbHasType?(:ICE) || attacker.hasWorkingAbility(:SNOWCLOAK) || attacker.hasWorkingAbility(:ICEBODY)
hail+=1
end
if attacker.hasWorkingItem(:ICYROCK)
hail+=1
end
if @battle.weather!=0
hail+=1
end
if @battle.weather==PBWeather::HAIL
hail=0
end
if hail==4
goodarray.push(257)# Hail
elsif hail>=2
decentarray.push(257)# Hail
elsif hail==1
badarray.push(257)# Hail
end
#=========Sunny Day=========#
sunny=0
if attacker.hasWorkingAbility(:FORECAST) || attacker.hasWorkingAbility(:FLOWERGIFT) ||
attacker.hasWorkingAbility(:CHLOROPHYLL) || attacker.hasWorkingAbility(:SOLARPOWER)
sunny+=2
elsif attacker.pbHasType?(:FIRE) || attacker.hasWorkingAbility(:LEAFGUARD) ||
attacker.hasWorkingAbility(:HARVEST)
sunny+=1
end
if attacker.hasWorkingItem(:HEATROCK)
sunny+=1
end
if @battle.weather==PBWeather::SUNNYDAY || attacker.hasWorkingAbility(:DRYSKIN) ||
attacker.pbHasType?(:WATER)
sunny=0
end
if @battle.weather!=0
sunny+=1
end
if sunny==4
goodarray.push(150)# Sunny Day
elsif sunny>=2
decentarray.push(150)# Sunny Day
elsif sunny==1
badarray.push(150)# Sunny Day
end
#=========Rain Dance=========#
rain=0
if attacker.hasWorkingAbility(:FORECAST) || attacker.hasWorkingAbility(:SWIFTSWIM)
rain+=2
elsif attacker.pbHasType?(:WATER) || attacker.hasWorkingAbility(:DRYSKIN) ||
attacker.hasWorkingAbility(:HYDRATION) || attacker.hasWorkingAbility(:RAINDISH)
rain+=1
end
if attacker.hasWorkingItem(:DAMPROCK)
rain+=1
end
if @battle.weather==PBWeather::RAINDANCE || attacker.pbHasType?(:FIRE)
rain=0
end
if @battle.weather!=0
rain+=1
end
if rain==4
goodarray.push(556)# Rain Dance
elsif rain>=2
decentarray.push(556)# Rain Dance
elsif rain==1
badarray.push(556)# Rain Dance
end
#=========Spikes|Toxic Spikes|Stealth Rock|Sticky Web=========#
if !opponent1.hasWorkingAbility(:MAGICBOUNCE) || !opponent2.hasWorkingAbility(:MAGICBOUNCE)
#$%change the "604" to the number of the move Sticky Web in your moves.txt
decentarray.push(604) if !attacker.pbOpposingSide.effects[PBEffects::StickyWeb] # Sticky Web
decentarray.push(514) if !attacker.pbOpposingSide.effects[PBEffects::StealthRock] # Stealth Rock
badarray.push(239) if attacker.pbOpposingSide.effects[PBEffects::Spikes]<3 # Spikes
if attacker.pbOpposingSide.effects[PBEffects::ToxicSpikes]<2 && !opponent1.pbHasType?(:STEEL) &&
!opponent2.pbHasType?(:STEEL) && !opponent1.pbHasType?(:POISON) && !opponent2.pbHasType?(:POISON)
badarray.push(447)# Toxic Spikes
end
end
#=========Baton Pass=========#
attackerstages=attacker.stages[PBStats::ATTACK]+attacker.stages[PBStats::DEFENSE]+
attacker.stages[PBStats::SPATK]+attacker.stages[PBStats::SPDEF]+
attacker.stages[PBStats::SPEED]+attacker.stages[PBStats::EVASION]+
attacker.stages[PBStats::ACCURACY]
attackerstages+=1 if attacker.effects[PBEffects::AquaRing]
attackerstages+=2 if attacker.effects[PBEffects::Substitute]
attackerstages+=1 if attacker.effects[PBEffects::Ingrain]
attackerstages+=2 if attacker.effects[PBEffects::FocusEnergy]
attackerstages-=1 if attacker.effects[PBEffects::LockOn]>0
attackerstages-=1 if attacker.effects[PBEffects::Confusion]>0
attackerstages-=2 if attacker.effects[PBEffects::Curse]
if attackerstages>8
goodarray.push(347)# Baton Pass
elsif attackerstages>5
decentarray.push(347)# Baton Pass
elsif attackerstages>2
badarray.push(347)# Baton Pass
end
#=========Recover=========#
if attacker.hp<=attacker.totalhp
if opponent1.status==PBStatuses::SLEEP || opponent1.status==PBStatuses::FROZEN ||
opponent1.effects[PBEffects::HyperBeam]>0 || opponent2.status==PBStatuses::SLEEP ||
opponent2.status==PBStatuses::FROZEN || opponent2.effects[PBEffects::HyperBeam]>0
goodarray.push(393)# Recover
elsif opponent1.status==PBStatuses::PARALYSIS || opponent1.effects[PBEffects::Confusion]>0 ||
opponent1.effects[PBEffects::Attract]>0 || opponent2.status==PBStatuses::PARALYSIS ||
opponent2.effects[PBEffects::Confusion]>0 || opponent2.effects[PBEffects::Attract]>0
decentarray.push(393)# Recover
end
end
#=========Pain Split=========#
goodarray.push(389) if attacker.hp<opponent1.hp/4 || attacker.hp<opponent2.hp/4 # Pain Split
decentarray.push(389) if attacker.hp<opponent1.hp/2 || attacker.hp<opponent2.hp/2 # Pain Split
#=========Spore=========#
if (opponent1.status==0 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)) ||
(opponent2.status==0 && !opponent2.hasWorkingAbility(:MAGICBOUNCE))
decentarray.push(219) # Spore
end
#=========Will-O-Wisp=========#
if (opponent1.status==0 && opponent1.attack>opponent1.spatk && !opponent1.hasWorkingAbility(:MAGICBOUNCE)) ||
(opponent2.status==0 && opponent2.attack>opponent1.spatk && !opponent2.hasWorkingAbility(:MAGICBOUNCE))
decentarray.push(151) # Will-O-Wisp
end
#=========Attract=========#
agender=attacker.gender
ogender1=opponent1.gender
ogender2=opponent2.gender
if ((agender==0 && ogender1==1) || (agender==1 && ogender1==0) &&
opponent1.effects[PBEffects::Attract]==-1 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)) ||
((agender==0 && ogender2==1) || (agender==1 && ogender2==0) &&
opponent2.effects[PBEffects::Attract]==-1 && !opponent2.hasWorkingAbility(:MAGICBOUNCE))
decentarray.push(346) if opponent1.status==PBStatuses::PARALYSIS || opponent2.status==PBStatuses::PARALYSIS # Attract
badarray.push(346) if !opponent1.status==PBStatuses::PARALYSIS && !opponent2.status==PBStatuses::PARALYSIS # Attract
end
if goodarray.length==0 && decentarray.length==0
artistrymove=badarray[@battle.pbRandom(badarray.length-1)]
elsif goodarray.length==0 && decentarray.length>0
if @battle.pbRandom(100)<=80
artistrymove=decentarray[@battle.pbRandom(decentarray.length-1)]
else
artistrymove=badarray[@battle.pbRandom(decentarray.length-1)]
end
elsif decentarray.length==0 && goodarray.length>0
if @battle.pbRandom(100)<=95
artistrymove=goodarray[@battle.pbRandom(decentarray.length-1)]
else
artistrymove=badarray[@battle.pbRandom(decentarray.length-1)]
end
else
[email protected](100)
if random<=5
artistrymove=badarray[@battle.pbRandom(goodarray.length-1)]
elsif random<=30
artistrymove=decentarray[@battle.pbRandom(goodarray.length-1)]
elsif random<=100
artistrymove=goodarray[@battle.pbRandom(goodarray.length-1)]
end
end
if @battle.doublebattle
targetopponent=0
case artistrymove
when 83 # Thunder Wave
if (opponent1.status==0 && typemod1!=0 && !opponent1.hasWorkingAbility(:MAGICBOUNCE))
targetopponent=1
elsif (opponent2.status==0 && typemod2!=0 && !opponent2.hasWorkingAbility(:MAGICBOUNCE))
targetopponent=2
end
when 392 # Psych Up
if opponentstages1>=opponentstages2
targetopponent=1
elsif opponentstages1<opponentstages2
targetopponent=2
end
when 389 # Pain Split
if opponent1.hp<=opponent2.hp
targetopponent=1
elsif opponent1.hp>opponent2.hp
targetopponent=2
end
when 219 # Spore
if opponent1.status==0 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=1
elsif opponent2.status==0 && !opponent2.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=2
end
when 151 # Will-O-Wisp
if opponent1.status==0 && opponent1.attack>opponent1.spatk && !opponent1.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=1
elsif opponent2.status==0 && opponent2.attack>opponent2.spatk && !opponent2.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=2
elsif opponent1.status==0 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=1
elsif opponent2.status==0 && !opponent2.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=2
end
when 346 # Attract
if (agender==0 && ogender1==1) || (agender==1 && ogender1==0) &&
opponent1.effects[PBEffects::Attract]==-1 && !opponent1.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=1
elsif (agender==0 && ogender2==1) || (agender==1 && ogender2==0) &&
opponent2.effects[PBEffects::Attract]==-1 && !opponent2.hasWorkingAbility(:MAGICBOUNCE)
targetopponent=2
end
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
if targetopponent==1
attacker.pbUseMoveSimple(artistrymove,-1,1)
elsif targetopponent==2
attacker.pbUseMoveSimple(artistrymove,-1,3)
end
else
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
attacker.pbUseMoveSimple(artistrymove)
end
return 0
end
end
Have a nice day!