+#ifndef TURRETS_EARLY_H
+#define TURRETS_EARLY_H
+
// Comment out below to skip turrets
#define TTURRETS_ENABLED
.string cvar_basename;
//.float spawnflags
-#define TSF_SUSPENDED 1
+const float TSF_SUSPENDED = 1;
/// Spawn a pillar model under the turret to make it look ok on uneven ground surfaces
-#define TSF_TERRAINBASE 2
+const float TSF_TERRAINBASE = 2;
/// Disable builtin ammo regeneration
-#define TSF_NO_AMMO_REGEN 4
+const float TSF_NO_AMMO_REGEN = 4;
/// Dont break path to chase enemys. will still fire at them if possible.
-#define TSF_NO_PATHBREAK 8
+const float TSF_NO_PATHBREAK = 8;
/// Dont respawn
-#define TSL_NO_RESPAWN 16
+const float TSL_NO_RESPAWN = 16;
/// Let this turret roam when idle.
-#define TSL_ROAM 32
+const float TSL_ROAM = 32;
/// target selection flags
.float target_select_flags;
/// target validatoin flags
.float target_validate_flags;
/// Dont select a target on its own.
-#define TFL_TARGETSELECT_NO 2
+const float TFL_TARGETSELECT_NO = 2;
/// Need line of sight
-#define TFL_TARGETSELECT_LOS 4
+const float TFL_TARGETSELECT_LOS = 4;
/// Players are valid targets
-#define TFL_TARGETSELECT_PLAYERS 8
+const float TFL_TARGETSELECT_PLAYERS = 8;
/// Missiles are valid targets
-#define TFL_TARGETSELECT_MISSILES 16
+const float TFL_TARGETSELECT_MISSILES = 16;
/// Responds to turret_trigger_target events
-#define TFL_TARGETSELECT_TRIGGERTARGET 32
+const float TFL_TARGETSELECT_TRIGGERTARGET = 32;
/// Angular limitations of turret head limits target selection
-#define TFL_TARGETSELECT_ANGLELIMITS 64
+const float TFL_TARGETSELECT_ANGLELIMITS = 64;
/// Range limits apply in targetselection
-#define TFL_TARGETSELECT_RANGELIMTS 128
+const float TFL_TARGETSELECT_RANGELIMTS = 128;
/// DOnt select targets with a .team matching its own
-#define TFL_TARGETSELECT_TEAMCHECK 256
+const float TFL_TARGETSELECT_TEAMCHECK = 256;
/// Cant select targets on its own. needs to be triggerd or slaved.
-#define TFL_TARGETSELECT_NOBUILTIN 512
+const float TFL_TARGETSELECT_NOBUILTIN = 512;
/// TFL_TARGETSELECT_TEAMCHECK is inverted (selects only mebers of own .team)
-#define TFL_TARGETSELECT_OWNTEAM 1024
+const float TFL_TARGETSELECT_OWNTEAM = 1024;
/// Turrets aren't valid targets
-#define TFL_TARGETSELECT_NOTURRETS 2048
+const float TFL_TARGETSELECT_NOTURRETS = 2048;
/// Use feild of view
-#define TFL_TARGETSELECT_FOV 4096
+const float TFL_TARGETSELECT_FOV = 4096;
-#define TFL_TARGETSELECT_MISSILESONLY 8192
+const float TFL_TARGETSELECT_MISSILESONLY = 8192;
/// aim flags
.float aim_flags;
/// Dont aim.
-#define TFL_AIM_NO 1
+const float TFL_AIM_NO = 1;
/// Go for ground, not direct hit, but only if target is on ground.
-#define TFL_AIM_GROUNDGROUND 2
+const float TFL_AIM_GROUNDGROUND = 2;
/// Try to predict target movement (does not account for gravity)
-#define TFL_AIM_LEAD 4
+const float TFL_AIM_LEAD = 4;
/// Compensate for shot traveltime when lead
-#define TFL_AIM_SHOTTIMECOMPENSATE 8
+const float TFL_AIM_SHOTTIMECOMPENSATE = 8;
/// Try to do real prediction of targets z pos at impact.
-#define TFL_AIM_ZPREDICT 16
+const float TFL_AIM_ZPREDICT = 16;
/// Simply aim at target's current location
-#define TFL_AIM_SIMPLE 32
+const float TFL_AIM_SIMPLE = 32;
/// track (turn and pitch head) flags
.float track_flags;
/// Dont move head
-#define TFL_TRACK_NO 2
+const float TFL_TRACK_NO = 2;
/// Pitch the head
-#define TFL_TRACK_PITCH 4
+const float TFL_TRACK_PITCH = 4;
/// Rotate the head
-#define TFL_TRACK_ROT 8
+const float TFL_TRACK_ROT = 8;
/// How tracking is preformed
.float track_type;
/// Hard angle increments. Ugly for fast turning, best accuracy.
-#define TFL_TRACKTYPE_STEPMOTOR 1
+const float TFL_TRACKTYPE_STEPMOTOR = 1;
/// Smoth absolute movement. Looks ok, fair accuracy.
-#define TFL_TRACKTYPE_FLUIDPRECISE 2
+const float TFL_TRACKTYPE_FLUIDPRECISE = 2;
/// Simulated inertia. "Wobbly mode" Looks kool, can mean really bad accuracy depending on how the fields below are set
-#define TFL_TRACKTYPE_FLUIDINERTIA 3
+const float TFL_TRACKTYPE_FLUIDINERTIA = 3;
/// TFL_TRACKTYPE_FLUIDINERTIA: pitch multiplier
.float track_accel_pitch;
/// TFL_TRACKTYPE_FLUIDINERTIA: rotation multiplier
/// How prefire check is preformed
.float firecheck_flags;
/// Dont kill the dead
-#define TFL_FIRECHECK_DEAD 4
+const float TFL_FIRECHECK_DEAD = 4;
/// Range limits apply
-#define TFL_FIRECHECK_DISTANCES 8
+const float TFL_FIRECHECK_DISTANCES = 8;
/// Line Of Sight needs to be clear
-#define TFL_FIRECHECK_LOS 16
+const float TFL_FIRECHECK_LOS = 16;
/// Consider distance inpactpoint<->aimspot
-#define TFL_FIRECHECK_AIMDIST 32
+const float TFL_FIRECHECK_AIMDIST = 32;
/// Consider enemy origin<->impactpoint
-#define TFL_FIRECHECK_REALDIST 64
+const float TFL_FIRECHECK_REALDIST = 64;
/// Consider angular diff head<->aimspot
-#define TFL_FIRECHECK_ANGLEDIST 128
+const float TFL_FIRECHECK_ANGLEDIST = 128;
/// (re)consider target.team<->self.team
-#define TFL_FIRECHECK_TEAMCECK 256
+const float TFL_FIRECHECK_TEAMCECK = 256;
/// Try to avoid friendly fire
-#define TFL_FIRECHECK_AFF 512
+const float TFL_FIRECHECK_AFF = 512;
/// Own .ammo needs to be >= then own .shot_dmg
-#define TFL_FIRECHECK_OWM_AMMO 1024
+const float TFL_FIRECHECK_OWM_AMMO = 1024;
/// Others ammo need to be < others .ammo_max
-#define TFL_FIRECHECK_OTHER_AMMO 2048
+const float TFL_FIRECHECK_OTHER_AMMO = 2048;
/// Check own .attack_finished_single vs time
-#define TFL_FIRECHECK_REFIRE 4096
+const float TFL_FIRECHECK_REFIRE = 4096;
/// Move the acctual target to aimspot before tracing impact (and back after)
//#define TFL_FIRECHECK_VERIFIED 8192
/// Dont do any chekcs
-#define TFL_FIRECHECK_NO 16384
+const float TFL_FIRECHECK_NO = 16384;
/// How shooting is done
.float shoot_flags;
/// Dont shoot
-#define TFL_SHOOT_NO 64
+const float TFL_SHOOT_NO = 64;
/// Fire in vollys (partial implementation through .shot_volly)
-#define TFL_SHOOT_VOLLY 2
+const float TFL_SHOOT_VOLLY = 2;
/// Always do a full volly, even if target is lost or dead. (not implemented)
-#define TFL_SHOOT_VOLLYALWAYS 4
+const float TFL_SHOOT_VOLLYALWAYS = 4;
/// Loop though all valid tarters, and hit them.
-#define TFL_SHOOT_HITALLVALID 8
+const float TFL_SHOOT_HITALLVALID = 8;
/// Fiering makes unit loose target (after volly is done, if in volly mode)
-#define TFL_SHOOT_CLEARTARGET 16
+const float TFL_SHOOT_CLEARTARGET = 16;
///Custom shooting;
-#define TFL_SHOOT_CUSTOM 32
+const float TFL_SHOOT_CUSTOM = 32;
/// Information aboute the units capabilities
.float turrcaps_flags;
/// No kown capabilities
-#define TFL_TURRCAPS_NONE 0
+const float TFL_TURRCAPS_NONE = 0;
/// Capable of sniping
-#define TFL_TURRCAPS_SNIPER 2
+const float TFL_TURRCAPS_SNIPER = 2;
/// Capable of splasdamage
-#define TFL_TURRCAPS_RADIUSDMG 4
+const float TFL_TURRCAPS_RADIUSDMG = 4;
/// Has one or more cannons with zero shot traveltime
-#define TFL_TURRCAPS_HITSCAN 8
+const float TFL_TURRCAPS_HITSCAN = 8;
/// More then one (type of) gun
-#define TFL_TURRCAPS_MULTIGUN 16
+const float TFL_TURRCAPS_MULTIGUN = 16;
/// Carries at least one guided weapon
-#define TFL_TURRCAPS_GUIDED 32
+const float TFL_TURRCAPS_GUIDED = 32;
/// At least one gun fiers slow projectiles
-#define TFL_TURRCAPS_SLOWPROJ 64
+const float TFL_TURRCAPS_SLOWPROJ = 64;
/// At least one gun fiers medium speed projectiles
-#define TFL_TURRCAPS_MEDPROJ 128
+const float TFL_TURRCAPS_MEDPROJ = 128;
/// At least one gun fiers fast projectiles
-#define TFL_TURRCAPS_FASTPROJ 256
+const float TFL_TURRCAPS_FASTPROJ = 256;
/// At least one gun capable of damaging players
-#define TFL_TURRCAPS_PLAYERKILL 512
+const float TFL_TURRCAPS_PLAYERKILL = 512;
/// At least one gun that can shoot town missiles
-#define TFL_TURRCAPS_MISSILEKILL 1024
+const float TFL_TURRCAPS_MISSILEKILL = 1024;
/// Has support capabilities. powerplants and sutch.
-#define TFL_TURRCAPS_SUPPORT 2048
+const float TFL_TURRCAPS_SUPPORT = 2048;
/// Proveides at least one type of ammmo
-#define TFL_TURRCAPS_AMMOSOURCE 4096
+const float TFL_TURRCAPS_AMMOSOURCE = 4096;
/// Can recive targets from external sources
-#define TFL_TURRCAPS_RECIVETARGETS 8192
+const float TFL_TURRCAPS_RECIVETARGETS = 8192;
/// Capable of self-transport
-#define TFL_TURRCAPS_MOVE 16384
+const float TFL_TURRCAPS_MOVE = 16384;
/// Will roam arround even if not chasing anyting
-#define TFL_TURRCAPS_ROAM 32768
-#define TFL_TURRCAPS_ISTURRET 65536
+const float TFL_TURRCAPS_ROAM = 32768;
+const float TFL_TURRCAPS_ISTURRET = 65536;
/// Ammo types needed and/or provided
//.float ammo_flags;
#define ammo_flags currentammo
/// Has and needs no ammo
-#define TFL_AMMO_NONE 64
+const float TFL_AMMO_NONE = 64;
/// Uses power
-#define TFL_AMMO_ENERGY 2
+const float TFL_AMMO_ENERGY = 2;
/// Uses bullets
-#define TFL_AMMO_BULLETS 4
+const float TFL_AMMO_BULLETS = 4;
/// Uses explosives
-#define TFL_AMMO_ROCKETS 8
+const float TFL_AMMO_ROCKETS = 8;
/// Regenerates ammo on its own
-#define TFL_AMMO_RECHARGE 16
+const float TFL_AMMO_RECHARGE = 16;
/// Can recive ammo from others
-#define TFL_AMMO_RECIVE 32
+const float TFL_AMMO_RECIVE = 32;
/// How incomming damage is handeld
.float damage_flags;
/// Cant be hurt
-#define TFL_DMG_NO 256
+const float TFL_DMG_NO = 256;
/// Can be damaged
-#define TFL_DMG_YES 2
+const float TFL_DMG_YES = 2;
/// Can be damaged by teammates
-#define TFL_DMG_TAKEFROMTEAM 4
+const float TFL_DMG_TAKEFROMTEAM = 4;
/// Traget attackers
-#define TFL_DMG_RETALIATE 8
+const float TFL_DMG_RETALIATE = 8;
/// Target attackers, even is on own team
-#define TFL_DMG_RETALIATEONTEAM 16
+const float TFL_DMG_RETALIATEONTEAM = 16;
/// Loses target when damaged
-#define TFL_DMG_TARGETLOSS 32
+const float TFL_DMG_TARGETLOSS = 32;
/// Reciving damage trows off aim (pointless atm, aim gets recalculated to fast). not implemented.
-#define TFL_DMG_AIMSHAKE 64
+const float TFL_DMG_AIMSHAKE = 64;
/// Reciving damage slaps the head arround
-#define TFL_DMG_HEADSHAKE 128
+const float TFL_DMG_HEADSHAKE = 128;
/// Die and stay dead.
-#define TFL_DMG_DEATH_NORESPAWN 256
+const float TFL_DMG_DEATH_NORESPAWN = 256;
// Spawnflags
/// Spawn in teambased modes
-#define TFL_SPAWN_TEAM 2
+const float TFL_SPAWN_TEAM = 2;
/// Spawn in FFA modes
-#define TFL_SPAWN_FFA 4
+const float TFL_SPAWN_FFA = 4;
/*
#endif // SVQC
// common
-.float turret_type;
-const float TID_COMMON = 1;
-const float TID_EWHEEL = 2;
-const float TID_FLAC = 3;
-const float TID_FUSION = 4;
-const float TID_HELLION = 5;
-const float TID_HK = 6;
-const float TID_MACHINEGUN = 7;
-const float TID_MLRS = 8;
-const float TID_PHASER = 9;
-const float TID_PLASMA = 10;
-const float TID_PLASMA_DUAL = 11;
-const float TID_TESLA = 12;
-const float TID_WALKER = 13;
-const float TID_LAST = 13;
-
-const float TNSF_UPDATE = 2;
-const float TNSF_STATUS = 4;
-const float TNSF_SETUP = 8;
-const float TNSF_ANG = 16;
-const float TNSF_AVEL = 32;
-const float TNSF_MOVE = 64;
+.int turret_type;
+const int TID_COMMON = 1;
+const int TID_EWHEEL = 2;
+const int TID_FLAC = 3;
+const int TID_FUSION = 4;
+const int TID_HELLION = 5;
+const int TID_HK = 6;
+const int TID_MACHINEGUN = 7;
+const int TID_MLRS = 8;
+const int TID_PHASER = 9;
+const int TID_PLASMA = 10;
+const int TID_PLASMA_DUAL = 11;
+const int TID_TESLA = 12;
+const int TID_WALKER = 13;
+const int TID_LAST = 13;
+
+const int TNSF_UPDATE = 2;
+const int TNSF_STATUS = 4;
+const int TNSF_SETUP = 8;
+const int TNSF_ANG = 16;
+const int TNSF_AVEL = 32;
+const int TNSF_MOVE = 64;
.float anim_start_time;
-const float TNSF_ANIM = 128;
+const int TNSF_ANIM = 128;
-const float TNSF_FULL_UPDATE = 16777215;
+const int TNSF_FULL_UPDATE = 16777215;
#endif // TTURRETS_ENABLED
-
-
+#endif