-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Secondary/primary effects overhaul #3577
Secondary/primary effects overhaul #3577
Conversation
Works great
It's that easy
Sorry, Lunos
Pass tests too
Now has the ability to loop over multiple effects without causing problems - requires a maybe controversial macro modification...
6a787d2
to
0b030c9
Compare
All work fine - all tests pass
0b030c9
to
bec0fea
Compare
Also tidied up paralysis/burn scripts; updated Barb Barrage
Jaw Lock needs a test but I'm too lazy to write it
Added move effect FREEZE_OR_FROSTBITE macro so that we only need that if statement once...
Two turn moves (Bounce, Freeze Shock, Sky Attack, Shadow/Phantom Force), Dire Claw, Stone Axe, Ceaseless Edge, Wicked Torque, Relic Song, Fake Out,
Added check to prevent loops in cmd_seteffectwithchance. Updated Pay Day, Tri Attack, Spectral Thief, Clear Smog, V Create, Core Enforcer
Poison Fang, Knock Off, Thunder, Hurricane, Snore; also Thief, hit_and_escape moves, recharge moves, (but didn't remove effect)
Includes Grav Apple - test that checks the AI can see its power bump needs fixing
To do: moves like CC, Overheat that LOWER stats; did NOT remove the effect for raising all stats due to an AI function
Also, Syrup Bomb (really weird script)
Modified tests to use MoveHasMoveEffect
Some util updates
Done. I've had to do this like three or four times already because by the nature of this PR, pretty much any change in upcoming to battle_scripts, battle_move_effects, or gBattleMoves will cause a conflict. If there are conflicts next time you check, please disregard and check anyway and I'll merge once more when it's approved. |
ac7c8c1
to
0980253
Compare
Just a couple for now; cleaned up parts of setadditionaleffects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple more things. Why do some effects have a 100%, some don't? E.g Thousand Waves and Spirit Shackle. Additionally can you write a test for Payday where Player and AI use them on the same turn?
Also I've noticed some minor details when going over the moves. Mighty Cleave doesn't break Protect and Sky Attack has a high critical ratio.
PR looks clean and so far I haven't found a broken move though I noticed some inconsistencies for Payday but high chance I'm wrong here.
Numerous AI updates and test fixes; added a test for Aura Wheel
Thanks for checking! For anyone else checking, we discussed Thousand Waves vs Spirit Shackle here. Mighty Cleave was given EFFECT_FEINT when I started so I simply gave it the move effect - I didn't think to check what its correct effect was. I don't know what happened with Sky Attack... Both fixed now |
Not the ideal solution but Fling now has a hardcoded check for Shield Dust and acts accordingly - a better long term solution inolves making a bunch of reusable MOVE_EFFECTS and rejigging attackcanceler but I didn't feel like doing that today...
Thanks, Edu Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
b9b059c
to
3c93f97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So close 👀
Revamping the way move secondary/primary effects are stored and handled by adding a compound literal of AdditionalEffects to the BattleMove struct.
Description
Each AdditionalEffect looks like this and lets you define primary/secondary effects and ones that target the opponent or the attacker::
The
ADDITIONAL_EFFECTS
macro let you define an array of them in a compound literal that also counts them:Example:
In order to call an array of multiple effects, we modify the
seteffectwithchance
macro (renamed tosetadditionaleffects
) to loop if we set the move effect toMOVE_EFFECT_CONTINUE
(see below).As we loop through, it's necessary to track the index in
gBattleStruct->additionalEffectsCounter
- if this value is less than the total number of effects this move has inadditionalEffects
, increment the counter, setgBattlescripting.moveEffect
toMOVE_EFFECT_CONTINUE
and the macro calls the function again.Out of scope:
Discord contact info
thechurchofcage