Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Reused a battle type time factor value and made possible to stun an e…

…nemy in the warm up state.
  • Loading branch information...
commit 4266944a086ec0becee9ff23c9090e0b7e7fec02 1 parent fa2e6bc
Yohann Ferreira authored
Showing with 5 additions and 8 deletions.
  1. +3 −0  src/modes/battle/battle.h
  2. +2 −8 src/modes/battle/battle_actors.cpp
3  src/modes/battle/battle.h
View
@@ -362,6 +362,9 @@ class BattleMode : public hoa_mode_manager::GameMode {
void SetBattleType(hoa_battle::private_battle::BATTLE_TYPE battle_type)
{ _battle_type = battle_type; }
+ float GetBattleTypeTimeFactor() const
+ { return _battle_type_time_factor; }
+
//! \name Class member accessor methods
//@{
std::deque<private_battle::BattleCharacter*>& GetCharacterActors()
10 src/modes/battle/battle_actors.cpp
View
@@ -217,13 +217,7 @@ void BattleActor::RegisterDamage(uint32 amount, BattleTarget* target) {
// Make the stun effect disappear faster depending on the battle type,
// to not advantage the attacker.
- BattleMode* BM = BattleMode::CurrentInstance();
- if (BM->GetBattleType() == BATTLE_TYPE_SEMI_ACTIVE)
- hurt_time /= BATTLE_SEMI_ACTIVE_FACTOR;
- else if (BM->GetBattleType() == BATTLE_TYPE_WAIT)
- hurt_time /= BATTLE_WAIT_FACTOR;
- else if (BM->GetBattleType() == BATTLE_TYPE_ACTIVE)
- hurt_time /= BATTLE_ACTIVE_FACTOR;
+ hurt_time /= BattleMode::CurrentInstance()->GetBattleTypeTimeFactor();
// Run a shake effect for the same time.
_hurt_timer.Initialize(hurt_time);
@@ -316,7 +310,7 @@ void BattleActor::Update() {
if (!_hurt_timer.IsRunning()) {
// Check the stun effect when in idle state.
- if (_state != ACTOR_STATE_IDLE || !_is_stunned)
+ if ((_state != ACTOR_STATE_IDLE && _state != ACTOR_STATE_WARM_UP) || !_is_stunned)
_state_timer.Update();
}
Please sign in to comment.
Something went wrong with that request. Please try again.