From: LegendaryGuard Date: Mon, 28 Nov 2022 11:09:40 +0000 (+0100) Subject: Return back Resistance buff set in the last skin order X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3f2c021a4d8dbb980f686e3bf387d0ab99108cff;p=xonotic%2Fxonotic-data.pk3dir.git Return back Resistance buff set in the last skin order --- diff --git a/gfx/hud/default/buff_resistance.tga b/gfx/hud/default/buff_resistance.tga new file mode 100644 index 000000000..d7e2524b1 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 index 000000000..046c22a91 Binary files /dev/null and b/gfx/hud/luma/buff_resistance.tga differ diff --git a/models/relics/relic.md3_11.skin b/models/relics/relic.md3_11.skin index cfcb99896..f4d914fa2 100644 --- a/models/relics/relic.md3_11.skin +++ b/models/relics/relic.md3_11.skin @@ -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 index 000000000..56a11639a 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 index 000000000..0e22a4314 Binary files /dev/null and b/models/relics/sign_resistance_glow.tga differ diff --git a/mutators.cfg b/mutators.cfg index d9a1166fc..443c666dd 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -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" diff --git a/qcsrc/common/effects/effectinfo_buffs.inc b/qcsrc/common/effects/effectinfo_buffs.inc index 94c177d02..1fe2d8e62 100644 --- a/qcsrc/common/effects/effectinfo_buffs.inc +++ b/qcsrc/common/effects/effectinfo_buffs.inc @@ -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'; +} diff --git a/qcsrc/common/mutators/mutator/buffs/all.inc b/qcsrc/common/mutators/mutator/buffs/all.inc index 0930498f8..659531a3c 100644 --- a/qcsrc/common/mutators/mutator/buffs/all.inc +++ b/qcsrc/common/mutators/mutator/buffs/all.inc @@ -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) diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 5bda45203..fa97b421b 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -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)) diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh index 2c94b706e..dccb35c86 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh @@ -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; diff --git a/scripts/relics.shader b/scripts/relics.shader index d2b44b1dd..aa676420e 100644 --- a/scripts/relics.shader +++ b/scripts/relics.shader @@ -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