7 entity player = isPlayer ? actor : actor.owner;
8 entity veh = player.vehicle;
10 float t = autocvar_g_vehicle_raptor_cannon_refire * (1 + ((veh.misc_bulletcounter + 1) >= 4));
17 veh.misc_bulletcounter += 1;
19 : (((veh.misc_bulletcounter >= 4) ? veh.misc_bulletcounter = 0 : 0),
gettaginfo(veh.gun2,
gettagindex(veh.gun2,
"fire1")));
21 veh.vehicle_energy -= autocvar_g_vehicle_raptor_cannon_cost;
25 org,
normalize(dir +
randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed,
26 autocvar_g_vehicle_raptor_cannon_damage, autocvar_g_vehicle_raptor_cannon_radius, autocvar_g_vehicle_raptor_cannon_force, 0,
33 entity player = isPlayer ? actor : actor.owner;
34 entity veh = player.vehicle;
35 return isPlayer || veh.vehicle_energy >= autocvar_g_vehicle_raptor_cannon_cost;
39 void raptor_bombdrop(
entity this);
42 entity player = isPlayer ? actor : actor.owner;
43 entity veh = player.vehicle;
45 if (!isPlayer ||
weapon_prepareattack(thiswep, player, weaponentity,
true, autocvar_g_vehicle_raptor_bombs_refire)) {
46 entity e = (veh) ? veh : player;
52 void raptor_flare_think(
entity this);
58 entity player = isPlayer ? actor : actor.owner;
59 entity veh = player.vehicle;
61 if (!isPlayer ||
weapon_prepareattack(thiswep, player, weaponentity,
true, autocvar_g_vehicle_raptor_flare_refire)) {
63 MAKE_VECTORS(player.v_angle, forward, right, up);
64 for(
int i = 0; i < 3; ++i) {
65 entity _flare =
new(RaptorFlare_flare);
66 setmodel(_flare, MDL_VEH_RAPTOR_FLARE);
69 setorigin(_flare, actor.origin -
'0 0 16');
71 _flare.gravity = 0.15;
72 _flare.velocity = 0.25 * actor.velocity + (forward +
randomvec() * 0.25)* -500;
73 setthink(_flare, raptor_flare_think);
74 _flare.nextthink =
time;
75 _flare.owner = veh ? veh : player;
78 _flare.event_damage = raptor_flare_damage;
80 _flare.tur_impacttime =
time + autocvar_g_vehicle_raptor_flare_lifetime;
81 settouch(_flare, raptor_flare_touch);
88 void raptor_bomblet_boom(
entity this)
91 autocvar_g_vehicle_raptor_bomblet_edgedamage,
92 autocvar_g_vehicle_raptor_bomblet_radius,
NULL,
NULL,
93 autocvar_g_vehicle_raptor_bomblet_force, DEATH_VH_RAPT_BOMB.m_id,
DMG_NOWEP,
NULL);
99 if(toucher == this.
owner)
103 setthink(
this, raptor_bomblet_boom);
107 void raptor_bomb_burst(
entity this)
110 if(autocvar_g_vehicle_raptor_bomblet_alt)
126 for(i = 0; i < autocvar_g_vehicle_raptor_bomblets; ++i)
128 bomblet =
new(raptor_bomb_bomblet);
132 settouch(bomblet, raptor_bomblet_touch);
133 setthink(bomblet, raptor_bomblet_boom);
134 bomblet.nextthink =
time + 5;
135 bomblet.owner = this.
owner;
148 raptor_bomb_burst(
this);
151 void raptor_bombdrop(
entity this)
153 entity bomb_1 =
new(bombmount_left);
154 entity bomb_2 =
new(bombmount_right);
163 bomb_1.velocity = bomb_2.velocity = this.
velocity;
164 settouch(bomb_1, raptor_bomb_touch);
165 settouch(bomb_2, raptor_bomb_touch);
166 setthink(bomb_1, raptor_bomb_burst);
167 setthink(bomb_2, raptor_bomb_burst);
168 bomb_1.cnt = bomb_2.cnt =
time + 10;
170 if(autocvar_g_vehicle_raptor_bomblet_alt)
171 bomb_1.nextthink = bomb_2.nextthink =
time;
173 bomb_1.nextthink = bomb_2.nextthink =
time + autocvar_g_vehicle_raptor_bomblet_time;
175 bomb_1.owner = bomb_2.owner =
this;
176 bomb_1.realowner = bomb_2.realowner = this.
owner;
178 bomb_1.gravity = bomb_2.gravity = 1;
199 void raptor_flare_think(
entity this)
204 if(vdist(this.origin - it.origin, <, autocvar_g_vehicle_raptor_flare_range))
205 if(random() > autocvar_g_vehicle_raptor_flare_chase)
217 void RaptorCBShellfragDraw(
entity this)
235 entity sfrag =
new(RaptorCBShellfrag);
236 setmodel(sfrag, MDL_VEH_RAPTOR_CB_FRAGMENT);
240 sfrag.gravity = 0.15;
243 sfrag.draw = RaptorCBShellfragDraw;
246 sfrag.velocity = _vel;
250 sfrag.move_time =
time;
251 sfrag.damageforcescale = 4;
253 sfrag.nextthink =
time + 3;
254 sfrag.cnt =
time + 2;
#define IL_EACH(this, cond, body)
const float ALPHA_MIN_VISIBLE
#define PROJECTILE_MAKETRIGGER(e)
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
const int PROJECTILE_RAPTORBOMBLET
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
#define METHOD(cname, name, prototype)
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
#define PROJECTILE_TOUCH(e, t)
#define setmodel(this, m)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void UpdateCSQCProjectile(entity e)
void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
#define W_SetupShot_Dir(ent, wepent, s_forward, antilag, recoil, snd, chan, maxdamage, deathtype)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
IntrusiveList g_projectiles
const int PROJECTILE_RAPTORBOMB
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, int deathtype, float bloodtype, entity dmgowner)
entity vehicles_projectile(entity this, entity _mzlfx, Sound _mzlsound, vector _org, vector _vel, float _dmg, float _radi, float _force, float _size, int _deahtype, float _projtype, float _health, bool _cull, bool _clianim, entity _owner)
const int PROJECTILE_RAPTORCANNON
IntrusiveList g_drawables
void set_movetype(entity this, int mt)