comparison Monsters.cpp @ 1297:5450af4f57ef

moving files mm7_x ending
author Ritor1
date Wed, 19 Jun 2013 17:06:58 +0600
parents b237a61e61d3
children 1e35cfed7928
comparison
equal deleted inserted replaced
1296:c423f946dc99 1297:5450af4f57ef
1171 if( (!_stricmp(pMonsters[i].pMonsterName, pMonsterName))) 1171 if( (!_stricmp(pMonsters[i].pMonsterName, pMonsterName)))
1172 return i; 1172 return i;
1173 } 1173 }
1174 assert(false && "Monster not found!"); 1174 assert(false && "Monster not found!");
1175 } 1175 }
1176 //----- (00438BDF) --------------------------------------------------------
1177 bool MonsterStats::BelongsToSupertype(unsigned int uMonsterInfoID, enum MONSTER_SUPERTYPE eSupertype)
1178 {
1179 unsigned __int8 v2; // zf@15
1180 char v3; // sf@15
1181 unsigned __int8 v4; // of@15
1182 bool result; // eax@33
1183
1184 switch ( eSupertype )
1185 {
1186 case MONSTER_SUPERTYPE_UNDEAD:
1187 if ( (signed int)uMonsterInfoID >= MONSTER_GHOST_1 && (signed int)uMonsterInfoID <= MONSTER_GHOST_3
1188 || (signed int)uMonsterInfoID >= MONSTER_LICH_1 && (signed int)uMonsterInfoID <= MONSTER_LICH_3
1189 || (signed int)uMonsterInfoID >= MONSTER_SKELETON_1 && (signed int)uMonsterInfoID <= MONSTER_SKELETON_3
1190 || (signed int)uMonsterInfoID >= MONSTER_VAMPIRE_1 && (signed int)uMonsterInfoID <= MONSTER_VAMPIRE_3
1191 || (signed int)uMonsterInfoID >= MONSTER_WIGHT_1 && (signed int)uMonsterInfoID <= MONSTER_WIGHT_3
1192 || (signed int)uMonsterInfoID >= MONSTER_ZOMBIE_1 && (signed int)uMonsterInfoID <= MONSTER_ZOMBIE_3 )
1193 goto ret_true;
1194 if ( (signed int)uMonsterInfoID < MONSTER_GHOUL_1 )
1195 goto ret_false;
1196 v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_GHOUL_3);
1197 v2 = uMonsterInfoID == MONSTER_GHOUL_3;
1198 v3 = ((uMonsterInfoID - MONSTER_GHOUL_3) & 0x80000000u) != 0;
1199 goto false_if_outside;
1200 case MONSTER_SUPERTYPE_KREEGAN:
1201 if ( (signed int)uMonsterInfoID < MONSTER_DEVIL_1 )
1202 goto ret_false;
1203 v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_DEVIL_3);
1204 v2 = uMonsterInfoID == MONSTER_DEVIL_3;
1205 v3 = ((uMonsterInfoID - MONSTER_DEVIL_3) & 0x80000000u) != 0;
1206 goto false_if_outside;
1207 case MONSTER_SUPERTYPE_ELF:
1208 if ( (signed int)uMonsterInfoID >= MONSTER_PEASANT_ELF_FEMALE_1_1
1209 && (signed int)uMonsterInfoID <= MONSTER_PEASANT_ELF_MALE_3_3
1210 || (signed int)uMonsterInfoID >= MONSTER_ELF_ARCHER_1 && (signed int)uMonsterInfoID <= MONSTER_ELF_ARCHER_3 )
1211 goto ret_true;
1212 if ( (signed int)uMonsterInfoID < MONSTER_ELF_SPEARMAN_1 )
1213 goto ret_false;
1214 v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_ELF_SPEARMAN_3);
1215 v2 = uMonsterInfoID == MONSTER_ELF_SPEARMAN_3;
1216 v3 = ((uMonsterInfoID - MONSTER_ELF_SPEARMAN_3) & 0x80000000u) != 0;
1217 goto false_if_outside;
1218 case MONSTER_SUPERTYPE_DRAGON:
1219 if ( (signed int)uMonsterInfoID < MONSTER_DRAGON_1 )
1220 goto ret_false;
1221 v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_DRAGON_3);
1222 v2 = uMonsterInfoID == MONSTER_DRAGON_3;
1223 v3 = ((uMonsterInfoID - MONSTER_DRAGON_3) & 0x80000000u) != 0;
1224 goto false_if_outside;
1225 case MONSTER_SUPERTYPE_WATER_ELEMENTAL:
1226 if ( (signed int)uMonsterInfoID < MONSTER_ELEMENTAL_WATER_1 )
1227 goto ret_false;
1228 v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_ELEMENTAL_WATER_3);
1229 v2 = uMonsterInfoID == MONSTER_ELEMENTAL_WATER_3;
1230 v3 = ((uMonsterInfoID - MONSTER_ELEMENTAL_WATER_3) & 0x80000000u) != 0;
1231 goto false_if_outside;
1232 case MONSTER_SUPERTYPE_TREANT:
1233 if ( (signed int)uMonsterInfoID < MONSTER_TREANT_1 )
1234 goto ret_false;
1235 v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_TREANT_3);
1236 v2 = uMonsterInfoID == MONSTER_TREANT_3;
1237 v3 = ((uMonsterInfoID - MONSTER_TREANT_3) & 0x80000000u) != 0;
1238 goto false_if_outside;
1239 case MONSTER_SUPERTYPE_TITAN:
1240 if ( (signed int)uMonsterInfoID < MONSTER_TITAN_1 )
1241 goto ret_false;
1242 v4 = __OFSUB__(uMonsterInfoID, (int)MONSTER_TITAN_3);
1243 v2 = uMonsterInfoID == MONSTER_TITAN_3;
1244 v3 = ((uMonsterInfoID - MONSTER_TITAN_3) & 0x80000000u) != 0;
1245 false_if_outside:
1246 if ( !((unsigned __int8)(v3 ^ v4) | v2) )
1247 goto ret_false;
1248 ret_true:
1249 result = 1;
1250 break;
1251 default:
1252 ret_false:
1253 result = 0;
1254 break;
1255 }
1256 return result;
1257 }