Wanted to mention two problems I encountered while testing my gameplay.
The first is that it seems that when a Ditto with an innate ability uses Transform, it keeps its innate, rather than copying the target's. If there's not an easy fix for this one, I'll probably just remove Ditto's innate and only give it a regular ability.
The second is a little more specific. I brought it up a while ago about how the innate system didn't allow Pokémon to not have an ability. While you fixed that problem, I had a related issue come up today. When in a double battle where one of the opponent's Pokémon had an innate ability but no regular ability, I got the following error message (or something very similar) whenever something tried to attack:
[2024-11-22 14:36:11 -0800]
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]
Exception: NoMethodError
Message: undefined method `id' for nil:NilClass
Backtrace:
[Innate Abilities] AAM Ability Effects.rb:332:in `block in triggerAccuracyCalcFromAlly'
[Innate Abilities] AAM Ability Effects.rb:331:in `each'
[Innate Abilities] AAM Ability Effects.rb:331:in `triggerAccuracyCalcFromAlly'
Move_UsageCalculations:216:in `block in pbCalcAccuracyModifiers'
Move_UsageCalculations:214:in `each'
Move_UsageCalculations:214:in `pbCalcAccuracyModifiers'
[Innate Abilities] AAM Move.rb:14:in `pbCalcAccuracyModifiers'
Move_UsageCalculations:181:in `pbAccuracyCheck'
[Generation 9 Pack] [001] Battle.rb:318:in `pbAccuracyCheck'
Battler_UseMoveSuccessChecks:637:in `pbSuccessCheckPerHit'
It seems to be a result of getting a nil from one of the Pokémon having no regular ability, and the code not being able to handle that eventuality.
EDIT: Sorry, just found another. It seems that an Aegislash with Stance Change as an innate ability will not change form.
Ok lets go by steps:
I didn't realized that Transform/Imposter use a different method to change the user rather than utilizing pbUpdate, so the innates arent re modified for them. I have already fixed the issue by modifying pbTransform to include a call for the target's current innate list and it will be included in the next update, so thanks a lot for that report!
As for the id problem yeah, it seems to be an issue with AAM's original code not handling those cases properly. I could suggest for an inmediat solution to your problem to simply give those pokemon with no abilities the "No ability" ability that is already included in the plugin. It thecnically is an ability with an ID and code so it stops all forms of crashes, it just does absolutely nothing more.
Ngl I didn't really consider cases with no specific abilities in a plugin that centers on giving MORE abilities lol. But I'll look for a solution.
As for Stance Change, not only that one, but Zen Mode, Shields Down, Ice Face and Disguise (And I think Illusion) don't work as innates either. This is because the way they are coded in base essentials. The plugin modifies the "hasActiveAbility?" method to include the list of the pokemon's current ability and innates.
The codes for those abilities ONLY look for if the pokemon's current ability it's equal to them.
To fix it I would have to alias a lot of the base code which is something I don't really want to do because I want to keep the plugin as not invasive to the base script as possible, but at this point I think I'll have to.
You could just exchange those codes for hasActiveAbility?(:STANCECHANGE) for example and it works. I don't really understand why the originals dont use that method but it has to be a reason, so I'll try to call them directly from the innate list instead of using the hasActiveAbility one for any possible problems.