Skip to content
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

Albeleon's Battle Fixes 2 of N #1448

Merged
merged 16 commits into from Nov 7, 2018

Conversation

Projects
None yet
6 participants
@fmatthew5876
Copy link
Contributor

fmatthew5876 commented Oct 14, 2018

More of the smaller commits from #1373.

Depends on #1447

Changes:

  • 2.26 Renamed weapon local variable to item.
  • 3.14 Minor refactor for code clarity

Dropped:

  • 1.4 - Since Ghabry wanted to have a discussion about it. Let's move it to a later PR and not hold up this one.
  • 4.15 - Algorithm is not correct as per: #1454 - New fix for this in #1455

Fixes #1102.
Fixes #1392.

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:albeleon_battle_2 branch 3 times, most recently from 619130e to 87324b3 Oct 14, 2018

@fmatthew5876
Copy link
Contributor Author

fmatthew5876 left a comment

This one causes a regression. When you kill the last enemy in a battle they don't fade out.

nevermind this, looks like its related to the midi hang glitch.

Show resolved Hide resolved src/game_battle.cpp Outdated

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:albeleon_battle_2 branch from 87324b3 to 6711470 Oct 16, 2018

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Oct 16, 2018

I've reviewed and did some basic testing of these.

Other than the ones with comments on the commits, LGTM 👍

Show resolved Hide resolved src/game_battler.cpp Outdated

@fmatthew5876 fmatthew5876 reopened this Oct 17, 2018

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:albeleon_battle_2 branch 3 times, most recently from b8f9d95 to 97fd233 Oct 17, 2018

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:albeleon_battle_2 branch 2 times, most recently from 5d858bf to 2c16b25 Oct 27, 2018

@fdelapena fdelapena added the Battle label Oct 28, 2018

@Ghabry Ghabry added this to the 0.5.5 (or 0.6.0) -> we will see milestone Nov 4, 2018

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:albeleon_battle_2 branch from 2c16b25 to 8424c49 Nov 4, 2018

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Nov 4, 2018

Rebased onto master

Show resolved Hide resolved src/game_battlealgorithm.cpp Outdated
Show resolved Hide resolved src/game_battlealgorithm.cpp Outdated
Show resolved Hide resolved src/game_battler.cpp Outdated
Show resolved Hide resolved src/game_battler.cpp Outdated
Show resolved Hide resolved src/game_battlealgorithm.cpp Outdated
Show resolved Hide resolved src/game_battlealgorithm.cpp Outdated
@Ghabry
Copy link
Member

Ghabry left a comment

done with reviewing

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:albeleon_battle_2 branch from 2be1a2d to 8066e1c Nov 6, 2018

Albeleon added some commits Jun 23, 2018

"3.9: RM2000: If an absorb skill doesn't take anything, it automatica…
…lly fails ignoring whether it has some conditions/states to cause."

Solution: If a negative absorb skill fails, it skips the rest of the "Execute". We also delete that Absorb SP code at the end. That code, if it's an absorb skill that doesn't absorb SP, and the enemy has 0 SP, it makes the skill miss; which is not true.
"4.10: RM2000: If a technique misses, it doesn't generate EVASION sou…
…nd unless the "Dodge technique" message is the same as the "physical miss"."

Solution: Override GetResultSe with Skill, so: if the attack fails and it's not the failure message 3 (the physical one), it returns NULL (no sound). Otherwise, it does AlgorithmBase::GetResultSe.
"4.11: RM2000: If you keep CANCEL pressed while in State_Battle, the …
…BattleActionState doesn't advance, it keeps paused."

Solution: After battle_action_wait has finished, we put an Input that returns false if CANCEL is pressed.
2.6 + 3.7
"2.6: RM2000 (issue #1102 ): When an enemy dies, a message should be displayed right after the attack inside the same message."
"3.7: RM2000: If an enemy dies with an attack that takes away many stats HP included (or puts conditions), the enemy should die right after the HP damage is done, and the other messages are ignored. This also includes absorb attacks."

Solution: We push that messages after the damage if the enemy is dead, and it skips the rest of result messages.
"2.23: RM2000 + RM2003: When screen shakes in a battle, the borders s…
…hould be black."

Solution: Override Scene::DrawBackground and CleanDisplay.
"2.25: RM2000: Skills and items that affect whole groups should only …
…reduce the item count or SP once. Check too if a weapon that decreases SP reduces when it hits double, everyone or misses."

