Thread: [Question] Ability cloning Zen Mode?
View Single Post
  #13    
Old September 28th, 2012, 11:17 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
That's a bit of a jumble. Study the following and see if you can spot where you went wrong:

Code:
################################################################################
# Hits twice. If user is Ghost-type, also doubles damage and paralyzes target.
################################################################################
class PokeBattle_Move_133 < PokeBattle_Move
  def pbIsMultiHit
    return true
  end

  def pbNumHits
    return 2
  end

  def pbBaseDamage(damage,attacker,opponent)
    damage*=2 if attacker.pbHasType?(:GHOST)
    return damage
  end

  def pbAdditionalEffect(attacker,opponent)
    return false if !attacker.pbHasType?(:GHOST)
    return false if !opponent.pbCanParalyze?(false)
    opponent.pbParalyze(attacker)
    @battle.pbDisplay(_INTL("{1} was paralyzed!  It may be unable to move!",opponent.pbThis))
    return true
  end
end
The move as defined in moves.txt should have an additional effect chance of whatever percentage chance you want the paralysis to be (apparently 100 for "always"). The move will always hit twice in a row (regardless) and do double damage (if the user is a Ghost type).
__________________
Reply With Quote