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
Merged

Conversation

mateofio
Copy link
Contributor

@mateofio mateofio 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:


Fixes #1102.
Fixes #1392.

@mateofio mateofio force-pushed the albeleon_battle_2 branch 3 times, most recently from 619130e to 87324b3 Compare October 15, 2018 01:18
src/scene_battle_rpg2k.cpp Outdated Show resolved Hide resolved
Copy link
Contributor Author

@mateofio mateofio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

src/game_battle.cpp Outdated Show resolved Hide resolved
@mateofio
Copy link
Contributor Author

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

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

src/game_battler.cpp Outdated Show resolved Hide resolved
@mateofio mateofio closed this Oct 16, 2018
@mateofio mateofio reopened this Oct 17, 2018
@mateofio mateofio force-pushed the albeleon_battle_2 branch 3 times, most recently from b8f9d95 to 97fd233 Compare October 17, 2018 00:57
@mateofio mateofio force-pushed the albeleon_battle_2 branch 2 times, most recently from 5d858bf to 2c16b25 Compare October 27, 2018 15:53
@Ghabry Ghabry added this to the 0.5.5 (or 0.6.0) -> we will see milestone Nov 4, 2018
@mateofio
Copy link
Contributor Author

mateofio commented Nov 4, 2018

Rebased onto master

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 Show resolved Hide resolved
Copy link
Member

@Ghabry Ghabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done with reviewing

@CherryDT
Copy link

CherryDT commented Nov 6, 2018

Most of them were actually pretty easy to verify, but to be 100% sure I would like to delegate the question "How is the crit_chance of a normal battle attack calculated" to @CherryDT

X = Actor|Enemy.critical_hit ? 100 / Actor|Enemy.critical_hit_chance : 0
X += max(weapon1's Item.critical_hit, weapon2's Item.critical_hit) [only for actors of course]

Then, X is the chance in percent.

If the target is a friend and not a foe (can happen with confusion for example), the crit chance is always zero.

If the target has an equipped item with Item.prevent_critical, the chance is zero as well.

Also, note that a critical hit does not stack with concentration. Concentration makes the attack x2, critical makes it x3, both together also make x3 and not x6.

…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.
…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.
…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: RM2000 (issue EasyRPG#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.
…hould be black."

Solution: Override Scene::DrawBackground and CleanDisplay.
…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())".
…, 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.
…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.
Solution: In GetResultMessages, only summon AlgorithmBase if the attack is a success.
…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.
…mber."

Solution: Ceil the result of the Half Cost SP for the instances where it's divided.
…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).
…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.
…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)".
@mateofio
Copy link
Contributor Author

mateofio 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
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)

@@ -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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Problem: Attack that hit all enemies also hits a hidden character.

Solution: In IsTargetValid(), use Exists()
@carstene1ns
Copy link
Member

alrighty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6 participants