From c349535153880b168372d5c2abb5548e986e598c Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Sat, 9 Mar 2019 01:09:44 +0200 Subject: [PATCH] Get damage effects working again --- effectinfo.txt | 82 ++++++++++---- qcsrc/common/effects/effectinfo.inc | 129 +++++++++++++++++------ qcsrc/common/effects/qc/damageeffects.qc | 15 ++- 3 files changed, 165 insertions(+), 61 deletions(-) diff --git a/effectinfo.txt b/effectinfo.txt index c07774a05..129dba36e 100644 --- a/effectinfo.txt +++ b/effectinfo.txt @@ -5632,7 +5632,7 @@ effect tr_hagar trailspacing 16 underwater velocityjitter 16 16 16 -effect damage_laser +effect damage_blaster type smoke airfriction -0.350000 alpha 128 16 128 @@ -5667,7 +5667,7 @@ effect damage_shotgun originjitter 1 1 1 size 8 16 tex 0 8 -effect damage_shotgun_alien +effect alien_damage_shotgun type blood airfriction 1 alpha 256 256 64 @@ -5681,7 +5681,7 @@ effect damage_shotgun_alien tex 24 32 velocityjitter 64 64 64 velocitymultiplier 5 -effect damage_shotgun_alien +effect alien_damage_shotgun type alphastatic alpha 100 256 400 color 0x000000 0x204010 @@ -5689,7 +5689,7 @@ effect damage_shotgun_alien originjitter 1 1 1 size 8 16 tex 0 8 -effect damage_shotgun_robot +effect robot_damage_shotgun type blood airfriction 1 alpha 256 256 64 @@ -5703,7 +5703,7 @@ effect damage_shotgun_robot tex 24 32 velocityjitter 64 64 64 velocitymultiplier 5 -effect damage_shotgun_robot +effect robot_damage_shotgun type alphastatic alpha 100 256 400 color 0x000000 0x301860 @@ -5711,7 +5711,7 @@ effect damage_shotgun_robot originjitter 1 1 1 size 8 16 tex 0 8 -effect damage_uzi +effect damage_machinegun type blood airfriction 1 alpha 256 256 64 @@ -5725,14 +5725,14 @@ effect damage_uzi tex 24 32 velocityjitter 32 32 32 velocitymultiplier 5 -effect damage_uzi +effect damage_machinegun type alphastatic alpha 100 256 400 color 0x000000 0x420000 count 1 size 6 12 tex 0 8 -effect damage_uzi_alien +effect alien_damage_machinegun type blood airfriction 1 alpha 256 256 64 @@ -5746,14 +5746,14 @@ effect damage_uzi_alien tex 24 32 velocityjitter 32 32 32 velocitymultiplier 5 -effect damage_uzi_alien +effect alien_damage_machinegun type alphastatic alpha 100 256 400 color 0x000000 0x204010 count 1 size 6 12 tex 0 8 -effect damage_uzi_robot +effect robot_damage_machinegun type blood airfriction 1 alpha 256 256 64 @@ -5767,7 +5767,7 @@ effect damage_uzi_robot tex 24 32 velocityjitter 32 32 32 velocitymultiplier 5 -effect damage_uzi_robot +effect robot_damage_machinegun type alphastatic alpha 100 256 400 color 0x000000 0x301860 @@ -5798,7 +5798,7 @@ effect damage_minelayer size 4 8 tex 0 8 velocityjitter 11 11 50 -effect damage_grenadelauncher +effect damage_mortar type smoke alpha 512 64 1024 color 0x8f0d00 0xff5a00 @@ -5810,7 +5810,7 @@ effect damage_grenadelauncher size 4 8 tex 48 55 velocityjitter 22 22 50 -effect damage_grenadelauncher +effect damage_mortar type alphastatic alpha 128 32 128 color 0x000000 0x111111 @@ -5822,6 +5822,46 @@ effect damage_grenadelauncher size 4 8 tex 0 8 velocityjitter 11 11 50 +effect damage_arc + type static + airfriction -0.650000 + alpha 48 8 48 + color 0x66ffff 0x2288ff + count 2 + gravity -0.000100 + liquidfriction 0.600000 + notunderwater + originjitter 2 2 2 + rotate 180 360 -30 30 + sizeincrease -14 + size 4 8 + tex 47 47 + velocityjitter 6 6 12 +effect damage_arc + type smoke + airfriction -0.500000 + alpha 64 16 64 + color 0x2244ff 0x002266 + count 4 + notunderwater + originjitter 3 3 3 + rotate 0 180 -30 30 + sizeincrease 10 + size 3 6 + tex 0 8 + velocityjitter 0.3 0.3 0.5 +effect damage_arc + type spark + airfriction 1 + alpha 768 64 256 + bounce 1.500000 + color 0x003090 0x00CCFF + count 0.500000 + gravity 0.150000 + liquidfriction 0.600000 + size 1 1 + tex 66 68 + velocityjitter 24 24 24 effect damage_electro type static airfriction -0.500000 @@ -5914,7 +5954,7 @@ effect damage_hlac size 2 4 tex 0 8 velocityjitter 0.4 0.4 0.6 -effect damage_nex +effect damage_vortex type static airfriction -0.500000 alpha 64 8 64 @@ -5928,7 +5968,7 @@ effect damage_nex size 5 10 tex 47 47 velocityjitter 8 8 16 -effect damage_nex +effect damage_vortex type smoke airfriction -0.350000 alpha 64 16 64 @@ -5940,7 +5980,7 @@ effect damage_nex size 4 8 tex 0 8 velocityjitter 0.5 0.5 0.8 -effect damage_nex +effect damage_vortex type spark airfriction 2 alpha 255 255 112 @@ -5953,7 +5993,7 @@ effect damage_nex tex 41 41 velocityjitter 100 100 300 velocitymultiplier 3 -effect damage_minstanex +effect damage_vaporizer type static airfriction -0.500000 alpha 64 8 64 @@ -5967,7 +6007,7 @@ effect damage_minstanex size 5 10 tex 47 47 velocityjitter 8 8 16 -effect damage_minstanex +effect damage_vaporizer type smoke airfriction -0.350000 alpha 64 16 64 @@ -5979,7 +6019,7 @@ effect damage_minstanex size 4 8 tex 0 8 velocityjitter 0.5 0.5 0.8 -effect damage_minstanex +effect damage_vaporizer type spark airfriction 2 alpha 255 255 112 @@ -6127,7 +6167,7 @@ effect damage_fireball size 4 8 tex 0 8 velocityjitter 11 11 50 -effect damage_rocketlauncher +effect damage_devastator type smoke alpha 512 64 1024 color 0x8f0c00 0xff2a00 @@ -6139,7 +6179,7 @@ effect damage_rocketlauncher size 5 10 tex 48 55 velocityjitter 22 22 30 -effect damage_rocketlauncher +effect damage_devastator type alphastatic alpha 128 32 128 color 0x000000 0x111111 diff --git a/qcsrc/common/effects/effectinfo.inc b/qcsrc/common/effects/effectinfo.inc index d3c184fab..d45bdf36d 100644 --- a/qcsrc/common/effects/effectinfo.inc +++ b/qcsrc/common/effects/effectinfo.inc @@ -7150,8 +7150,8 @@ SUB(tr_hagar) { } // laser damage effect -DEF(damage_laser); -SUB(damage_laser) { +DEF(damage_blaster); +SUB(damage_blaster) { MY(airfriction) = -0.350000; MY(alpha_min) = 128; MY(alpha_max) = 16; @@ -7212,8 +7212,8 @@ SUB(damage_shotgun) { } // shotgun damage effect, alien blood -DEF(damage_shotgun_alien); -SUB(damage_shotgun_alien) { +DEF(alien_damage_shotgun); +SUB(alien_damage_shotgun) { MY(airfriction) = 1; MY(alpha_min) = 256; MY(alpha_max) = 256; @@ -7236,7 +7236,7 @@ SUB(damage_shotgun_alien) { MY(velocitymultiplier) = 5; } // blood mist -SUB(damage_shotgun_alien) { +SUB(alien_damage_shotgun) { MY(alpha_min) = 100; MY(alpha_max) = 256; MY(alpha_fade) = 400; @@ -7251,8 +7251,8 @@ SUB(damage_shotgun_alien) { } // shotgun damage effect, robot blood -DEF(damage_shotgun_robot); -SUB(damage_shotgun_robot) { +DEF(robot_damage_shotgun); +SUB(robot_damage_shotgun) { MY(airfriction) = 1; MY(alpha_min) = 256; MY(alpha_max) = 256; @@ -7275,7 +7275,7 @@ SUB(damage_shotgun_robot) { MY(velocitymultiplier) = 5; } // blood mist -SUB(damage_shotgun_robot) { +SUB(robot_damage_shotgun) { MY(alpha_min) = 100; MY(alpha_max) = 256; MY(alpha_fade) = 400; @@ -7290,8 +7290,8 @@ SUB(damage_shotgun_robot) { } // machinegun damage effect, normal blood -DEF(damage_uzi); -SUB(damage_uzi) { +DEF(damage_machinegun); +SUB(damage_machinegun) { MY(airfriction) = 1; MY(alpha_min) = 256; MY(alpha_max) = 256; @@ -7314,7 +7314,7 @@ SUB(damage_uzi) { MY(velocitymultiplier) = 5; } // blood mist -SUB(damage_uzi) { +SUB(damage_machinegun) { MY(alpha_min) = 100; MY(alpha_max) = 256; MY(alpha_fade) = 400; @@ -7328,8 +7328,8 @@ SUB(damage_uzi) { } // machinegun damage effect, alien blood -DEF(damage_uzi_alien); -SUB(damage_uzi_alien) { +DEF(alien_damage_machinegun); +SUB(alien_damage_machinegun) { MY(airfriction) = 1; MY(alpha_min) = 256; MY(alpha_max) = 256; @@ -7352,7 +7352,7 @@ SUB(damage_uzi_alien) { MY(velocitymultiplier) = 5; } // blood mist -SUB(damage_uzi_alien) { +SUB(alien_damage_machinegun) { MY(alpha_min) = 100; MY(alpha_max) = 256; MY(alpha_fade) = 400; @@ -7366,8 +7366,8 @@ SUB(damage_uzi_alien) { } // machinegun damage effect, robot blood -DEF(damage_uzi_robot); -SUB(damage_uzi_robot) { +DEF(robot_damage_machinegun); +SUB(robot_damage_machinegun) { MY(airfriction) = 1; MY(alpha_min) = 256; MY(alpha_max) = 256; @@ -7390,7 +7390,7 @@ SUB(damage_uzi_robot) { MY(velocitymultiplier) = 5; } // blood mist -SUB(damage_uzi_robot) { +SUB(robot_damage_machinegun) { MY(alpha_min) = 100; MY(alpha_max) = 256; MY(alpha_fade) = 400; @@ -7443,8 +7443,8 @@ SUB(damage_minelayer) { } // mortar damage effect -DEF(damage_grenadelauncher); -SUB(damage_grenadelauncher) { +DEF(damage_mortar); +SUB(damage_mortar) { MY(alpha_min) = 512; MY(alpha_max) = 64; MY(alpha_fade) = 1024; @@ -7463,7 +7463,7 @@ SUB(damage_grenadelauncher) { MY(velocityjitter) = '22.0 22.0 50.0'; } // smoke -SUB(damage_grenadelauncher) { +SUB(damage_mortar) { MY(alpha_min) = 128; MY(alpha_max) = 32; MY(alpha_fade) = 128; @@ -7481,6 +7481,73 @@ SUB(damage_grenadelauncher) { MY(velocityjitter) = '11.0 11.0 50.0'; } +// arc damage effect +DEF(damage_arc); +SUB(damage_arc) { + MY(airfriction) = -0.650000; + MY(alpha_min) = 48; + MY(alpha_max) = 8; + MY(alpha_fade) = 48; + MY(color_min) = "0x66ffff"; + MY(color_max) = "0x2288ff"; + MY(count) = 2; + MY(gravity) = -0.000100; + MY(liquidfriction) = 0.600000; + MY(notunderwater) = true; + MY(originjitter) = '2.0 2.0 2.0'; + MY(startangle_min) = 180; + MY(startangle_max) = 360; + MY(spin_min) = -30; + MY(spin_max) = 30; + MY(sizeincrease) = -14; + MY(size_min) = 4; + MY(size_max) = 8; + MY(tex_min) = 47; + MY(tex_max) = 47; + MY(type) = "static"; + MY(velocityjitter) = '6.0 6.0 12.0'; +} +// plasma smoke +SUB(damage_arc) { + MY(airfriction) = -0.500000; + MY(alpha_min) = 64; + MY(alpha_max) = 16; + MY(alpha_fade) = 64; + MY(color_min) = "0x2244ff"; + MY(color_max) = "0x002266"; + MY(count) = 4; + MY(notunderwater) = true; + MY(originjitter) = '3.0 3.0 3.0'; + MY(startangle_max) = 180; + MY(spin_min) = -30; + MY(spin_max) = 30; + MY(sizeincrease) = 10; + MY(size_min) = 3; + MY(size_max) = 6; + MY(tex_max) = 8; + MY(type) = "smoke"; + MY(velocityjitter) = '0.3 0.3 0.5'; +} +// bouncing sparks +SUB(damage_arc) { + MY(airfriction) = 1; + MY(alpha_min) = 768; + MY(alpha_max) = 64; + MY(alpha_fade) = 256; + MY(bounce) = 1.500000; + MY(color_min) = "0x003090"; + MY(color_max) = "0x00CCFF"; + MY(count) = 0.500000; + MY(gravity) = 0.150000; + MY(liquidfriction) = 0.600000; + MY(size_min) = 1; + MY(size_max) = 1; + MY(tex_min) = 66; + MY(tex_max) = 68; + MY(type) = "spark"; + MY(velocityjitter) = '24.0 24.0 24.0'; +} + // electro damage effect DEF(damage_electro); SUB(damage_electro) { @@ -7637,8 +7704,8 @@ SUB(damage_hlac) { } // vortex damage effect -DEF(damage_nex); -SUB(damage_nex) { +DEF(damage_vortex); +SUB(damage_vortex) { MY(airfriction) = -0.500000; MY(alpha_min) = 64; MY(alpha_max) = 8; @@ -7662,7 +7729,7 @@ SUB(damage_nex) { MY(velocityjitter) = '8.0 8.0 16.0'; } // plasma smoke -SUB(damage_nex) { +SUB(damage_vortex) { MY(airfriction) = -0.350000; MY(alpha_min) = 64; MY(alpha_max) = 16; @@ -7682,7 +7749,7 @@ SUB(damage_nex) { MY(velocityjitter) = '0.5 0.5 0.8'; } // bouncing sparks -SUB(damage_nex) { +SUB(damage_vortex) { MY(airfriction) = 2; MY(alpha_min) = 255; MY(alpha_max) = 255; @@ -7703,8 +7770,8 @@ SUB(damage_nex) { } // vaporizer damage effect -DEF(damage_minstanex); -SUB(damage_minstanex) { +DEF(damage_vaporizer); +SUB(damage_vaporizer) { MY(airfriction) = -0.500000; MY(alpha_min) = 64; MY(alpha_max) = 8; @@ -7728,7 +7795,7 @@ SUB(damage_minstanex) { MY(velocityjitter) = '8.0 8.0 16.0'; } // plasma smoke -SUB(damage_minstanex) { +SUB(damage_vaporizer) { MY(airfriction) = -0.350000; MY(alpha_min) = 64; MY(alpha_max) = 16; @@ -7748,7 +7815,7 @@ SUB(damage_minstanex) { MY(velocityjitter) = '0.5 0.5 0.8'; } // bouncing sparks -SUB(damage_minstanex) { +SUB(damage_vaporizer) { MY(airfriction) = 2; MY(alpha_min) = 255; MY(alpha_max) = 255; @@ -8000,8 +8067,8 @@ SUB(damage_fireball) { } // rocketlauncher damage effect -DEF(damage_rocketlauncher); -SUB(damage_rocketlauncher) { +DEF(damage_devastator); +SUB(damage_devastator) { MY(alpha_min) = 512; MY(alpha_max) = 64; MY(alpha_fade) = 1024; @@ -8020,7 +8087,7 @@ SUB(damage_rocketlauncher) { MY(velocityjitter) = '22.0 22.0 30.0'; } // smoke -SUB(damage_rocketlauncher) { +SUB(damage_devastator) { MY(alpha_min) = 128; MY(alpha_max) = 32; MY(alpha_fade) = 128; diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index 9090977da..cc487a552 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -82,8 +82,7 @@ void DamageEffect_Think(entity this) return; // if we aren't using a third person camera, hide our own effects // now generate the particles - vector org; - org = gettaginfo(this, 0); // origin at attached location + vector org = gettaginfo(this, 0); // origin at attached location __pointparticles(this.team, org, '0 0 0', 1); } @@ -108,7 +107,7 @@ void DamageEffect(entity this, vector hitorg, float thedamage, int type, int spe int nearestbone = 0; float life; - string specstr, effectname; + string effectname; entity e; if(!autocvar_cl_damageeffect || autocvar_cl_gentle || autocvar_cl_gentle_damage) @@ -149,15 +148,13 @@ void DamageEffect(entity this, vector hitorg, float thedamage, int type, int spe life = bound(autocvar_cl_damageeffect_lifetime_min, thedamage * autocvar_cl_damageeffect_lifetime, autocvar_cl_damageeffect_lifetime_max); - effectname = DEATH_WEAPONOF(type).netname; - - if(substring(effectname, strlen(effectname) - 5, 5) == "BLOOD") + effectname = strcat("damage_", DEATH_WEAPONOF(type).netname); + if(DEATH_WEAPONOF(type) == WEP_SHOTGUN || DEATH_WEAPONOF(type) == WEP_MACHINEGUN) { if((this.isplayermodel & ISPLAYER_MODEL)) { - specstr = species_prefix(specnum); - specstr = substring(specstr, 0, strlen(specstr) - 1); - effectname = strreplace("BLOOD", specstr, effectname); + string specstr = species_prefix(specnum); + effectname = strcat(specstr, effectname); } else { return; } // objects don't bleed } -- 2.39.2