mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-02 09:47:58 +03:00
Fixed baddy state 0
This commit is contained in:
parent
3da38df713
commit
adf51a567c
2 changed files with 69 additions and 60 deletions
|
@ -534,7 +534,7 @@ GAME_STATUS ControlPhase(int numFrames, int demoMode)
|
||||||
} while (SmashedMeshCount != 0);
|
} while (SmashedMeshCount != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
PHD_VECTOR src = { 1024,-512,1024 };
|
/*PHD_VECTOR src = { 1024,-512,1024 };
|
||||||
PHD_VECTOR dest = { 4096,-1024,4096 };
|
PHD_VECTOR dest = { 4096,-1024,4096 };
|
||||||
|
|
||||||
byte b = (GetRandomControl() & 0x1F) + 224 - (GetRandomControl() & 0x3F);
|
byte b = (GetRandomControl() & 0x1F) + 224 - (GetRandomControl() & 0x3F);
|
||||||
|
@ -562,7 +562,7 @@ GAME_STATUS ControlPhase(int numFrames, int demoMode)
|
||||||
1,
|
1,
|
||||||
32,
|
32,
|
||||||
5);
|
5);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
UpdateSparks();
|
UpdateSparks();
|
||||||
UpdateFireSparks();
|
UpdateFireSparks();
|
||||||
|
|
|
@ -524,82 +524,90 @@ void BaddyControl(short itemNum)
|
||||||
|
|
||||||
//currentCreature->enemy = LaraItem;
|
//currentCreature->enemy = LaraItem;
|
||||||
|
|
||||||
|
//ITEM_INFO* oldEnemy = creature->enemy;
|
||||||
|
//creature->enemy = LaraItem;
|
||||||
|
|
||||||
// Is baddy alerted?
|
// Is baddy alerted?
|
||||||
if (item->hitStatus
|
if (item->hitStatus
|
||||||
|| laraInfo.distance < SQUARE(1024)
|
|| laraInfo.distance < SQUARE(1024)
|
||||||
|| TargetVisible(item, &laraInfo) && abs(LaraItem->pos.yPos - item->pos.yPos) < STEP_SIZE * 4)
|
|| TargetVisible(item, &laraInfo)
|
||||||
|
&& abs(LaraItem->pos.yPos - item->pos.yPos) < STEP_SIZE * 4)
|
||||||
{
|
{
|
||||||
currentCreature->alerted = true;
|
currentCreature->alerted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item != Lara.target || laraInfo.distance <= 942 ||
|
if (item != Lara.target
|
||||||
laraInfo.angle <= -ANGLE(56.25f) || laraInfo.angle >= ANGLE(56.25f))
|
|| laraInfo.distance <= 942
|
||||||
|
|| laraInfo.angle <= -ANGLE(56.25f)
|
||||||
|
|| laraInfo.angle >= ANGLE(56.25f))
|
||||||
{
|
{
|
||||||
roll = false;
|
roll = false;
|
||||||
jump = false;
|
jump = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
dx = 942 * phd_sin(item->pos.yRot + ANGLE(45));
|
|
||||||
dz = 942 * phd_cos(item->pos.yRot + ANGLE(45));
|
|
||||||
|
|
||||||
x = item->pos.xPos + dx;
|
|
||||||
y = item->pos.yPos;
|
|
||||||
z = item->pos.zPos + dz;
|
|
||||||
|
|
||||||
roomNumber = item->roomNumber;
|
|
||||||
floor = GetFloor(x, y, z, &roomNumber);
|
|
||||||
int height4 = GetFloorHeight(floor, x, y, z);
|
|
||||||
|
|
||||||
dx = 942 * phd_sin(item->pos.yRot + ANGLE(78.75f));
|
|
||||||
dz = 942 * phd_cos(item->pos.yRot + ANGLE(78.75f));
|
|
||||||
|
|
||||||
x = item->pos.xPos + dx;
|
|
||||||
y = item->pos.yPos;
|
|
||||||
z = item->pos.zPos + dz;
|
|
||||||
|
|
||||||
roomNumber = item->roomNumber;
|
|
||||||
floor = GetFloor(x, y, z, &roomNumber);
|
|
||||||
int height5 = GetFloorHeight(floor, x, y, z);
|
|
||||||
|
|
||||||
if (abs(height5 - item->pos.yPos) > STEP_SIZE)
|
|
||||||
jump = false;
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jump = true;
|
dx = 942 * phd_sin(item->pos.yRot + ANGLE(45));
|
||||||
if (height4 + 512 >= item->pos.yPos)
|
dz = 942 * phd_cos(item->pos.yRot + ANGLE(45));
|
||||||
|
|
||||||
|
x = item->pos.xPos + dx;
|
||||||
|
y = item->pos.yPos;
|
||||||
|
z = item->pos.zPos + dz;
|
||||||
|
|
||||||
|
roomNumber = item->roomNumber;
|
||||||
|
floor = GetFloor(x, y, z, &roomNumber);
|
||||||
|
int height4 = GetFloorHeight(floor, x, y, z);
|
||||||
|
|
||||||
|
dx = 942 * phd_sin(item->pos.yRot + ANGLE(78.75f));
|
||||||
|
dz = 942 * phd_cos(item->pos.yRot + ANGLE(78.75f));
|
||||||
|
|
||||||
|
x = item->pos.xPos + dx;
|
||||||
|
y = item->pos.yPos;
|
||||||
|
z = item->pos.zPos + dz;
|
||||||
|
|
||||||
|
roomNumber = item->roomNumber;
|
||||||
|
floor = GetFloor(x, y, z, &roomNumber);
|
||||||
|
int height5 = GetFloorHeight(floor, x, y, z);
|
||||||
|
|
||||||
|
if (abs(height5 - item->pos.yPos) > STEP_SIZE)
|
||||||
jump = false;
|
jump = false;
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
jump = true;
|
||||||
|
if (height4 + 512 >= item->pos.yPos)
|
||||||
|
jump = false;
|
||||||
|
}
|
||||||
|
|
||||||
dx = 942 * phd_sin(item->pos.yRot - ANGLE(45));
|
dx = 942 * phd_sin(item->pos.yRot - ANGLE(45));
|
||||||
dz = 942 * phd_cos(item->pos.yRot - ANGLE(45));
|
dz = 942 * phd_cos(item->pos.yRot - ANGLE(45));
|
||||||
|
|
||||||
x = item->pos.xPos + dx;
|
x = item->pos.xPos + dx;
|
||||||
y = item->pos.yPos;
|
y = item->pos.yPos;
|
||||||
z = item->pos.zPos + dz;
|
z = item->pos.zPos + dz;
|
||||||
|
|
||||||
roomNumber = item->roomNumber;
|
roomNumber = item->roomNumber;
|
||||||
floor = GetFloor(x, y, z, &roomNumber);
|
floor = GetFloor(x, y, z, &roomNumber);
|
||||||
int height6 = GetFloorHeight(floor, x, y, z);
|
int height6 = GetFloorHeight(floor, x, y, z);
|
||||||
|
|
||||||
dx = 942 * phd_sin(item->pos.yRot - ANGLE(78.75f));
|
dx = 942 * phd_sin(item->pos.yRot - ANGLE(78.75f));
|
||||||
dz = 942 * phd_cos(item->pos.yRot - ANGLE(78.75f));
|
dz = 942 * phd_cos(item->pos.yRot - ANGLE(78.75f));
|
||||||
|
|
||||||
x = item->pos.xPos + dx;
|
x = item->pos.xPos + dx;
|
||||||
y = item->pos.yPos;
|
y = item->pos.yPos;
|
||||||
z = item->pos.zPos + dz;
|
z = item->pos.zPos + dz;
|
||||||
|
|
||||||
roomNumber = item->roomNumber;
|
roomNumber = item->roomNumber;
|
||||||
floor = GetFloor(x, y, z, &roomNumber);
|
floor = GetFloor(x, y, z, &roomNumber);
|
||||||
int height7 = GetFloorHeight(floor, x, y, z);
|
int height7 = GetFloorHeight(floor, x, y, z);
|
||||||
|
|
||||||
if (abs(height7 - item->pos.yPos) > STEP_SIZE || height6 + (STEP_SIZE * 2) >= item->pos.yPos)
|
if (abs(height7 - item->pos.yPos) > STEP_SIZE || height6 + (STEP_SIZE * 2) >= item->pos.yPos)
|
||||||
{
|
{
|
||||||
roll = false;
|
roll = false;
|
||||||
someFlag3 = false;
|
someFlag3 = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
roll = true;
|
roll = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (item->currentAnimState)
|
switch (item->currentAnimState)
|
||||||
|
@ -610,7 +618,7 @@ void BaddyControl(short itemNum)
|
||||||
currentCreature->flags = 0;
|
currentCreature->flags = 0;
|
||||||
currentCreature->maximumTurn = 0;
|
currentCreature->maximumTurn = 0;
|
||||||
joint3 = info.angle / 2;
|
joint3 = info.angle / 2;
|
||||||
if (info.ahead && item->aiBits & FOLLOW)
|
if (info.ahead && item->aiBits != GUARD)
|
||||||
{
|
{
|
||||||
joint1 = info.angle / 2;
|
joint1 = info.angle / 2;
|
||||||
joint2 = info.xAngle;
|
joint2 = info.xAngle;
|
||||||
|
@ -646,7 +654,7 @@ void BaddyControl(short itemNum)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
item->goalAnimState = STATE_BADDY_STOP;
|
item->goalAnimState = STATE_BADDY_HOLSTER_SWORD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -737,7 +745,7 @@ void BaddyControl(short itemNum)
|
||||||
{
|
{
|
||||||
item->goalAnimState = STATE_BADDY_HOLSTER_GUN;
|
item->goalAnimState = STATE_BADDY_HOLSTER_GUN;
|
||||||
}
|
}
|
||||||
else if (info.distance >= 0x40000)
|
else if (info.distance >= SQUARE(512))
|
||||||
{
|
{
|
||||||
item->goalAnimState = STATE_BADDY_SWORD_HIT_FRONT;
|
item->goalAnimState = STATE_BADDY_SWORD_HIT_FRONT;
|
||||||
}
|
}
|
||||||
|
@ -752,6 +760,7 @@ void BaddyControl(short itemNum)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
item->goalAnimState = STATE_BADDY_WALK;
|
item->goalAnimState = STATE_BADDY_WALK;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue