A lot of the moves appear to be damaging versions of some status moves. It's a good rule of thumb to include the following line to the pbEffect function of your custom moves to allow the ability for them to do damage:
return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0
Move #1:
################################################################################
# Damaging version of Yawn
################################################################################
class PokeBattle_Move_nnn < PokeBattle_Move # change nnn to a custom function code
def pbAdditionalEffect(attacker,opponent)
return false if !opponent.pbCanSleep?(true) || opponent.effects[PBEffects::Yawn]>0
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.effects[PBEffects::Yawn]=2
@battle.pbDisplay(_INTL("{1} made {2} drowsy!",attacker.pbThis,opponent.pbThis(true)))
return true
end
end
PokeBattle_Move subclasses that have the pbAdditionalEffect function allow you to define a probability of those effects occurring in the PBS file and are affected by abilities such as Huge Power.
For Moves #2 and #3, you'll need to create and define new PBEffects to act as countdowns similar in function to the Yawn effect and decrease their values at the same time as the Yawn effect's value. The code for Move #1 can be changed to badly poison or burn the opponent instead of putting them to sleep.
Move #4 is simple to implement and based on Shell Smash:
################################################################################
# Increases the user's Attack and Special Attack by 1 stage
# and decreases the user's Defense and Special Defense by 1 stage.
################################################################################
class PokeBattle_Move_nnn < PokeBattle_Move # change nnn to a custom function code
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
ret = @basedamage>0 ? super(attacker,opponent,hitnum,alltargets,showanimation) : 0
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation) if ret==0
if !attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::SPATK,false)
@battle.pbDisplay(_INTL("{1}'s stats won't go any higher!",attacker.pbThis))
return ret==0 ? -1 : ret
end
showanim=true
if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,false)
attacker.pbIncreaseStat(PBStats::ATTACK,2,false,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,false)
attacker.pbIncreaseStat(PBStats::SPATK,2,false,showanim)
showanim=false
end
if !attacker.pbCanReduceStatStage?(PBStats::DEFENSE,false) &&
!attacker.pbCanReduceStatStage?(PBStats::SPDEF,false)
@battle.pbDisplay(_INTL("{1}'s stats won't go any lower!",attacker.pbThis))
return ret==0 ? -1 : ret
end
showanim=true
if attacker.pbCanReduceStatStage?(PBStats::DEFENSE,false,true)
attacker.pbReduceStat(PBStats::DEFENSE,1,false,showanim,true)
showanim=false
end
if attacker.pbCanReduceStatStage?(PBStats::SPDEF,false,true)
attacker.pbReduceStat(PBStats::SPDEF,1,false,showanim,true)
showanim=false
end
return ret
end
end
Move #5 is simply copy/pasting the recoil move pbEffect (depending if the user should take 1/4, 1/3 or 1/2 the damage dealt as recoil damage) and adding the pbAdditionalEffect from function code 005.
Move #6 is based on function code 021:
################################################################################
# Increases the user's Special Defense by 3 stages.
################################################################################
class PokeBattle_Move_nnn < PokeBattle_Move # change nnn to a custom function code
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return -1 if !attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,true)
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
ret=attacker.pbIncreaseStat(PBStats::SPDEF,3,false)
return ret ? 0 : -1
end
end
Move #7 is a tweaking of the code I suggested for Move #4:
################################################################################
# Increases the user's Attack and Special Attack by 1 stage
################################################################################
class PokeBattle_Move_nnn < PokeBattle_Move # change nnn to a custom function code
def pbAdditionalEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if !attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,false) &&
!attacker.pbCanIncreaseStatStage?(PBStats::SPATK,false)
@battle.pbDisplay(_INTL("{1}'s stats won't go any higher!",attacker.pbThis))
return false
end
showanim=true
if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,false)
attacker.pbIncreaseStat(PBStats::ATTACK,2,false,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,false)
attacker.pbIncreaseStat(PBStats::SPATK,2,false,showanim)
showanim=false
end
return true
end
end
Move #8 is based on the code for moves like Sand Attack:
################################################################################
# Decreases the user's accuracy by 1 stage.
################################################################################
class PokeBattle_Move_nnn < PokeBattle_Move # change nnn to a custom function code
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0
return -1 if !attacker.pbCanReduceStatStage?(PBStats::ACCURACY,true,true)
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
ret=attacker.pbReduceStat(PBStats::ACCURACY,2,false,true)
return ret ? 0 : -1
end
def pbAdditionalEffect(attacker,opponent)
if attacker.pbCanReduceStatStage?(PBStats::ACCURACY,false,true)
attacker.pbReduceStat(PBStats::ACCURACY,2,false,true)
end
return true
end
end
Move #9 is a little complicated as it's similar in functionality to Flying Press. How much extra Electric-type damage does the user inflict relative to the move's base power?
For Move #10, you can simply tweak function code 0B9 to allow for damaging versions of moves using that function and then define your move in the PBS file:
################################################################################
# For 5 rounds, disables the last move the target used.
################################################################################
class PokeBattle_Move_0B9 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
ret = @basedamage>0 ? super(attacker,opponent,hitnum,alltargets,showanimation) : 0
return ret if opponent.effects[PBEffects::Disable]>0
for i in opponent.moves
if i.id>0 && i.id==opponent.lastMoveUsed && (i.pp>0 || i.totalpp==0)
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.effects[PBEffects::Disable]=4
opponent.effects[PBEffects::DisableMove]=opponent.lastMoveUsed
@battle.pbDisplay(_INTL("{1}'s {2} was disabled!",opponent.pbThis,i.name))
return ret
end
end
@battle.pbDisplay(_INTL("But it failed!")) if ret==0
return ret
end
end