comparison Party.cpp @ 599:deb559e4fe47

Merge
author Gloval
date Wed, 06 Mar 2013 22:47:21 +0400
parents f8a4a2e0b4c9 8ef867ae88b9
children 6a2d29c21d09
comparison
equal deleted inserted replaced
598:f8a4a2e0b4c9 599:deb559e4fe47
196 return 0; 196 return 0;
197 } 197 }
198 198
199 199
200 //----- (00492AD5) -------------------------------------------------------- 200 //----- (00492AD5) --------------------------------------------------------
201 __int16 Party::SetFood(unsigned int uNumFood) 201 void Party::SetFood(unsigned int uNumFood)
202 { 202 {
203 __int16 result; // ax@1
204
205 pUIAnim_Food->uAnimTime = 0; 203 pUIAnim_Food->uAnimTime = 0;
206 pParty->uNumFoodRations = uNumFood; 204 pParty->uNumFoodRations = uNumFood;
207 result = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength; 205 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength;
208 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
209 return result;
210 } 206 }
211 207
212 //----- (00492B03) -------------------------------------------------------- 208 //----- (00492B03) --------------------------------------------------------
213 void Party::TakeFood(unsigned int uNumFood) 209 void Party::TakeFood(unsigned int uNumFood)
214 { 210 {
215 if ( ((pParty->uNumFoodRations - uNumFood) & 0x80000000u) == 0 ) 211 if (pParty->uNumFoodRations <= uNumFood)
212 pParty->uNumFoodRations = 0;
213 else
216 pParty->uNumFoodRations -= uNumFood; 214 pParty->uNumFoodRations -= uNumFood;
217 else 215
218 pParty->uNumFoodRations = 0;
219 pUIAnim_Food->uAnimTime = 0; 216 pUIAnim_Food->uAnimTime = 0;
220 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength; 217 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength;
221 } 218 }
222 219
223 //----- (00492B42) -------------------------------------------------------- 220 //----- (00492B42) --------------------------------------------------------
224 __int16 Party::GiveFood(unsigned int _this) 221 void Party::GiveFood(unsigned int _this)
225 { 222 {
226 __int16 result; // ax@1
227
228 pParty->uNumFoodRations += _this; 223 pParty->uNumFoodRations += _this;
229 pUIAnim_Food->uAnimTime = 0; 224 pUIAnim_Food->uAnimTime = 0;
230 result = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength; 225 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength;
231 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
232 return result;
233 } 226 }
234 227
235 //----- (00492B70) -------------------------------------------------------- 228 //----- (00492B70) --------------------------------------------------------
236 void Party::SetGold(unsigned int uNumGold) 229 void Party::SetGold(unsigned int uNumGold)
237 { 230 {
238 pParty->uNumGold = uNumGold; 231 pParty->uNumGold = uNumGold;
239 pUIAnim_Gold->uAnimTime = 0; 232 pUIAnim_Gold->uAnimTime = 0;
240 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength; 233 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Gold->uIconID].uAnimLength;
241 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0); 234 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
242 } 235 }
243 236
244 //----- (00492BB6) -------------------------------------------------------- 237 //----- (00492BB6) --------------------------------------------------------
245 void Party::TakeGold(unsigned int uNumGold) 238 void Party::TakeGold(unsigned int uNumGold)
247 if ( uNumGold <= pParty->uNumGold ) 240 if ( uNumGold <= pParty->uNumGold )
248 pParty->uNumGold -= uNumGold; 241 pParty->uNumGold -= uNumGold;
249 else 242 else
250 pParty->uNumGold = 0; 243 pParty->uNumGold = 0;
251 pUIAnim_Gold->uAnimTime = 0; 244 pUIAnim_Gold->uAnimTime = 0;
252 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength; 245 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Gold->uIconID].uAnimLength;
253 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0); 246 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
254 } 247 }
255 248
256 //----- (0049135E) -------------------------------------------------------- 249 //----- (0049135E) --------------------------------------------------------
257 unsigned int Party::GetPartyFame() 250 unsigned int Party::GetPartyFame()