- 22
- Posts
- 8
- Years
- Seen May 15, 2023
Hi, I have some ideas for movements that I would like to code, but I would appreciate some help. I am working with P.Essentials V.17.2
-A Movement with this effect: Uses a random move the user knows (even deactivated moves, by Disable, e.g.) increasing a bit their power if this are physical or special
I have used the code for sleep talk for the first part, but i'm not sure how to code the basepower increased part.
The code:
-An Ability that increase the power of the weakest Special moves only for the first time each one is used.
I have tried to do that with a code similar to Technician's code, but it didn't worked when i tested.
The code:
-A Movement with this effect: Uses a random move the user knows (even deactivated moves, by Disable, e.g.) increasing a bit their power if this are physical or special
I have used the code for sleep talk for the first part, but i'm not sure how to code the basepower increased part.
The code:
Spoiler:
################################################################################
# Uses a random move the user knows. Even deactivated moves (Similar to Sleep Talk)
################################################################################
class PokeBattle_Move_1E4 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
blacklist=[
0x02, # Struggle
0x14, # Chatter
0x5C, # Mimic
0x5D, # Sketch
0xAE, # Mirror Move
0xAF, # Copycat
0xB0, # Me First
0xB3, # Nature Power
0xB4, # Sleep Talk
0xB5, # Assist
0xB6, # Metronome
0xD1, # Uproar
0xD4, # Bide
0x115, # Focus Punch
# Two-turn attacks
0xC3, # Razor Wind
0xC4, # SolarBeam
0xC5, # Freeze Shock
0xC6, # Ice Burn
0xC7, # Sky Attack
0xC8, # Skull Bash
0xC9, # Fly
0xCA, # Dig
0xCB, # Dive
0xCC, # Bounce
0xCD, # Shadow Force
0xCE, # Sky Drop
0x14D, # Phantom Force
0x14E, # Geomancy
0x1CA, # Georrayo/Meteor Beam
0x1D7, # Lunarbeam/Lunarblade
0x208 # Gigagarra
]
choices=[]
for i in 0...4
found=false
next if attacker.moves.id==0
found=true if blacklist.include?(attacker.moves.function)
next if found
choices.push(i) if @battle.pbCanChooseMove?(attacker.index,i,false,true)
end
if choices.length==0
@battle.pbDisplay(_INTL("¡Pero falló!"))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
choice=choices[@battle.pbRandom(choices.length)]
attacker.pbUseMoveSimple(attacker.moves[choice].id,choice,attacker.pbOppositeOpposing.index)
return 0
end
end
# Uses a random move the user knows. Even deactivated moves (Similar to Sleep Talk)
################################################################################
class PokeBattle_Move_1E4 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
blacklist=[
0x02, # Struggle
0x14, # Chatter
0x5C, # Mimic
0x5D, # Sketch
0xAE, # Mirror Move
0xAF, # Copycat
0xB0, # Me First
0xB3, # Nature Power
0xB4, # Sleep Talk
0xB5, # Assist
0xB6, # Metronome
0xD1, # Uproar
0xD4, # Bide
0x115, # Focus Punch
# Two-turn attacks
0xC3, # Razor Wind
0xC4, # SolarBeam
0xC5, # Freeze Shock
0xC6, # Ice Burn
0xC7, # Sky Attack
0xC8, # Skull Bash
0xC9, # Fly
0xCA, # Dig
0xCB, # Dive
0xCC, # Bounce
0xCD, # Shadow Force
0xCE, # Sky Drop
0x14D, # Phantom Force
0x14E, # Geomancy
0x1CA, # Georrayo/Meteor Beam
0x1D7, # Lunarbeam/Lunarblade
0x208 # Gigagarra
]
choices=[]
for i in 0...4
found=false
next if attacker.moves.id==0
found=true if blacklist.include?(attacker.moves.function)
next if found
choices.push(i) if @battle.pbCanChooseMove?(attacker.index,i,false,true)
end
if choices.length==0
@battle.pbDisplay(_INTL("¡Pero falló!"))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
choice=choices[@battle.pbRandom(choices.length)]
attacker.pbUseMoveSimple(attacker.moves[choice].id,choice,attacker.pbOppositeOpposing.index)
return 0
end
end
-An Ability that increase the power of the weakest Special moves only for the first time each one is used.
I have tried to do that with a code similar to Technician's code, but it didn't worked when i tested.
The code:
Spoiler:
if attacker.hasWorkingAbility(:PISTOLERO) && (thismove.pp==thismove.totalpp) && @id>0 && pbIsSpecial?(type)
if basedmg<=20
damagemult=(damagemult*5.0).round
elsif basedmg<=30 && basedmg>20
damagemult=(damagemult*3.3).round
elsif basedmg<=40 && basedmg>30
damagemult=(damagemult*2.5).round
elsif basedmg<=50 && basedmg>40
damagemult=(damagemult*2.0).round
elsif basedmg<=60 && basedmg>50
damagemult=(damagemult*1.7).round
elsif basedmg<=70 && basedmg>60
damagemult=(damagemult*1.4).round
elsif basedmg<=80 && basedmg>70
damagemult=(damagemult*1.2).round
end
end
if basedmg<=20
damagemult=(damagemult*5.0).round
elsif basedmg<=30 && basedmg>20
damagemult=(damagemult*3.3).round
elsif basedmg<=40 && basedmg>30
damagemult=(damagemult*2.5).round
elsif basedmg<=50 && basedmg>40
damagemult=(damagemult*2.0).round
elsif basedmg<=60 && basedmg>50
damagemult=(damagemult*1.7).round
elsif basedmg<=70 && basedmg>60
damagemult=(damagemult*1.4).round
elsif basedmg<=80 && basedmg>70
damagemult=(damagemult*1.2).round
end
end
Last edited: