comparison Actor.cpp @ 1935:1cbfb6e50e48

moving _4BBF61_summon_actor under Actor
author Grumpy7
date Wed, 23 Oct 2013 23:15:08 -0700
parents 564898c5882b
children a50511e4f3c6
comparison
equal deleted inserted replaced
1934:564898c5882b 1935:1cbfb6e50e48
3576 SpriteObject *projectileSprite; // ebx@1 3576 SpriteObject *projectileSprite; // ebx@1
3577 Actor *pMonster; // esi@7 3577 Actor *pMonster; // esi@7
3578 unsigned __int16 v16; // cx@25 3578 unsigned __int16 v16; // cx@25
3579 int v33; // eax@100 3579 int v33; // eax@100
3580 int v40; // ebx@107 3580 int v40; // ebx@107
3581 signed __int64 extraRecoveryTime; // qax@125 3581 int extraRecoveryTime; // qax@125
3582 unsigned __int16 v43; // ax@132 3582 unsigned __int16 v43; // ax@132
3583 unsigned __int16 v45; // ax@132 3583 unsigned __int16 v45; // ax@132
3584 unsigned __int64 v46; // [sp+Ch] [bp-60h]@6 3584 unsigned __int64 v46; // [sp+Ch] [bp-60h]@6
3585 char *pPlayerName; // [sp+18h] [bp-54h]@12 3585 char *pPlayerName; // [sp+18h] [bp-54h]@12
3586 char *pMonsterName; // [sp+1Ch] [bp-50h]@6 3586 char *pMonsterName; // [sp+1Ch] [bp-50h]@6
3828 if ( pMonsterStats->pInfos[pMonster->pMonsterInfo.uID].bQuestMonster & 1 ) 3828 if ( pMonsterStats->pInfos[pMonster->pMonsterInfo.uID].bQuestMonster & 1 )
3829 { 3829 {
3830 if ( pRenderer->pRenderD3D && pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) 3830 if ( pRenderer->pRenderD3D && pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS )
3831 { 3831 {
3832 v33 = byte_4D864C && pGame->uFlags & 80000 ? 10 * pMonster->uActorRadius : pMonster->uActorRadius; 3832 v33 = byte_4D864C && pGame->uFlags & 80000 ? 10 * pMonster->uActorRadius : pMonster->uActorRadius;
3833 pDecalBuilder->AddBloodsplat(pMonster->vPosition.x, pMonster->vPosition.y, pMonster->vPosition.z, 1.0, 0.0, 0.0, v33, 0, 0); 3833 pDecalBuilder->AddBloodsplat((float)pMonster->vPosition.x, (float)pMonster->vPosition.y, (float)pMonster->vPosition.z, 1.0, 0.0, 0.0, (float)v33, 0, 0);
3834 } 3834 }
3835 } 3835 }
3836 Actor::Die(uActorID_Monster); 3836 Actor::Die(uActorID_Monster);
3837 Actor::ApplyFineForKillingPeasant(uActorID_Monster); 3837 Actor::ApplyFineForKillingPeasant(uActorID_Monster);
3838 Actor::AggroSurroundingPeasants(uActorID_Monster, 1); 3838 Actor::AggroSurroundingPeasants(uActorID_Monster, 1);
3857 if ( (player->GetSpecialItemBonus(24) || hit_will_stun) && stru_50C198.GetMagicalResistance(pMonster, DMGT_EARTH) ) 3857 if ( (player->GetSpecialItemBonus(24) || hit_will_stun) && stru_50C198.GetMagicalResistance(pMonster, DMGT_EARTH) )
3858 { 3858 {
3859 extraRecoveryTime = 20; 3859 extraRecoveryTime = 20;
3860 knockbackValue = 10; 3860 knockbackValue = 10;
3861 if ( !pParty->bTurnBasedModeOn ) 3861 if ( !pParty->bTurnBasedModeOn )
3862 extraRecoveryTime = (signed __int64)(flt_6BE3A8_debug_recmod2 * 42.66666666666666); 3862 extraRecoveryTime = (int)(flt_6BE3A8_debug_recmod2 * 42.66666666666666);
3863 pMonster->pMonsterInfo.uRecoveryTime += extraRecoveryTime; 3863 pMonster->pMonsterInfo.uRecoveryTime += extraRecoveryTime;
3864 if ( bShowDamage ) 3864 if ( bShowDamage )
3865 { 3865 {
3866 pMonsterName = player->pName; // "%s stuns %s" 3866 pMonsterName = player->pName; // "%s stuns %s"
3867 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[635], player->pName, pMonster); 3867 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[635], player->pName, pMonster);
3893 pMonster->vVelocity.z = 50 * LOWORD(pVelocity->z); 3893 pMonster->vVelocity.z = 50 * LOWORD(pVelocity->z);
3894 } 3894 }
3895 Actor::AddBloodsplatOnDamageOverlay(uActorID_Monster, 1, v61); 3895 Actor::AddBloodsplatOnDamageOverlay(uActorID_Monster, 1, v61);
3896 } 3896 }
3897 //----- (004BBF61) -------------------------------------------------------- 3897 //----- (004BBF61) --------------------------------------------------------
3898 void __fastcall _4BBF61_summon_actor(int a1, __int16 x, int y, int z) 3898 void Actor::_4BBF61_summon_actor( int a1, __int16 x, int y, int z )
3899 { 3899 {
3900 size_t v4; // esi@1
3901 int monster_id; // edi@1
3902 __int16 v6; // ax@4
3903 Actor *v7; // esi@5 3900 Actor *v7; // esi@5
3904 int v8; // eax@5
3905 MonsterInfo *v9; // edi@5 3901 MonsterInfo *v9; // edi@5
3906 MonsterDesc *v10; // ebx@5 3902 MonsterDesc *v10; // ebx@5
3907 unsigned __int16 *v11; // ebx@5
3908 int v12; // ebx@7 3903 int v12; // ebx@7
3909 int v13; // eax@8 3904 int v13; // eax@8
3910 __int16 x_; // [sp+8h] [bp-Ch]@1
3911 __int16 v15; // [sp+Ch] [bp-8h]@1
3912 __int16 v16; // [sp+10h] [bp-4h]@3 3905 __int16 v16; // [sp+10h] [bp-4h]@3
3913 signed int ya; // [sp+1Ch] [bp+8h]@5 3906
3914
3915 v4 = uNumActors;
3916 monster_id = a1;
3917 x_ = x;
3918 v15 = a1;
3919 if (uNumActors < 500) 3907 if (uNumActors < 500)
3920 { 3908 {
3921 v16 = 0; 3909 v16 = 0;
3922 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) 3910 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
3923 { 3911 {
3924 v6 = pIndoor->GetSector(x, y, z); 3912 v16 = pIndoor->GetSector(x, y, z);
3925 v4 = uNumActors; 3913 }
3926 v16 = v6; 3914 v7 = &pActors[uNumActors];
3927 }
3928 v7 = &pActors[v4];
3929 v7->Reset(); 3915 v7->Reset();
3930 v8 = monster_id; 3916 v9 = &pMonsterStats->pInfos[a1];
3931 v9 = &pMonsterStats->pInfos[monster_id]; 3917 v10 = &pMonsterList->pMonsters[a1 - 1];
3932 v10 = &pMonsterList->pMonsters[v8 - 1];
3933 strcpy(v7->pActorName, v9->pName); 3918 strcpy(v7->pActorName, v9->pName);
3934 v7->sCurrentHP = LOWORD(v9->uHP); 3919 v7->sCurrentHP = LOWORD(v9->uHP);
3935 memcpy(&v7->pMonsterInfo, v9, 0x58u); 3920 memcpy(&v7->pMonsterInfo, v9, 0x58u);
3936 v7->word_000086_some_monster_id = v15; 3921 v7->word_000086_some_monster_id = a1;
3937 v7->uActorRadius = v10->uMonsterRadius; 3922 v7->uActorRadius = v10->uMonsterRadius;
3938 v7->uActorHeight = v10->uMonsterHeight; 3923 v7->uActorHeight = v10->uMonsterHeight;
3939 v7->uMovementSpeed = v10->uMovementSpeed; 3924 v7->uMovementSpeed = v10->uMovementSpeed;
3940 v7->vInitialPosition.x = x_; 3925 v7->vInitialPosition.x = x;
3941 v7->vPosition.x = x_; 3926 v7->vPosition.x = x;
3942 BYTE2(v7->uAttributes) |= 8u; 3927 v7->uAttributes |= 80000;
3943 v7->pMonsterInfo.uTreasureType = 0; 3928 v7->pMonsterInfo.uTreasureType = 0;
3944 v7->pMonsterInfo.uTreasureLevel = 0; 3929 v7->pMonsterInfo.uTreasureLevel = 0;
3945 v7->pMonsterInfo.uTreasureDiceSides = 0; 3930 v7->pMonsterInfo.uTreasureDiceSides = 0;
3946 v7->pMonsterInfo.uTreasureDiceRolls = 0; 3931 v7->pMonsterInfo.uTreasureDiceRolls = 0;
3947 v7->pMonsterInfo.uTreasureDropChance = 0; 3932 v7->pMonsterInfo.uTreasureDropChance = 0;
3952 v7->uTetherDistance = 256; 3937 v7->uTetherDistance = 256;
3953 v7->uSectorID = v16; 3938 v7->uSectorID = v16;
3954 v7->uGroup = 1; 3939 v7->uGroup = 1;
3955 v7->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; 3940 v7->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
3956 v7->PrepareSprites(0); 3941 v7->PrepareSprites(0);
3957 v11 = v10->pSoundSampleIDs; 3942 for ( int i = 0; i < 4; i++)
3958 ya = 4; 3943 {
3959 do 3944 pSoundList->LoadSound(v10->pSoundSampleIDs[i], 0);
3960 { 3945 }
3961 pSoundList->LoadSound((signed __int16)*v11, 0);
3962 ++v11;
3963 --ya;
3964 }
3965 while ( ya );
3966 v12 = 0; 3946 v12 = 0;
3967 do 3947 do
3968 LOWORD(v13) = pSoundList->LoadSound(v12++ + word_4EE088_sound_ids[v9->uSpell1ID], 1u); 3948 {
3949 LOWORD(v13) = pSoundList->LoadSound(v12 + word_4EE088_sound_ids[v9->uSpell1ID], 1u);
3950 v12++;
3951 }
3969 while ( v13 ); 3952 while ( v13 );
3970 ++uNumActors; 3953 ++uNumActors;
3971 } 3954 }
3972 } 3955 }
3973 //----- (00426E10) -------------------------------------------------------- 3956 //----- (00426E10) --------------------------------------------------------