comparison Actor.cpp @ 1895:6b4e14436ee8

renaming Actor::_44FD29 to Actor::SummonMinion
author Grumpy7
date Sun, 20 Oct 2013 02:48:35 -0700
parents fe7182c30aad
children b6a7410ff0ef
comparison
equal deleted inserted replaced
1894:fe7182c30aad 1895:6b4e14436ee8
2680 { 2680 {
2681 this->uAIState = Removed; 2681 this->uAIState = Removed;
2682 } 2682 }
2683 2683
2684 //----- (0044FD29) -------------------------------------------------------- 2684 //----- (0044FD29) --------------------------------------------------------
2685 void Actor::_44FD29( int a2 ) 2685 void Actor::SummonMinion( int summonerId )
2686 { 2686 {
2687 unsigned __int8 v3; // al@1 2687 unsigned __int8 v3; // al@1
2688 int v4; // esi@1 2688 int v4; // esi@1
2689 int v5; // edx@2 2689 int v5; // edx@2
2690 int v7; // edi@10 2690 int v7; // edi@10
2691 Actor *v8; // esi@10 2691 Actor *v8; // esi@10
2692 MonsterInfo *v9; // ebx@10 2692 MonsterInfo *v9; // ebx@10
2693 MonsterDesc *v10; // edi@10 2693 MonsterDesc *v10; // edi@10
2694 unsigned __int16 v11; // ax@10
2695 int v13; // ebx@10 2694 int v13; // ebx@10
2696 int v15; // edi@10 2695 int v15; // edi@10
2697 int v17; // ebx@10 2696 int v17; // ebx@10
2698 unsigned int v19; // qax@10 2697 unsigned int v19; // qax@10
2699 int result; // eax@13 2698 int result; // eax@13
2700 unsigned int monsterId; // [sp+10h] [bp-18h]@8 2699 unsigned int monsterId; // [sp+10h] [bp-18h]@8
2701 int v27; // [sp+18h] [bp-10h]@10 2700 int v27; // [sp+18h] [bp-10h]@10
2702 int actorSector; // [sp+1Ch] [bp-Ch]@8 2701 int actorSector; // [sp+1Ch] [bp-Ch]@8
2703 2702
2703
2704 actorSector = 0;
2705 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
2706 actorSector = pIndoor->GetSector(this->vPosition.x, this->vPosition.y, this->vPosition.z);
2707
2708 v19 = this->uAlly;
2709 if ( !v19 )
2710 {
2711 monsterId = this->pMonsterInfo.uID - 1;
2712 v19 = (uint)(monsterId * 0.33333334);
2713 }
2714 v27 = uCurrentlyLoadedLevelType == LEVEL_Outdoor ? 128 : 64;
2715 v13 = rand() % 2048;
2716 v15 = ((stru_5C6E00->Cos(v13) * (signed __int64)v27) >> 16) + this->vPosition.x;
2717 v17 = ((stru_5C6E00->Sin(v13) * (signed __int64)v27) >> 16) + this->vPosition.y;
2718
2719 if (uCurrentlyLoadedLevelType != LEVEL_Outdoor)
2720 {
2721 result = pIndoor->GetSector(v15, v17, this->vPosition.z);
2722 if (result != actorSector)
2723 return;
2724 result = BLV_GetFloorLevel(v15, v17, v27, result, &monsterId);
2725 if (result != -30000)
2726 return;
2727 if (abs(result - v27) > 1024)
2728 return;
2729 }
2730
2704 v3 = this->pMonsterInfo.uSpecialAbilityDamageDiceRolls; 2731 v3 = this->pMonsterInfo.uSpecialAbilityDamageDiceRolls;
2705 v4 = this->pMonsterInfo.field_3C_some_special_attack; 2732 v4 = this->pMonsterInfo.field_3C_some_special_attack;
2706 if ( v3 ) 2733 if ( v3 )
2707 { 2734 {
2708 if ( v3 >= 1u && v3 <= 3u ) 2735 if ( v3 >= 1u && v3 <= 3u )
2716 else if ( v5 >= 60 ) 2743 else if ( v5 >= 60 )
2717 { 2744 {
2718 v4 += 1; 2745 v4 += 1;
2719 } 2746 }
2720 } 2747 }
2721 actorSector = 0;
2722 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
2723 actorSector = pIndoor->GetSector(this->vPosition.x, this->vPosition.y, this->vPosition.z);
2724 v7 = v4 - 1; 2748 v7 = v4 - 1;
2725 v8 = &pActors[uNumActors]; 2749 v8 = &pActors[uNumActors];
2726 v27 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64;
2727 v9 = &pMonsterStats->pInfos[v7 + 1]; 2750 v9 = &pMonsterStats->pInfos[v7 + 1];
2728 pActors[uNumActors].Reset(); 2751 pActors[uNumActors].Reset();
2729 v10 = &pMonsterList->pMonsters[v7]; 2752 v10 = &pMonsterList->pMonsters[v7];
2730 strcpy(v8->pActorName, v9->pName); 2753 strcpy(v8->pActorName, v9->pName);
2731 v8->sCurrentHP = LOWORD(v9->uHP); 2754 v8->sCurrentHP = LOWORD(v9->uHP);
2732 memcpy(&v8->pMonsterInfo, v9, sizeof(v8->pMonsterInfo)); 2755 memcpy(&v8->pMonsterInfo, v9, sizeof(v8->pMonsterInfo));
2733 v8->word_000086_some_monster_id = v4; 2756 v8->word_000086_some_monster_id = v4;
2734 v8->uActorRadius = v10->uMonsterRadius; 2757 v8->uActorRadius = v10->uMonsterRadius;
2735 v8->uActorHeight = v10->uMonsterHeight; 2758 v8->uActorHeight = v10->uMonsterHeight;
2736 v11 = v10->uMovementSpeed;
2737 v8->pMonsterInfo.uTreasureDiceRolls = 0; 2759 v8->pMonsterInfo.uTreasureDiceRolls = 0;
2738 v8->pMonsterInfo.uTreasureType = 0; 2760 v8->pMonsterInfo.uTreasureType = 0;
2739 v8->pMonsterInfo.uExp = 0; 2761 v8->pMonsterInfo.uExp = 0;
2740 v8->uMovementSpeed = v11; 2762 v8->uMovementSpeed = v10->uMovementSpeed;
2741 v13 = rand() % 2048;
2742 v15 = ((stru_5C6E00->Cos(v13) * (signed __int64)v27) >> 16) + this->vPosition.x;
2743 v17 = ((stru_5C6E00->Sin(v13) * (signed __int64)v27) >> 16) + this->vPosition.y;
2744 v8->vInitialPosition.z = this->vPosition.z; 2763 v8->vInitialPosition.z = this->vPosition.z;
2745 v8->vPosition.z = this->vPosition.z; 2764 v8->vPosition.z = this->vPosition.z;
2746 v8->vInitialPosition.x = v15; 2765 v8->vInitialPosition.x = v15;
2747 v8->vPosition.x = v15; 2766 v8->vPosition.x = v15;
2748 v8->vInitialPosition.y = v17; 2767 v8->vInitialPosition.y = v17;
2749 v8->vPosition.y = v17; 2768 v8->vPosition.y = v17;
2750 v8->uTetherDistance = 256; 2769 v8->uTetherDistance = 256;
2751 v8->uSectorID = actorSector; 2770 v8->uSectorID = actorSector;
2752 v8->PrepareSprites(0); 2771 v8->PrepareSprites(0);
2753 v8->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; 2772 v8->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
2754 v19 = this->uAlly;
2755 if ( !v19 )
2756 {
2757 monsterId = this->pMonsterInfo.uID - 1;
2758 v19 = (uint)(monsterId * 0.33333334);
2759 }
2760 v8->uAlly = v19; 2773 v8->uAlly = v19;
2761 v8->uCurrentActionTime = 0; 2774 v8->uCurrentActionTime = 0;
2762 v8->uGroup = this->uGroup; 2775 v8->uGroup = this->uGroup;
2763 v8->uAIState = Summoned; 2776 v8->uAIState = Summoned;
2764 v8->uCurrentActionLength = 256; 2777 v8->uCurrentActionLength = 256;
2765 v8->UpdateAnimation(); 2778 v8->UpdateAnimation();
2766 2779
2767 if (uCurrentlyLoadedLevelType != LEVEL_Outdoor)
2768 {
2769 result = pIndoor->GetSector(v15, v17, this->vPosition.z);
2770 if (result != actorSector)
2771 return;
2772 result = BLV_GetFloorLevel(v15, v17, v27, result, &monsterId);
2773 if (result != -30000)
2774 return;
2775 if (abs(result - v27) > 1024)
2776 return;
2777 }
2778
2779 ++uNumActors; 2780 ++uNumActors;
2780 ++this->pMonsterInfo.uSpecialAbilityDamageDiceBonus; 2781 ++this->pMonsterInfo.uSpecialAbilityDamageDiceBonus;
2781 if ( this->uAttributes & 0x80000 ) 2782 if ( this->uAttributes & 0x80000 )
2782 v8->uAttributes |= 0x80000u; 2783 v8->uAttributes |= 0x80000u;
2783 v8->uSummonerID = PID(OBJECT_Actor,a2); 2784 v8->uSummonerID = PID(OBJECT_Actor,summonerId);
2784 2785
2785 } 2786 }
2786 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int); 2787 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
2787 //----- (0046DF1A) -------------------------------------------------------- 2788 //----- (0046DF1A) --------------------------------------------------------
2788 signed int __fastcall _46DF1A_collide_against_actor(int a1, int a2) 2789 signed int __fastcall _46DF1A_collide_against_actor(int a1, int a2)