unit g_Types;

interface
uses
  windows,iz_gfx,iz_types,iz_GUI;

type
  izGameState = (gsLoad, gsMenu, gsGame);
  izCameraType = (ctCharView, ctSpecial, ctFree);
  izBaseState = (bsStay,bsFire,bsDead);
  izTowerState = (tsBuild,tsFind,tsShot,tsFire);
  izCharacterType = (ctBuilder, ctMonster);
  izCharacterState = (csMove,csAtack,csDeath,csDead);
  izMonsterState = (msNone, msFree, msFind, msWait, msAttackChar, msMoveToChar, msMoveToPos);

  zGame = ^izGame;
  izGame = record
    GUI : zGUI;
    Finish : bool;
    State : izGameState;
    ChangeLevelDelay : word;
    NextLevel : bool;
    Money,Mobs : word;
    TTC,LTC : DWORD;
    MapName : string;
    Level,numLevel : byte;
  end;

  zCamera = ^izCamera;
  izCamera = record
    Typ : izCameraType;
    Pos, Pos_2 : izPosition_f;
    CurPos : izPosition_f;
    left,right : izPosition_w;
    PastTime,SpeedX,SpeedY : float;
    Move : bool;
    target : word;
  end;

  zMiniMap = ^izMiniMap;
  izMiniMap = record
    pos : izPosition_f;
    size : word;
    rad : word;
  end;

  zGame_Text = ^izGame_Text;
  izGame_Text = record
    Pos : izPosition_i;
  end;

  izLand = record
    typeID : byte;
    Block : byte;
    pos : izPosition_f;
  end;

  izObj = record
    typeID : byte;
    pos : izPosition_f;
    size : izSize_w;
    Rad : byte;
    Angle : word;
  end;

  zBase = ^izBase;
  izBase = record
    Tex,Spr : word;
    Pos : izPosition_f;
    size : izSize_w;
    Rad : word;
    Life : float;
    State : izBaseState;
  end;

  izSpark = record
    Points : array of izPoint_w;
    PointCount : word;
    TTC,LTC : DWORD;
    MaxFract,Delay : word;
  end;

  zTower = ^izTower;
  izTower = record
    name : string;
    Tex,Spr : word;
    pos : izPosition_f;
    size : izSize_w;
    Rad : word;
    price : word;
    State : izTowerState;
    target : word;
    Upgrade : byte;
    aniFindStart : word;
    AniBuild,AniShot : word;
    aniBuildStart,aniBuildEnd,aniBuildDelay : word;
    aniShotStart,aniShotEnd,aniShotDelay : word;
    BuildDelay,ShotSpeed : float;
    ShotDistance : word;
    ShotPower : word;
    TTC,LTC : DWORD;
    Spark : izSpark;
  end;

  zCharacter = ^izCharacter;
  izCharacter = record
    name,TexName : string;
    Tex,Spr : word;
    Pos : izPosition_f;
    Deviation : izPosition_i;
    size : izSize_w;
    Rad : byte;
    Move_end : bool;
    Col : izColor;
    MoveAngle,
    SeeAngle : float;
    Speed,rSpeed : float;
    chType : izCharacterType;
    State : izCharacterState;                    //Состояние (жив, мёртв)
    Life : int;                                 //Life
    LineWP : byte;
    NextWP : byte;
    //***Animations***\\
    AniBodyStart,AniBodyEnd,AniDeadStart,AniDeadEnd : byte;
    AniBodySpeed,AniDeadSpeed : byte;
    CHARACTER_ANIM_BODY_MOVE,CHARACTER_ANIM_DEAD : word;
  end;

  zMonster = ^izMonster;
  izMonster = record
    State : izMonsterState;
    Character : word;
  end;

  zWorld = ^izWorld;
  izWorld = record
    Base : izBase;
    Tower : array of izTower;
    ActiveTower : byte;
    Monsters : array of izMonster;
    Characters : array of izCharacter;
    MapSize : izSize_w;
    MapSize_num : izSize_w;
    TowerCount,
    TowerTypeCount,
    MonsterTypeCount,
    CharacterActiveCount,
    CharacterCount : word;
    EndCharAC : word;
    MaxMonster,MonAddCoef : word;
    MonsterCreateTTC,MonsterCreateLTC,MonsterCreateDelay : DWORD;
  end;

implementation

end.
