X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Fturret%2Fplasma.qc;h=c4e50a7e71f058be20cd74201a619a5878e20777;hb=d2103fff45069a3eea862441558ddf536371e59d;hp=97f5c5659721767a2c08a9e54d2ef5eade95949a;hpb=74cebbb48d9481bb83eccb4438283f319352cb74;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/turret/plasma.qc b/qcsrc/common/turrets/turret/plasma.qc index 97f5c5659..c4e50a7e7 100644 --- a/qcsrc/common/turrets/turret/plasma.qc +++ b/qcsrc/common/turrets/turret/plasma.qc @@ -1,57 +1,37 @@ -#ifndef TURRET_PLASMA_H -#define TURRET_PLASMA_H - -#include "plasma_weapon.qh" - -CLASS(PlasmaTurret, Turret) -/* spawnflags */ ATTRIB(PlasmaTurret, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER); -/* mins */ ATTRIB(PlasmaTurret, mins, vector, '-32 -32 0'); -/* maxs */ ATTRIB(PlasmaTurret, maxs, vector, '32 32 64'); -/* modelname */ ATTRIB(PlasmaTurret, mdl, string, "base.md3"); -/* model */ ATTRIB_STRZONE(PlasmaTurret, model, string, strcat("models/turrets/", this.mdl)); -/* head_model */ ATTRIB_STRZONE(PlasmaTurret, head_model, string, strcat("models/turrets/", "plasma.md3")); -/* netname */ ATTRIB(PlasmaTurret, netname, string, "plasma"); -/* fullname */ ATTRIB(PlasmaTurret, turret_name, string, _("Plasma Cannon")); - ATTRIB(PlasmaTurret, m_weapon, Weapon, WEP_PLASMA); -ENDCLASS(PlasmaTurret) -REGISTER_TURRET(PLASMA, NEW(PlasmaTurret)); - -#endif - -#ifdef IMPLEMENTATION +#include "plasma.qh" #ifdef SVQC -spawnfunc(turret_plasma) { if (!turret_initialize(TUR_PLASMA)) remove(this); } +spawnfunc(turret_plasma) { if (!turret_initialize(this, TUR_PLASMA)) delete(this); } METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this, entity it)) { - if(g_instagib) + if(autocvar_g_instagib) { - FireRailgunBullet (self, self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000, + .entity weaponentity = weaponentities[0]; // TODO: unhardcode + FireRailgunBullet (it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * max_shot_distance, 10000000000, 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); + WarpZone_TrailParticles(NULL, particleeffectnum(EFFECT_VAPORIZER(it.team)), it.tur_shotorg, v); } else { SUPER(PlasmaTurret).tr_attack(this, it); } - if (self.tur_head.frame == 0) - self.tur_head.frame = 1; + if (it.tur_head.frame == 0) + it.tur_head.frame = 1; } METHOD(PlasmaTurret, tr_think, void(PlasmaTurret thistur, entity it)) { - SELFPARAM(); - if (self.tur_head.frame != 0) - self.tur_head.frame = self.tur_head.frame + 1; + if (it.tur_head.frame != 0) + it.tur_head.frame = it.tur_head.frame + 1; - if (self.tur_head.frame > 5) - self.tur_head.frame = 0; + if (it.tur_head.frame > 5) + it.tur_head.frame = 0; } METHOD(PlasmaTurret, tr_setup, void(PlasmaTurret this, entity it)) { @@ -64,4 +44,3 @@ METHOD(PlasmaTurret, tr_setup, void(PlasmaTurret this, entity it)) } #endif -#endif