mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 20:58:07 +03:00
creature: move Creature_Tilt to trx
This commit is contained in:
parent
4e03c39ffd
commit
a878739c40
5 changed files with 9 additions and 21 deletions
|
@ -9,6 +9,7 @@
|
|||
#define M_ATTACK_RANGE SQUARE(WALL_L * 3) // = 0x900000 = 9437184
|
||||
#define M_ESCAPE_CHANCE 2048
|
||||
#define M_RECOVER_CHANCE 256
|
||||
#define M_MAX_TILT (3 * DEG_1) // = 546
|
||||
|
||||
static ITEM *M_ChooseEnemy(const ITEM *item);
|
||||
static bool M_SwitchToWater(
|
||||
|
@ -419,3 +420,10 @@ int16_t Creature_Turn(ITEM *const item, int16_t max_turn)
|
|||
item->rot.y += angle;
|
||||
return angle;
|
||||
}
|
||||
|
||||
void Creature_Tilt(ITEM *const item, int16_t angle)
|
||||
{
|
||||
angle = angle * 4 - item->rot.z;
|
||||
CLAMP(angle, -M_MAX_TILT, M_MAX_TILT);
|
||||
item->rot.z += angle;
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@ bool Creature_EnsureHabitat(
|
|||
void Creature_Mood(const ITEM *item, const AI_INFO *info, bool violent);
|
||||
|
||||
int16_t Creature_Turn(ITEM *item, int16_t max_turn);
|
||||
void Creature_Tilt(ITEM *item, int16_t angle);
|
||||
|
||||
extern bool Creature_IsHostile(const ITEM *item);
|
||||
extern void Creature_Collision(
|
||||
int16_t item_num, ITEM *lara_item, COLL_INFO *coll);
|
||||
extern void Creature_Tilt(ITEM *item, int16_t angle);
|
||||
extern void Creature_Head(ITEM *item, int16_t required);
|
||||
extern bool Creature_Animate(int16_t item_num, int16_t angle, int16_t tilt);
|
||||
extern int16_t Creature_Effect(
|
||||
|
|
|
@ -18,17 +18,6 @@
|
|||
#include <libtrx/game/math.h>
|
||||
#include <libtrx/log.h>
|
||||
|
||||
void Creature_Tilt(ITEM *item, int16_t angle)
|
||||
{
|
||||
angle = angle * 4 - item->rot.z;
|
||||
if (angle < -MAX_TILT) {
|
||||
angle = -MAX_TILT;
|
||||
} else if (angle > MAX_TILT) {
|
||||
angle = MAX_TILT;
|
||||
}
|
||||
item->rot.z += angle;
|
||||
}
|
||||
|
||||
void Creature_Head(ITEM *item, int16_t required)
|
||||
{
|
||||
CREATURE *creature = item->data;
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
#define DIVE_WAIT 10
|
||||
#define STEPUP_HEIGHT ((STEP_L * 3) / 2) // = 384
|
||||
#define MAX_HEAD_CHANGE (DEG_1 * 5) // = 910
|
||||
#define MAX_TILT (DEG_1 * 3) // = 546
|
||||
#define CAM_A_HANG 0
|
||||
#define CAM_E_HANG (-60 * DEG_1) // = -10920
|
||||
#define CAM_WADE_ELEVATION (-22 * DEG_1) // = -4004
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include <libtrx/utils.h>
|
||||
|
||||
#define MAX_X_ROT (20 * DEG_1) // = 3640
|
||||
#define MAX_TILT (3 * DEG_1) // = 546
|
||||
#define MAX_HEAD_CHANGE (5 * DEG_1) // = 910
|
||||
#define HEAD_ARC 0x3000 // = 12288
|
||||
#define FLOAT_SPEED 32
|
||||
|
@ -359,13 +358,6 @@ bool Creature_Animate(
|
|||
return true;
|
||||
}
|
||||
|
||||
void Creature_Tilt(ITEM *const item, int16_t angle)
|
||||
{
|
||||
angle = 4 * angle - item->rot.z;
|
||||
CLAMP(angle, -MAX_TILT, MAX_TILT);
|
||||
item->rot.z += angle;
|
||||
}
|
||||
|
||||
void Creature_Head(ITEM *item, int16_t required)
|
||||
{
|
||||
CREATURE *const creature = item->data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue