mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-30 16:57:57 +03:00
515 lines
12 KiB
C++
515 lines
12 KiB
C++
![]() |
#include "framework.h"
|
||
|
#include "tr4_objects.h"
|
||
|
/// entities
|
||
|
#include "tr4_ahmet.h"
|
||
|
#include "tr4_baddy.h"
|
||
|
#include "tr4_bat.h"
|
||
|
#include "tr4_bigscorpion.h"
|
||
|
#include "tr4_crocodile.h"
|
||
|
#include "tr4_demigod.h"
|
||
|
#include "tr4_guide.h"
|
||
|
#include "tr4_harpy.h"
|
||
|
#include "tr4_horseman.h"
|
||
|
#include "tr4_jeanyves.h"
|
||
|
#include "tr4_knighttemplar.h"
|
||
|
#include "tr4_littlebeetle.h"
|
||
|
#include "tr4_mummy.h"
|
||
|
#include "tr4_sas.h"
|
||
|
#include "tr4_sentrygun.h"
|
||
|
#include "tr4_skeleton.h"
|
||
|
#include "tr4_smallscorpion.h"
|
||
|
#include "tr4_sphinx.h"
|
||
|
#include "tr4_troops.h"
|
||
|
#include "tr4_wildboar.h"
|
||
|
#include "tr4_wraith.h"
|
||
|
/// objects
|
||
|
|
||
|
/// traps
|
||
|
|
||
|
/// vehicles
|
||
|
#include "motorbike.h"
|
||
|
#include "jeep.h"
|
||
|
|
||
|
/// necessary import
|
||
|
#include "collide.h"
|
||
|
#include "setup.h"
|
||
|
#include "level.h"
|
||
|
|
||
|
static void InitialiseBaddy()
|
||
|
{
|
||
|
ObjectInfo* obj;
|
||
|
obj = &Objects[ID_SMALL_SCORPION];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseSmallScorpion;
|
||
|
obj->control = SmallScorpionControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 8;
|
||
|
obj->pivotLength = 20;
|
||
|
obj->radius = 128;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_BIG_SCORPION];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseScorpion;
|
||
|
obj->control = ScorpionControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 80;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 512;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveFlags = true;
|
||
|
obj->saveAnim = true;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_WILD_BOAR];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseWildBoar;
|
||
|
obj->control = WildBoarControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 40;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 102;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
|
||
|
Bones[obj->boneIndex + 48 * 4] |= ROT_Z;
|
||
|
Bones[obj->boneIndex + 48 * 4] |= ROT_Y;
|
||
|
Bones[obj->boneIndex + 52 * 4] |= ROT_Z;
|
||
|
Bones[obj->boneIndex + 52 * 4] |= ROT_Y;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_BAT];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseBat;
|
||
|
obj->control = BatControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 5;
|
||
|
obj->pivotLength = 10;
|
||
|
obj->radius = 102;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
obj->zoneType = ZONE_FLYER;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_AHMET];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseAhmet;
|
||
|
obj->control = AhmetControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 80;
|
||
|
obj->pivotLength = 300;
|
||
|
obj->radius = 341;
|
||
|
obj->intelligent = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->hitEffect = HIT_BLOOD;
|
||
|
|
||
|
Bones[obj->boneIndex + 9 * 4] |= ROT_Y;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_BADDY1];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseBaddy;
|
||
|
obj->control = BaddyControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 25;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 102;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
obj->meshSwapSlot = ID_MESHSWAP_BADDY1;
|
||
|
obj->zoneType = ZONE_HUMAN_JUMP_AND_MONKEY;
|
||
|
|
||
|
Bones[obj->boneIndex + 28 * 4] |= ROT_Y;
|
||
|
Bones[obj->boneIndex + 28 * 4] |= ROT_X;
|
||
|
Bones[obj->boneIndex + 88 * 4] |= ROT_Y;
|
||
|
Bones[obj->boneIndex + 88 * 4] |= ROT_X;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_BADDY2];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseBaddy;
|
||
|
obj->control = BaddyControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 25;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 102;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
obj->meshSwapSlot = ID_MESHSWAP_BADDY2;
|
||
|
obj->zoneType = ZONE_HUMAN_JUMP_AND_MONKEY;
|
||
|
|
||
|
Bones[obj->boneIndex + 28 * 4] |= ROT_Y;
|
||
|
Bones[obj->boneIndex + 28 * 4] |= ROT_X;
|
||
|
Bones[obj->boneIndex + 88 * 4] |= ROT_Y;
|
||
|
Bones[obj->boneIndex + 88 * 4] |= ROT_X;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_SAS_CAIRO];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseSas;
|
||
|
obj->control = SasControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 40;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 102;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
|
||
|
Bones[obj->boneIndex] |= ROT_Y;
|
||
|
Bones[obj->boneIndex] |= ROT_X;
|
||
|
Bones[obj->boneIndex + 28 * 4] |= ROT_Y;
|
||
|
Bones[obj->boneIndex + 28 * 4] |= ROT_X;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_MUMMY];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseMummy;
|
||
|
obj->control = MummyControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 15;
|
||
|
obj->radius = 170;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
|
||
|
Bones[obj->boneIndex + 28 * 4] |= ROT_Y;
|
||
|
Bones[obj->boneIndex + 28 * 4] |= ROT_X;
|
||
|
Bones[obj->boneIndex + 72 * 4] |= ROT_Y;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_SKELETON];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseSkeleton;
|
||
|
obj->control = SkeletonControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->hitPoints = 15;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 128;
|
||
|
obj->explodableMeshbits = 0xA00;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_KNIGHT_TEMPLAR];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseKnightTemplar;
|
||
|
obj->control = KnightTemplarControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 15;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 128;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveFlags = true;
|
||
|
obj->saveAnim = true;
|
||
|
|
||
|
Bones[obj->boneIndex + 6 * 4] |= ROT_X | ROT_Y;
|
||
|
Bones[obj->boneIndex + 7 * 4] |= ROT_Y;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_DEMIGOD1];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseDemigod;
|
||
|
obj->control = DemigodControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 200;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 341;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveFlags = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->hitEffect = HIT_FRAGMENT;
|
||
|
obj->undead = true;
|
||
|
|
||
|
Bones[obj->boneIndex + 4 * 4] |= ROT_X | ROT_Y | ROT_Z;
|
||
|
Bones[obj->boneIndex + 5 * 4] |= ROT_Y;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_DEMIGOD2];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseDemigod;
|
||
|
obj->control = DemigodControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 200;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 341;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveFlags = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->hitEffect = HIT_FRAGMENT;
|
||
|
Bones[obj->boneIndex + 4 * 4] |= ROT_X | ROT_Y | ROT_Z;
|
||
|
Bones[obj->boneIndex + 5 * 4] |= ROT_Y;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_DEMIGOD3];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseDemigod;
|
||
|
obj->control = DemigodControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 200;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 341;
|
||
|
obj->intelligent = true;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveFlags = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->hitEffect = HIT_FRAGMENT;
|
||
|
Bones[obj->boneIndex + 4 * 4] |= ROT_X | ROT_Y | ROT_Z;
|
||
|
Bones[obj->boneIndex + 5 * 4] |= ROT_Y;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_JEAN_YVES];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseJeanYves;
|
||
|
obj->control = JeanYvesControl;
|
||
|
obj->collision = ObjectCollision;
|
||
|
obj->nonLot = true;
|
||
|
obj->savePosition = true;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_TROOPS];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseTroops;
|
||
|
obj->control = TroopsControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 40;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 102;
|
||
|
obj->intelligent = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
|
||
|
Bones[obj->boneIndex] |= ROT_X | ROT_Y;
|
||
|
Bones[obj->boneIndex + 7 * 4] |= ROT_X | ROT_Y;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_SENTRY_GUN];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseSentryGun;
|
||
|
obj->control = SentryGunControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 30;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 204;
|
||
|
obj->intelligent = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
obj->explodableMeshbits = 64;
|
||
|
|
||
|
Bones[obj->boneIndex + 0] |= ROT_Y;
|
||
|
Bones[obj->boneIndex + 1 * 4] |= ROT_X;
|
||
|
Bones[obj->boneIndex + 2 * 4] |= ROT_Z;
|
||
|
Bones[obj->boneIndex + 3 * 4] |= ROT_Z;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_HARPY];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseHarpy;
|
||
|
obj->control = HarpyControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 60;
|
||
|
obj->pivotLength = 50;
|
||
|
obj->radius = 409;
|
||
|
obj->intelligent = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
obj->zoneType = ZONE_FLYER;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_GUIDE];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseGuide;
|
||
|
obj->control = GuideControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = -16384;
|
||
|
obj->pivotLength = 0;
|
||
|
obj->radius = 128;
|
||
|
obj->intelligent = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
|
||
|
Bones[obj->boneIndex + 6 * 4] |= ROT_X | ROT_Y;
|
||
|
Bones[obj->boneIndex + 20 * 4] |= ROT_X | ROT_Y;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_CROCODILE];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseCrocodile;
|
||
|
obj->control = CrocodileControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 36;
|
||
|
obj->pivotLength = 300;
|
||
|
obj->radius = 409;
|
||
|
obj->intelligent = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
obj->waterCreature = true;
|
||
|
obj->zoneType = ZONE_WATER;
|
||
|
|
||
|
Bones[obj->boneIndex] |= ROT_Y;
|
||
|
Bones[obj->boneIndex + 7 * 4] |= ROT_Y;
|
||
|
Bones[obj->boneIndex + 9 * 4] |= ROT_Y;
|
||
|
Bones[obj->boneIndex + 10 * 4] |= ROT_Y;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_SPHINX];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseSphinx;
|
||
|
obj->control = SphinxControl;
|
||
|
obj->collision = CreatureCollision;
|
||
|
obj->shadowSize = 128;
|
||
|
obj->hitPoints = 1000;
|
||
|
obj->pivotLength = 500;
|
||
|
obj->radius = 512;
|
||
|
obj->intelligent = true;
|
||
|
obj->saveHitpoints = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_BABOON_NORMAL];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_BABOON_INV];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_BABOON_SILENT];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
static void InitialiseObject()
|
||
|
{
|
||
|
ObjectInfo* obj;
|
||
|
|
||
|
}
|
||
|
|
||
|
static void InitialiseTrap()
|
||
|
{
|
||
|
ObjectInfo* obj;
|
||
|
|
||
|
}
|
||
|
|
||
|
static void InitialiseVehicles()
|
||
|
{
|
||
|
ObjectInfo* obj;
|
||
|
obj = &Objects[ID_JEEP];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseJeep;
|
||
|
obj->collision = JeepCollision;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
}
|
||
|
|
||
|
obj = &Objects[ID_MOTORBIKE];
|
||
|
if (obj->loaded)
|
||
|
{
|
||
|
obj->initialise = InitialiseMotorbike;
|
||
|
obj->collision = MotorbikeCollision;
|
||
|
//obj->drawRoutine = DrawMotorbike; // for wheel rotation
|
||
|
obj->drawRoutineExtra = DrawMotorbikeEffect;
|
||
|
obj->savePosition = true;
|
||
|
obj->saveAnim = true;
|
||
|
obj->saveFlags = true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void InitialiseTR4Objects()
|
||
|
{
|
||
|
InitialiseBaddy();
|
||
|
InitialiseObject();
|
||
|
InitialiseTrap();
|
||
|
InitialiseVehicles();
|
||
|
}
|