mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-11 04:56:49 +03:00
Fix for Crocodile
- Updated ZONE_NULL in case it's not updated to ZONE_BASIC...
This commit is contained in:
parent
77d9ff4380
commit
a571c397b9
3 changed files with 24 additions and 17 deletions
|
@ -55,8 +55,8 @@ typedef struct OBJECT_BONES
|
|||
{
|
||||
this->bone0 = all;
|
||||
this->bone1 = all;
|
||||
this->bone2 = -all;
|
||||
this->bone3 = -all;
|
||||
this->bone2 = all;
|
||||
this->bone3 = all;
|
||||
}
|
||||
|
||||
OBJECT_BONES(short angleY, short angleX)
|
||||
|
|
|
@ -124,7 +124,6 @@ void InitialiseSlot(short itemNum, short slot)
|
|||
creature->patrol2 = false;
|
||||
creature->jumpAhead = false;
|
||||
creature->monkeyAhead = false;
|
||||
creature->alerted = false;
|
||||
creature->LOT.canJump = false;
|
||||
creature->LOT.canMonkey = false;
|
||||
creature->LOT.isAmphibious = false; // only the crocodile can go water and land. (default: true)
|
||||
|
@ -147,12 +146,7 @@ void InitialiseSlot(short itemNum, short slot)
|
|||
else if (!obj->undead && obj->hitPoints)
|
||||
obj->hitEffect = HIT_BLOOD;
|
||||
}
|
||||
|
||||
// init the basic zone for creature.
|
||||
// ignore if the zoneType is specified in the Objects[] already with other than ZONE_NULL.
|
||||
if (obj->zoneType == ZONE_NULL)
|
||||
obj->zoneType = ZONE_BASIC; // only entity that use CreatureActive() will reach InitialiseSlot() !
|
||||
|
||||
|
||||
obj->nonLot = false; // change to use pathfinding
|
||||
}
|
||||
|
||||
|
@ -160,6 +154,9 @@ void InitialiseSlot(short itemNum, short slot)
|
|||
{
|
||||
default:
|
||||
case ZONE_NULL:
|
||||
creature->LOT.step = SECTOR(1) - CLICK(3);
|
||||
creature->LOT.drop = -(SECTOR(1) - CLICK(3));
|
||||
obj->zoneType = ZONE_BASIC; // only entity that use CreatureActive() will reach InitialiseSlot() !
|
||||
break;
|
||||
|
||||
case ZONE_SKELLY:
|
||||
|
|
|
@ -106,18 +106,18 @@ void CrocodileControl(short itemNumber)
|
|||
AI_INFO info;
|
||||
OBJECT_BONES boneRot;
|
||||
short angle;
|
||||
short bone_angle;
|
||||
short boneAngle;
|
||||
|
||||
item = &Items[itemNumber];
|
||||
obj = &Objects[item->objectNumber];
|
||||
crocodile = GetCreatureInfo(item);
|
||||
angle = 0;
|
||||
bone_angle = 0;
|
||||
boneAngle = 0;
|
||||
|
||||
if (item->hitPoints <= 0)
|
||||
{
|
||||
angle = 0;
|
||||
bone_angle = 0;
|
||||
boneAngle = 0;
|
||||
|
||||
if (item->currentAnimState != CROC_DIE && item->currentAnimState != WCROC_DIE)
|
||||
{
|
||||
|
@ -162,7 +162,7 @@ void CrocodileControl(short itemNumber)
|
|||
AlertAllGuards(itemNumber);
|
||||
}
|
||||
|
||||
bone_angle = angle << 2;
|
||||
boneAngle = angle << 2;
|
||||
switch (item->currentAnimState)
|
||||
{
|
||||
case CROC_IDLE:
|
||||
|
@ -170,9 +170,9 @@ void CrocodileControl(short itemNumber)
|
|||
|
||||
if (item->aiBits & GUARD)
|
||||
{
|
||||
bone_angle = item->itemFlags[0];
|
||||
boneAngle = item->itemFlags[0];
|
||||
item->goalAnimState = CROC_IDLE;
|
||||
item->itemFlags[0] = item->itemFlags[1] + bone_angle;
|
||||
item->itemFlags[0] = item->itemFlags[1] + boneAngle;
|
||||
|
||||
if (!(GetRandomControl() & 0x1F))
|
||||
{
|
||||
|
@ -298,9 +298,19 @@ void CrocodileControl(short itemNumber)
|
|||
}
|
||||
|
||||
if (item->currentAnimState == CROC_IDLE || item->currentAnimState == CROC_ATK || item->currentAnimState == WCROC_ATK)
|
||||
boneRot = OBJECT_BONES(info.angle, info.xAngle);
|
||||
{
|
||||
boneRot.bone0 = info.angle;
|
||||
boneRot.bone1 = info.angle;
|
||||
boneRot.bone2 = 0;
|
||||
boneRot.bone3 = 0;
|
||||
}
|
||||
else
|
||||
boneRot = OBJECT_BONES(bone_angle);
|
||||
{
|
||||
boneRot.bone0 = boneAngle;
|
||||
boneRot.bone1 = boneAngle;
|
||||
boneRot.bone2 = -boneAngle;
|
||||
boneRot.bone3 = -boneAngle;
|
||||
}
|
||||
|
||||
CreatureTilt(item, 0);
|
||||
CreatureJoint(item, 0, boneRot.bone0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue