]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/electro_combo_over_time
authorMario <mario.mario@y7mail.com>
Mon, 27 Jul 2020 07:28:42 +0000 (17:28 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 27 Jul 2020 07:28:42 +0000 (17:28 +1000)
12 files changed:
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
effectinfo.txt
qcsrc/common/effects/all.inc
qcsrc/common/effects/effectinfo.inc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/electro.qh
qcsrc/server/g_damage.qc
testing.cfg

index 52dfc5f12ca507fcf15c621d2c24514468572dff..8bfabc37381affe93c9fc40f67355c3993baf1c6 100644 (file)
@@ -179,8 +179,11 @@ set g_balance_minelayer_weaponthrowable 1
 set g_balance_electro_combo_comboradius 300
 set g_balance_electro_combo_comboradius_thruwall 200
 set g_balance_electro_combo_damage 50
-set g_balance_electro_combo_edgedamage 25
-set g_balance_electro_combo_force 120
+set g_balance_electro_combo_damage_interval 0.05
+set g_balance_electro_combo_duration 1.5
+set g_balance_electro_combo_edgedamage 45
+set g_balance_electro_combo_force -100
+set g_balance_electro_combo_power 3
 set g_balance_electro_combo_radius 150
 set g_balance_electro_combo_safeammocheck 1
 set g_balance_electro_combo_speed 2000
index 7bc8de485d6c5943c0b4c965cd4406909a246f79..acdd6a2ac2b5880f69c36eb97ee2e8329b624ec3 100644 (file)
@@ -179,8 +179,11 @@ set g_balance_minelayer_weaponthrowable 1
 set g_balance_electro_combo_comboradius 0
 set g_balance_electro_combo_comboradius_thruwall 0
 set g_balance_electro_combo_damage 80
+set g_balance_electro_combo_damage_interval 0.05
+set g_balance_electro_combo_duration 0
 set g_balance_electro_combo_edgedamage 0
 set g_balance_electro_combo_force 200
+set g_balance_electro_combo_power 3
 set g_balance_electro_combo_radius 250
 set g_balance_electro_combo_safeammocheck 0
 set g_balance_electro_combo_speed 2000
index a89f480215ae56c7d4abf98be80d6a7302dd6b08..a2391e559a728f04a3e62f8b32234da5843b9e59 100644 (file)
@@ -179,8 +179,11 @@ set g_balance_minelayer_weaponthrowable 1
 set g_balance_electro_combo_comboradius 300
 set g_balance_electro_combo_comboradius_thruwall 200
 set g_balance_electro_combo_damage 50
+set g_balance_electro_combo_damage_interval 0.05
+set g_balance_electro_combo_duration 0
 set g_balance_electro_combo_edgedamage 25
 set g_balance_electro_combo_force 120
+set g_balance_electro_combo_power 3
 set g_balance_electro_combo_radius 150
 set g_balance_electro_combo_safeammocheck 1
 set g_balance_electro_combo_speed 2000
index 007a36cf56e217c29d8fa749dbcf166f8bcbe29c..f58233f3ea4429dea59486a670f4105a447421d0 100644 (file)
@@ -179,8 +179,11 @@ set g_balance_minelayer_weaponthrowable 1
 set g_balance_electro_combo_comboradius 275
 set g_balance_electro_combo_comboradius_thruwall 200
 set g_balance_electro_combo_damage 50
+set g_balance_electro_combo_damage_interval 0.05
+set g_balance_electro_combo_duration 0
 set g_balance_electro_combo_edgedamage 25
 set g_balance_electro_combo_force 120
+set g_balance_electro_combo_power 3
 set g_balance_electro_combo_radius 175
 set g_balance_electro_combo_safeammocheck 1
 set g_balance_electro_combo_speed 2000
index 2f7b598b739e6d4664c284c7468fc23d36f11e8a..19281a3cd269905290e6ed671dc0776b62e2a1b8 100644 (file)
@@ -179,8 +179,11 @@ set g_balance_minelayer_weaponthrowable 1
 set g_balance_electro_combo_comboradius 300
 set g_balance_electro_combo_comboradius_thruwall 200
 set g_balance_electro_combo_damage 50
+set g_balance_electro_combo_damage_interval 0.05
+set g_balance_electro_combo_duration 0
 set g_balance_electro_combo_edgedamage 25
 set g_balance_electro_combo_force 120
+set g_balance_electro_combo_power 3
 set g_balance_electro_combo_radius 150
 set g_balance_electro_combo_safeammocheck 1
 set g_balance_electro_combo_speed 2000
index 7fc732b7da5037d59c87a0762f85c71f6be3a813..4b488ff95df443b752feeee309ae33fc0ccabdd4 100644 (file)
@@ -8390,3 +8390,62 @@ effect respawn_ghost
        originoffset 0 0 -8
        originjitter 28 28 16
        velocityjitter 0 0 256
+effect electro_combo_long
+       type decal
+       alpha 256 256 0
+       countabsolute 1
+       lightcolor 4 5 6
+       lightradiusfade 300
+       lightradius 400
+       originjitter 17 17 17
+       size 64 64
+       tex 59 59
+effect electro_combo_long
+       type static
+       alpha 128 128 64
+       color 0x80C0FF 0x80C0FF
+       countabsolute 1
+       size 48 48
+       tex 38 38
+effect electro_combo_long
+       type static
+       airfriction 6
+       alpha 156 156 100
+       bounce 2
+       color 0x2030FF 0x80C0FF
+       count 5
+       liquidfriction 16
+       sizeincrease 50
+       size 32 32
+       tex 0 7
+       velocityjitter 512 512 512
+effect electro_combo_long
+       type spark
+       alpha 444 512 500
+       bounce 1.600000
+       color 0xa9cacf 0x0054ff
+       count 32
+       originjitter 1 1 1
+       size 2 4
+       stretchfactor 2
+       tex 41 41
+       velocityjitter 128 128 128
+       velocitymultiplier 0.300000
+       rotate -180 180 4000 -4000
+effect electro_combo_long
+       type smoke
+       alpha 256 256 256
+       color 0x202020 0x404040
+       count 0.125000
+       originjitter 20 20 20
+       size 24 24
+       tex 0 8
+       velocityjitter 32 32 32
+effect electro_combo_long
+       type smoke
+       alpha 40 40 20
+       color 0xa9cacf 0x0054ff
+       countabsolute 1
+       size 120 120
+       tex 33 33
+       velocitymultiplier 0.300000
index 019ae6139cd8ce909ad05c5dd832d776240ca918..3141cb62a69d795d633562f6504d3b07627fc89f 100644 (file)
@@ -40,6 +40,7 @@ EFFECT(0, GRENADE_MUZZLEFLASH,      "grenadelauncher_muzzleflash")
 
 EFFECT(0, ELECTRO_BALLEXPLODE,      "electro_ballexplode")
 EFFECT(0, ELECTRO_COMBO,            "electro_combo")
+EFFECT(0, ELECTRO_COMBO_LONG,       "electro_combo_long")
 EFFECT(0, ELECTRO_IMPACT,           "electro_impact")
 EFFECT(0, ELECTRO_MUZZLEFLASH,      "electro_muzzleflash")
 
index 090d2b111902b66247a52978b1c404598a5b4c1a..a58ad7d43a125a5af93bac92e8eeb67ff6e29e79 100644 (file)
@@ -9107,4 +9107,101 @@ SUB(respawn_ghost) {
        MY(velocityjitter) = '0 0 256';
 }
 
+DEF(electro_combo_long);
+// decal
+SUB(electro_combo_long) {
+       MY(alpha_min) = 256;
+       MY(alpha_max) = 256;
+       MY(countabsolute) = 1;
+       MY(lightcolor) = '4.0 5.0 6.0';
+       MY(lightradiusfade) = 300;
+       MY(lightradius) = 400;
+       MY(originjitter) = '17.0 17.0 17.0';
+       MY(size_min) = 64;
+       MY(size_max) = 64;
+       MY(tex_min) = 59;
+       MY(tex_max) = 59;
+       MY(type) = "decal";
+}
+// flare effect
+SUB(electro_combo_long) {
+       MY(alpha_min) = 128;
+       MY(alpha_max) = 128;
+       MY(alpha_fade) = 64;
+       MY(color_min) = "0x80C0FF";
+       MY(color_max) = "0x80C0FF";
+       MY(countabsolute) = 1;
+       MY(size_min) = 48;
+       MY(size_max) = 48;
+       MY(tex_min) = 38;
+       MY(tex_max) = 38;
+       MY(type) = "static";
+}
+// large sparks
+SUB(electro_combo_long) {
+       MY(airfriction) = 6;
+       MY(alpha_min) = 156;
+       MY(alpha_max) = 156;
+       MY(alpha_fade) = 156;
+       MY(bounce) = 2;
+       MY(color_min) = "0x2030FF";
+       MY(color_max) = "0x80C0FF";
+       MY(count) = 5;
+       MY(liquidfriction) = 16;
+       MY(sizeincrease) = 50;
+       MY(size_min) = 32;
+       MY(size_max) = 32;
+       MY(tex_max) = 7;
+       MY(type) = "static";
+       MY(velocityjitter) = '512.0 512.0 512.0';
+}
+SUB(electro_combo_long) {
+       MY(alpha_min) = 444;
+       MY(alpha_max) = 512;
+       MY(alpha_fade) = 500;
+       MY(bounce) = 1.600000;
+       MY(color_min) = "0xa9cacf";
+       MY(color_max) = "0x0054ff";
+       MY(count) = 32;
+       MY(originjitter) = '1.0 1.0 1.0';
+       MY(size_min) = 2;
+       MY(size_max) = 4;
+       MY(stretchfactor) = 2;
+       MY(tex_min) = 41;
+       MY(tex_max) = 41;
+       MY(type) = "spark";
+       MY(velocityjitter) = '128.0 128.0 128.0';
+       MY(velocitymultiplier) = 0.300000;
+}
+// inner cloud of smoke
+SUB(electro_combo_long) {
+       MY(alpha_min) = 256;
+       MY(alpha_max) = 256;
+       MY(alpha_fade) = 256;
+       MY(color_min) = "0x202020";
+       MY(color_max) = "0x404040";
+       MY(count) = 0.125000;
+       MY(originjitter) = '20.0 20.0 20.0';
+       MY(size_min) = 24;
+       MY(size_max) = 24;
+       MY(tex_max) = 8;
+       MY(type) = "smoke";
+       MY(velocityjitter) = '32.0 32.0 32.0';
+}
+// shockwave
+SUB(electro_combo_long) {
+       MY(alpha_min) = 40;
+       MY(alpha_max) = 40;
+       MY(alpha_fade) = 20;
+       MY(color_min) = "0xa9cacf";
+       MY(color_max) = "0x0054ff";
+       MY(countabsolute) = 1;
+       MY(size_min) = 120;
+       MY(size_max) = 120;
+       MY(tex_min) = 33;
+       MY(tex_max) = 33;
+       MY(type) = "smoke";
+       MY(velocitymultiplier) = 0.300000;
+}
+
 // always add new effects to the bottom of the list. And keep this comment in the bottom line of this file!
index 10005f22e541eb41f8e472ad9ca307fe1e0cecc7..e650138289aea9b3eee2364cf897d45db62fc37e 100644 (file)
@@ -49,12 +49,51 @@ void W_Electro_TriggerCombo(vector org, float rad, entity own)
        }
 }
 
