Mercurial > mm7
comparison Monsters.cpp @ 694:52329962fcdb
monster table init rework started
author | Gloval |
---|---|
date | Sun, 17 Mar 2013 12:47:19 +0400 |
parents | 2799737f8a74 |
children | b097497f07e2 |
comparison
equal
deleted
inserted
replaced
693:e0a1fccc89b1 | 694:52329962fcdb |
---|---|
180 fclose(v3); | 180 fclose(v3); |
181 } | 181 } |
182 | 182 |
183 | 183 |
184 //----- (004563FF) -------------------------------------------------------- | 184 //----- (004563FF) -------------------------------------------------------- |
185 signed int MonsterStats::_4563FF(const char *Str2) | 185 signed int MonsterStats::FindMonsterByName(const char *Str2) |
186 { | 186 { |
187 MonsterStats *v2; // esi@1 | 187 MonsterStats *v2; // esi@1 |
188 signed int v3; // ebx@1 | 188 signed int v3; // ebx@1 |
189 MonsterInfo *v4; // edi@2 | 189 MonsterInfo *v4; // edi@2 |
190 signed int result; // eax@6 | 190 signed int result; // eax@6 |
191 | 191 /* |
192 for (int i=1; i<=uNumMonsters; ++i) | |
193 { | |
194 if() | |
195 return i; | |
196 } | |
197 return -1; | |
198 */ | |
192 v2 = this; | 199 v2 = this; |
193 v3 = 1; | 200 v3 = 1; |
194 if ( (signed int)this->uNumMonsters <= 1 ) | 201 if ( (signed int)this->uNumMonsters <= 1 ) |
195 { | 202 { |
196 LABEL_6: | 203 LABEL_6: |
197 result = -1; | 204 result = -1; |
198 } | 205 } |
199 else | 206 else |
200 { | 207 { |
201 v4 = &this->pInfos[1]; | 208 v4 = &this->pInfos[1]; |
202 while ( !v4->pName || _strcmpi(v4->pTexture, Str2) ) | 209 while ( !v4->pName || _strcmpi(v4->pPictureName, Str2) ) |
203 { | 210 { |
204 ++v3; | 211 ++v3; |
205 ++v4; | 212 ++v4; |
206 if ( v3 >= (signed int)v2->uNumMonsters ) | 213 if ( v3 >= (signed int)v2->uNumMonsters ) |
207 goto LABEL_6; | 214 goto LABEL_6; |
260 uNumPlacements = 31; | 267 uNumPlacements = 31; |
261 } | 268 } |
262 | 269 |
263 //----- (0045501E) -------------------------------------------------------- | 270 //----- (0045501E) -------------------------------------------------------- |
264 void MonsterStats::Initialize() | 271 void MonsterStats::Initialize() |
265 { | 272 { |
266 MonsterStats *v1; // ebx@1 | 273 MonsterStats *v1; // ebx@1 |
267 int v2; // ebx@4 | 274 int v2; // ebx@4 |
268 char v3; // cl@5 | 275 char v3; // cl@5 |
269 int v4; // eax@5 | 276 int v4; // eax@5 |
270 size_t v5; // eax@19 | 277 size_t v5; // eax@19 |
271 signed int v6; // edi@19 | 278 signed int v6; // edi@19 |
272 MonsterStats *v7; // ecx@23 | 279 MonsterStats *v7; // ecx@23 |
273 int v8; // eax@23 | 280 int v8; // eax@23 |
274 unsigned int *pHP; // esi@23 | 281 unsigned int *pHP; // esi@23 |
275 size_t v10; // eax@29 | 282 size_t v10; // eax@29 |
276 signed int v11; // edi@29 | 283 signed int v11; // edi@29 |
277 MonsterStats *v12; // ecx@33 | 284 MonsterStats *v12; // ecx@33 |
278 int v13; // eax@33 | 285 int v13; // eax@33 |
279 unsigned int *pExp; // esi@33 | 286 unsigned int *pExp; // esi@33 |
280 signed int v15; // edi@36 | 287 signed int v15; // edi@36 |
281 size_t v16; // esi@36 | 288 size_t v16; // esi@36 |
282 int v17; // eax@37 | 289 int v17; // eax@37 |
283 MonsterInfo *v18; // esi@45 | 290 MonsterInfo *v18; // esi@45 |
284 size_t v19; // edi@50 | 291 size_t v19; // edi@50 |
285 int v20; // eax@51 | 292 int v20; // eax@51 |
286 unsigned __int8 v21; // al@55 | 293 unsigned __int8 v21; // al@55 |
287 size_t v22; // edi@59 | 294 size_t v22; // edi@59 |
288 char v23; // cl@63 | 295 char v23; // cl@63 |
289 const char *v24; // edi@63 | 296 const char *v24; // edi@63 |
290 unsigned __int16 *v25; // esi@114 | 297 unsigned __int16 *v25; // esi@114 |
291 int v26; // eax@118 | 298 int v26; // eax@118 |
292 size_t v27; // eax@136 | 299 size_t v27; // eax@136 |
293 int v28; // edi@137 | 300 int v28; // edi@137 |
294 MonsterStats *v29; // esi@137 | 301 MonsterStats *v29; // esi@137 |
295 int v30; // eax@138 | 302 int v30; // eax@138 |
296 int v31; // eax@142 | 303 int v31; // eax@142 |
297 int v32; // eax@143 | 304 int v32; // eax@143 |
298 int v33; // eax@144 | 305 int v33; // eax@144 |
299 int v34; // eax@151 | 306 int v34; // eax@151 |
300 int v35; // eax@152 | 307 int v35; // eax@152 |
301 int v36; // eax@153 | 308 int v36; // eax@153 |
302 int v37; // eax@162 | 309 int v37; // eax@162 |
303 int v38; // eax@163 | 310 int v38; // eax@163 |
304 int v39; // eax@164 | 311 int v39; // eax@164 |
305 int v40; // eax@171 | 312 int v40; // eax@171 |
306 int v41; // eax@172 | 313 int v41; // eax@172 |
307 size_t v42; // eax@180 | 314 size_t v42; // eax@180 |
308 int v43; // edi@180 | 315 int v43; // edi@180 |
309 MonsterInfo *v44; // esi@180 | 316 MonsterInfo *v44; // esi@180 |
310 int v45; // edi@184 | 317 int v45; // edi@184 |
311 MonsterInfo *v46; // eax@232 | 318 MonsterInfo *v46; // eax@232 |
312 char *v47; // edx@232 | 319 char *v47; // edx@232 |
313 char *v48; // ecx@232 | 320 char *v48; // ecx@232 |
314 MonsterInfo *v49; // eax@236 | 321 MonsterInfo *v49; // eax@236 |
315 FrameTableTxtLine *v50; // esi@240 | 322 FrameTableTxtLine *v50; // esi@240 |
316 int v51; // eax@240 | 323 int v51; // eax@240 |
317 int v52; // eax@241 | 324 int v52; // eax@241 |
318 int v53; // esi@242 | 325 int v53; // esi@242 |
319 int v54; // edi@242 | 326 int v54; // edi@242 |
320 char v55; // al@242 | 327 char v55; // al@242 |
321 char *v56; // edi@242 | 328 char *v56; // edi@242 |
322 FrameTableTxtLine *v57; // esi@249 | 329 FrameTableTxtLine *v57; // esi@249 |
323 int v58; // eax@249 | 330 int v58; // eax@249 |
324 MonsterInfo *v59; // eax@250 | 331 MonsterInfo *v59; // eax@250 |
325 MonsterInfo *v60; // esi@251 | 332 MonsterInfo *v60; // esi@251 |
326 int v61; // edi@251 | 333 int v61; // edi@251 |
327 char v62; // al@251 | 334 char v62; // al@251 |
328 char *v63; // edi@251 | 335 char *v63; // edi@251 |
329 char v64; // al@258 | 336 char v64; // al@258 |
330 char v65; // al@262 | 337 char v65; // al@262 |
331 char v66; // al@266 | 338 char v66; // al@266 |
332 char v67; // al@270 | 339 char v67; // al@270 |
333 char v68; // al@274 | 340 char v68; // al@274 |
334 char v69; // al@278 | 341 char v69; // al@278 |
335 char v70; // al@282 | 342 char v70; // al@282 |
336 char v71; // al@286 | 343 char v71; // al@286 |
337 char v72; // al@290 | 344 char v72; // al@290 |
338 unsigned __int8 v73; // al@294 | 345 unsigned __int8 v73; // al@294 |
339 int v74; // edi@298 | 346 int v74; // edi@298 |
340 MonsterInfo *v75; // esi@300 | 347 MonsterInfo *v75; // esi@300 |
341 MonsterInfo *v76; // esi@302 | 348 MonsterInfo *v76; // esi@302 |
342 char **v77; // edi@306 | 349 char **v77; // edi@306 |
343 __int16 v78; // ax@316 | 350 __int16 v78; // ax@316 |
344 MonsterInfo *v79; // esi@323 | 351 MonsterInfo *v79; // esi@323 |
345 const char *v80; // ecx@323 | 352 const char *v80; // ecx@323 |
346 std::string v81; // [sp-14h] [bp-46Ch]@317 | 353 std::string v81; // [sp-14h] [bp-46Ch]@317 |
347 const char *v82; // [sp-8h] [bp-460h]@306 | 354 const char *v82; // [sp-8h] [bp-460h]@306 |
348 char *v83; // [sp-4h] [bp-45Ch]@23 | 355 char *v83; // [sp-4h] [bp-45Ch]@23 |
349 char *v84; // [sp+0h] [bp-458h]@37 | 356 char *v84; // [sp+0h] [bp-458h]@37 |
350 FrameTableTxtLine v85; // [sp+10h] [bp-448h]@297 | 357 FrameTableTxtLine v85; // [sp+10h] [bp-448h]@297 |
351 FrameTableTxtLine v86; // [sp+8Ch] [bp-3CCh]@249 | 358 FrameTableTxtLine v86; // [sp+8Ch] [bp-3CCh]@249 |
352 FrameTableTxtLine v87; // [sp+108h] [bp-350h]@240 | 359 FrameTableTxtLine v87; // [sp+108h] [bp-350h]@240 |
353 char Src[120]; // [sp+184h] [bp-2D4h]@317 | 360 char Src[120]; // [sp+184h] [bp-2D4h]@317 |
354 FrameTableTxtLine v89; // [sp+1FCh] [bp-25Ch]@249 | 361 FrameTableTxtLine v89; // [sp+1FCh] [bp-25Ch]@249 |
355 FrameTableTxtLine v90; // [sp+278h] [bp-1E0h]@240 | 362 FrameTableTxtLine v90; // [sp+278h] [bp-1E0h]@240 |
356 char Str[64]; // [sp+2F4h] [bp-164h]@240 | 363 char Str[64]; // [sp+2F4h] [bp-164h]@240 |
357 char Dest[64]; // [sp+334h] [bp-124h]@249 | 364 char Dest[64]; // [sp+334h] [bp-124h]@249 |
358 char v93[64]; // [sp+374h] [bp-E4h]@297 | 365 char v93[64]; // [sp+374h] [bp-E4h]@297 |
359 FrameTableTxtLine v94; // [sp+3B4h] [bp-A4h]@297 | 366 FrameTableTxtLine v94; // [sp+3B4h] [bp-A4h]@297 |
360 int v95; // [sp+430h] [bp-28h]@317 | 367 int v95; // [sp+430h] [bp-28h]@317 |
361 int v96; // [sp+434h] [bp-24h]@9 | 368 int v96; // [sp+434h] [bp-24h]@9 |
362 int v97; // [sp+438h] [bp-20h]@4 | 369 int v97; // [sp+438h] [bp-20h]@4 |
363 char a3[5]; // [sp+43Fh] [bp-19h]@4 | 370 char a3[5]; // [sp+43Fh] [bp-19h]@4 |
364 int a2; // [sp+444h] [bp-14h]@36 | 371 int a2; // [sp+444h] [bp-14h]@36 |
365 int v100; // [sp+448h] [bp-10h]@36 | 372 int v100; // [sp+448h] [bp-10h]@36 |
366 size_t v101; // [sp+44Ch] [bp-Ch]@19 | 373 size_t v101; // [sp+44Ch] [bp-Ch]@19 |
367 MonsterStats *v102; // [sp+450h] [bp-8h]@1 | 374 MonsterStats *v102; // [sp+450h] [bp-8h]@1 |
368 int v103; // [sp+454h] [bp-4h]@3 | 375 int v103; // [sp+454h] [bp-4h]@3 |
369 | 376 |
370 v1 = this; | 377 int i,j; |
371 v102 = this; | 378 char* test_string; |
372 if ( pMonstersTXT_Raw ) | 379 unsigned char c; |
373 pAllocator->FreeChunk(pMonstersTXT_Raw); | 380 bool break_loop; |
374 pMonstersTXT_Raw = 0; | 381 unsigned int temp_str_len; |
375 pMonstersTXT_Raw = (char *)pEvents_LOD->LoadRaw("monsters.txt", 0); | 382 char* tmp_pos; |
376 strtok(pMonstersTXT_Raw, "\r"); | 383 int decode_step; |
377 strtok(0, "\r"); | 384 int item_counter; |
378 strtok(0, "\r"); | 385 int curr_rec_num; |
379 strtok(0, "\r"); | 386 |
387 v1 = this; | |
388 v102 = this; | |
389 if ( pMonstersTXT_Raw ) | |
390 pAllocator->FreeChunk(pMonstersTXT_Raw); | |
391 pMonstersTXT_Raw = NULL; | |
392 pMonstersTXT_Raw = (char *)pEvents_LOD->LoadRaw("monsters.txt", 0); | |
393 strtok(pMonstersTXT_Raw, "\r"); | |
394 strtok(NULL, "\r"); | |
395 strtok(NULL, "\r"); | |
396 strtok(NULL, "\r"); | |
397 uNumMonsters = 265; | |
398 curr_rec_num=0; | |
399 for (i=0;i<uNumMonsters-1;++i) | |
400 { | |
401 test_string = strtok(NULL, "\r") + 1; | |
402 break_loop = false; | |
403 decode_step=0; | |
404 do | |
405 { | |
406 c = *(unsigned char*)test_string; | |
407 temp_str_len = 0; | |
408 while((c!='\t')&&(c>0)) | |
409 { | |
410 ++temp_str_len; | |
411 c=test_string[temp_str_len]; | |
412 } | |
413 tmp_pos=test_string+temp_str_len; | |
414 if (*tmp_pos == 0) | |
415 break_loop = true; | |
416 *tmp_pos = 0; | |
417 if (temp_str_len) | |
418 { | |
419 switch (decode_step) | |
420 { | |
421 case 0: | |
422 curr_rec_num=atoi(test_string); | |
423 pInfos[curr_rec_num].uID=curr_rec_num; | |
424 break; | |
425 case 1: | |
426 pInfos[curr_rec_num].pName=RemoveQuotes(test_string); | |
427 break; | |
428 case 2: | |
429 pInfos[curr_rec_num].pPictureName=RemoveQuotes(test_string); | |
430 break; | |
431 case 3: | |
432 { | |
433 pInfos[curr_rec_num].uLevel=atoi(test_string); | |
434 } | |
435 break; | |
436 case 4: | |
437 { | |
438 int str_len=0; | |
439 int str_pos=0; | |
440 pInfos[curr_rec_num].uHP=0; | |
441 if (test_string[0]=='"') | |
442 test_string[0]=' '; | |
443 str_len=strlen(test_string); | |
444 if (str_len==0) | |
445 break; | |
446 while ((test_string[str_pos]!=',')&&(str_pos<str_len)) | |
447 ++str_pos; | |
448 if (str_len==str_pos) | |
449 pInfos[curr_rec_num].uHP=atoi(test_string); | |
450 else | |
451 { | |
452 test_string[str_pos]='\0'; | |
453 pInfos[curr_rec_num].uHP=1000*atoi(test_string); | |
454 pInfos[curr_rec_num].uHP+=atoi(&test_string[str_pos+1]); | |
455 test_string[str_pos]=','; | |
456 } | |
457 } | |
458 break; | |
459 case 5: | |
460 { | |
461 pInfos[curr_rec_num].uAC=atoi(test_string); | |
462 } | |
463 break; | |
464 case 6: | |
465 { | |
466 int str_len=0; | |
467 int str_pos=0; | |
468 pInfos[curr_rec_num].uExp=0; | |
469 if (test_string[0]=='"') | |
470 test_string[0]=' '; | |
471 str_len=strlen(test_string); | |
472 if (str_len==0) | |
473 break; | |
474 while ((test_string[str_pos]!=',')&&(str_pos<str_len)) | |
475 ++str_pos; | |
476 if (str_len==str_pos) | |
477 pInfos[curr_rec_num].uExp=atoi(test_string); | |
478 else | |
479 { | |
480 test_string[str_pos]='\0'; | |
481 pInfos[curr_rec_num].uExp=1000*atoi(test_string); | |
482 pInfos[curr_rec_num].uExp+=atoi(&test_string[str_pos+1]); | |
483 test_string[str_pos]=','; | |
484 } | |
485 } | |
486 break; | |
487 case 7: | |
488 { | |
489 int str_len=0; | |
490 int str_pos=0; | |
491 bool chance_flag=false; | |
492 bool dice_flag=false; | |
493 bool item_type_flag=false; | |
494 char* item_name; | |
495 pInfos[curr_rec_num].uTreasureDropChance=0; | |
496 pInfos[curr_rec_num].uTreasureDiceRolls=0; | |
497 pInfos[curr_rec_num].uTreasureDiceSides=0; | |
498 if (test_string[0]=='"') | |
499 test_string[0]=' '; | |
500 str_len=strlen(test_string); | |
501 do | |
502 { | |
503 switch(tolower(test_string[str_pos])) | |
504 { | |
505 case '%': chance_flag=true; break; | |
506 case 'd': dice_flag=true; break; | |
507 case 'l': item_type_flag=true; break; | |
508 } | |
509 ++str_pos; | |
510 } | |
511 while(str_pos<str_len); | |
512 if (chance_flag) | |
513 { | |
514 pInfos[curr_rec_num].uTreasureDropChance=atoi(test_string); | |
515 } | |
516 else | |
517 { | |
518 if ((!dice_flag)&&(!item_type_flag)) | |
519 break; | |
520 pInfos[curr_rec_num].uTreasureDropChance=100; | |
521 } | |
522 if (dice_flag) | |
523 { | |
524 str_pos=0; | |
525 dice_flag=false; | |
526 do | |
527 { | |
528 switch(tolower(test_string[str_pos])) | |
529 { | |
530 case '%': | |
531 pInfos[curr_rec_num].uTreasureDiceRolls=atoi(&test_string[str_pos+1]); | |
532 dice_flag=true; | |
533 break; | |
534 case 'd': | |
535 if(!dice_flag) | |
536 pInfos[curr_rec_num].uTreasureDiceRolls=atoi(test_string); | |
537 pInfos[curr_rec_num].uTreasureDiceSides=atoi(&test_string[str_pos+1]); | |
538 str_pos=str_len; | |
539 break; | |
540 | |
541 } | |
542 ++str_pos; | |
543 } | |
544 while(str_pos<str_len); | |
545 } | |
546 if (item_type_flag) | |
547 { | |
548 str_pos=0; | |
549 do | |
550 { | |
551 if (tolower(test_string[str_pos])=='l') | |
552 break; | |
553 ++str_pos; | |
554 } | |
555 while(str_pos<str_len); | |
556 pInfos[curr_rec_num].uTreasureType=0; | |
557 pInfos[curr_rec_num].uTreasureLevel=test_string[str_pos+1]-'0'; | |
558 item_name=&test_string[str_pos+2]; | |
559 if (*item_name) | |
560 { | |
561 if ( !_strcmpi(item_name, "WEAPON")) | |
562 pInfos[curr_rec_num].uTreasureType= 20; | |
563 else if ( !_strcmpi(item_name, "ARMOR")) | |
564 pInfos[curr_rec_num].uTreasureType= 21; | |
565 else if ( !_strcmpi(item_name, "MISC")) | |
566 pInfos[curr_rec_num].uTreasureType= 22; | |
567 else if ( !_strcmpi(item_name, "SWORD")) | |
568 pInfos[curr_rec_num].uTreasureType= 23; | |
569 else if ( !_strcmpi(item_name, "DAGGER")) | |
570 pInfos[curr_rec_num].uTreasureType= 24; | |
571 else if ( !_strcmpi(item_name, "AXE")) | |
572 pInfos[curr_rec_num].uTreasureType= 25; | |
573 else if ( !_strcmpi(item_name, "SPEAR")) | |
574 pInfos[curr_rec_num].uTreasureType= 26; | |
575 else if ( !_strcmpi(item_name, "BOW")) | |
576 pInfos[curr_rec_num].uTreasureType= 27; | |
577 else if ( !_strcmpi(item_name, "MACE")) | |
578 pInfos[curr_rec_num].uTreasureType= 28; | |
579 else if ( !_strcmpi(item_name, "CLUB")) | |
580 pInfos[curr_rec_num].uTreasureType= 29; | |
581 else if ( !_strcmpi(item_name, "STAFF")) | |
582 pInfos[curr_rec_num].uTreasureType= 30; | |
583 else if ( !_strcmpi(item_name, "LEATHER")) | |
584 pInfos[curr_rec_num].uTreasureType= 31; | |
585 else if ( !_strcmpi(item_name, "CHAIN")) | |
586 pInfos[curr_rec_num].uTreasureType= 32; | |
587 else if ( !_strcmpi(item_name, "PLATE")) | |
588 pInfos[curr_rec_num].uTreasureType= 33; | |
589 else if ( !_strcmpi(item_name, "SHIELD")) | |
590 pInfos[curr_rec_num].uTreasureType= 34; | |
591 else if ( !_strcmpi(item_name, "HELM")) | |
592 pInfos[curr_rec_num].uTreasureType= 35; | |
593 else if ( !_strcmpi(item_name, "BELT")) | |
594 pInfos[curr_rec_num].uTreasureType= 36; | |
595 else if ( !_strcmpi(item_name, "CAPE")) | |
596 pInfos[curr_rec_num].uTreasureType= 37; | |
597 else if ( !_strcmpi(item_name, "GAUNTLETS")) | |
598 pInfos[curr_rec_num].uTreasureType= 38; | |
599 else if ( !_strcmpi(item_name, "BOOTS")) | |
600 pInfos[curr_rec_num].uTreasureType= 39; | |
601 else if ( !_strcmpi(item_name, "RING")) | |
602 pInfos[curr_rec_num].uTreasureType= 40; | |
603 else if ( !_strcmpi(item_name, "AMULET")) | |
604 pInfos[curr_rec_num].uTreasureType= 41; | |
605 else if ( !_strcmpi(item_name, "WAND")) | |
606 pInfos[curr_rec_num].uTreasureType= 42; | |
607 else if ( !_strcmpi(item_name, "SCROLL")) | |
608 pInfos[curr_rec_num].uTreasureType= 43; | |
609 else if ( !_strcmpi(item_name, "GEM")) | |
610 pInfos[curr_rec_num].uTreasureType= 46; | |
611 } | |
612 } | |
613 | |
614 } | |
615 break; | |
616 case 8: | |
617 { | |
618 pInfos[curr_rec_num].bQuestMonster=0; | |
619 if (atoi(test_string)) | |
620 pInfos[curr_rec_num].bQuestMonster=1; | |
621 } | |
622 break; | |
623 case 9: | |
624 { | |
625 pInfos[curr_rec_num].uFlying=false; | |
626 if (_strnicmp(test_string, "n",1)) | |
627 pInfos[curr_rec_num].uFlying=true; | |
628 } | |
629 break; | |
630 case 10: | |
631 { | |
632 switch(tolower(test_string[0])) | |
633 { | |
634 case 's': pInfos[curr_rec_num].uMovementType=0;// short | |
635 if (tolower(test_string[1])!='h') | |
636 pInfos[curr_rec_num].uMovementType=5; //?? | |
637 break; //short | |
638 case 'l': pInfos[curr_rec_num].uMovementType=2; break; //long | |
639 case 'm': pInfos[curr_rec_num].uMovementType=1; break; //med | |
640 case 'g': pInfos[curr_rec_num].uMovementType=3; break; //??? | |
641 default: | |
642 pInfos[curr_rec_num].uMovementType=4; //free | |
643 } | |
644 } | |
645 break; | |
646 case 11: | |
647 { | |
648 switch(tolower(test_string[0])) | |
649 { | |
650 case 's': pInfos[curr_rec_num].uAIType=0; break; // suicide | |
651 case 'w': pInfos[curr_rec_num].uAIType=1; break; //wimp | |
652 case 'n': pInfos[curr_rec_num].uAIType=2; break; //normal | |
653 default: | |
654 pInfos[curr_rec_num].uAIType=3; //Agress | |
655 } | |
656 } | |
657 break; | |
658 case 12: | |
659 { | |
660 pInfos[curr_rec_num].uHostilityType=(MonsterInfo::HostilityRadius)atoi(test_string); | |
661 } | |
662 break; | |
663 case 13: | |
664 { | |
665 pInfos[curr_rec_num].uBaseSpeed=atoi(test_string); | |
666 } | |
667 break; | |
668 case 14: | |
669 { | |
670 pInfos[curr_rec_num].uRecoveryTime=atoi(test_string); | |
671 } | |
672 break; | |
673 case 15: | |
674 { | |
675 int str_len=0; | |
676 int str_pos=0; | |
677 pInfos[curr_rec_num].uAttackPreference=0; | |
678 pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=0; | |
679 str_len=strlen(test_string); | |
680 for (str_pos=0;str_pos<str_len;++str_pos ) | |
681 { | |
682 switch(tolower(test_string[str_pos])) | |
683 { | |
684 case '0': pInfos[curr_rec_num].uAttackPreference|=0x0004; break; | |
685 case '2': pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=2; break; | |
686 case '3': pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=3; break; | |
687 case '4': pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=4; break; | |
688 case 'c': pInfos[curr_rec_num].uAttackPreference|=0x0010; break; | |
689 case 'd': pInfos[curr_rec_num].uAttackPreference|=0x0008; break; | |
690 case 'e': pInfos[curr_rec_num].uAttackPreference|=0x0100; break; | |
691 case 'f': pInfos[curr_rec_num].uAttackPreference|=0x0400; break; | |
692 case 'h': pInfos[curr_rec_num].uAttackPreference|=0x0800; break; | |
693 case 'k': pInfos[curr_rec_num].uAttackPreference|=0x0001; break; | |
694 case 'm': pInfos[curr_rec_num].uAttackPreference|=0x0100; break; | |
695 case 'o': pInfos[curr_rec_num].uAttackPreference|=0x0400; break; | |
696 case 'p': pInfos[curr_rec_num].uAttackPreference|=0x0002; break; | |
697 case 'r': pInfos[curr_rec_num].uAttackPreference|=0x0040; break; | |
698 case 's': pInfos[curr_rec_num].uAttackPreference|=0x0020; break; | |
699 case 't': pInfos[curr_rec_num].uAttackPreference|=0x0080; break; | |
700 case 'w': pInfos[curr_rec_num].uAttackPreference|=0x2000; break; | |
701 case 'x': pInfos[curr_rec_num].uAttackPreference|=0x0200; break; | |
702 case 'l': break; | |
703 } | |
704 } | |
705 } | |
706 break; | |
707 /* case 16: | |
708 { | |
709 | |
710 } | |
711 break; | |
712 case 17: | |
713 { | |
714 | |
715 } | |
716 break; | |
717 case 18: | |
718 { | |
719 | |
720 } | |
721 break; | |
722 case 19: | |
723 { | |
724 | |
725 } | |
726 break; | |
727 case 20: | |
728 { | |
729 | |
730 } | |
731 break; | |
732 case 21: | |
733 { | |
734 | |
735 } | |
736 break; | |
737 case 22: | |
738 { | |
739 | |
740 } | |
741 break; | |
742 case 23: | |
743 { | |
744 | |
745 } | |
746 break; | |
747 case 24: | |
748 { | |
749 | |
750 } | |
751 break; | |
752 case 25: | |
753 { | |
754 | |
755 } | |
756 break; | |
757 case 26: | |
758 { | |
759 | |
760 } | |
761 break; | |
762 case 27: | |
763 { | |
764 | |
765 } | |
766 break; | |
767 case 28: | |
768 { | |
769 | |
770 } | |
771 break; | |
772 case 29: | |
773 { | |
774 | |
775 } | |
776 break; | |
777 case 30: | |
778 { | |
779 | |
780 } | |
781 break; | |
782 case 31: | |
783 { | |
784 | |
785 } | |
786 break; | |
787 case 32: | |
788 { | |
789 | |
790 } | |
791 break; | |
792 case 33: | |
793 { | |
794 | |
795 } | |
796 break; | |
797 case 34: | |
798 { | |
799 | |
800 } | |
801 break; | |
802 case 35: | |
803 { | |
804 | |
805 } | |
806 break; | |
807 case 36: | |
808 { | |
809 | |
810 } | |
811 break; | |
812 case 37: | |
813 { | |
814 | |
815 } | |
816 break; | |
817 case 38: | |
818 { | |
819 | |
820 } | |
821 break; */ | |
822 } | |
823 } | |
824 else | |
825 { | |
826 break_loop = true; | |
827 } | |
828 ++decode_step; | |
829 test_string=tmp_pos+1; | |
830 } while ((decode_step<39)&&!break_loop); | |
831 } | |
832 uNumMonsters = i; | |
833 | |
834 /* | |
380 v103 = 0; | 835 v103 = 0; |
381 v1->uNumMonsters = 265; | 836 v1->uNumMonsters = 265; |
382 do | 837 do |
383 { | 838 { |
384 v2 = (int)(strtok(0, "\r") + 1); | 839 v2 = (int)(strtok(NULL, "\r") + 1); |
385 *(_DWORD *)&a3[1] = 0; | 840 *(_DWORD *)&a3[1] = 0; |
386 v97 = 0; | 841 v97 = 0; |
387 do | 842 do |
388 { | 843 { |
389 v3 = *(_BYTE *)v2; | 844 v3 = *(_BYTE *)v2; |
399 *(_BYTE *)(v4 + v2) = 0; | 854 *(_BYTE *)(v4 + v2) = 0; |
400 if ( v4 ) | 855 if ( v4 ) |
401 { | 856 { |
402 switch ( *(_DWORD *)&a3[1] ) | 857 switch ( *(_DWORD *)&a3[1] ) |
403 { | 858 { |
404 case 0: | 859 /* case 0: |
405 v103 = atoi((const char *)v2); | 860 v103 = atoi((const char *)v2); |
406 v102->pInfos[v103].uID = v103; | 861 v102->pInfos[v103].uID = v103; |
407 goto LABEL_325; | 862 goto LABEL_325; |
408 case 2: | 863 case 2: |
409 v102->pInfos[v103].pTexture = RemoveQuotes((char *)v2); | 864 v102->pInfos[v103].pPictureName = RemoveQuotes((char *)v2); |
410 goto LABEL_325; | 865 goto LABEL_325; |
411 case 1: | 866 case 1: |
412 v102->pInfos[v103].pName = RemoveQuotes((char *)v2); | 867 v102->pInfos[v103].pName = RemoveQuotes((char *)v2); |
413 goto LABEL_325; | 868 goto LABEL_325; |
414 case 3: | 869 case 3: |
1457 while ( *(_DWORD *)&a3[1] - 1 <= (signed int)v102->uNumMonsters && !v97 ); | 1912 while ( *(_DWORD *)&a3[1] - 1 <= (signed int)v102->uNumMonsters && !v97 ); |
1458 ++v103; | 1913 ++v103; |
1459 } | 1914 } |
1460 while ( v103 < 265 ); | 1915 while ( v103 < 265 ); |
1461 v102->uNumMonsters = v103; | 1916 v102->uNumMonsters = v103; |
1917 */ | |
1462 } | 1918 } |
1463 | 1919 |
1464 | 1920 |
1465 | 1921 |
1466 | 1922 |