- 1
- Posts
- 6
- Years
- Seen Feb 4, 2022
I'm new to this whole thing but I've been trying to create a new function code to allow me to make that give a status ailment I added. I followed other steps to implement the ailment itself but the function I made for It keeps saying its the wrong number of arguments. 1 for 2 specifically.
This is what I got so far,
################################################################################
# Gives the target tetanus.
################################################################################
class PokeBattle_Move_66A < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0
return -1 if !opponent.pbCanTetanus?(true)
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.pbPoison(attacker,true)
@battle.pbDisplay(_INTL("{1} was infected with tetanus!",opponent.pbThis))
return 0
end
def pbAdditionalEffect(attacker,opponent)
return false if !opponent.pbCanTetanus?(false)
opponent.pbPoison(attacker,true)
@battle.pbDisplay(_INTL("{1} was infected with tetanus!",opponent.pbThis))
return true
end
end
This is the error I get.
---------------------------
Exception: ArgumentError
Message: wrong number of arguments(1 for 2)
PokeBattle_MoveEffects:227:in `pbCanTetanus?'
PokeBattle_MoveEffects:227:in `pbAdditionalEffect'
PokeBattle_Battler:4647:in `pbProcessMoveAgainstTarget'
PokeBattle_Battler:4519:in `each'
PokeBattle_Battler:4519:in `pbProcessMoveAgainstTarget'
PokeBattle_Battler:5284:in `pbUseMove'
PokeBattle_Battler:5234:in `loop'
PokeBattle_Battler:5287:in `pbUseMove'
PokeBattle_Battler:6057:in `pbProcessTurn'
PokeBattle_Battler:6056:in `logonerr'
-----------
This is what I got so far,
################################################################################
# Gives the target tetanus.
################################################################################
class PokeBattle_Move_66A < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0
return -1 if !opponent.pbCanTetanus?(true)
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.pbPoison(attacker,true)
@battle.pbDisplay(_INTL("{1} was infected with tetanus!",opponent.pbThis))
return 0
end
def pbAdditionalEffect(attacker,opponent)
return false if !opponent.pbCanTetanus?(false)
opponent.pbPoison(attacker,true)
@battle.pbDisplay(_INTL("{1} was infected with tetanus!",opponent.pbThis))
return true
end
end
This is the error I get.
---------------------------
Exception: ArgumentError
Message: wrong number of arguments(1 for 2)
PokeBattle_MoveEffects:227:in `pbCanTetanus?'
PokeBattle_MoveEffects:227:in `pbAdditionalEffect'
PokeBattle_Battler:4647:in `pbProcessMoveAgainstTarget'
PokeBattle_Battler:4519:in `each'
PokeBattle_Battler:4519:in `pbProcessMoveAgainstTarget'
PokeBattle_Battler:5284:in `pbUseMove'
PokeBattle_Battler:5234:in `loop'
PokeBattle_Battler:5287:in `pbUseMove'
PokeBattle_Battler:6057:in `pbProcessTurn'
PokeBattle_Battler:6056:in `logonerr'
-----------