-
Notifications
You must be signed in to change notification settings - Fork 186
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
Refactor Battle2k message timings + state fixes 1 / 2 #1726
Conversation
bd5aa3d
to
a70d306
Compare
6ee60c4
to
352ed88
Compare
e66ba7c
to
47bdd2a
Compare
This is ready now, I've run through all the test cases and they all pass.
|
Can you explain why How is success handled now? |
The GetResult methods had too much 2k specific logic in them so I moved them out. GetResultSE no longer makes sense as failure and damage sounds happen in different places. In the damage and death commits I already had to start ripping stuff out of GetResultMessages(). So it already became partially implemented. Success is computed in Execute(), so it shouldn't change. Essentially, We could move out all the message logic from battle algorithm, but there are many others outside of failure and I haven't done that. I'm not sure we need to, as long as they stay like properties and not battle system logic. |
47bdd2a
to
4c8c552
Compare
What was broken there? I don't really understand the cloning. |
Self Destruct is supposed to heal states like confuse, just like a normal attack.
Ouch, that's a pretty bad oversight on my part. I will need to re-evaluate this one. It's supposed to make a copy of everything, so that we just use The reason for this is that the logic involved is very complicated, mostly because of the whole thing about states being cancelled by priorities. The idea was to isolate it in one place. |
This now passes all test cases of #1770 |
src/scene_equip.cpp
Outdated
def = Utils::Clamp(def, 1, 999); | ||
spi = Utils::Clamp(spi, 1, 999); | ||
agi = Utils::Clamp(agi, 1, 999); | ||
|
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.
Refactor scene_equip
But this change doesn't handle the case where a state is inflicted which halfes the SP, or does it?
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.
Half SP?
If you mean the half SP cost flag on equipment, that doesn't change the equip numbers.
If you mean half / double stats from states, this is RPG_RT compatible. The equip window doesn't show the effect of those states in the arrows, they only appear after you change equipment.
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.
Yes I mean the half/double skill stuff.
The problem is that this is a RPG2k3 feature, so my educated guess is: They forgot to update the scene code. ^^'
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.
I could see a use for this. Imagine a cursed equipment with apparently good stats which ends up halving all your stats after you equip it and can't remove it!
I ask for a split after "Fixes for physically healed conditions" because the state code exploded into 20 new commits. |
Use it for battle 2k escape logic
* Add Begin state to flash and wait 4 * Rename ConditionsHeal -> Conditions * Remove IsFirstAttack() check, as the state machine never returns to Begin anyway
* Add wait 4 in execute * Adds Critical state
Hacky, but we need it for proper message timing in 2k battles
* No target? : Apply->Finished * Add a new failure state: Apply->Failure->Finished * Handle failure SFX and message separately
Also clean up Finished state
* Wait 4 before each action * Fix timing for actions
* Remove Game_BattleAlgorithm::GetResultsMessages() * Put all the logic into ProcessActionResults * Fix RPG_RT wait bug with death state handling
Conditions healed by attacks can be re-infliced again by the same weapon. Change the logic to allow this to happen and rename `healed_conditions` to `phys_healed_conditions` to make it more obvious what its for.
thx! |
FYI I haven't really tested this split here. Not sure if there would be regressions while we're in between this and #1785 |
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.
Everything seems to work, couldn't find any regressions (also tested a bit in 2k3)
This is yet another 2k battle system refactor.
In order to emulate all of the waits RPG_RT does in #1677 I've had to add more states and substates.
I've also taken this opportunity to do some cleanup. In particular I've removed
GetResultMessages()
fromGame_BattleAlgorithm
and nearly all of the 2k message processing logic intoSceneBattleRpg2k
.I also fixed a self-destruct bug and #1725 using a hack that hopefully can be dismantled later.
Related: #1725
Related: #1677
Related: #1748
Related: #1770
Related: #821
Related: #1490
(they are all closed with #1785)
Tested: