#include <StdAfx.h>
#include "dragon.h"
#include <trng_core.h>
#include "utility.h"
#include "Class/TRClass.h"
#include "Class/TRLog.h"
#include "Class/TRLara.h"
#include "phd_math.h"

extern TYPE_CreateItem CreateItem;
extern TYPE_InitialiseItem InitialiseItem;
extern TYPE2_AnimateItem AnimateItem_2;
extern TYPE_AddActiveItem AddActiveItem;
extern TYPE_KillItem KillItem;
extern TYPE_EnableBaddieAI EnableBaddieAI;
extern TYPE_CreatureActive CreatureActive;
extern TYPE_CreatureCollision CreatureCollision;
extern TYPE_InitialiseCreature InitialiseCreature;
extern TYPE_CreatureAnimation CreatureAnimation;
extern TYPE_CreatureJoint CreatureJoint;
extern TYPE_CreatureTilt CreatureTilt;
extern TYPE_CreatureAIInfo CreatureAIInfo;
extern TYPE_CreatureTurn CreatureTurn;
extern TYPE_CreatureMood CreatureMood;
extern TYPE_GetCreatureMood GetCreatureMood;
extern TYPE_DrawAnimatingItem DrawAnimatingItem;
extern TYPE_SoundEffect SoundEffect;
extern TYPE_GetRandomControl GetRandomControl;
extern TYPE_TriggerDynamic TriggerDynamic;
extern TYPE_GetRandomDraw GetRandomDraw;
extern TYPE_ItemNewRoom ItemNewRoom;
extern TYPE_CreatureEffect CreatureEffect;
extern TYPE_CreateEffect CreateEffect;
extern TYPE_DisableBaddieAI DisableBaddieAI;
extern TYPE2_TestBoundsCollide TestBoundsCollide_2;
extern TYPE2_TestCollision TestCollision_2;
extern TYPE2_ItemPushLara ItemPushLara_2;
extern TYPE2_TriggerActive TriggerActive_2;
extern TYPE_swap_meshes_with_meshswap3 swap_meshes_with_meshswap3;
extern StrMyData mydata;

#define HP_DRAGON (300)
#define DRAGON_SWIPE_DAMAGE 250
#define DRAGON_TOUCH_DAMAGE 10
#define DRAGON_DIE_ANIM 21
#define DRAGON_DEAD_ANIM 22
#define DRAGON_LIVE_TIME (30*11)
#define DRAGON_ALMOST_LIVE 100
#define DRAGON_WALK_TURN (ONE_DEGREE*2)
#define DRAGON_NEED_TURN (ONE_DEGREE*1)
#define DRAGON_TURN_TURN (ONE_DEGREE*1)
#define DRAGON_CLOSE_RANGE SQUARE(WALL_L*3)
#define DRAGON_STOP_RANGE SQUARE(WALL_L*6)
#define DRAGON_FLAME_SPEED 200
#define DRAGON_TOUCH_R  0x0fe
#define DRAGON_TOUCH_L  0x7f000000
#define BOOM_TIME (130)
#define BOOM_TIME_MIDDLE (140)
#define BOOM_TIME_END (150)
#define BARTOLI_RANGE (WALL_L*9)
#define DRAGON_CLOSE 900
#define DRAGON_FAR   2300
#define DRAGON_MID   ((DRAGON_CLOSE+DRAGON_FAR)/2)
#define DRAGON_LCOL  -512
#define DRAGON_RCOL  +512

static BITE_INFO dragon_mouth = { 35, 171, 1168, 12 };

enum DRAGON_STATE {
    DRAGON_EMPTY,
    DRAGON_WALK,
    DRAGON_LEFT,
    DRAGON_RIGHT,
    DRAGON_AIM1,
    DRAGON_FIRE1,
    DRAGON_STOP,
    DRAGON_TURNLEFT,
    DRAGON_TURNRIGHT,
    DRAGON_SWIPELEFT,
    DRAGON_SWIPERIGHT,
    DRAGON_DEATH
};

void CreateBartoliLight(short ItemIndex, int type)
{

}

static void DragonFire(DWORD x, int y, DWORD z, int speed, WORD yrot, WORD room_number)
{

}

void CreateExplosion(ITEM_INFO* item)
{

}

void CreateDragonBone(short front_number)
{

}

void AnimateDragon(ITEM_INFO* front, short front_number, short angle, short head)
{

}

void CtrlTR2_DragonFront(short front_number)
{

}

void CtrlTR2_DragonBack(short back_number)
{

}

void CollTR2_Dragon(short back_number, ITEM_INFO* lara, COLL_INFO* coll)
{

}

void CtrlTR2_MarcoBartoli(short ItemIndex)
{

}

void InitTR2_DragonFront(short front_number)
{

}

void InitTR2_DragonBack(short back_number)
{

}

void InitTR2_MarcoBartoli(short item_number)
{

}

void InitialiseTR2_DragonFront()
{

}

void InitialiseTR2_DragonBack()
{

}

void InitialiseTR2_DragonBoneFront()
{

}

void InitialiseTR2_DragonBoneBack()
{

}

void InitialiseTR2_MarcoBartoli()
{

}