Hello! Working in Essentials 21.1 with the Hotfix. Light PBS and code edits to project, but nothing related to my question.
I'm currently working on giving a Pokémon the attack bonus and resistances of another type without the weaknesses, and have it in the form of a species-specific item. The attack bonuses are fairly straightforward because of many type boosting items already in the code, but I am currently trying to give Toxicroak the resistances (and immunity) of a Dark type when holding the "Croak Cloak."
None of the above resistances are working, but the game loads up just fine.
Anyone have any ideas of what to do here? Is this an instance where I need to define a new function code in the ItemEffects (potentially by pulling from AbilityEffects), or am I making a dumb mistake?
Thanks in advance!
I'm currently working on giving a Pokémon the attack bonus and resistances of another type without the weaknesses, and have it in the form of a species-specific item. The attack bonuses are fairly straightforward because of many type boosting items already in the code, but I am currently trying to give Toxicroak the resistances (and immunity) of a Dark type when holding the "Croak Cloak."
Ruby:
Battle::ItemEffects::DamageCalcFromTarget.add(:CROAKCLOAK,
proc { |item, user, target, move, mults, power, type|
if !target.isSpecies?(:TOXICROAK)
next if move.calcType != :PSYCHIC
next 0
next if move.calcType != :DARK
mults[:defense_multiplier] *= 1.5
next if move.calcType != :GHOST
mults[:defense_multiplier] *= 1.5
end
}
)
None of the above resistances are working, but the game loads up just fine.
Anyone have any ideas of what to do here? Is this an instance where I need to define a new function code in the ItemEffects (potentially by pulling from AbilityEffects), or am I making a dumb mistake?
Thanks in advance!