comparison Monsters.cpp @ 701:d5b16a44d9b3

frame_table parser, new files for UI func
author Gloval
date Mon, 18 Mar 2013 22:53:56 +0400
parents b097497f07e2
children a9c1fb7483c2
comparison
equal deleted inserted replaced
700:1d05543f522d 701:d5b16a44d9b3
22 void ParseDamage( char *damage_str, unsigned __int8* dice_rolls, unsigned __int8* dice_sides, unsigned __int8* dmg_bonus ); 22 void ParseDamage( char *damage_str, unsigned __int8* dice_rolls, unsigned __int8* dice_sides, unsigned __int8* dmg_bonus );
23 int ParseMissleAttackType(const char *missle_attack_str); 23 int ParseMissleAttackType(const char *missle_attack_str);
24 int ParseSpecialAttack(const char *spec_att_str); 24 int ParseSpecialAttack(const char *spec_att_str);
25 25
26 //----- (004548E2) -------------------------------------------------------- 26 //----- (004548E2) --------------------------------------------------------
27 unsigned int __fastcall ParseSpellType(FrameTableTxtLine *a1, int a2) 27 unsigned int __fastcall ParseSpellType(FrameTableTxtLine *a1, int a2)
28 { 28 {
29 int v2; // edi@1 29 int v2; // edi@1
30 int v3; // esi@1 30 int v3; // esi@1
31 unsigned int result; // eax@1 31 unsigned int result; // eax@1
32 std::string v5; // [sp-18h] [bp-28h]@75 32 std::string v5; // [sp-18h] [bp-28h]@75
457 { 457 {
458 do 458 do
459 { 459 {
460 *strchr(&Buf, 10) = 0; 460 *strchr(&Buf, 10) = 0;
461 memcpy(&v25, frame_table_txt_parser(&Buf, &v24), sizeof(v25)); 461 memcpy(&v25, frame_table_txt_parser(&Buf, &v24), sizeof(v25));
462 if ( v25.field_0 && *v25.pProperties[0] != 47 ) 462 if ( v25.uPropCount && *v25.pProperties[0] != 47 )
463 ++Argsa; 463 ++Argsa;
464 } 464 }
465 while ( fgets(&Buf, 490, File) ); 465 while ( fgets(&Buf, 490, File) );
466 v4 = Argsa; 466 v4 = Argsa;
467 } 467 }
476 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) ) 476 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
477 { 477 {
478 *strchr(&Buf, 10) = 0; 478 *strchr(&Buf, 10) = 0;
479 memcpy(&v25, frame_table_txt_parser(&Buf, &v24), sizeof(v25)); 479 memcpy(&v25, frame_table_txt_parser(&Buf, &v24), sizeof(v25));
480 v8 = 0; 480 v8 = 0;
481 if ( v25.field_0 && *v25.pProperties[0] != 47 ) 481 if ( v25.uPropCount && *v25.pProperties[0] != 47 )
482 { 482 {
483 strcpy(v2->pMonsters[v2->uNumMonsters].pMonsterName, v25.pProperties[0]); 483 strcpy(v2->pMonsters[v2->uNumMonsters].pMonsterName, v25.pProperties[0]);
484 v35 = 0; 484 v35 = 0;
485 v36 = 1; 485 v36 = 1;
486 v37 = 7; 486 v37 = 7;
516 v2->pMonsters[v2->uNumMonsters].uMonsterRadius = v13; 516 v2->pMonsters[v2->uNumMonsters].uMonsterRadius = v13;
517 v15 = atoi(v14); 517 v15 = atoi(v14);
518 v16 = v25.pProperties[12]; 518 v16 = v25.pProperties[12];
519 v2->pMonsters[v2->uNumMonsters].uToHitRadius = v15; 519 v2->pMonsters[v2->uNumMonsters].uToHitRadius = v15;
520 v17 = (unsigned __int8)atoi(v16); 520 v17 = (unsigned __int8)atoi(v16);
521 Argsb = atoi(v25.pProperties2[0]) & 0xFF; 521 Argsb = atoi(v25.pProperties[13]) & 0xFF;
522 v26 = atoi(v25.pProperties2[1]) & 0xFF; 522 v26 = atoi(v25.pProperties[14]) & 0xFF;
523 v18 = atoi(v25.pProperties2[2]); 523 v18 = atoi(v25.pProperties[15]);
524 v2->pMonsters[v2->uNumMonsters].uTintColor = v18 | ((v26 | ((Argsb | (v17 << 8)) << 8)) << 8); 524 v2->pMonsters[v2->uNumMonsters].uTintColor = v18 | ((v26 | ((Argsb | (v17 << 8)) << 8)) << 8);
525 v19 = 0; 525 v19 = 0;
526 do 526 do
527 { 527 {
528 v20 = atoi(v25.pProperties2[v19 + 4]); 528 v20 = atoi(v25.pProperties[v19 + 16]);
529 v21 = v19++ + 76 * v2->uNumMonsters; 529 v21 = v19++ ;
530 v2->pMonsters->pSoundSampleIDs[v21] = v20; 530 v2->pMonsters[v2->uNumMonsters].pSoundSampleIDs[v21] = v20;
531 } 531 }
532 while ( v19 < 4 ); 532 while ( v19 < 4 );
533 ++v2->uNumMonsters; 533 ++v2->uNumMonsters;
534 } 534 }
535 } 535 }