Mercurial > mm7
comparison Party.cpp @ 912:22abf110163e
Слияние
author | Ritor1 |
---|---|
date | Mon, 22 Apr 2013 20:22:56 +0600 |
parents | 8cd0b155bebe |
children | ae747684f644 |
comparison
equal
deleted
inserted
replaced
911:645b5fbfce6b | 912:22abf110163e |
---|---|
1027 } | 1027 } |
1028 | 1028 |
1029 //----- (00490D02) -------------------------------------------------------- | 1029 //----- (00490D02) -------------------------------------------------------- |
1030 void Party::RestAndHeal() | 1030 void Party::RestAndHeal() |
1031 { | 1031 { |
1032 SpellBuff *v1; // esi@1 | 1032 Player *pPlayer; // esi@4 |
1033 Player *v2; // esi@4 | |
1034 signed int v3; // ebx@4 | |
1035 SpellBuff *v4; // edi@4 | |
1036 int v5; // eax@9 | |
1037 char v6; // zf@9 | |
1038 ItemGen *v7; // eax@10 | 1033 ItemGen *v7; // eax@10 |
1039 signed int v8; // ecx@10 | |
1040 int v9; // eax@18 | |
1041 int v10; // eax@25 | |
1042 signed int v11; // ecx@26 | 1034 signed int v11; // ecx@26 |
1043 signed int v12; // [sp-4h] [bp-1Ch]@26 | 1035 signed int v12; // [sp-4h] [bp-1Ch]@26 |
1044 Party *v13; // [sp+Ch] [bp-Ch]@1 | 1036 bool have_vessels_soul; // [sp+10h] [bp-8h]@10 |
1045 signed int v14; // [sp+10h] [bp-8h]@10 | 1037 |
1046 signed int v15; // [sp+14h] [bp-4h]@3 | 1038 /* v1 = pParty->pPartyBuffs; |
1047 | |
1048 v13 = this; | |
1049 v1 = pParty->pPartyBuffs; | |
1050 do | 1039 do |
1051 { | 1040 { |
1052 v1->Reset(); | 1041 v1->Reset(); |
1053 ++v1; | 1042 ++v1; |
1054 } | 1043 } |
1055 while ( (signed int)v1 < (signed int)pParty->pPlayers ); | 1044 while ( (signed int)v1 < (signed int)pParty->pPlayers ); |
1056 v15 = 0; | 1045 v15 = 0; |
1057 do | 1046 do |
1058 { | 1047 { |
1059 v2 = &pParty->pPlayers[v15]; | 1048 pPlayer = &pParty->pPlayers[v15]; |
1060 v3 = 20; | 1049 v3 = 20; |
1061 v4 = v2->pPlayerBuffs; | 1050 v4 = pPlayer->pPlayerBuffs; |
1062 do | 1051 do |
1063 { | 1052 { |
1064 v4->Reset(); | 1053 v4->Reset(); |
1065 ++v4; | 1054 ++v4; |
1066 --v3; | 1055 --v3; |
1067 } | 1056 } |
1068 while ( v3 ); | 1057 while ( v3 );*/ |
1069 v2->Zero(); | 1058 for ( uint i = 0; i < 20; ++i ) |
1070 if ( v2->pConditions[14] || v2->pConditions[15] || v2->pConditions[16] ) | 1059 pParty->pPartyBuffs[i].Reset(); |
1071 goto LABEL_33; | 1060 for ( int pPlayerID = 0; pPlayerID < 4; ++pPlayerID ) |
1072 v2->pConditions[13] = 0; | 1061 { |
1073 v2->pConditions[4] = 0; | 1062 pPlayer = &pParty->pPlayers[pPlayerID]; |
1074 v2->pConditions[2] = 0; | 1063 for ( uint i = 0; i < 20; ++i ) |
1075 v2->pConditions[3] = 0; | 1064 pPlayer->pPlayerBuffs[i].Reset(); |
1076 v2->pConditions[1] = 0; | 1065 |
1077 v2->uTimeToRecovery = 0; | 1066 pPlayer->Zero(); |
1078 v2->sHealth = v2->GetMaxHealth(); | 1067 if ( pPlayer->pConditions[14] || pPlayer->pConditions[15] || pPlayer->pConditions[16] )//Dead/Petrified/Eradicated |
1079 v5 = v2->GetMaxMana(); | 1068 continue; |
1080 v6 = v2->classType == PLAYER_CLASS_LICH; | 1069 pPlayer->pConditions[13] = 0;//Unconcious |
1081 v2->sMana = v5; | 1070 pPlayer->pConditions[4] = 0;//Drunk |
1082 if ( v6 ) | 1071 pPlayer->pConditions[3] = 0;//Fear |
1083 { | 1072 pPlayer->pConditions[2] = 0;//Sleep |
1084 v14 = 0; | 1073 pPlayer->pConditions[1] = 0;//Weak |
1085 v7 = v2->pInventoryItems;//[0].field_1A; | 1074 pPlayer->uTimeToRecovery = 0; |
1086 v8 = 138; | 1075 pPlayer->sHealth = pPlayer->GetMaxHealth(); |
1087 do | 1076 pPlayer->sMana = pPlayer->GetMaxMana(); |
1088 { | 1077 if ( pPlayer->classType == PLAYER_CLASS_LICH ) |
1089 if ( v7->uItemID == 601 && (unsigned __int8)v7->uHolderPlayer== v15 + 1 ) | 1078 { |
1090 v14 = 1; | 1079 have_vessels_soul = false; |
1080 v7 = pPlayer->pInventoryItems;//[0].field_1A; | |
1081 for ( uint i = 138; i; --i ) | |
1082 { | |
1083 if ( v7->uItemID == 601 && (unsigned __int8)v7->uHolderPlayer == pPlayerID + 1 ) | |
1084 have_vessels_soul = true; | |
1091 ++v7; | 1085 ++v7; |
1092 --v8; | 1086 } |
1093 } | 1087 if ( !have_vessels_soul ) |
1094 while ( v8 ); | 1088 { |
1095 if ( !v14 ) | 1089 pPlayer->sHealth = pPlayer->GetMaxHealth() / 2; |
1096 { | 1090 pPlayer->sMana = pPlayer->GetMaxMana() / 2; |
1097 v2->sHealth = v2->GetMaxHealth() / 2; | 1091 } |
1098 v2->sMana = v2->GetMaxMana() / 2; | 1092 } |
1099 } | 1093 if ( !pPlayer->pConditions[17] )// Zombie |
1100 } | 1094 { |
1101 if ( !v2->pConditions[17] ) | 1095 if ( pPlayer->pConditions[10] || pPlayer->pConditions[11] ) |
1102 { | |
1103 if ( v2->pConditions[10] || v2->pConditions[11] ) | |
1104 { | 1096 { |
1105 v11 = 4; | 1097 v11 = 4; |
1106 v12 = 4; | 1098 v12 = 4; |
1107 } | 1099 } |
1108 else | 1100 else |
1109 { | 1101 { |
1110 if ( !v2->pConditions[8] && !v2->pConditions[9] ) | 1102 if ( !pPlayer->pConditions[8] && !pPlayer->pConditions[9] ) |
1111 { | 1103 { |
1112 if ( !v2->pConditions[6] && !v2->pConditions[7] ) | 1104 if ( !pPlayer->pConditions[6] && !pPlayer->pConditions[7] ) |
1113 goto LABEL_30; | 1105 { |
1114 v2->sHealth /= 2; | 1106 if ( pPlayer->pConditions[5] ) |
1115 v10 = v2->sMana / 2; | 1107 pPlayer->sMana = 0; |
1116 goto LABEL_29; | 1108 UpdatePlayersAndHirelingsEmotions(); |
1109 continue; | |
1110 } | |
1111 pPlayer->sHealth /= 2; | |
1112 pPlayer->sMana = pPlayer->sMana / 2; | |
1113 if ( pPlayer->pConditions[5] ) | |
1114 pPlayer->sMana = 0; | |
1115 UpdatePlayersAndHirelingsEmotions(); | |
1116 continue; | |
1117 } | 1117 } |
1118 v11 = 3; | 1118 v11 = 3; |
1119 v12 = 3; | 1119 v12 = 3; |
1120 } | 1120 } |
1121 v2->sHealth /= v11; | 1121 pPlayer->sHealth /= v11; |
1122 v10 = v2->sMana / v12; | 1122 pPlayer->sMana = pPlayer->sMana / v12; |
1123 LABEL_29: | 1123 if ( pPlayer->pConditions[5] ) |
1124 v2->sMana = v10; | 1124 pPlayer->sMana = 0; |
1125 goto LABEL_30; | 1125 UpdatePlayersAndHirelingsEmotions(); |
1126 } | 1126 continue; |
1127 v9 = v2->sHealth; | 1127 } |
1128 v2->sMana = 0; | 1128 pPlayer->sMana = 0; |
1129 v2->sHealth = v9 / 2; | 1129 pPlayer->sHealth = pPlayer->sHealth / 2; |
1130 LABEL_30: | 1130 if ( pPlayer->pConditions[5] ) |
1131 if ( v2->pConditions[5] ) | 1131 pPlayer->sMana = 0; |
1132 v2->sMana = 0; | |
1133 UpdatePlayersAndHirelingsEmotions(); | 1132 UpdatePlayersAndHirelingsEmotions(); |
1134 LABEL_33: | 1133 } |
1135 ++v15; | |
1136 } | |
1137 while ( v15 < 4 ); | |
1138 pParty->days_played_without_rest = 0; | 1134 pParty->days_played_without_rest = 0; |
1139 } | 1135 } |