comparison CastSpellInfo.cpp @ 1980:c1c74df0a33e

changing most of auto types to their actual types
author Grumpy7
date Wed, 30 Oct 2013 00:47:37 -0700
parents c22dd8b6c3f4
children 7a9477135943
comparison
equal deleted inserted replaced
1979:92dfa0cafbe3 1980:c1c74df0a33e
553 553
554 //if ( (signed int)uNumSpriteObjects > 0 ) 554 //if ( (signed int)uNumSpriteObjects > 0 )
555 int _v733 = 0; 555 int _v733 = 0;
556 for (uint i = 0; i < uNumSpriteObjects; ++i) 556 for (uint i = 0; i < uNumSpriteObjects; ++i)
557 { 557 {
558 auto object = &pSpriteObjects[i]; 558 SpriteObject* object = &pSpriteObjects[i];
559 if (object->uType && object->spell_id == SPELL_FIRE_FIRE_SPIKE && object->spell_caster_pid == PID(OBJECT_Player, pCastSpell->uPlayerID)) 559 if (object->uType && object->spell_id == SPELL_FIRE_FIRE_SPIKE && object->spell_caster_pid == PID(OBJECT_Player, pCastSpell->uPlayerID))
560 ++_v733; 560 ++_v733;
561 /*v33 = (char *)&pSpriteObjects[0].field_48; 561 /*v33 = (char *)&pSpriteObjects[0].field_48;
562 v730 = uNumSpriteObjects; 562 v730 = uNumSpriteObjects;
563 do 563 do
635 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); 635 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
636 pSpellSprite.vPosition.x = pActors[PID_ID(a2)].vPosition.x; 636 pSpellSprite.vPosition.x = pActors[PID_ID(a2)].vPosition.x;
637 pSpellSprite.vPosition.z = pActors[PID_ID(a2)].vPosition.z; 637 pSpellSprite.vPosition.z = pActors[PID_ID(a2)].vPosition.z;
638 pSpellSprite.vPosition.y = pActors[PID_ID(a2)].vPosition.y; 638 pSpellSprite.vPosition.y = pActors[PID_ID(a2)].vPosition.y;
639 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, PID_ID(a2)); 639 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, PID_ID(a2));
640 auto obj_id = pSpellSprite.Create(0, 0, 0, 0); 640 int obj_id = pSpellSprite.Create(0, 0, 0, 0);
641 DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v697); 641 DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v697);
642 LODWORD(v727) = 1; 642 LODWORD(v727) = 1;
643 break; 643 break;
644 } 644 }
645 case SPELL_EARTH_MASS_DISTORTION: 645 case SPELL_EARTH_MASS_DISTORTION:
669 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); 669 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
670 pSpellSprite.vPosition.x = pActors[PID_ID(a2)].vPosition.x; 670 pSpellSprite.vPosition.x = pActors[PID_ID(a2)].vPosition.x;
671 pSpellSprite.vPosition.y = pActors[PID_ID(a2)].vPosition.y; 671 pSpellSprite.vPosition.y = pActors[PID_ID(a2)].vPosition.y;
672 pSpellSprite.vPosition.z = pActors[PID_ID(a2)].vPosition.z; 672 pSpellSprite.vPosition.z = pActors[PID_ID(a2)].vPosition.z;
673 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, PID_ID(a2)); 673 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, PID_ID(a2));
674 auto obj_id = pSpellSprite.Create(0, 0, 0, 0); 674 int obj_id = pSpellSprite.Create(0, 0, 0, 0);
675 DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v704); 675 DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v704);
676 LODWORD(v727) = 1; 676 LODWORD(v727) = 1;
677 break; 677 break;
678 } 678 }
679 case SPELL_LIGHT_DESTROY_UNDEAD: 679 case SPELL_LIGHT_DESTROY_UNDEAD:
700 pSpellSprite.spell_target_pid = a2; 700 pSpellSprite.spell_target_pid = a2;
701 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); 701 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
702 pSpellSprite.uFacing = LOWORD(v715.uYawAngle); 702 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
703 pSpellSprite.uAttributes |= 0x80u; 703 pSpellSprite.uAttributes |= 0x80u;
704 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); 704 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
705 auto obj_id = pSpellSprite.Create(0, 0, 0, 0); 705 int obj_id = pSpellSprite.Create(0, 0, 0, 0);
706 if ( !MonsterStats::BelongsToSupertype(pActor->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) 706 if ( !MonsterStats::BelongsToSupertype(pActor->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
707 { 707 {
708 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed 708 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
709 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); 709 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
710 pCastSpell->uSpellID = 0; 710 pCastSpell->uSpellID = 0;
994 } 994 }
995 995
996 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 996 if ( !pPlayer->CanCastSpell(uRequiredMana) )
997 break; 997 break;
998 v730c = &pParty->pPlayers[pCastSpell->uPlayerID_2].pInventoryItemList[a2]; 998 v730c = &pParty->pPlayers[pCastSpell->uPlayerID_2].pInventoryItemList[a2];
999 auto _itm = &pItemsTable->pItems[v730c->uItemID]; 999 ItemDesc* _itm = &pItemsTable->pItems[v730c->uItemID];
1000 v730c->UpdateTempBonus(pParty->uTimePlayed); 1000 v730c->UpdateTempBonus(pParty->uTimePlayed);
1001 if ( v730c->uItemID < 64 || v730c->uItemID > 65 1001 if ( v730c->uItemID < 64 || v730c->uItemID > 65
1002 && !v730c->IsBroken() 1002 && !v730c->IsBroken()
1003 && !v730c->uSpecEnchantmentType 1003 && !v730c->uSpecEnchantmentType
1004 && !v730c->uEnchantmentType 1004 && !v730c->uEnchantmentType
1416 pCastSpell->uSpellID = 0; 1416 pCastSpell->uSpellID = 0;
1417 continue; 1417 continue;
1418 } 1418 }
1419 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 1419 if ( !pPlayer->CanCastSpell(uRequiredMana) )
1420 break; 1420 break;
1421 auto _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096); 1421 int _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096);
1422 v700.z = 0; 1422 v700.z = 0;
1423 v700.y = 0; 1423 v700.y = 0;
1424 v700.x = 0; 1424 v700.x = 0;
1425 pSpellSprite.stru_24.Reset(); 1425 pSpellSprite.stru_24.Reset();
1426 pSpellSprite.spell_id = pCastSpell->uSpellID; 1426 pSpellSprite.spell_id = pCastSpell->uSpellID;
1510 default: 1510 default:
1511 assert(false); 1511 assert(false);
1512 } 1512 }
1513 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 1513 if ( !pPlayer->CanCastSpell(uRequiredMana) )
1514 break; 1514 break;
1515 auto _v726 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; 1515 int _v726 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
1516 pSpellSprite.stru_24.Reset(); 1516 pSpellSprite.stru_24.Reset();
1517 pSpellSprite.spell_id = pCastSpell->uSpellID; 1517 pSpellSprite.spell_id = pCastSpell->uSpellID;
1518 pSpellSprite.spell_level = v2; 1518 pSpellSprite.spell_level = v2;
1519 pSpellSprite.spell_skill = v731; 1519 pSpellSprite.spell_skill = v731;
1520 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); 1520 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
2391 LODWORD(v733) = 60 * (v2 + 3); 2391 LODWORD(v733) = 60 * (v2 + 3);
2392 else 2392 else
2393 LODWORD(v733) = 300 * v2 + 180; 2393 LODWORD(v733) = 300 * v2 + 180;
2394 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 2394 if ( !pPlayer->CanCastSpell(uRequiredMana) )
2395 break; 2395 break;
2396 auto _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096); 2396 int _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096);
2397 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); 2397 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u);
2398 ++pSpellSprite.uType; 2398 ++pSpellSprite.uType;
2399 pSpellSprite.stru_24.Reset(); 2399 pSpellSprite.stru_24.Reset();
2400 pSpellSprite.spell_id = pCastSpell->uSpellID; 2400 pSpellSprite.spell_id = pCastSpell->uSpellID;
2401 pSpellSprite.spell_level = v2; 2401 pSpellSprite.spell_level = v2;
2861 amount = 300 * v2; 2861 amount = 300 * v2;
2862 else 2862 else
2863 amount = 180 * v2; 2863 amount = 180 * v2;
2864 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 2864 if ( !pPlayer->CanCastSpell(uRequiredMana) )
2865 break; 2865 break;
2866 auto _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096); 2866 int _v726 = _46A6AC_spell_render((int)dword_50BF30.data(), 100, 4096);
2867 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); 2867 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u);
2868 ++pSpellSprite.uType; 2868 ++pSpellSprite.uType;
2869 pSpellSprite.stru_24.Reset(); 2869 pSpellSprite.stru_24.Reset();
2870 pSpellSprite.spell_id = pCastSpell->uSpellID; 2870 pSpellSprite.spell_id = pCastSpell->uSpellID;
2871 pSpellSprite.spell_level = v2; 2871 pSpellSprite.spell_level = v2;
3311 //v733 = __PAIR__(0, v516); 3311 //v733 = __PAIR__(0, v516);
3312 signed int _v733 = 0; 3312 signed int _v733 = 0;
3313 if ( (signed int)uNumActors > 0 ) 3313 if ( (signed int)uNumActors > 0 )
3314 { 3314 {
3315 v518 = pActors.data();//[0].uAIState; 3315 v518 = pActors.data();//[0].uAIState;
3316 auto _v726 = uNumActors; 3316 size_t _v726 = uNumActors;
3317 do 3317 do
3318 { 3318 {
3319 v519 = v518->uAIState; 3319 v519 = v518->uAIState;
3320 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && PID(OBJECT_Player, pCastSpell->uPlayerID) == v518->uSummonerID ) 3320 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && PID(OBJECT_Player, pCastSpell->uPlayerID) == v518->uSummonerID )
3321 ++_v733; 3321 ++_v733;
3685 default: 3685 default:
3686 assert(false); 3686 assert(false);
3687 } 3687 }
3688 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 3688 if ( !pPlayer->CanCastSpell(uRequiredMana) )
3689 break; 3689 break;
3690 auto _v726 = ((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); 3690 signed int _v726 = ((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360);
3691 pSpellSprite.stru_24.Reset(); 3691 pSpellSprite.stru_24.Reset();
3692 pSpellSprite.spell_id = pCastSpell->uSpellID; 3692 pSpellSprite.spell_id = pCastSpell->uSpellID;
3693 pSpellSprite.spell_level = v2; 3693 pSpellSprite.spell_level = v2;
3694 pSpellSprite.spell_skill = v731; 3694 pSpellSprite.spell_skill = v731;
3695 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); 3695 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
4013 pParty->armageddon_timer = 256; 4013 pParty->armageddon_timer = 256;
4014 pParty->armageddonDamage = v2; 4014 pParty->armageddonDamage = v2;
4015 ++pPlayer->uNumArmageddonCasts; 4015 ++pPlayer->uNumArmageddonCasts;
4016 if ( pParty->bTurnBasedModeOn == 1 ) 4016 if ( pParty->bTurnBasedModeOn == 1 )
4017 ++pTurnEngine->pending_actions; 4017 ++pTurnEngine->pending_actions;
4018 auto _v726 = 50; 4018 int _v726 = 50;
4019 do 4019 do
4020 { 4020 {
4021 v642 = rand() % 4096 - 2048; 4021 v642 = rand() % 4096 - 2048;
4022 v643 = rand(); 4022 v643 = rand();
4023 v721 = v642 + pParty->vPosition.x; 4023 v721 = v642 + pParty->vPosition.x;
4152 4152
4153 4153
4154 //v6 = a5; 4154 //v6 = a5;
4155 //v7 = &pParty->pPlayers[uPlayerID]; 4155 //v7 = &pParty->pPlayers[uPlayerID];
4156 assert(uPlayerID < 4); 4156 assert(uPlayerID < 4);
4157 auto player = &pParty->pPlayers[uPlayerID]; 4157 Player* player = &pParty->pPlayers[uPlayerID];
4158 if ( !(a5 & 0x10) ) 4158 if ( !(a5 & 0x10) )
4159 { 4159 {
4160 switch ( a1 ) 4160 switch ( a1 )
4161 { 4161 {
4162 case SPELL_SPIRIT_FATE: 4162 case SPELL_SPIRIT_FATE:
4317 } 4317 }
4318 } 4318 }
4319 4319
4320 for (uint i = 0; i < CastSpellInfoCount; ++i) 4320 for (uint i = 0; i < CastSpellInfoCount; ++i)
4321 { 4321 {
4322 auto spell = &pCastSpellInfo[i]; 4322 CastSpellInfo* spell = &pCastSpellInfo[i];
4323 if (!spell->uSpellID) 4323 if (!spell->uSpellID)
4324 continue; 4324 continue;
4325 4325
4326 spell->uSpellID = 0; 4326 spell->uSpellID = 0;
4327 if (spell->uFlags & 0x3CA) 4327 if (spell->uFlags & 0x3CA)