Mercurial > mm7
diff Party.cpp @ 1361:b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
author | Grumpy7 |
---|---|
date | Sun, 14 Jul 2013 23:22:43 +0200 |
parents | 60cdc3eac407 |
children | 9014784ae84f |
line wrap: on
line diff
--- a/Party.cpp Sat Jul 13 21:36:35 2013 +0200 +++ b/Party.cpp Sun Jul 14 23:22:43 2013 +0200 @@ -26,6 +26,7 @@ #include "Sprites.h" #include "SpriteObject.h" #include "ObjectList.h" +#include "Conditions.h" Party *pParty; // idb @@ -949,7 +950,7 @@ auto condition = player->GetMajorConditionIdx(); - if (condition == Player::Condition_Good || condition == Player::Condition_Zombie) + if (condition == Condition_Good || condition == Condition_Zombie) { if (player->uExpressionTimePassed < player->uExpressionTimeLength) continue; @@ -999,23 +1000,23 @@ switch (condition) { - case Player::Condition_Dead: player->expression = CHARACTER_EXPRESSION_DEAD; break; - case Player::Condition_Pertified: player->expression = CHARACTER_EXPRESSION_PERTIFIED; break; - case Player::Condition_Eradicated: player->expression = CHARACTER_EXPRESSION_ERADICATED; break; - case Player::Condition_Cursed: player->expression = CHARACTER_EXPRESSION_CURSED; break; - case Player::Condition_Weak: player->expression = CHARACTER_EXPRESSION_WEAK; break; - case Player::Condition_Sleep: player->expression = CHARACTER_EXPRESSION_SLEEP; break; - case Player::Condition_Fear: player->expression = CHARACTER_EXPRESSION_FEAR; break; - case Player::Condition_Drunk: player->expression = CHARACTER_EXPRESSION_DRUNK; break; - case Player::Condition_Insane: player->expression = CHARACTER_EXPRESSION_INSANE; break; - case Player::Condition_Poison1: - case Player::Condition_Poison2: - case Player::Condition_Poison3: player->expression = CHARACTER_EXPRESSION_POISONED; break; - case Player::Condition_Disease1: - case Player::Condition_Disease2: - case Player::Condition_Disease3: player->expression = CHARACTER_EXPRESSION_DISEASED; break; - case Player::Condition_Paralyzed: player->expression = CHARACTER_EXPRESSION_PARALYZED; break; - case Player::Condition_Unconcious: player->expression = CHARACTER_EXPRESSION_UNCONCIOUS; break; + case Condition_Dead: player->expression = CHARACTER_EXPRESSION_DEAD; break; + case Condition_Pertified: player->expression = CHARACTER_EXPRESSION_PERTIFIED; break; + case Condition_Eradicated: player->expression = CHARACTER_EXPRESSION_ERADICATED; break; + case Condition_Cursed: player->expression = CHARACTER_EXPRESSION_CURSED; break; + case Condition_Weak: player->expression = CHARACTER_EXPRESSION_WEAK; break; + case Condition_Sleep: player->expression = CHARACTER_EXPRESSION_SLEEP; break; + case Condition_Fear: player->expression = CHARACTER_EXPRESSION_FEAR; break; + case Condition_Drunk: player->expression = CHARACTER_EXPRESSION_DRUNK; break; + case Condition_Insane: player->expression = CHARACTER_EXPRESSION_INSANE; break; + case Condition_Poison1: + case Condition_Poison2: + case Condition_Poison3: player->expression = CHARACTER_EXPRESSION_POISONED; break; + case Condition_Disease1: + case Condition_Disease2: + case Condition_Disease3: player->expression = CHARACTER_EXPRESSION_DISEASED; break; + case Condition_Paralyzed: player->expression = CHARACTER_EXPRESSION_PARALYZED; break; + case Condition_Unconcious: player->expression = CHARACTER_EXPRESSION_UNCONCIOUS; break; default: assert(false); }