X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Ftturrets%2Funits%2Funit_plasma.qc;h=f4a60e545a12163a9d14b894d8804106a5f63ead;hb=dd70edcca2f19a7b95b1f0441db75c154bf10606;hp=7867310329452f9f3fca928caa3cb760d7a25628;hpb=7ec398db61b56e3c74bf0dbef1f6740a81cc7ced;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/tturrets/units/unit_plasma.qc b/qcsrc/server/tturrets/units/unit_plasma.qc index 786731032..f4a60e545 100644 --- a/qcsrc/server/tturrets/units/unit_plasma.qc +++ b/qcsrc/server/tturrets/units/unit_plasma.qc @@ -5,7 +5,7 @@ void turret_plasma_std_init(); void turret_plasma_dual_init(); void turret_plasma_attack(); -void turret_plasma_projectile_explode(); + void turret_plasma_postthink() { @@ -25,78 +25,60 @@ void turret_plasma_dual_postthink() self.tur_head.frame = 0; } -void turret_plasma_attack() +void turret_plasma_minsta_attack (void) { - entity proj; + 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 NUM_TEAM_1: // Red + WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED"), self.tur_shotorg, v); + break; + case NUM_TEAM_2: // Blue + WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE"), self.tur_shotorg, v); + break; + case NUM_TEAM_3: // Yellow + WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW"), self.tur_shotorg, v); + break; + case NUM_TEAM_4: // 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; +} - sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM); +void turret_plasma_attack() +{ + entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); + missile.missile_flags = MIF_SPLASH; + pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); - - proj = spawn (); - setorigin(proj, self.tur_shotorg); - setsize(proj, '-1 -1 -1', '1 1 1'); - proj.classname = "plasmabomb"; - proj.owner = self; - proj.bot_dodge = TRUE; - proj.bot_dodgerating = self.shot_dmg; - proj.think = turret_plasma_projectile_explode; - proj.nextthink = time + 9; - proj.solid = SOLID_BBOX; - proj.movetype = MOVETYPE_FLYMISSILE; - proj.velocity = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed; - proj.touch = turret_plasma_projectile_explode; - proj.flags = FL_PROJECTILE; - proj.enemy = self.enemy; - proj.flags = FL_PROJECTILE | FL_NOTARGET; - - CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE); - if (self.tur_head.frame == 0) self.tur_head.frame = 1; } void turret_plasma_dual_attack() { - entity proj; - - sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM); - proj = spawn (); - setorigin(proj, self.tur_shotorg); - setsize(proj, '0 0 0', '0 0 0'); - proj.classname = "plasmabomb"; - proj.owner = self; - proj.bot_dodge = TRUE; - proj.bot_dodgerating = self.shot_dmg; - proj.think = turret_plasma_projectile_explode; - proj.nextthink = time + 9; - proj.solid = SOLID_BBOX; - proj.movetype = MOVETYPE_FLYMISSILE; - proj.velocity = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed; - proj.touch = turret_plasma_projectile_explode; - proj.flags = FL_PROJECTILE; - proj.enemy = self.enemy; - proj.flags = FL_PROJECTILE | FL_NOTARGET; - + entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); + missile.missile_flags = MIF_SPLASH; + pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); self.tur_head.frame += 1; - - CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE); -} - -void turret_plasma_projectile_explode() -{ - self.event_damage = SUB_Null; - //w_deathtypestring = "ate to much plasma"; -#ifdef TURRET_DEBUG - float d; - - d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_PLASMA, world); - self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg; - self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg; -#else - RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_PLASMA, world); -#endif - - remove (self); } void turret_plasma_std_init() @@ -107,8 +89,8 @@ void turret_plasma_std_init() self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE; // How to aim - self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUND2; - self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL; + self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUNDGROUND; + self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL; if (turret_stdproc_init("plasma_std", "models/turrets/base.md3", "models/turrets/plasma.md3", TID_PLASMA) == 0) { @@ -120,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; @@ -136,7 +121,7 @@ void turret_plasma_dual_init() self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE; // How to aim at targets - self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUND2 ; + self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUNDGROUND ; self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL; if (turret_stdproc_init("plasma_dual", "models/turrets/base.md3", "models/turrets/plasmad.md3", TID_PLASMA_DUAL) == 0)