Mercurial > mm7
diff Monsters.cpp @ 1297:5450af4f57ef
moving files mm7_x ending
author | Ritor1 |
---|---|
date | Wed, 19 Jun 2013 17:06:58 +0600 |
parents | b237a61e61d3 |
children | 1e35cfed7928 |
line wrap: on
line diff
--- a/Monsters.cpp Tue Jun 18 17:28:11 2013 +0600 +++ b/Monsters.cpp Wed Jun 19 17:06:58 2013 +0600 @@ -1173,3 +1173,85 @@ } assert(false && "Monster not found!"); } +//----- (00438BDF) -------------------------------------------------------- +bool MonsterStats::BelongsToSupertype(unsigned int uMonsterInfoID, enum MONSTER_SUPERTYPE eSupertype) +{ + unsigned __int8 v2; // zf@15 + char v3; // sf@15 + unsigned __int8 v4; // of@15 + bool result; // eax@33 + + switch ( eSupertype ) + { + case MONSTER_SUPERTYPE_UNDEAD: + if ( (signed int)uMonsterInfoID >= MONSTER_GHOST_1 && (signed int)uMonsterInfoID <= MONSTER_GHOST_3 + || (signed int)uMonsterInfoID >= MONSTER_LICH_1 && (signed int)uMonsterInfoID <= MONSTER_LICH_3 + || (signed int)uMonsterInfoID >= MONSTER_SKELETON_1 && (signed int)uMonsterInfoID <= MONSTER_SKELETON_3 + || (signed int)uMonsterInfoID >= MONSTER_VAMPIRE_1 && (signed int)uMonsterInfoID <= MONSTER_VAMPIRE_3 + || (signed int)uMonsterInfoID >= MONSTER_WIGHT_1 && (signed int)uMonsterInfoID <= MONSTER_WIGHT_3 + || (signed int)uMonsterInfoID >= MONSTER_ZOMBIE_1 && (signed int)uMonsterInfoID <= MONSTER_ZOMBIE_3 ) + goto ret_true; + if ( (signed int)uMonsterInfoID < MONSTER_GHOUL_1 ) + goto ret_false; + v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_GHOUL_3); + v2 = uMonsterInfoID == MONSTER_GHOUL_3; + v3 = ((uMonsterInfoID - MONSTER_GHOUL_3) & 0x80000000u) != 0; + goto false_if_outside; + case MONSTER_SUPERTYPE_KREEGAN: + if ( (signed int)uMonsterInfoID < MONSTER_DEVIL_1 ) + goto ret_false; + v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_DEVIL_3); + v2 = uMonsterInfoID == MONSTER_DEVIL_3; + v3 = ((uMonsterInfoID - MONSTER_DEVIL_3) & 0x80000000u) != 0; + goto false_if_outside; + case MONSTER_SUPERTYPE_ELF: + if ( (signed int)uMonsterInfoID >= MONSTER_PEASANT_ELF_FEMALE_1_1 + && (signed int)uMonsterInfoID <= MONSTER_PEASANT_ELF_MALE_3_3 + || (signed int)uMonsterInfoID >= MONSTER_ELF_ARCHER_1 && (signed int)uMonsterInfoID <= MONSTER_ELF_ARCHER_3 ) + goto ret_true; + if ( (signed int)uMonsterInfoID < MONSTER_ELF_SPEARMAN_1 ) + goto ret_false; + v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_ELF_SPEARMAN_3); + v2 = uMonsterInfoID == MONSTER_ELF_SPEARMAN_3; + v3 = ((uMonsterInfoID - MONSTER_ELF_SPEARMAN_3) & 0x80000000u) != 0; + goto false_if_outside; + case MONSTER_SUPERTYPE_DRAGON: + if ( (signed int)uMonsterInfoID < MONSTER_DRAGON_1 ) + goto ret_false; + v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_DRAGON_3); + v2 = uMonsterInfoID == MONSTER_DRAGON_3; + v3 = ((uMonsterInfoID - MONSTER_DRAGON_3) & 0x80000000u) != 0; + goto false_if_outside; + case MONSTER_SUPERTYPE_WATER_ELEMENTAL: + if ( (signed int)uMonsterInfoID < MONSTER_ELEMENTAL_WATER_1 ) + goto ret_false; + v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_ELEMENTAL_WATER_3); + v2 = uMonsterInfoID == MONSTER_ELEMENTAL_WATER_3; + v3 = ((uMonsterInfoID - MONSTER_ELEMENTAL_WATER_3) & 0x80000000u) != 0; + goto false_if_outside; + case MONSTER_SUPERTYPE_TREANT: + if ( (signed int)uMonsterInfoID < MONSTER_TREANT_1 ) + goto ret_false; + v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_TREANT_3); + v2 = uMonsterInfoID == MONSTER_TREANT_3; + v3 = ((uMonsterInfoID - MONSTER_TREANT_3) & 0x80000000u) != 0; + goto false_if_outside; + case MONSTER_SUPERTYPE_TITAN: + if ( (signed int)uMonsterInfoID < MONSTER_TITAN_1 ) + goto ret_false; + v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_TITAN_3); + v2 = uMonsterInfoID == MONSTER_TITAN_3; + v3 = ((uMonsterInfoID - MONSTER_TITAN_3) & 0x80000000u) != 0; +false_if_outside: + if ( !((unsigned __int8)(v3 ^ v4) | v2) ) + goto ret_false; +ret_true: + result = 1; + break; + default: +ret_false: + result = 0; + break; + } + return result; +} \ No newline at end of file