Mercurial > mm7
comparison mm7_4.cpp @ 2059:f9698295c0bd
AttackerInfo, MerchandiseTest
author | Ritor1 |
---|---|
date | Sun, 01 Dec 2013 23:43:03 +0600 |
parents | 28cb79ae2f6f |
children | 72177f3603da |
comparison
equal
deleted
inserted
replaced
2058:e249bd483311 | 2059:f9698295c0bd |
---|---|
3409 pGame->Draw(); | 3409 pGame->Draw(); |
3410 dword_7241C8 = 0; | 3410 dword_7241C8 = 0; |
3411 } | 3411 } |
3412 | 3412 |
3413 //----- (004BDAAF) -------------------------------------------------------- | 3413 //----- (004BDAAF) -------------------------------------------------------- |
3414 bool __fastcall MerchandiseTest(ItemGen *item, int _2da_idx) | 3414 bool MerchandiseTest(ItemGen *item, int _2da_idx) |
3415 { | 3415 { |
3416 int v6; // edx@8 | 3416 int v6; // edx@8 |
3417 int v7; // edx@9 | 3417 int v7; // edx@9 |
3418 int v8; // edx@10 | 3418 int v8; // edx@10 |
3419 unsigned __int8 v9; // zf@16 | 3419 unsigned __int8 v9; // zf@16 |
3421 unsigned __int8 v11; // of@16 | 3421 unsigned __int8 v11; // of@16 |
3422 bool test; | 3422 bool test; |
3423 | 3423 |
3424 if ( (p2DEvents[_2da_idx - 1].uType != 4 || (signed int)item->uItemID < 740 || (signed int)item->uItemID > 771) | 3424 if ( (p2DEvents[_2da_idx - 1].uType != 4 || (signed int)item->uItemID < 740 || (signed int)item->uItemID > 771) |
3425 && ((signed int)item->uItemID >= 600 || (signed int)item->uItemID >= 529 && (signed int)item->uItemID <= 599) || item->IsStolen()) | 3425 && ((signed int)item->uItemID >= 600 || (signed int)item->uItemID >= 529 && (signed int)item->uItemID <= 599) || item->IsStolen()) |
3426 return 0; | 3426 return false; |
3427 switch( p2DEvents[_2da_idx - 1].uType ) | 3427 switch( p2DEvents[_2da_idx - 1].uType ) |
3428 { | 3428 { |
3429 case BuildingType_WeaponShop: | 3429 case BuildingType_WeaponShop: |
3430 { | 3430 { |
3431 test = item->GetItemEquipType() <= 2; | 3431 test = item->GetItemEquipType() <= EQUIP_BOW; |
3432 break; | 3432 break; |
3433 } | 3433 } |
3434 case BuildingType_ArmorShop: | 3434 case BuildingType_ArmorShop: |
3435 { | 3435 { |
3436 test = item->GetItemEquipType() >= 3; | 3436 test = item->GetItemEquipType() >= EQUIP_ARMOUR && item->GetItemEquipType() <= EQUIP_BOOTS; |
3437 break; | 3437 break; |
3438 } | 3438 } |
3439 case BuildingType_MagicShop: | 3439 case BuildingType_MagicShop: |
3440 { | 3440 { |
3441 test = item->GetPlayerSkillType() == 38 || item->GetItemEquipType() == 16; | 3441 test = item->GetPlayerSkillType() == PLAYER_SKILL_MISC || item->GetItemEquipType() == EQIUP_ANY; |
3442 break; | 3442 break; |
3443 } | 3443 } |
3444 case BuildingType_AlchemistShop: | 3444 case BuildingType_AlchemistShop: |
3445 { | 3445 { |
3446 test = item->GetItemEquipType() == 13 || item->GetItemEquipType() == 14 | 3446 test = item->GetItemEquipType() == EQUIP_REAGENT || item->GetItemEquipType() == EQUIP_POTION |
3447 || (item->GetItemEquipType() > 14 && !(item->GetItemEquipType() != 17 | 3447 || (item->GetItemEquipType() > EQUIP_POTION && !(item->GetItemEquipType() != EQUIP_MESSAGE_SCROLL |
3448 || (signed int)item->uItemID < 740) && item->uItemID != 771); | 3448 || (signed int)item->uItemID < 740) && item->uItemID != 771); |
3449 break; | 3449 break; |
3450 } | 3450 } |
3451 default: | 3451 default: |
3452 { | 3452 { |
3453 test = false; | 3453 test = false; |
3454 break; | 3454 break; |
3455 } | 3455 } |
3456 } | 3456 } |
3457 return test; | 3457 return test; |
3458 /* | 3458 } |
3459 if ( p2DEvents[a2 - 1].uType == 1 ) | |
3460 { | |
3461 v11 = __OFSUB__(v5, 2); | |
3462 v9 = v5 == 2; | |
3463 v10 = v5 - 2 < 0; | |
3464 goto LABEL_23; | |
3465 } | |
3466 if ( p2DEvents[a2 - 1].uType > 2 ) | |
3467 { | |
3468 if ( p2DEvents[a2 - 1].uType == 3 ) | |
3469 { | |
3470 if ( pItemsTable->pItems[v4].uSkillType != 38 ) | |
3471 return v5 == 16; | |
3472 return 1; | |
3473 } | |
3474 if ( p2DEvents[a2 - 1].uType != 4 || v5 < 13 ) | |
3475 return 0; | |
3476 if ( p2DEvents[a2 - 1].uType == 4) | |
3477 { | |
3478 if ( v5 < 13 ) | |
3479 return 0; | |
3480 if ( v5 <= 14 ) | |
3481 return 1; | |
3482 if ( v5 != 17 || (signed int)v3 < 740 ) | |
3483 return 0; | |
3484 v11 = __OFSUB__(v3, 771); | |
3485 v9 = v3 == 771; | |
3486 v10 = ((v3 - 771) & 0x80000000u) != 0; | |
3487 LABEL_23: | |
3488 if ( !((unsigned __int8)(v10 ^ v11) | v9) ) | |
3489 return 0; | |
3490 return 1; | |
3491 } | |
3492 } | |
3493 if ( p2DEvents[a2 - 1].uType == 2 ) | |
3494 { | |
3495 if ( v5 >= 3 ) | |
3496 { | |
3497 v11 = __OFSUB__(v5, 9); | |
3498 v9 = v5 == 9; | |
3499 v10 = v5 - 9 < 0; | |
3500 goto LABEL_23; | |
3501 } | |
3502 } | |
3503 return 0; | |
3504 */ | |
3505 } | |
3506 | |
3507 | |
3508 |