Registrarse

[RPG - Scripting] MoveEffect personalizado

Estado
Cerrado para nuevas respuestas.

Parritoso

Usuario de oro
Hola a todos.
Necesito crear un movimiento One-Hit K.O, que siempre acierte, y también cura al pokemon de los efectos de estado. He creado este código, a partir de los movimientos K.O. Pero igual a fallado, creo que he eliminado la parte donde calculé la probabilidad de fallo. ¿Lo he hecho o no? Si alguien pudiera decirme, gracias.

(Este es mi primer script, seguramente esta muy mal)
Ruby:
class PokeBattle_Move_159 < PokeBattle_Move
  def pbAccuracyCheck(attacker,opponent)
    if !attacker.hasMoldBreaker && opponent.hasWorkingAbility(:STURDY)
      @battle.pbDisplay(_INTL("{1} was protected by {2}!",opponent.pbThis,PBAbilities.getName(opponent.ability))) 
      return false
    end
  end

  def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    damage=pbEffectFixedDamage(opponent.totalhp,attacker,opponent,hitnum,alltargets,showanimation)
    if opponent.fainted?
      @battle.pbDisplay(_INTL("It's a one-hit KO!"))
    end
    return damage
  end
 
  def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    if attacker.status!=PBStatuses::BURN &&
       attacker.status!=PBStatuses::POISON &&
       attacker.status!=PBStatuses::PARALYSIS
      @battle.pbDisplay(_INTL("But it failed!"))
      return -1
    else
      t=attacker.status
      attacker.pbCureStatus(false)
      pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
      if t==PBStatuses::BURN
        @battle.pbDisplay(_INTL("{1} healed its burn!",attacker.pbThis)) 
      elsif t==PBStatuses::POISON
        @battle.pbDisplay(_INTL("{1} cured its poisoning!",attacker.pbThis)) 
      elsif t==PBStatuses::PARALYSIS
        @battle.pbDisplay(_INTL("{1} cured its paralysis!",attacker.pbThis)) 
      end
      return 0
    end
  end
end
 
Estado
Cerrado para nuevas respuestas.
Arriba