]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Return back Resistance buff set in the last skin order
authorLegendaryGuard <rootuser999@gmail.com>
Mon, 28 Nov 2022 11:09:40 +0000 (12:09 +0100)
committerLegendaryGuard <rootuser999@gmail.com>
Mon, 28 Nov 2022 11:09:40 +0000 (12:09 +0100)
gfx/hud/default/buff_resistance.tga [new file with mode: 0644]
gfx/hud/luma/buff_resistance.tga [new file with mode: 0644]
models/relics/relic.md3_11.skin
models/relics/sign_resistance.tga [new file with mode: 0644]
models/relics/sign_resistance_glow.tga [new file with mode: 0644]
mutators.cfg
qcsrc/common/effects/effectinfo_buffs.inc
qcsrc/common/mutators/mutator/buffs/all.inc
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/mutators/mutator/buffs/sv_buffs.qh
scripts/relics.shader

diff --git a/gfx/hud/default/buff_resistance.tga b/gfx/hud/default/buff_resistance.tga
new file mode 100644 (file)
index 0000000..d7e2524
Binary files /dev/null and b/gfx/hud/default/buff_resistance.tga differ
diff --git a/gfx/hud/luma/buff_resistance.tga b/gfx/hud/luma/buff_resistance.tga
new file mode 100644 (file)
index 0000000..046c22a
Binary files /dev/null and b/gfx/hud/luma/buff_resistance.tga differ
index cfcb99896d9f6ecbf30e676b431798d14eef6891..f4d914fa281ec0bd0633a66d791a89076b1e382f 100644 (file)
@@ -1,3 +1,3 @@
 ring,models/relics/relic_ring
 mesh,models/relics/relic
-sign,textures/common/nodraw
\ No newline at end of file
+sign,models/relics/sign_resistance
\ No newline at end of file
diff --git a/models/relics/sign_resistance.tga b/models/relics/sign_resistance.tga
new file mode 100644 (file)
index 0000000..56a1163
Binary files /dev/null and b/models/relics/sign_resistance.tga differ
diff --git a/models/relics/sign_resistance_glow.tga b/models/relics/sign_resistance_glow.tga
new file mode 100644 (file)
index 0000000..0e22a43
Binary files /dev/null and b/models/relics/sign_resistance_glow.tga differ
index d9a1166fce9c4306871268a62f46f029281a1872..443c666dd08b19de668e84990735d0e0f137c59c 100644 (file)
@@ -322,6 +322,9 @@ set g_buffs_cooldown_activate 5 "cooldown period when buff is first activated"
 set g_buffs_cooldown_respawn 3 "cooldown period when buff is reloading"
 set g_buffs_ammo 1 "ammo buff: infinite ammunition"
 set g_buffs_ammo_time 60 "ammo buff carry time"
+set g_buffs_resistance 1 "resistance buff: greatly reduces damage taken"
+set g_buffs_resistance_time 60 "resistance buff time"
+set g_buffs_resistance_blockpercent 0.5 "damage reduction multiplier, higher values mean less damage"
 set g_buffs_medic 1 "medic buff: increased regeneration speed, extra health, chance to survive a fatal attack"
 set g_buffs_medic_time 60 "medic buff carry time"
 set g_buffs_medic_survive_chance 0.6 "multiplier chance of player surviving a fatal hit"
index 94c177d02c875ab2cb4886783656b43d2fbe8a11..1fe2d8e624a304ec9556444757df75714d2e07a8 100644 (file)
@@ -285,3 +285,21 @@ SUB(relic_vengeance) {
     MY(type) = "static";
     MY(velocityjitter) = '64.0 64.0 32.0';
 }
