#ifndef VEHICLE_RAPTOR_WEAPONS_H
#define VEHICLE_RAPTOR_WEAPONS_H
-#include "../../weapons/all.qh"
+#include <common/weapons/all.qh>
CLASS(RaptorCannon, PortoLaunch)
/* flags */ ATTRIB(RaptorCannon, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
float autocvar_g_vehicle_raptor_bomblet_force;
float autocvar_g_vehicle_raptor_bomblet_explode_delay;
-METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
+METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
bool isPlayer = IS_PLAYER(actor);
entity player = isPlayer ? actor : actor.owner;
entity veh = player.vehicle;
// 1 [wait] 1 [wait] 2 [wait] 2 [wait] [wait]
float t = autocvar_g_vehicle_raptor_cannon_refire * (1 + veh.misc_bulletcounter == 4);
if (fire & 1)
- if (weapon_prepareattack(thiswep, player, slot, false, t)) {
+ if (weapon_prepareattack(thiswep, player, weaponentity, false, t)) {
if (isPlayer) W_SetupShot_Dir(player, v_forward, false, 0, SND(Null), CH_WEAPON_B, 0);
vector org = w_shotorg;
vector dir = w_shotdir;
org, normalize(dir + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed,
autocvar_g_vehicle_raptor_cannon_damage, autocvar_g_vehicle_raptor_cannon_radius, autocvar_g_vehicle_raptor_cannon_force, 0,
DEATH_VH_RAPT_CANNON.m_id, PROJECTILE_RAPTORCANNON, 0, true, true, player);
- weapon_thinkf(player, slot, WFRAME_FIRE1, 0, w_ready);
+ weapon_thinkf(player, weaponentity, WFRAME_FIRE1, 0, w_ready);
}
}
METHOD(RaptorCannon, wr_checkammo1, bool(RacerAttack thiswep)) {
float autocvar_g_vehicle_raptor_bombs_refire;
void raptor_bombdrop();
-METHOD(RaptorBomb, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
+METHOD(RaptorBomb, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
bool isPlayer = IS_PLAYER(actor);
entity player = isPlayer ? actor : actor.owner;
entity veh = player.vehicle;
if (fire & 2)
- if (!isPlayer || weapon_prepareattack(thiswep, player, slot, true, autocvar_g_vehicle_raptor_bombs_refire)) {
+ if (!isPlayer || weapon_prepareattack(thiswep, player, weaponentity, true, autocvar_g_vehicle_raptor_bombs_refire)) {
if (veh) setself(veh);
raptor_bombdrop();
- weapon_thinkf(player, slot, WFRAME_FIRE2, 0, w_ready);
+ weapon_thinkf(player, weaponentity, WFRAME_FIRE2, 0, w_ready);
}
}
void raptor_flare_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
void raptor_flare_touch();
-METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
+METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
bool isPlayer = IS_PLAYER(actor);
entity player = isPlayer ? actor : actor.owner;
entity veh = player.vehicle;
if (fire & 2)
- if (!isPlayer || weapon_prepareattack(thiswep, player, slot, true, autocvar_g_vehicle_raptor_flare_refire)) {
+ if (!isPlayer || weapon_prepareattack(thiswep, player, weaponentity, true, autocvar_g_vehicle_raptor_flare_refire)) {
for(int i = 0; i < 3; ++i) {
entity _flare = spawn();
setmodel(_flare, MDL_VEH_RAPTOR_FLARE);
_flare.tur_impacttime = time + autocvar_g_vehicle_raptor_flare_lifetime;
_flare.touch = raptor_flare_touch;
}
- weapon_thinkf(player, slot, WFRAME_FIRE2, 0, w_ready);
+ weapon_thinkf(player, weaponentity, WFRAME_FIRE2, 0, w_ready);
}
}
bomb_1 = spawn();
bomb_2 = spawn();
- setorigin(bomb_1, gettaginfo(self, gettagindex(self, "bombmount_left")));
- setorigin(bomb_2, gettaginfo(self, gettagindex(self, "bombmount_right")));
+ vector org = gettaginfo(self, gettagindex(self, "bombmount_left"));
+ setorigin(bomb_1, org);
+ org = gettaginfo(self, gettagindex(self, "bombmount_right"));
+ setorigin(bomb_2, org);
bomb_1.movetype = bomb_2.movetype = MOVETYPE_BOUNCE;
bomb_1.velocity = bomb_2.velocity = self.velocity;
if(wasfreed(self))
return;
- Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
+ Movetype_Physics_MatchTicrate(self, autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
self.move_avelocity += randomvec() * 15;
self.renderflags = 0;