- 11
- Posts
- 6
- Years
- Seen May 19, 2019
Hi,
Im trying to add mimikyu's ability into essentials following the steps listed here (I had to copy the whole comment because im not allowed to use links yet
Create a PBEffect called Disguise in PBEffects and initialise it in PokeBattle_Battler, def pbInitEffects:
Code:
@effects[PBEffects::Disguise] = false
# Disguise causes the ability-suppressing effect to fade
# if it was passed on through Baton Pass
if isConst?(self.ability,PBAbilities,:DISGUISE)
@effects[PBEffects::GastroAcid] = false
end
if isConst?(self.ability,PBAbilities,:ILLUSION) #Illusion
[email protected](@index)
party=party.find_all {|item| item && !item.egg? && item.hp>0 }
if party[party.length-1] != @pokemon
@effects[PBEffects::Illusion] = party[party.length-1]
else
@effects[PBEffects::Illusion] = nil
end
else
@effects[PBEffects::Illusion] = nil
end #Illusion
In PokeBattle_Battler, def pbCheckForm:
Code:
# Mimikyu
if self.hasWorkingAbility(:DISGUISE) &&
isConst?(self.species,PBSpecies,:MIMIKYU) &&
!self.isFainted?
if self.form!=1
self.form=1
self.type1=getID(PBTypes,:GHOST)
self.type2=getID(PBTypes,:FAIRY)
end
end
in PokeBattle_Battler, def pbAbilitiesOnSwitchIn:
Code:
if onactive
# weather ability scripts
if self.hasWorkingAbility(:DISGUISE) && onactive
@effects[PBEffects::Disguise]=true
end
In PokeBattle_Move, def pbReduceHPDamage insert this code:
Code:
if opponent.effects[PBEffects::Substitute]>0 && (!attacker || attacker.index!=opponent.index) &&
!attacker.hasWorkingAbility(:INFILTRATOR) && !isSoundBased?
PBDebug.log("[#{opponent.pbThis}'s substitute took the damage]")
damage=opponent.effects[PBEffects::Substitute] if damage>opponent.effects[PBEffects::Substitute]
opponent.effects[PBEffects::Substitute]-=damage
opponent.damagestate.substitute=true
@battle.scene.pbDamageAnimation(opponent,0)
@battle.pbDisplayPaused(_INTL("The substitute took damage for {1}!",opponent.name))
if opponent.effects[PBEffects::Substitute]<=0
opponent.effects[PBEffects::Substitute]=0
@battle.pbDisplayPaused(_INTL("{1}'s substitute faded!",opponent.name))
PBDebug.log("[#{opponent.pbThis}'s substitute faded]")
end
opponent.damagestate.hplost=damage
damage=0
else
opponent.damagestate.substitute=false
if opponent.effects[PBEffects::Disguise] && !attacker.hasBypassingAbility()
@battle.pbDisplayEffect(opponent)
@battle.pbDisplay(_INTL("Its disguise served it as a decoy!"))
opponent.effects[PBEffects::Disguise]=false
opponent.form=1
opponent.pbCheckForm
@battle.pbDisplay(_INTL("{1}'s disguise was busted!"))
damage=0
end
Moves that swap, copy, change or suppress abilities will fail and abilities that copy other abilities will not trigger if Disguise is the targeted ability. Mummy will only change Mimikyu's ability if its Disguise is busted.
However, after doing this I get the error below when entering any encounter.
[Pok?mon Essentials version 17]
Exception: NameError
Message: uninitialized constant PBEffects::Disguise
PokeBattle_Battler:479:in `pbInitEffects'
PokeBattle_Battler:199:in `initialize'
PokeBattle_Battle:333:in `new'
PokeBattle_Battle:333:in `initialize'
PokeBattle_Battle:332:in `each'
PokeBattle_Battle:332:in `initialize'
PField_Battles:91:in `new'
PField_Battles:91:in `pbWildBattle'
PField_Field:387:in `pbBattleOnStepTaken'
PField_Field:368:in `pbOnStepTaken'
any help would be appreciated. thanks.
Im trying to add mimikyu's ability into essentials following the steps listed here (I had to copy the whole comment because im not allowed to use links yet
Create a PBEffect called Disguise in PBEffects and initialise it in PokeBattle_Battler, def pbInitEffects:
Code:
@effects[PBEffects::Disguise] = false
# Disguise causes the ability-suppressing effect to fade
# if it was passed on through Baton Pass
if isConst?(self.ability,PBAbilities,:DISGUISE)
@effects[PBEffects::GastroAcid] = false
end
if isConst?(self.ability,PBAbilities,:ILLUSION) #Illusion
[email protected](@index)
party=party.find_all {|item| item && !item.egg? && item.hp>0 }
if party[party.length-1] != @pokemon
@effects[PBEffects::Illusion] = party[party.length-1]
else
@effects[PBEffects::Illusion] = nil
end
else
@effects[PBEffects::Illusion] = nil
end #Illusion
In PokeBattle_Battler, def pbCheckForm:
Code:
# Mimikyu
if self.hasWorkingAbility(:DISGUISE) &&
isConst?(self.species,PBSpecies,:MIMIKYU) &&
!self.isFainted?
if self.form!=1
self.form=1
self.type1=getID(PBTypes,:GHOST)
self.type2=getID(PBTypes,:FAIRY)
end
end
in PokeBattle_Battler, def pbAbilitiesOnSwitchIn:
Code:
if onactive
# weather ability scripts
if self.hasWorkingAbility(:DISGUISE) && onactive
@effects[PBEffects::Disguise]=true
end
In PokeBattle_Move, def pbReduceHPDamage insert this code:
Code:
if opponent.effects[PBEffects::Substitute]>0 && (!attacker || attacker.index!=opponent.index) &&
!attacker.hasWorkingAbility(:INFILTRATOR) && !isSoundBased?
PBDebug.log("[#{opponent.pbThis}'s substitute took the damage]")
damage=opponent.effects[PBEffects::Substitute] if damage>opponent.effects[PBEffects::Substitute]
opponent.effects[PBEffects::Substitute]-=damage
opponent.damagestate.substitute=true
@battle.scene.pbDamageAnimation(opponent,0)
@battle.pbDisplayPaused(_INTL("The substitute took damage for {1}!",opponent.name))
if opponent.effects[PBEffects::Substitute]<=0
opponent.effects[PBEffects::Substitute]=0
@battle.pbDisplayPaused(_INTL("{1}'s substitute faded!",opponent.name))
PBDebug.log("[#{opponent.pbThis}'s substitute faded]")
end
opponent.damagestate.hplost=damage
damage=0
else
opponent.damagestate.substitute=false
if opponent.effects[PBEffects::Disguise] && !attacker.hasBypassingAbility()
@battle.pbDisplayEffect(opponent)
@battle.pbDisplay(_INTL("Its disguise served it as a decoy!"))
opponent.effects[PBEffects::Disguise]=false
opponent.form=1
opponent.pbCheckForm
@battle.pbDisplay(_INTL("{1}'s disguise was busted!"))
damage=0
end
Moves that swap, copy, change or suppress abilities will fail and abilities that copy other abilities will not trigger if Disguise is the targeted ability. Mummy will only change Mimikyu's ability if its Disguise is busted.
However, after doing this I get the error below when entering any encounter.
[Pok?mon Essentials version 17]
Exception: NameError
Message: uninitialized constant PBEffects::Disguise
PokeBattle_Battler:479:in `pbInitEffects'
PokeBattle_Battler:199:in `initialize'
PokeBattle_Battle:333:in `new'
PokeBattle_Battle:333:in `initialize'
PokeBattle_Battle:332:in `each'
PokeBattle_Battle:332:in `initialize'
PField_Battles:91:in `new'
PField_Battles:91:in `pbWildBattle'
PField_Field:387:in `pbBattleOnStepTaken'
PField_Field:368:in `pbOnStepTaken'
any help would be appreciated. thanks.