Mercurial > mm7
comparison mm7_4.cpp @ 2250:3cc3a29f073b
moved MerchandiseTest to ItemGen::MerchandiseTest
author | Grumpy7 |
---|---|
date | Wed, 26 Feb 2014 01:26:22 +0100 |
parents | 708aa31cad56 |
children | aff7a7b072b7 |
comparison
equal
deleted
inserted
replaced
2249:708aa31cad56 | 2250:3cc3a29f073b |
---|---|
2330 if ( !dword_7241C8 ) | 2330 if ( !dword_7241C8 ) |
2331 pGame->Draw(); | 2331 pGame->Draw(); |
2332 dword_7241C8 = 0; | 2332 dword_7241C8 = 0; |
2333 } | 2333 } |
2334 | 2334 |
2335 //----- (004BDAAF) -------------------------------------------------------- | |
2336 bool MerchandiseTest(ItemGen *item, int _2da_idx) | |
2337 { | |
2338 bool test; | |
2339 | |
2340 if ( (p2DEvents[_2da_idx - 1].uType != 4 || (signed int)item->uItemID < 740 || (signed int)item->uItemID > 771) | |
2341 && ((signed int)item->uItemID >= 600 || (signed int)item->uItemID >= 529 && (signed int)item->uItemID <= 599) || item->IsStolen()) | |
2342 return false; | |
2343 switch( p2DEvents[_2da_idx - 1].uType ) | |
2344 { | |
2345 case BuildingType_WeaponShop: | |
2346 { | |
2347 test = item->GetItemEquipType() <= EQUIP_BOW; | |
2348 break; | |
2349 } | |
2350 case BuildingType_ArmorShop: | |
2351 { | |
2352 test = item->GetItemEquipType() >= EQUIP_ARMOUR && item->GetItemEquipType() <= EQUIP_BOOTS; | |
2353 break; | |
2354 } | |
2355 case BuildingType_MagicShop: | |
2356 { | |
2357 test = item->GetPlayerSkillType() == PLAYER_SKILL_MISC || item->GetItemEquipType() == EQIUP_ANY; | |
2358 break; | |
2359 } | |
2360 case BuildingType_AlchemistShop: | |
2361 { | |
2362 test = item->GetItemEquipType() == EQUIP_REAGENT || item->GetItemEquipType() == EQUIP_POTION | |
2363 || (item->GetItemEquipType() > EQUIP_POTION && !(item->GetItemEquipType() != EQUIP_MESSAGE_SCROLL | |
2364 || (signed int)item->uItemID < 740) && item->uItemID != 771); | |
2365 break; | |
2366 } | |
2367 default: | |
2368 { | |
2369 test = false; | |
2370 break; | |
2371 } | |
2372 } | |
2373 return test; | |
2374 } |