Solution: For reducing items or skill cost, all of them should be inside "if(FirstAttack())".
"2.26: RM2000 + RM2003: When calculating an actor's state probability…
…, the armor state resistance should be also taken. If there are many armors with state protection of the same type, only the one with the most resistance will be taken, they don't stack."

Solution: In Game_Actor::GetStateProbability, check all the armor, see if they resist the current state, and if they do, save the resistance percentage. It will only take the most resistent. After that, it is multiplied to the result and divided by 100.
"2.27: RM2000 + RM2003: If all the player party is in a state that ha…
…s Restriction NoMove and has a 0% chance of recovery (the physical recovery doesn't matter), it's a game over."

Solution: In CheckLose, in case there is a member active, it checks for each active member whether they are in a state with Restriction NoMove and 0% recovery. If the number of members like that are the same as the active members, it's game over.
"2.31: RM2000: Items that miss shouldn't print any message at all."
Solution: In GetResultMessages, only summon AlgorithmBase if the attack is a success.
"2.38: RM2000 + RM2003: Skills with physical attributes can only be t…
…hrown if the character's weapons (one or two) have all the attributes."

Solution: Check if it has at least one weapon, an that weapon has that particular physical attribute. If one is missing for that technique, it cannot use it.
"2.39: RM2000 + RM2003: Half Cost SP is always rounded to the ceil nu…
…mber."

Solution: Ceil the result of the Half Cost SP for the instances where it's divided.
"3.12: RM2000 + RM2003: Protection equipment against an element shoul…
…d increase the rate for 1 (at most). This can be combined with Shift attribute."

Solution: Add in Game_Actor::GetAttributeModifier a check for all the protections. If it protects against that element, increase rate (only once).
"3.14: RM2000 + RM2003: After a battle is over, heal all the states t…
…hat despite being "Persist after battle", still have more than 0% chance of recovery (turns and physical recovery don't matter)."

Solution: Put that condition in RemoveBattleStates, which removes states when the battle is over.
"4.13: RM2000: If you keep pressed DECISION while in State_Battle, th…
…e waiting time fast-forwards."

Solution: If DECISION is pressed in ProcessBattleAction, it goes twice as fast - it reduces "battle_wait_action" by another unity. To avoid that "if (battle_wait_action)" doesn't detect -1 if that's the case, we change it to "if (battle_wait_action > 0)".

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:albeleon_battle_2 branch from 8066e1c to 7006d47 Nov 6, 2018

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Nov 6, 2018

Thanks Cherry, I'll review criticals in full in the other PR.

What is the base crit chance for enemies?

For enemy, crit is only possible for normal attack and double attack yes?

@CherryDT

This comment has been minimized.

Copy link

CherryDT commented Nov 6, 2018

For enemies and actors it's the same thing, it's stored in critical_hit/critical_hit_chance in the Actor/Enemy structure in the LDB.

In general, crit is only possible for normal physical attacks (double attack is just two physical attacks one after another, which have their individual damage/crit/miss calculation)

@Ghabry

Ghabry approved these changes Nov 7, 2018

@@ -1127,6 +1127,10 @@ const RPG::Sound* Game_BattleAlgorithm::Skill::GetStartSe() const {
}
}

const RPG::Sound* Game_BattleAlgorithm::Skill::GetResultSe() const {
return !success && skill.failure_message != 3 ? NULL : AlgorithmBase::GetResultSe();

This comment has been minimized.

@carstene1ns

carstene1ns Nov 7, 2018

Member

This magic number should probably be resolved to some SkillFailureMessage_Physical in the future.

Make an "All enemy" attack not affect hidden enemies.
Problem: Attack that hit all enemies also hits a hidden character.

Solution: In IsTargetValid(), use Exists()

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:albeleon_battle_2 branch from 7006d47 to d8445c4 Nov 7, 2018

@carstene1ns

This comment has been minimized.

Copy link
Member

carstene1ns commented Nov 7, 2018

alrighty

@carstene1ns carstene1ns merged commit d0453b2 into EasyRPG:master Nov 7, 2018

6 checks passed

Android (armeabi-v7a) Build finished.
Details
GNU/Linux Build finished.
Details
OSX Build finished.
Details
Windows (x64) Build finished.
Details
Windows (x86) Build finished.
Details
web Build finished.
Details

@fmatthew5876 fmatthew5876 deleted the fmatthew5876:albeleon_battle_2 branch Nov 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.