mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-11 04:56:49 +03:00
Decompiled ID_LAGOON_WITCH
This commit is contained in:
parent
2e1ad52e1e
commit
0dd2df5dba
6 changed files with 145 additions and 11 deletions
|
@ -831,6 +831,7 @@ typedef enum GAME_OBJECT_ID
|
|||
ID_AUTOGUN,
|
||||
ID_ROMAN_GOD1,
|
||||
ID_ROMAN_GOD2,
|
||||
ID_LAGOON_WITCH,
|
||||
|
||||
/* Traps / Doors */
|
||||
ID_SPRINGBOARD = 320,
|
||||
|
|
133
TR5Main/Objects/TR5/tr5_lagoon_witch.cpp
Normal file
133
TR5Main/Objects/TR5/tr5_lagoon_witch.cpp
Normal file
|
@ -0,0 +1,133 @@
|
|||
#include "../newobjects.h"
|
||||
#include "../../Game/items.h"
|
||||
#include "../../Game/Box.h"
|
||||
#include "../../Game/effects.h"
|
||||
#include "../../Game/effect2.h"
|
||||
#include "../../Game/tomb4fx.h"
|
||||
#include "../../Game/inventory.h"
|
||||
|
||||
#define STATE_LAGOON_WITCH_SWIM 1
|
||||
#define STATE_LAGOON_WITCH_STOP 2
|
||||
#define STATE_LAGOON_WITCH_ATTACK 3
|
||||
|
||||
extern Inventory* g_Inventory;
|
||||
|
||||
BITE_INFO LagoonWitchBite = { 0, 0, 0, 7 };
|
||||
|
||||
void InitialiseLagoonWitch(short itemNumber)
|
||||
{
|
||||
ITEM_INFO* item = &Items[itemNumber];
|
||||
|
||||
ClearItem(itemNumber);
|
||||
|
||||
item->animNumber = Objects[item->objectNumber].animIndex + 1;
|
||||
item->goalAnimState = STATE_LAGOON_WITCH_STOP;
|
||||
item->currentAnimState = STATE_LAGOON_WITCH_STOP;
|
||||
item->frameNumber = Anims[item->animNumber].frameBase;
|
||||
item->pos.yPos += 512;
|
||||
}
|
||||
|
||||
void ControlLagoonWitch(short itemNumber)
|
||||
{
|
||||
if (!CreatureActive(itemNumber))
|
||||
return;
|
||||
|
||||
short joint0 = 0;
|
||||
short joint1 = 0;
|
||||
short joint2 = 0;
|
||||
|
||||
ITEM_INFO* item = &Items[itemNumber];
|
||||
CREATURE_INFO* creature = (CREATURE_INFO*)item->data;
|
||||
|
||||
if (g_Inventory->IsObjectPresentInInventory(ID_PUZZLE_ITEM2))
|
||||
{
|
||||
item->aiBits = 0;
|
||||
creature->enemy = LaraItem;
|
||||
}
|
||||
|
||||
if (item->aiBits)
|
||||
{
|
||||
GetAITarget(creature);
|
||||
}
|
||||
else if (creature->hurtByLara)
|
||||
{
|
||||
creature->enemy = LaraItem;
|
||||
}
|
||||
|
||||
AI_INFO info;
|
||||
CreatureAIInfo(item, &info);
|
||||
|
||||
//if (creature->enemy != LaraItem)
|
||||
// phd_atan(lara_item->pos.z_pos - item->pos.z_pos, lara_item->pos.x_pos - item->pos.x_pos);
|
||||
|
||||
GetCreatureMood(item, &info, VIOLENT);
|
||||
CreatureMood(item, &info, VIOLENT);
|
||||
|
||||
short angle = CreatureTurn(item, creature->maximumTurn);
|
||||
|
||||
if (info.ahead)
|
||||
{
|
||||
joint0 = info.angle >> 1;
|
||||
joint2 = info.angle >> 1;
|
||||
joint1 = info.xAngle;
|
||||
}
|
||||
|
||||
creature->maximumTurn = 0;
|
||||
|
||||
switch (item->currentAnimState)
|
||||
{
|
||||
case STATE_LAGOON_WITCH_SWIM:
|
||||
creature->maximumTurn = 728;
|
||||
if (info.distance < SQUARE(1024))
|
||||
item->goalAnimState = STATE_LAGOON_WITCH_STOP;
|
||||
break;
|
||||
|
||||
case STATE_LAGOON_WITCH_STOP:
|
||||
creature->flags = 0;
|
||||
creature->maximumTurn = ANGLE(2);
|
||||
if (info.distance < SQUARE(768))
|
||||
item->goalAnimState = STATE_LAGOON_WITCH_ATTACK;
|
||||
else if (info.distance > SQUARE(1024))
|
||||
item->goalAnimState = STATE_LAGOON_WITCH_SWIM;
|
||||
else
|
||||
item->goalAnimState = STATE_LAGOON_WITCH_STOP;
|
||||
break;
|
||||
|
||||
case STATE_LAGOON_WITCH_ATTACK:
|
||||
creature->maximumTurn = ANGLE(2);
|
||||
if (!creature->flags
|
||||
&& item->touchBits & 0x3C3C0
|
||||
&& item->frameNumber > Anims[item->animNumber].frameBase + 29)
|
||||
{
|
||||
LaraItem->hitPoints -= 100;
|
||||
LaraItem->hitStatus = true;
|
||||
CreatureEffect2(item, &LagoonWitchBite, 10, item->pos.yRot, DoBloodSplat);
|
||||
creature->flags = STATE_LAGOON_WITCH_SWIM;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (creature->reachedGoal)
|
||||
{
|
||||
ITEM_INFO* enemy = creature->enemy;
|
||||
if (enemy)
|
||||
{
|
||||
if (enemy->flags & 2)
|
||||
item->itemFlags[3] = (item->TOSSPAD & 0xFF) - 1;
|
||||
item->itemFlags[3]++;
|
||||
creature->reachedGoal = false;
|
||||
creature->enemy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
CreatureTilt(item, 0);
|
||||
|
||||
CreatureJoint(item, 0, joint0);
|
||||
CreatureJoint(item, 1, joint1);
|
||||
CreatureJoint(item, 2, joint2);
|
||||
|
||||
CreatureAnimation(itemNumber, angle, 0);
|
||||
|
||||
CreatureUnderwater(item, 341);
|
||||
}
|
|
@ -164,4 +164,6 @@ void MissileControl(short itemNumber);
|
|||
void InitialiseGuardian(short itemNumber);
|
||||
void GuardianControl(short itemNumber);
|
||||
void ControlBodyPart(short fxNumber);
|
||||
void ExplodeFX(FX_INFO* fx, int noXZVel, int bits);
|
||||
void ExplodeFX(FX_INFO* fx, int noXZVel, int bits);
|
||||
void InitialiseLagoonWitch(short itemNumber);
|
||||
void ControlLagoonWitch(short itemNumber);
|
||||
|
|
|
@ -1725,7 +1725,7 @@ void BaddyObjects()
|
|||
obj->collision = CreatureCollision;
|
||||
obj->control = ControlBrowsBeast;
|
||||
obj->shadowSize = UNIT_SHADOW / 2;
|
||||
obj->hitPoints = 4000;
|
||||
obj->hitPoints = 100;
|
||||
obj->pivotLength = 20;
|
||||
obj->radius = 341;
|
||||
obj->intelligent = true;
|
||||
|
@ -1740,16 +1740,9 @@ void BaddyObjects()
|
|||
Bones[obj->boneIndex + 9 * 4] |= ROT_X;
|
||||
}
|
||||
|
||||
// TODO: LagoonWitch is deleted !
|
||||
/*
|
||||
obj = &Objects[ID_GREEN_TEETH];
|
||||
obj = &Objects[ID_LAGOON_WITCH];
|
||||
if (obj->loaded)
|
||||
{
|
||||
//v33 = (*(&Objects[79] + 25) | 2) & 0xF7FF;
|
||||
//HIBYTE(v33) |= 4u;
|
||||
//v33 |= 0x100u;
|
||||
//LOBYTE(v33) = v33 | 0x70;
|
||||
//*(&Objects[79] + 25) = v33 | 8;
|
||||
obj->biteOffset = 256;
|
||||
obj->initialise = InitialiseLagoonWitch;
|
||||
obj->collision = CreatureCollision;
|
||||
|
@ -1763,13 +1756,14 @@ void BaddyObjects()
|
|||
obj->saveFlags = true;
|
||||
obj->saveHitpoints = true;
|
||||
obj->savePosition = true;
|
||||
//obj->undead = true;
|
||||
obj->zoneType = ZONE_FLYER;
|
||||
|
||||
Bones[obj->boneIndex + 4 * 4] |= ROT_Z;
|
||||
Bones[obj->boneIndex + 4 * 4] |= ROT_X;
|
||||
Bones[obj->boneIndex + 9 * 4] |= ROT_Z;
|
||||
Bones[obj->boneIndex + 9 * 4] |= ROT_X;
|
||||
}
|
||||
*/
|
||||
|
||||
obj = &Objects[ID_INVISIBLE_GHOST];
|
||||
if (obj->loaded)
|
||||
|
|
|
@ -243,6 +243,7 @@ xcopy /Y "$(ProjectDir)Scripting\Scripts\*.lua" "$(TargetDir)\Scripts"</Command>
|
|||
<ClCompile Include="Objects\TR5\tr5_guard.cpp" />
|
||||
<ClCompile Include="Objects\TR5\tr5_hydra.cpp" />
|
||||
<ClCompile Include="Objects\TR5\tr5_imp.cpp" />
|
||||
<ClCompile Include="Objects\TR5\tr5_lagoon_witch.cpp" />
|
||||
<ClCompile Include="Objects\TR5\tr5_larson.cpp" />
|
||||
<ClCompile Include="Objects\TR5\tr5_laser_head.cpp" />
|
||||
<ClCompile Include="Objects\TR5\tr5_misc_objects.cpp" />
|
||||
|
|
|
@ -845,6 +845,9 @@
|
|||
<ClCompile Include="Objects\TR5\tr5_particle_enemies.cpp">
|
||||
<Filter>File di origine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Objects\TR5\tr5_lagoon_witch.cpp">
|
||||
<Filter>File di origine</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Shaders\Shader.fx" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue