Mercurial > mm7
comparison Party.cpp @ 1369:6b4a1c44a56f
Merge
author | Gloval |
---|---|
date | Mon, 15 Jul 2013 08:20:28 +0400 |
parents | 9014784ae84f |
children | b51332ab228f |
comparison
equal
deleted
inserted
replaced
1368:cc2a25ce8ed2 | 1369:6b4a1c44a56f |
---|---|
24 #include "Texture.h" | 24 #include "Texture.h" |
25 #include "LOD.h" | 25 #include "LOD.h" |
26 #include "Sprites.h" | 26 #include "Sprites.h" |
27 #include "SpriteObject.h" | 27 #include "SpriteObject.h" |
28 #include "ObjectList.h" | 28 #include "ObjectList.h" |
29 #include "Conditions.h" | |
29 | 30 |
30 Party *pParty; // idb | 31 Party *pParty; // idb |
31 | 32 |
32 struct ActionQueue *pPartyActionQueue = new ActionQueue; | 33 struct ActionQueue *pPartyActionQueue = new ActionQueue; |
33 | 34 |
947 auto player = pPlayers + i; | 948 auto player = pPlayers + i; |
948 player->uExpressionTimePassed += (unsigned short)pMiscTimer->uTimeElapsed; | 949 player->uExpressionTimePassed += (unsigned short)pMiscTimer->uTimeElapsed; |
949 | 950 |
950 | 951 |
951 auto condition = player->GetMajorConditionIdx(); | 952 auto condition = player->GetMajorConditionIdx(); |
952 if (condition == Player::Condition_Good || condition == Player::Condition_Zombie) | 953 if (condition == Condition_Good || condition == Condition_Zombie) |
953 { | 954 { |
954 if (player->uExpressionTimePassed < player->uExpressionTimeLength) | 955 if (player->uExpressionTimePassed < player->uExpressionTimeLength) |
955 continue; | 956 continue; |
956 | 957 |
957 player->uExpressionTimePassed = 0; | 958 player->uExpressionTimePassed = 0; |
997 player->uExpressionTimeLength = 0; | 998 player->uExpressionTimeLength = 0; |
998 player->uExpressionTimePassed = 0; | 999 player->uExpressionTimePassed = 0; |
999 | 1000 |
1000 switch (condition) | 1001 switch (condition) |
1001 { | 1002 { |
1002 case Player::Condition_Dead: player->expression = CHARACTER_EXPRESSION_DEAD; break; | 1003 case Condition_Dead: player->expression = CHARACTER_EXPRESSION_DEAD; break; |
1003 case Player::Condition_Pertified: player->expression = CHARACTER_EXPRESSION_PERTIFIED; break; | 1004 case Condition_Pertified: player->expression = CHARACTER_EXPRESSION_PERTIFIED; break; |
1004 case Player::Condition_Eradicated: player->expression = CHARACTER_EXPRESSION_ERADICATED; break; | 1005 case Condition_Eradicated: player->expression = CHARACTER_EXPRESSION_ERADICATED; break; |
1005 case Player::Condition_Cursed: player->expression = CHARACTER_EXPRESSION_CURSED; break; | 1006 case Condition_Cursed: player->expression = CHARACTER_EXPRESSION_CURSED; break; |
1006 case Player::Condition_Weak: player->expression = CHARACTER_EXPRESSION_WEAK; break; | 1007 case Condition_Weak: player->expression = CHARACTER_EXPRESSION_WEAK; break; |
1007 case Player::Condition_Sleep: player->expression = CHARACTER_EXPRESSION_SLEEP; break; | 1008 case Condition_Sleep: player->expression = CHARACTER_EXPRESSION_SLEEP; break; |
1008 case Player::Condition_Fear: player->expression = CHARACTER_EXPRESSION_FEAR; break; | 1009 case Condition_Fear: player->expression = CHARACTER_EXPRESSION_FEAR; break; |
1009 case Player::Condition_Drunk: player->expression = CHARACTER_EXPRESSION_DRUNK; break; | 1010 case Condition_Drunk: player->expression = CHARACTER_EXPRESSION_DRUNK; break; |
1010 case Player::Condition_Insane: player->expression = CHARACTER_EXPRESSION_INSANE; break; | 1011 case Condition_Insane: player->expression = CHARACTER_EXPRESSION_INSANE; break; |
1011 case Player::Condition_Poison1: | 1012 case Condition_Poison1: |
1012 case Player::Condition_Poison2: | 1013 case Condition_Poison2: |
1013 case Player::Condition_Poison3: player->expression = CHARACTER_EXPRESSION_POISONED; break; | 1014 case Condition_Poison3: player->expression = CHARACTER_EXPRESSION_POISONED; break; |
1014 case Player::Condition_Disease1: | 1015 case Condition_Disease1: |
1015 case Player::Condition_Disease2: | 1016 case Condition_Disease2: |
1016 case Player::Condition_Disease3: player->expression = CHARACTER_EXPRESSION_DISEASED; break; | 1017 case Condition_Disease3: player->expression = CHARACTER_EXPRESSION_DISEASED; break; |
1017 case Player::Condition_Paralyzed: player->expression = CHARACTER_EXPRESSION_PARALYZED; break; | 1018 case Condition_Paralyzed: player->expression = CHARACTER_EXPRESSION_PARALYZED; break; |
1018 case Player::Condition_Unconcious: player->expression = CHARACTER_EXPRESSION_UNCONCIOUS; break; | 1019 case Condition_Unconcious: player->expression = CHARACTER_EXPRESSION_UNCONCIOUS; break; |
1019 default: | 1020 default: |
1020 assert(false); | 1021 assert(false); |
1021 } | 1022 } |
1022 } | 1023 } |
1023 } | 1024 } |
1151 pPlayer->sMana = 0; | 1152 pPlayer->sMana = 0; |
1152 UpdatePlayersAndHirelingsEmotions(); | 1153 UpdatePlayersAndHirelingsEmotions(); |
1153 } | 1154 } |
1154 pParty->days_played_without_rest = 0; | 1155 pParty->days_played_without_rest = 0; |
1155 } | 1156 } |
1157 | |
1156 //----- (004938D1) -------------------------------------------------------- | 1158 //----- (004938D1) -------------------------------------------------------- |
1157 void __fastcall Rest(unsigned int uHoursToSleep) | 1159 void __fastcall Rest(unsigned int uHoursToSleep) |
1158 { | 1160 { |
1159 unsigned int v1; // esi@1 | 1161 unsigned int v1; // esi@1 |
1160 double v2; // st7@3 | 1162 double v2; // st7@3 |
1456 while ( v3 <= &pParty->pPlayers[3] ) | 1458 while ( v3 <= &pParty->pPlayers[3] ) |
1457 { | 1459 { |
1458 v4 = v3->AddItem(-1, pParty->pPickedItem.uItemID); | 1460 v4 = v3->AddItem(-1, pParty->pPickedItem.uItemID); |
1459 if ( v4 ) | 1461 if ( v4 ) |
1460 { | 1462 { |
1461 memcpy(&pParty->pPlayers[v12].pInventoryItems[v4], &pParty->pPickedItem, 0x24u); | 1463 memcpy(&pParty->pPlayers[v12].pInventoryItems[v4 - 1], &pParty->pPickedItem, 0x24u); |
1462 pMouse->RemoveHoldingItem(); | 1464 pMouse->RemoveHoldingItem(); |
1463 break; | 1465 break; |
1464 } | 1466 } |
1465 ++v12; | 1467 ++v12; |
1466 ++v3; | 1468 ++v3; |
1512 v1->Release(); | 1514 v1->Release(); |
1513 pIcons_LOD->SyncLoadedFilesCount(); | 1515 pIcons_LOD->SyncLoadedFilesCount(); |
1514 } | 1516 } |
1515 return 1; | 1517 return 1; |
1516 } | 1518 } |
1519 | |
1520 | |
1521 bool Party::IsPartyEvil() | |
1522 { | |
1523 return _449B57_test_bit(_quest_bits, 100); | |
1524 } | |
1525 | |
1526 bool Party::IsPartyGood() | |
1527 { | |
1528 return _449B57_test_bit(_quest_bits, 99); | |
1529 } |