#include <StdAfx.h>
#include "skidoo.h"
#include "utility.h"
#include "snow.h"
#include "phd_math.h"
#include "Class/TRClass.h"
#include "Class/TRLog.h"
#include "Class/TRRender.h"
#include "Class/TRLara.h"
#include "Class/TRWeapons.h"
#include "TR3_Functions.h"

extern TYPE_game_malloc game_malloc;
extern TYPE_ObjectCollision ObjectCollision;
extern TYPE2_TestCollision TestCollision_2;
extern TYPE_GetFloor GetFloor;
extern TYPE_GetHeight GetHeight;
extern TYPE_GetCeiling GetCeiling;
extern TYPE_CreateFlare CreateFlare;
extern TYPE_undraw_flare_meshes undraw_flare_meshes;
extern TYPE_TestTriggers TestTriggers;
extern TYPE_phd_atan phd_atan;
extern TYPE_ItemNewRoom ItemNewRoom;
extern TYPE2_AnimateItem AnimateItem_2;
extern TYPE_SoundEffect SoundEffect;
extern TYPE_GetRandomDraw GetRandomDraw;
extern TYPE_ExplodingDeath ExplodingDeath;
extern TYPE_BikeExplode BikeExplode;
extern TYPE2_TriggerUnderwaterExplosion TriggerUnderwaterExplosion_2;
extern TYPE_TriggerExplosionSparks TriggerExplosionSparks;
extern TYPE_BikeBaddieCollision BikeBaddieCollision;
extern TYPE_BikeCollideStaticObjects BikeCollideStaticObjects;
extern TYPE_KillItem KillItem;
extern TYPE_LaraGetNewTarget LaraGetNewTarget;
extern TYPE_AimWeapon AimWeapon;
extern TYPE_FireWeapon FireWeapon;
extern TYPE_CreatureEffect CreatureEffect;
extern TYPE_AddActiveItem AddActiveItem;
extern TYPE_CreateEffect CreateEffect;
extern TYPE_S_SoundSampleIsPlaying S_SoundSampleIsPlaying;
extern TYPE2_GetBestFrame GetBestFrame_2;
extern TYPE2_TestBoundsCollide TestBoundsCollide_2;
extern TYPE2_ItemPushLara ItemPushLara_2;
extern TYPE_DoLotsOfBlood DoLotsOfBlood;
extern TYPE_CreateItem CreateItem;
extern TYPE_InitialiseItem InitialiseItem;
extern TYPE_EnableBaddieAI EnableBaddieAI;
extern TYPE2_AnimateItem AnimateItem_2;
extern TYPE_CreatureAIInfo CreatureAIInfo;
extern TYPE_CreatureMood CreatureMood;
extern TYPE_GetCreatureMood GetCreatureMood;
extern TYPE_CreatureTurn CreatureTurn;
extern TYPE_ShotLara ShotLara;
extern TYPE_CreatureAnimation CreatureAnimation;
extern TYPE_RemoveActiveItem RemoveActiveItem;
extern TYPE_DisableBaddieAI DisableBaddieAI;
extern TYPE_LookUpDown LookUpDown;
extern TYPE_S_CDPlay S_CDPlay;
extern TYPE_GetWaterHeight GetWaterHeight;
extern TYPE_GetWaterDepth GetWaterDepth;
extern TYPE_TriggerSmallSplash TriggerSmallSplash;
extern TYPE_TriggerDynamic TriggerDynamic;
extern TYPE_DrawAnimatingItem DrawAnimatingItem;
extern TYPE_GetLaraJointPos GetLaraJointPos;
extern TYPE_phd_GetVectorAngles phd_GetVectorAngles;
extern TYPE_CreatureCollision CreatureCollision;
extern TYPE_GetCollisionInfo GetCollisionInfo;

/*
* LEVEL_TEST2 SoundID:
* - 131, BIKE_START: snomw_start
* - 132, BIKE_IDLE: snowm_idle
* - 133, BIKE_ACCELERATE: snowm_accel
* - 134, BIKE_MOVING: snowm_accelmax
* - 135, BIKE_LAND: snowm_shutoff
*/

