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
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
2713cae
"3.9: RM2000: If an absorb skill doesn't take anything, it automatica…
Albeleon Jun 23, 2018
b941b60
"4.10: RM2000: If a technique misses, it doesn't generate EVASION sou…
Albeleon Jun 23, 2018
506d9f3
"4.11: RM2000: If you keep CANCEL pressed while in State_Battle, the …
Albeleon Jun 23, 2018
bc40101
2.6 + 3.7
Albeleon Jun 23, 2018
9be1f65
"2.23: RM2000 + RM2003: When screen shakes in a battle, the borders s…
Albeleon Jun 24, 2018
7278e7c
"2.25: RM2000: Skills and items that affect whole groups should only …
Albeleon Jun 29, 2018
956d66f
"2.26: RM2000 + RM2003: When calculating an actor's state probability…
Albeleon Jul 4, 2018
5b84c36
"2.27: RM2000 + RM2003: If all the player party is in a state that ha…
Albeleon Jul 4, 2018
aa17110
"2.31: RM2000: Items that miss shouldn't print any message at all."
Albeleon Jul 4, 2018
1605f7c
"2.38: RM2000 + RM2003: Skills with physical attributes can only be t…
Albeleon Jul 6, 2018
cbd34e9
"2.39: RM2000 + RM2003: Half Cost SP is always rounded to the ceil nu…
Albeleon Jul 6, 2018
6c3a01c
"3.12: RM2000 + RM2003: Protection equipment against an element shoul…
Albeleon Jul 7, 2018
eb8a6ec
"3.14: RM2000 + RM2003: After a battle is over, heal all the states t…
Albeleon Jul 7, 2018
a0fcb1b
"4.13: RM2000: If you keep pressed DECISION while in State_Battle, th…
Albeleon Jul 7, 2018
d38d6e5
Not show EXP line in victory message if there wasn't.
Albeleon Jul 16, 2018
d8445c4
Make an "All enemy" attack not affect hidden enemies.
Albeleon Jul 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/game_battlealgorithm.cpp
Expand Up @@ -1021,8 +1021,12 @@ bool Game_BattleAlgorithm::Skill::Execute() {

this->success = (GetAffectedHp() != -1 && !IsAbsorb()) || (GetAffectedHp() > 0 && IsAbsorb()) || GetAffectedSp() > 0 || GetAffectedAttack() > 0
|| GetAffectedDefense() > 0 || GetAffectedSpirit() > 0 || GetAffectedAgility() > 0;

if (IsAbsorb() && !success)
return this->success;
}

// Conditions:
for (int i = 0; i < (int) skill.state_effects.size(); i++) {
if (!skill.state_effects[i])
continue;
Expand All @@ -1044,12 +1048,6 @@ bool Game_BattleAlgorithm::Skill::Execute() {
assert(false && "Unsupported skill type");
}

if (IsAbsorb() && sp != -1) {
if (GetTarget()->GetSp() == 0) {
this->success = false;
}
}

return this->success;
}

Expand Down Expand Up @@ -1129,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.

}

void Game_BattleAlgorithm::Skill::GetResultMessages(std::vector<std::string>& out) const {
if (!success) {
switch (skill.failure_message) {
Expand Down
1 change: 1 addition & 0 deletions src/game_battlealgorithm.h
Expand Up @@ -391,6 +391,7 @@ class Skill : public AlgorithmBase {
std::string GetStartMessage() const override;
int GetSourceAnimationState() const override;
const RPG::Sound* GetStartSe() const override;
const RPG::Sound* GetResultSe() const override;
void GetResultMessages(std::vector<std::string>& out) const override;
int GetPhysicalDamageRate() const override;
bool IsReflected() const override;
Expand Down