X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Fturret%2Fplasma_dual.qc;h=b1e7d5850aa08416e77ed650418234dc4eace550;hb=5be93573a7c9b9e29b5f230614f6de51378c502e;hp=faac00d26dce98cfb77b7cbe21e9503e26c6465f;hpb=93f6c1c41d7a17718dfbf7b464c319a9716643f4;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/turret/plasma_dual.qc b/qcsrc/common/turrets/turret/plasma_dual.qc index faac00d26..920f88ad2 100644 --- a/qcsrc/common/turrets/turret/plasma_dual.qc +++ b/qcsrc/common/turrets/turret/plasma_dual.qc @@ -1,58 +1,34 @@ -#ifndef TURRET_PLASMA_DUAL_H -#define TURRET_PLASMA_DUAL_H - -CLASS(PlasmaDualAttack, PlasmaAttack) -/* refname */ ATTRIB(PlasmaDualAttack, netname, string, "turret_plasma_dual"); -/* wepname */ ATTRIB(PlasmaDualAttack, message, string, _("Dual plasma")); -ENDCLASS(PlasmaDualAttack) -REGISTER_WEAPON(PLASMA_DUAL, NEW(PlasmaDualAttack)); - -CLASS(DualPlasmaTurret, PlasmaTurret) -/* spawnflags */ ATTRIB(DualPlasmaTurret, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER); -/* mins */ ATTRIB(DualPlasmaTurret, mins, vector, '-32 -32 0'); -/* maxs */ ATTRIB(DualPlasmaTurret, maxs, vector, '32 32 64'); -/* modelname */ ATTRIB(DualPlasmaTurret, mdl, string, "base.md3"); -/* model */ ATTRIB(DualPlasmaTurret, model, string, strzone(strcat("models/turrets/", this.mdl))); -/* head_model */ ATTRIB(DualPlasmaTurret, head_model, string, strzone(strcat("models/turrets/", "plasmad.md3"))); -/* netname */ ATTRIB(DualPlasmaTurret, netname, string, "plasma_dual"); -/* fullname */ ATTRIB(DualPlasmaTurret, turret_name, string, _("Dual Plasma Cannon")); - ATTRIB(DualPlasmaTurret, m_weapon, Weapon, WEP_PLASMA_DUAL); -ENDCLASS(DualPlasmaTurret) -REGISTER_TURRET(PLASMA_DUAL, NEW(DualPlasmaTurret)); - -#endif - -#ifdef IMPLEMENTATION +#include "plasma_dual.qh" #ifdef SVQC -void spawnfunc_turret_plasma_dual() { SELFPARAM(); if (!turret_initialize(TUR_PLASMA_DUAL)) remove(self); } +spawnfunc(turret_plasma_dual) { if (!turret_initialize(this, TUR_PLASMA_DUAL)) delete(this); } -METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret this)) +METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret thistur, entity it)) { - if (g_instagib) { - FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000, - 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA); + if (MUTATOR_IS_ENABLED(mutator_instagib)) { + .entity weaponentity = weaponentities[0]; // TODO: unhardcode + FireRailgunBullet (it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * max_shot_distance, 10000000000, false, + 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id); - Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); + Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, it.tur_shotorg, it.tur_shotdir_updated * 1000, 1); // teamcolor / hit beam effect vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); - WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v); + Send_Effect(EFFECT_VAPORIZER(it.team), it.tur_shotorg, v, 1); } else { - super.vtblbase.tr_attack(this); + SUPER(PlasmaTurret).tr_attack(thistur, it); } - self.tur_head.frame += 1; + it.tur_head.frame += 1; } -METHOD(DualPlasmaTurret, tr_think, void(DualPlasmaTurret thistur)) +METHOD(DualPlasmaTurret, tr_think, void(DualPlasmaTurret thistur, entity it)) { - if ((self.tur_head.frame != 0) && (self.tur_head.frame != 3)) - self.tur_head.frame = self.tur_head.frame + 1; + if ((it.tur_head.frame != 0) && (it.tur_head.frame != 3)) + it.tur_head.frame = it.tur_head.frame + 1; - if (self.tur_head.frame > 6) - self.tur_head.frame = 0; + if (it.tur_head.frame > 6) + it.tur_head.frame = 0; } #endif -#endif