+void W_Electro_ExplodeComboThink(entity this)
+{
+       float dt = time - this.teleport_time + this.dmg_interval;
+       float dmg_remaining_next = (bound(0, 1 - dt / this.dmg_duration, 1) ** this.dmg_power);
+
+       float f = this.dmg_last - dmg_remaining_next;
+       this.dmg_last = dmg_remaining_next;
+
+       RadiusDamage(this, this.realowner, this.dmg * f, this.dmg_edge * f, this.dmg_radius, NULL, NULL, this.dmg_force * f, this.projectiledeathtype, this.weaponentity_fld, NULL);
+       this.projectiledeathtype |= HITTYPE_BOUNCE; // ensure it doesn't spam its effect
+
+       if(dt < this.dmg_duration)
+               this.nextthink = time + this.dmg_interval; // soon
+       else
+               delete(this);
+}
+
 void W_Electro_ExplodeCombo(entity this)
 {
        W_Electro_TriggerCombo(this.origin, WEP_CVAR(electro, combo_comboradius), this.realowner);
 
        this.event_damage = func_null;
 
+       if(WEP_CVAR(electro, combo_duration))
+       {
+               this.projectiledeathtype = WEP_ELECTRO.m_id | HITTYPE_SPLASH;
+               this.event_damage = func_null;
+               settouch(this, func_null);
+               this.effects |= EF_NODRAW;
+
+               setthink(this, W_Electro_ExplodeComboThink);
+               this.nextthink = time;
+               this.dmg = WEP_CVAR(electro, combo_damage);
+               this.dmg_edge = WEP_CVAR(electro, combo_edgedamage);
+               this.dmg_radius = WEP_CVAR(electro, combo_radius);
+               this.dmg_force = WEP_CVAR(electro, combo_force);
+               this.dmg_power = WEP_CVAR(electro, combo_power);
+               this.dmg_duration = WEP_CVAR(electro, combo_duration);
+               this.dmg_interval = WEP_CVAR(electro, combo_damage_interval);
+               this.teleport_time = time;
+               this.dmg_last = 1;
+               set_movetype(this, MOVETYPE_NONE);
+               return;
+       }
+
        RadiusDamage(
                this,
                this.realowner,
@@ -570,7 +609,17 @@ METHOD(Electro, wr_impacteffect, void(entity thiswep, entity actor))
     }
     else
     {
-        if(w_deathtype & HITTYPE_BOUNCE)
+       if(w_deathtype & HITTYPE_SPLASH)
+       {
+               org2 = w_org + w_backoff * 2;
+               if(particleeffectnum(EFFECT_ELECTRO_COMBO_LONG) >= 0)
+               pointparticles(EFFECT_ELECTRO_COMBO_LONG, org2, '0 0 0', 1);
+               else
+               pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1);
+            if(!w_issilent)
+                sound(actor, CH_SHOTS, SND_ELECTRO_IMPACT_COMBO, VOL_BASE, ATTEN_NORM);
+       }
+        else if(w_deathtype & HITTYPE_BOUNCE)
         {
             // this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls
             pointparticles(EFFECT_ELECTRO_COMBO, org2, '0 0 0', 1);
index 9583bc9f262624adf61e9a7ec71f3b0760d6ce8b..c9298acaa6e8e4bdfe073ea240a8a332a548030a 100644 (file)
@@ -4,7 +4,7 @@ CLASS(Electro, Weapon)
 /* spawnfunc */ ATTRIB(Electro, m_canonical_spawnfunc, string, "weapon_electro");
 /* ammotype  */ ATTRIB(Electro, ammo_type, int, RES_CELLS);
 /* impulse   */ ATTRIB(Electro, impulse, int, 5);
-/* flags     */ ATTRIB(Electro, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
+/* flags     */ ATTRIB(Electro, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
 /* rating    */ ATTRIB(Electro, bot_pickupbasevalue, float, 5000);
 /* color     */ ATTRIB(Electro, wpcolor, vector, '0 0.5 1');
 /* modelname */ ATTRIB(Electro, mdl, string, "electro");
@@ -29,9 +29,12 @@ CLASS(Electro, Weapon)
                P(class, prefix, combo_comboradius, float, NONE) \
                P(class, prefix, combo_comboradius_thruwall, float, NONE) \
                P(class, prefix, combo_damage, float, NONE) \
+               P(class, prefix, combo_damage_interval, float, NONE) \
+               P(class, prefix, combo_duration, float, NONE) \
                P(class, prefix, combo_edgedamage, float, NONE) \
                P(class, prefix, combo_force, float, NONE) \
                P(class, prefix, combo_radius, float, NONE) \
+               P(class, prefix, combo_power, float, NONE) \
                P(class, prefix, combo_safeammocheck, float, NONE) \
                P(class, prefix, combo_speed, float, NONE) \
                P(class, prefix, count, float, SEC) \
@@ -76,6 +79,15 @@ REGISTER_WEAPON(ELECTRO, electro, NEW(Electro));
 SPAWNFUNC_WEAPON(weapon_electro, WEP_ELECTRO)
 
 #ifdef SVQC
+.float dmg;
+.float dmg_edge;
+.float dmg_radius;
+.float dmg_force;
+.float dmg_power;
+.float dmg_duration;
+.float dmg_last;
+.float dmg_interval;
+
 .float electro_count;
 .float electro_secondarytime;
 void W_Electro_ExplodeCombo(entity this);
index 626b3e5ac9deb549962da400657d4d0044659fca..22a45f23532f2b8005d9466438a68cab2a92ab6e 100644 (file)
@@ -910,7 +910,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
 
        total_damage_to_creatures = 0;
 
-       if(deathtype != (WEP_HOOK.m_id | HITTYPE_SECONDARY | HITTYPE_BOUNCE)) // only send gravity bomb damage once
+       if(deathtype != (WEP_HOOK.m_id | HITTYPE_SECONDARY | HITTYPE_BOUNCE) && deathtype != (WEP_ELECTRO.m_id | HITTYPE_BOUNCE | HITTYPE_SPLASH)) // only send damage over time bombs once
                if(!(deathtype & HITTYPE_SOUND)) // do not send radial sound damage (bandwidth hog)
                {
                        force = inflictorvelocity;
index f000a084aacbe22fa29ceee679c29ee679947323..f64bff94b9116eb179856cd34d4a0c5df8dfe56f 100644 (file)
@@ -11,5 +11,7 @@ alias test_rocket_flying "settemp g_balance_devastator_remote_jump 1"
 alias test_ctf_stalemate90 "settemp g_ctf_stalemate_time 90"
 alias test_ctf_stalemate120 "settemp g_ctf_stalemate_time 120"
 
-alias testing_enable "addvote test_blaster_switch ; addvote test_crylink_sec_horizontal ; addvote test_rocket_flying ; addvote test_ctf_stalemate90 ; addvote test_ctf_stalemate120"
-alias testing_disable "delvote test_blaster_switch ; delvote test_crylink_sec_horizontal ; delvote test_rocket_flying ; delvote test_ctf_stalemate90 ; delvote test_ctf_stalemate120"
+alias test_electro_combo_over_time "settemp g_balance_electro_combo_damage_interval 0.05 ; settemp g_balance_electro_combo_duration 1.5 ; settemp g_balance_electro_combo_power 3"
+
+alias testing_enable "addvote test_blaster_switch ; addvote test_crylink_sec_horizontal ; addvote test_rocket_flying ; addvote test_ctf_stalemate90 ; addvote test_ctf_stalemate120 ; addvote test_electro_combo_over_time"
+alias testing_disable "delvote test_blaster_switch ; delvote test_crylink_sec_horizontal ; delvote test_rocket_flying ; delvote test_ctf_stalemate90 ; delvote test_ctf_stalemate120 ; delvote test_electro_combo_over_time"