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

Albeleons's Battle fixes 1 of N #1447

Merged
merged 22 commits into from Nov 4, 2018

Commits on Nov 3, 2018

  1. "1.2: RM2000: Animations executed in a battle event should not wait u…

    …ntil the animation is over when the option "wait to end" is selected."
    
    Solution: Eliminate in Game_Interpreter_Battle::ExecuteCommand and "if" that checks whether the animation is finished no matter if the option "wait to finish" is clicked or not. This difference is already treated and differentiated by itself, and this condition is just a left-over code from previous function structure that isn't needed anymore.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    97fb076 View commit details
    Browse the repository at this point in the history
  2. "2.7: RM2000 + RM2003: The Victory message should have pauses after e…

    …ach line. The first line with the victory message has a longer pause than the others (in RM2003 only the first line should have a pause)."
    
    Solution: Add after each "string" to be printed in the victory message:
    - "\|" to the first message in RM2000 and RM2003.
    - "\." to the following messages in RM2000.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    d8516ca View commit details
    Browse the repository at this point in the history
  3. "4.1: RM2000 + RM2003: Battle music should start when the TransitionI…

    …n from map to battle starts instead of when it ends."
    
    Solution: Add, when a battle is called before the TransitionIn, a BgmStop and BgmPlay with the battle music.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    c9c48e2 View commit details
    Browse the repository at this point in the history
  4. "4.3: RM2000 (not tested in RM2003): If you press "Cancel" when an at…

    …tack is being made, the "Cancel" sound shouldn't play."
    
    Solution: Scene_Battle_Rpg2K::ProcessInput made the "CANCEL" sound play everytime you press the button no matter in which state the Battle is in. It's been fixed to only sound in the places where it has an operation.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    617d7c0 View commit details
    Browse the repository at this point in the history
  5. "4.5: RM2000 + RM2003: The "DECISION" sound when pressing the Attack …

    …command should only sound once, not twice."
    
    Solution: Scene_Battle::AttackSelected already has the "DECISION" sound. Therefore, it's not needed for it to sound when the command is selected. We eliminate it then for the "Attack" command in the Scene_Battle_Rpg2k::CommandSelected and Scene_Battle_Rpg2k3::CommandSelected (for the other commands (skill, items, defend, etc.) it's still kept).
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    b2c0a30 View commit details
    Browse the repository at this point in the history
  6. "4.6: RM2000 + RM2003: There should be a "DECISION" sound when you pr…

    …ess a target (enemy or ally)."
    
    Solution: We add a "DECISION" sound when an ally or enemy is selected in Scene_Battle.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    4756125 View commit details
    Browse the repository at this point in the history
  7. "4.7: RM2000: The Escape sound should sound after the message and whe…

    …n the TransitionOut starts, instead of before the message."
    
    Solution: Move the "ESCAPE" sound from the beginning to after the message is finished (successfully) and before the Scene is popped.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    8a4992b View commit details
    Browse the repository at this point in the history
  8. "4.8: RM2000 + RM2003: When exiting via F12 (Screen Title) in a battl…

    …e, the TransitionOut should be a quick fadeout, not the same slow defined BattleErased one."
    
    Solution: Add in Scene_Battle::TransitionOut an "if" that checks if the type of the current instance (after the scenes have been popped) is Scene::Title.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    05e6c4d View commit details
    Browse the repository at this point in the history
  9. "2.4: RM2000 (not tested in RM2003): If you have the "special skill n…

    …ame" (to give your character a different name to the skill command) checkbox unmarked, it should show the default skill name instead of what is inside."
    
    Solution: Instead of checking whether the skill rename is empty, it checks whether the rename_skill checkbox was clicked or not (after all, if it's clicked, you can put any name, even an empty one).
    For this, we modify Game_Actor::GetSkillName() to always return the
    correct skill.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    87f8644 View commit details
    Browse the repository at this point in the history
  10. "4.9: RM2000 + RM2003: The "DECISION" sound when pressing the Defend …

    …command should only sound once, not twice."
    
    Solution: Taking away the sound when selecting "Defend" in Scene_Battle_Rpg2k and Scene_Battle_Rpg2k3 (it's already played in Scene_Battle).
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    6414b51 View commit details
    Browse the repository at this point in the history
  11. "2.13: RM2000: When pressing CANCEL when selecting an enemy target, i…

    …t should return to the previous window / state, not to SelectCommand. Just like AllyTarget."
    
    Solution: in Scene_Battle_Rpg2k::ProcessInput (and 2k3), change the state of EnemyTarget with AllyTarget, where it returns to the previous state.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    75d7f1f View commit details
    Browse the repository at this point in the history
  12. "2.12: RM2000: Using an object that restores SP displays the message …

    …with the amount -1 (it recovers the normal SP though)."
    
    Solution: Fix an error where in the GetHpSpRecoveredMessage it took GetAffectedHp instead of value (which changes for HP or SP). It returned -1 because Ethers only cure SP.
    
    By checking this, it's also been fixed "GetHpSpAbsorbedMessage" where it printed Data::terms.health_points instead of the input parameter "points" (which means, if you absorb SP, it would still say it was HP in the message).
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    ad581dc View commit details
    Browse the repository at this point in the history
  13. "4.4: RM2000 (not tested in RM2003): When you use an Item, the "Item"…

    … sound should play."
    
    Solution: Fix an error where in Game_BattleAlgorithm::Item::GetStartSe it only played if the object was of type switch (which actually doesn't generate sound) instead of medicine.
    
    Also, fix another error in the same function: the SFX_EnemyAttacks would never be executed since an enemy can't use items, so it's always NULL.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    ec496f6 View commit details
    Browse the repository at this point in the history
  14. 3.3 + 3.5 (together because they have some common code):

    "3.3; RM2000: An absorb attack shouldn't make the enemy flash and generate "Damage" sound."
    "3.5: RM2000: If a skill decreases stats that are not HP, the enemy shouldn't flash and the "Damage" sound shouldn't play."
    
    Solution for 3.3: Put a condition so it doesn't flash or generate sound. For this:
    1. We create a public bool function IsAbsorb() in AlgorithmBase which returns the bool "absorb", so it can be used outside.
    2. Change every instance where absorb is used to put IsAbsorb (this is done for consistency since other parameters use the same).
    3. To not generate the sound: in AlgorithmBase::GetResultSe, if the attack is absorb, it returns NULL.
    4. To not generate the flash: in Scene_Battle_Rpg2k::ProcessBattleAction, in the BattleActionState_Result, when the enemy flashes, it should be put as a condition that the attack shouldn't be absorb.
    
    Solution for 3.5: Put a condition so it doesn't flash or generate sound. We know if GetAffectedHp is -1, HP is not a parameter, so we'll use this check:
    1. To not generate the sound: in AlgorithmBase::GetResultSe, if the successful attack doesn't affect HP, it returns NULL.
    2. To not generate the sound: in Scene_Battle_Rpg2k::ProcessBattleAction, in the BattleActionState_Result, when the enemy flashes, it should be put as a condition.
    
    Also added that the attack shouldn't be IsPositive(): it shouldn't flash if the enemy is healed.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    f520a47 View commit details
    Browse the repository at this point in the history
  15. "2.9: RM2000: When an ally receives damage result that is more than 0…

    …, the screen should shake a little bit."
    
    Solution: Add a screen shake when a sucessful damage is caused to an ally target, with damage that is more than 0, and is not positive or absorb.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    c313037 View commit details
    Browse the repository at this point in the history
  16. "1.3: RM2000 + RM2003: When an enemy dies in a event, it has differen…

    …t effects depending of whether it dies by HP damage or status condition = Death. In the first one, it gradually disappears with monster dying sound. In the second one, it just disappears inmediately."
    
    Solution:
     - When in Game_Interpreter_Battle::CommandChangeMonsterHP the enemy dies, generate the dying monster sound.
     - When in Game_Interpreter_Battle::CommandChangeMonsterCondition the enemies suffers Death, its graphic disappears inmediately, so we don't see the progressive disappearance.
     - When an enemy is dead, ChangeHP shouldn't work.
     - To resurrect an enemy, you use RemoveCondition Death. In that case the enemy appears inmediately and with 1 HP. This has been implemented too.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    c7cb645 View commit details
    Browse the repository at this point in the history
  17. "2.15: RM2000: The conditions caused by a weapon attack are different…

    … from the ones selected in RPG_RT (i.e. a weapon with Poison and Blindness, causes Death)."
    
    Solution: This happened because when calculating which state it was, they put state_set[i], which is not the answer because state_set is a set of booleans that mark if the state i is checked or not. Therefore, because the conditional before said it's checked, state_set[i] => i + 1 (because the ID starts with 1 instead of 0).
    
    Also, since an enemy isn't inmediately in Death condition when taking the Death Message, and it's the only message that matters, we change "GetTarget()->GetSignificantState()" for "ReaderUtil::GetElement(Data::states, 1)" (always Death).
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    9852b4b View commit details
    Browse the repository at this point in the history
  18. "2.16: RM2000: If you have one instance of an object and it's the las…

    …t one in the list, in the battle, when you use it and return to the item window, for a frame you can see the cursor in that position (which now it's empty and shouldn't be accesible) before going back to a normal position. Logically it's fixed, but graphically it's an awkward frame change."
    
    Solution: Put SetIndex in Windows_Item instead of changing the index directly. This will update the cursors and it will automatically clamp it.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    164c164 View commit details
    Browse the repository at this point in the history
  19. "2.19: RM2000: When going to the skill battle menu, only when you go …

    …from SelectCommand the index should go to the first one (0). If you press CANCEL after selecting an enemy, it should keep in the same position."
    
    Solution: in SetState, only SetIndex(0) if the previous state was SelectCommand.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    313e449 View commit details
    Browse the repository at this point in the history
  20. "2.20: RM2000: Only active enemies should have their actions defined …

    …for a turn: hidden or dead ones shouldn't."
    
    Solution: In "CreateEnemyActions": Change "GetBattlers" for "GetActiveBattlers."
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    2ab2eac View commit details
    Browse the repository at this point in the history
  21. "3.6: RM2000: If an enemy doesn't have any more stats to decrease by …

    …a skill (and HP is not there), the enemy should "dodge" that attack. If the enemy has at least one stat to decrease, but other who doesn't (and is not HP), that message shouldn't show up at all, instead of appearing as 0."
    
    Solution:
    1. In "Game_BattleAlgorithm::Skill::Execute", a skill fails if no buff/debuff stat is bigger than 0. If HP is selected, it always succeeds unless it's a negative absorb damage and HP is 0. If SP is selected, it only fails if SP is 0 and the attack is not positive.
    2. In GetResultMessages, not print the buff/debuff stats that aren't bigger than 0. When SP is 0, only print it when the action is positive.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    3f2d601 View commit details
    Browse the repository at this point in the history
  22. "3.8: RM2000: Buffs and bebuffs should be able to stack the more you …

    …use them. Also, there is a limit: the modified stats (decrease or increase) only go in the range [-ParameterBase / 2, ParameterBase * 2]. In case the buff/debuff overcomes the limit, it should be clamped and same with the message result. Heal skills (HP and SP) also clamp with the difference healed (so, if Ally 22/30 HP, and uses a potion or heal, it will only show 8)."
    
    Solution:
    1. The reason why the buffs/debuffs don't stack is because they use "SetXXXModifier" instead of "ChangeXXXModifier", it sets the value instead of add it or decrease it. So we create those methods in Game_Battler. We change them in "Apply".
    2. We clamp the buffs and debuffs within that range in Skill::Execute. If the skill is positive, HP and SP are also clamped to not heal more than the HP or SP left.
    3. If HP is an absorb negative, it is clamped to not take away more than the enemy's current HP. This also means moving the absorb set earlier.
    4. We put the same HP and SP clamp for healing medicines.
    5. When a buff / debuff stat is absorbed from the target, these should also be clamped in the same way they were in point 2.
    Albeleon authored and fmatthew5876 committed Nov 3, 2018
    Copy the full SHA
    3f881c6 View commit details
    Browse the repository at this point in the history