X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Fsv_turrets.qh;h=cdd9e57bfa2e7c1f65b041a2f7a93acbfd8657a6;hb=b83c5c7bd21b66c0df9e797c66e60c6655f7b65f;hp=62759c058f3df63b37713919baf4f55a9c8314ee;hpb=d492869ab1f18e05121529b7bcffcb637d13994c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/sv_turrets.qh b/qcsrc/common/turrets/sv_turrets.qh index 62759c058..cdd9e57bf 100644 --- a/qcsrc/common/turrets/sv_turrets.qh +++ b/qcsrc/common/turrets/sv_turrets.qh @@ -1,5 +1,14 @@ #pragma once +#include "all.qh" + +bool autocvar_g_turrets; +float autocvar_g_turrets_aimidle_delay; +bool autocvar_g_turrets_nofire; +bool autocvar_g_turrets_reloadcvars; +float autocvar_g_turrets_targetscan_maxdelay; +float autocvar_g_turrets_targetscan_mindelay; + entity turret_projectile(entity actor, Sound _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim); void turret_projectile_explode(entity this); float turret_validate_target(entity e_turret, entity e_target, float validate_flags); @@ -7,6 +16,15 @@ bool turret_firecheck(entity this); entity turret_select_target(entity this); // turret fields + +#define X(class, prefix, fld, type) .type fld; +TR_PROPS_COMMON(X, , ) +#undef X +/* +.float shot_volly; // smaller than 1 = shoot # times at target +.float shot_volly_refire; // refire after completed volly +*/ + .float ticrate; // interal ai think rate .entity tur_head; // top part of the turret .entity tur_defend; // defend this entity @@ -19,36 +37,11 @@ entity turret_select_target(entity this); .float tur_dist_impact_to_aimpos; // distance impact<->aim .float volly_counter; // decrement counter from .shot_volly to 0 -.float shot_refire; // attack refire -.float shot_speed; // projectile speed -.float shot_spread; // inaccuracy -.float shot_dmg; // core damage of projectile -.float shot_radius; // projectile damage radius -.float shot_force; // projectile damage force -.float shot_volly; // smaller than 1 = shoot # times at target -.float shot_volly_refire; // refire after completed volly - -.float target_range; -.float target_range_min; -.float target_range_optimal; - -.float target_select_rangebias; -.float target_select_samebias; -.float target_select_anglebias; -.float target_select_missilebias; -.float target_select_playerbias; .float target_select_time; // last time turret had a valid target .float target_validate_time; // throttle re-validation of current target -.float aim_firetolerance_dist; -.float aim_speed; -.float aim_maxpitch; -.float aim_maxrotate; .float ammo; // current ammo -.float ammo_recharge; // recharge rate -.float ammo_max; // maximum ammo - .vector idle_aim; /// Map time control over pain inflicted @@ -67,13 +60,9 @@ entity turret_select_target(entity this); .float turret_scale_respawn; // tracking type -.float track_type; const float TFL_TRACKTYPE_STEPMOTOR = 1; // hard angle increments, ugly for fast turning with best accuracy const float TFL_TRACKTYPE_FLUIDPRECISE = 2; // smooth absolute movement, looks OK with fair accuracy const float TFL_TRACKTYPE_FLUIDINERTIA = 3; // simulated inertia ("wobbly" mode), worst accuracy, depends on below flags -.float track_accel_pitch; -.float track_accel_rotate; -.float track_blendrate; void turret_respawn(entity this); @@ -87,6 +76,9 @@ void turrets_setframe(entity this, float _frame, float client_only); bool turret_initialize(entity this, Turret tur); +// returns true when box overlaps with a given location +bool turret_closetotarget(entity this, vector targ); + /// Function to use for target evaluation. usualy turret_targetscore_generic .float(entity _turret, entity _target) turret_score_target; @@ -94,6 +86,8 @@ bool turret_initialize(entity this, Turret tur); .entity pathcurrent; +.entity pathgoal; + float turret_count; // debugging @@ -115,5 +109,7 @@ float turret_count; vector tvt_thadv; // turret head angle diff vector, updated by a successful call to turret_validate_target vector tvt_tadv; // turret angle diff vector, updated by a successful call to turret_validate_target float tvt_thadf; // turret head angle diff float, updated by a successful call to turret_validate_target -float tvt_tadf; // turret angle diff float, updated by a successful call to turret_validate_target float tvt_dist; // turret distance, updated by a successful call to turret_validate_target + +IntrusiveList g_turrets; +STATIC_INIT(g_turrets) { g_turrets = IL_NEW(); }