X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Ftturrets%2Funits%2Funit_ewheel.qc;h=b98388984ce16a15e1d245f4c6d8bf84afac2400;hb=0f0e69c6625fc4db17559e2e47f2fdaed8298076;hp=4858cafc6ed549b950ba4498cfa439914898d896;hpb=22042893e4c8ce0f178043ace460c7831c3df4d2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/tturrets/units/unit_ewheel.qc b/qcsrc/server/tturrets/units/unit_ewheel.qc index 4858cafc6..b98388984 100644 --- a/qcsrc/server/tturrets/units/unit_ewheel.qc +++ b/qcsrc/server/tturrets/units/unit_ewheel.qc @@ -4,51 +4,19 @@ #define ewheel_amin_bck_slow 3 #define ewheel_amin_bck_fast 4 -void turret_ewheel_projectile_explode() -{ -#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_EWHEEL, world); - self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; - 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_EWHEEL, world); -#endif - - remove (self); -} - - void ewheel_attack() { - entity proj; float i; + entity _mis; for (i = 0; i < 1; ++i) { turret_do_updates(self); - sound (self, CH_WEAPON_A, "weapons/lasergun_fire.wav", VOL_BASE, ATTN_NORM); - pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); + _mis = turret_projectile("weapons/lasergun_fire.wav", 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_LASER, TRUE, TRUE); + _mis.missile_flags = MIF_SPLASH; - proj = spawn (); - setorigin(proj, self.tur_shotorg); - proj.classname = "ewheel bolt"; - proj.owner = self; - proj.bot_dodge = FALSE; - proj.bot_dodgerating = self.shot_dmg; - proj.think = turret_ewheel_projectile_explode; - proj.nextthink = time + 9; - //proj.solid = SOLID_TRIGGER; - proj.movetype = MOVETYPE_FLYMISSILE; - proj.velocity = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed; - proj.touch = turret_ewheel_projectile_explode; - proj.enemy = self.enemy; - proj.flags = FL_PROJECTILE | FL_NOTARGET; - PROJECTILE_MAKETRIGGER(proj); - - CSQCProjectile(proj, TRUE, PROJECTILE_LASER, TRUE); + pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); self.tur_head.frame += 2; @@ -87,7 +55,7 @@ void ewheel_move_path() self.pathcurrent = self.pathcurrent.path_next; #else - if (vlen(self.origin - self.pathcurrent.origin) < 64) + if (vlen(self.origin - self.pathcurrent.origin) < 64) self.pathcurrent = self.pathcurrent.enemy; #endif @@ -105,7 +73,7 @@ void ewheel_move_enemy() { float newframe; - + self.steerto = steerlib_arrive(self.enemy.origin,self.target_range_optimal); //self.steerto = steerlib_standoff(self.enemy.origin,self.target_range_optimal); @@ -141,13 +109,15 @@ void ewheel_move_enemy() newframe = ewheel_amin_stop; movelib_beak_simple(autocvar_g_turrets_unit_ewheel_speed_stop); } - - if(self.frame != newframe) + + turrets_setframe(newframe , FALSE); + + /*if(self.frame != newframe) { self.frame = newframe; self.SendFlags |= TNSF_ANIM; self.anim_start_time = time; - } + }*/ } @@ -194,7 +164,7 @@ void ewheel_postthink() self.velocity_z = vz; - + if(vlen(self.velocity)) self.SendFlags |= TNSF_MOVE; } @@ -206,7 +176,7 @@ void ewheel_respawnhook() // Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn. if(self.movetype != MOVETYPE_WALK) return; - + self.velocity = '0 0 0'; self.enemy = world; @@ -251,7 +221,7 @@ void turret_ewheel_dinit() { entity e; - if (self.netname == "") + if (self.netname == "") self.netname = "eWheel Turret"; if (self.target != "") @@ -281,21 +251,19 @@ void turret_ewheel_dinit() return; } + self.frame = 1; self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS; self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS; - - self.damage_flags |= TFL_DMG_DEATH_NOGIBS; - self.iscreature = TRUE; + self.teleportable = TELEPORT_NORMAL; self.damagedbycontents = TRUE; self.movetype = MOVETYPE_WALK; self.solid = SOLID_SLIDEBOX; self.takedamage = DAMAGE_AIM; + self.idle_aim = '0 0 0'; + self.pos1 = self.origin; setsize(self, '-32 -32 0', '32 32 48'); - self.idle_aim = '0 0 0'; - - self.pos1 = self.origin; // Our fire routine self.turret_firefunc = ewheel_attack;