X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fdamage.qc;h=cd338553adaec3830f4fb2489bc3524674339f10;hb=f3efebde7ada4e5ba2f2720f0318cb46b53d68da;hp=13c8e462e3d5d800cdafe161cca952e81bb246d2;hpb=5a682c6eb030594b9cc2cf652dd5ab98475095db;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 13c8e462e..cd338553a 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -57,7 +57,7 @@ void Ent_DamageInfo(float isNew) if(self.damageforcescale) if(vlen(thisforce)) { - self.move_velocity = self.move_velocity + self.damageforcescale * thisforce; + self.move_velocity = self.move_velocity + damage_explosion_calcpush(self.damageforcescale * thisforce, self.move_velocity, autocvar_g_balance_damagepush_speedfactor); self.move_flags &~= FL_ONGROUND; } @@ -69,9 +69,80 @@ void Ent_DamageInfo(float isNew) } self = oldself; - - // TODO spawn particle effects and sounds based on w_deathtype + if(DEATH_ISVEHICLE(w_deathtype)) + { + traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world); + if(trace_plane_normal != '0 0 0') + w_backoff = trace_plane_normal; + else + w_backoff = -1 * normalize(w_org - (w_org + normalize(force) * 16)); + + setorigin(self, w_org + w_backoff * 2); // for sound() calls + + switch(w_deathtype) + { + case DEATH_VHCRUSH: + break; + + case DEATH_SBMINIGUN: + string _snd; + _snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw"); + sound(self, CHAN_PROJECTILE, _snd, VOL_BASE, ATTN_NORM); + pointparticles(particleeffectnum("spiderbot_minigun_impact"), self.origin, w_backoff * 1000, 1); + break; + case DEATH_SBROCKET: + sound(self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM); + pointparticles(particleeffectnum("spiderbot_rocket_explode"), self.origin, w_backoff * 1000, 1); + break; + case DEATH_SBBLOWUP: + sound(self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN); + pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1); + break; + + case DEATH_WAKIGUN: + sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); + pointparticles(particleeffectnum("wakizashi_gun_impact"), self.origin, w_backoff * 1000, 1); + break; + case DEATH_WAKIROCKET: + sound(self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM); + pointparticles(particleeffectnum("wakizashi_rocket_explode"), self.origin, w_backoff * 1000, 1); + break; + case DEATH_WAKIBLOWUP: + sound(self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN); + pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1); + break; + + case DEATH_RAPTOR_CANNON: + sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); + pointparticles(particleeffectnum("raptor_cannon_impact"), self.origin, w_backoff * 1000, 1); + break; + case DEATH_RAPTOR_BOMB_SPLIT: + float i; + vector ang, vel; + for(i = 1; i < 4; ++i) + { + vel = normalize(w_org - (w_org + normalize(force) * 16)) + randomvec() * 128; + ang = vectoangles(vel); + RaptorCBShellfragToss(w_org, vel, ang + '0 0 1' * (120 * i)); + } + + + sound(self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM); + pointparticles(particleeffectnum("raptor_bomb_spread"), self.origin, w_backoff * 1000, 1); + break; + case DEATH_RAPTOR_BOMB: + sound(self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM); + pointparticles(particleeffectnum("raptor_bomb_impact"), self.origin, w_backoff * 1000, 1); + break; + case DEATH_RAPTOR_DEATH: + sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_MIN); + pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1); + break; + } + } + + // TODO spawn particle effects and sounds based on w_deathtype if(!DEATH_ISSPECIAL(w_deathtype)) { float hitwep;