From: Rudolf Polzer Date: Thu, 21 Mar 2013 16:24:53 +0000 (+0100) Subject: Turn plasma turret into instagib turret in minstagib mode (by Mario), fixes #1317 X-Git-Tag: xonotic-v0.7.0~79^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fa8819795f768832ba9cef107c3ae2be48b6af40;p=xonotic%2Fxonotic-data.pk3dir.git Turn plasma turret into instagib turret in minstagib mode (by Mario), fixes #1317 --- diff --git a/qcsrc/server/tturrets/units/unit_plasma.qc b/qcsrc/server/tturrets/units/unit_plasma.qc index aacca522e..f03911be9 100644 --- a/qcsrc/server/tturrets/units/unit_plasma.qc +++ b/qcsrc/server/tturrets/units/unit_plasma.qc @@ -25,6 +25,44 @@ void turret_plasma_dual_postthink() self.tur_head.frame = 0; } +void turret_plasma_minsta_attack (void) +{ + float flying; + flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last + + FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000, + 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA); + + + pointparticles(particleeffectnum("nex_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); + + // teamcolor / hit beam effect + vector v; + v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); + if(teamplay) + { + switch(self.team) + { + case COLOR_TEAM1: // Red + WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED"), self.tur_shotorg, v); + break; + case COLOR_TEAM2: // Blue + WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE"), self.tur_shotorg, v); + break; + case COLOR_TEAM3: // Yellow + WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW"), self.tur_shotorg, v); + break; + case COLOR_TEAM4: // Pink + WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK"), self.tur_shotorg, v); + break; + } + } + else + WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), self.tur_shotorg, v); + if (self.tur_head.frame == 0) + self.tur_head.frame = 1; +} + void turret_plasma_attack() { entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); @@ -64,7 +102,10 @@ void turret_plasma_std_init() self.firecheck_flags |= TFL_FIRECHECK_AFF; // Our fireing routine - self.turret_firefunc = turret_plasma_attack; + if(g_minstagib) + self.turret_firefunc = turret_plasma_minsta_attack; + else + self.turret_firefunc = turret_plasma_attack; // Custom per turret frame stuff. usualy animation. self.turret_postthink = turret_plasma_postthink;