+
+DEF(relic_resistance);
+SUB(relic_resistance) {
+    MY(airfriction) = 0.200000;
+    MY(alpha_min) = 128;
+    MY(alpha_max) = 256;
+    MY(alpha_fade) = 256;
+    MY(color_min) = "0x00ff80";
+    MY(color_max) = "0x00ff80";
+    MY(count) = 20;
+    MY(gravity) = -0.100000;
+    MY(liquidfriction) = 0.800000;
+    MY(originjitter) = '8.0 8.0 32.0';
+    MY(size_min) = 1.500000;
+    MY(size_max) = 1.500000;
+    MY(type) = "static";
+    MY(velocityjitter) = '64.0 64.0 32.0';
+}
index 0930498f8f81a941a256804667ddb164bf9baaef..659531a3c42e4a8acc290b80f827ca7d57142eaf 100644 (file)
@@ -4,6 +4,7 @@ string Buff_UndeprecateName(string buffname)
     {
         case "ammoregen": return "ammo";               // Q3TA ammoregen
         case "doubler": return "inferno";              // Q3TA doubler
+        case "guard": return "resistance";             // Q3TA guard
         case "revival": case "regen": return "medic";  // WOP revival, Q3A regen
         case "jumper": return "jump";                  // WOP jumper
         case "invulnerability": return "vampire";      // Q3TA invulnerability
@@ -146,3 +147,14 @@ ENDCLASS(FlightBuff)
 REGISTER_BUFF(FLIGHT, NEW(FlightBuff));
 BUFF_SPAWNFUNCS(flight, BUFF_FLIGHT)
 BUFF_SPAWNFUNC_Q3COMPAT(item_flight, BUFF_FLIGHT)
+
+CLASS(ResistanceBuff, Buff)
+    ATTRIB(ResistanceBuff, m_name, string, _("Resistance"));
+    ATTRIB(ResistanceBuff, netname, string, "resistance");
+    ATTRIB(ResistanceBuff, m_icon, string, "buff_resistance");
+    ATTRIB(ResistanceBuff, m_skin, int, 11);
+    ATTRIB(ResistanceBuff, m_color, vector, '0.36 1 0.07');
+ENDCLASS(ResistanceBuff)
+REGISTER_BUFF(RESISTANCE, NEW(ResistanceBuff));
+BUFF_SPAWNFUNCS(resistance, BUFF_RESISTANCE)
+BUFF_SPAWNFUNC_Q3COMPAT(item_guard, BUFF_RESISTANCE)
index 5bda4520366562910c87757c1221b5bab5bd62ea..fa97b421b6dd549c98d8e9825916aafa3f673fb5 100644 (file)
@@ -663,6 +663,12 @@ MUTATOR_HOOKFUNCTION(buffs, Damage_Calculate)
 
        if(frag_deathtype == DEATH_BUFF.m_id) { return; }
 
+       if(StatusEffects_active(BUFF_RESISTANCE, frag_target))
+       {
+               float reduced = frag_damage * autocvar_g_buffs_resistance_blockpercent;
+               frag_damage = bound(0, frag_damage - reduced, frag_damage);
+       }
+
        if(StatusEffects_active(BUFF_MEDIC, frag_target))
        if((GetResource(frag_target, RES_HEALTH) - frag_damage) <= 0)
        if(!ITEM_DAMAGE_NEEDKILL(frag_deathtype))
index 2c94b706e184abb62e06a709269a4a32dc2d963b..dccb35c869854fe0dddbb27e3a44ad3678e63f21 100644 (file)
@@ -30,6 +30,7 @@ bool autocvar_g_buffs_replace_powerups;
 bool autocvar_g_buffs_drop = false;
 float autocvar_g_buffs_cooldown_activate;
 float autocvar_g_buffs_cooldown_respawn;
+float autocvar_g_buffs_resistance_blockpercent;
 float autocvar_g_buffs_medic_survive_chance;
 float autocvar_g_buffs_medic_survive_health;
 float autocvar_g_buffs_medic_rot;
index d2b44b1dd032dc27051a96fc5354f8465e0c907d..aa676420e3bbf37e2e2ed1aa25de4f7c8ce60dc3 100644 (file)
@@ -104,6 +104,17 @@ models/relics/sign_medic
        }
 }
 
+models/relics/sign_resistance
+{
+       deformVertexes autosprite
+       cull none
+       nopicmip
+       {
+               map models/relics/sign_resistance
+               blendfunc add
+       }
+}
+
 models/relics/sign_swapper
 {
        deformVertexes autosprite