#define HP_SKIDMAN (100)
#define SWIM_DEPTH 730
#define WADE_DEPTH (STEP_L)
#define DAMAGE_START 140   // DAMAGE_START 140
#define DAMAGE_LENGTH 14
#define SKIDOO_GETON_ANIM 1
#define SKIDOO_GETONL_ANIM 18
#define SKIDOO_FALL_ANIM 8
#define SKIDOO_DEAD_ANIM 15
#define SKIDOO_HIT_LEFT 11
#define SKIDOO_HIT_RIGHT 12
#define SKIDOO_HIT_FRONT 13
#define SKIDOO_HIT_BACK 14
#define SKIDOO_GETOFF_DIST 330
#define SKIDOO_UNDO_TURN (ONE_DEGREE*2)
#define SKIDOO_TURN (ONE_DEGREE/2 + SKIDOO_UNDO_TURN)
#define SKIDOO_MAX_TURN (ONE_DEGREE*6)
#define SKIDOO_MOMENTUM_TURN (ONE_DEGREE*3)
#define SKIDOO_MAX_MOM_TURN (ONE_DEGREE*150)
#define SKIDOO_FAST_SPEED 150
#define SKIDOO_MAX_SPEED 100
#define SKIDOO_SLOW_SPEED 50
#define SKIDOO_MIN_SPEED 15
#define SKIDOO_ACCELERATION    10
#define SKIDOO_BRAKE 5
#define SKIDOO_SLOWDOWN 2
#define SKIDOO_REVERSE -5
#define SKIDOO_MAX_BACK -30
#define SKIDOO_MAX_KICK -80
#define SKIDOO_SLIP 100
#define SKIDOO_SLIP_SIDE 50
#define SKIDOO_FRONT 550
#define SKIDOO_SIDE    260
#define SKIDOO_RADIUS 500
#define SKIDOO_SNOW 500
#define SKIDOO_MAX_HEIGHT (STEP_L)
#define SKIDOO_MIN_BOUNCE ((SKIDOO_MAX_SPEED/2)>>8)

static BITE_INFO left_gun = { 240, -190, 540, NULL };
static BITE_INFO right_gun = { -240, -190, 540, NULL };

enum SKIDOO_STATE
{
    SKID_SIT,
    SKID_GETON,
    SKID_LEFT,
    SKID_RIGHT,
    SKID_FALL,
    SKID_HIT,
    SKID_GETONL,
    SKID_GETOFFL,
    SKID_STILL,
    SKID_GETOFF,
    SKID_LETGO,
    SKID_DEATH,
    SKID_FALLOFF
};

#define SMAN_SHOT_DAMAGE 10
#define SMAN_LARA_DAMAGE 50
#define SMAN_MIN_TURN (SKIDOO_MAX_TURN/3)
#define SMAN_TARGET_ANGLE (ONE_DEGREE*15)
#define SMAN_WAIT_RANGE SQUARE(WALL_L*4)
#define SMAN_DEATH_ANIM 10

enum SKIDMAN_STATE
{
    SMAN_EMPTY,
    SMAN_WAIT,
    SMAN_MOVING,
    SMAN_STARTLEFT,
    SMAN_STARTRIGHT,
    SMAN_LEFT,
    SMAN_RIGHT,
    SMAN_DEATH
};

void InitTR2_Skidoo(short item_number)
{

}

void InitTR2_SkidooArmed(short item_number)
{

}

int SkidooCheckGetOn(sint16 item_number, COLL_INFO *coll)
{
    return 0;
}

static void SkidmanPush(ITEM_INFO *item, ITEM_INFO *laraitem, int radius)
{

}

static void SkidooBaddieCollision(short item_index, ITEM_INFO *skidoo)
{

}

static int GetCollisionAnim(ITEM_INFO *skidoo, PHD_VECTOR *moved)
{
    return 0;
}

sint32 TestHeight(ITEM_INFO *item, sint32 z_off, sint32 x_off, PHD_VECTOR *pos)
{
    return 0;
}

int DoShift(ITEM_INFO *skidoo, PHD_VECTOR *pos, PHD_VECTOR *old)
{
    return 0;
}

int DoDynamics(int height, int fallspeed, int *y)
{
    return 0;
}

void DoSnowEffect(ITEM_INFO *skidoo)
{

}

static int SkidooDynamics(ITEM_INFO *skidoo)
{
    return 0;
}

int SkidooCheckGetOffOK(int direction)
{
    return 0;
}

void SkidooExplode(ITEM_INFO *v)
{

}

static int SkidooCheckGetOff()
{
    return 0;
}

static void SkidooGuns(void)
{

}

static void SkidooAnimation(ITEM_INFO *skidoo, int collide, int dead)
{

}

static int SkidooUserControl(ITEM_INFO *skidoo, int height, int *pitch)
{
    return 0;
}

int CtrlTR2_Skidoo()
{
    return 0;
}

void CollTR2_Skidoo(short item_number, ITEM_INFO* litem, COLL_INFO* coll)
{

}

void InitSkidman(sint16 item_number)
{

}

void SkidManControl(sint16 rider_number)
{

}

void SkidmanCollision(sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll)
{

}

void InitialiseTR2_Skidoo()
{

}

void InitialiseTR2_SkidooLaraAnim()
{

}

void InitialiseTR2_SkidooTrack()
{

}

void InitialiseTR2_SkidooSnow()
{

}

void InitialiseTR2_SkidooGun()
{

}

void InitialiseTR2_SkidooDriver()
{

}

void InitialiseTR2_SkidooAfterDeath()
{

}