]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
New buff: Luck (random chance to deal 3x damage)
authorMario <mario@smbclan.net>
Fri, 22 Jan 2016 01:20:09 +0000 (11:20 +1000)
committerMario <mario@smbclan.net>
Fri, 22 Jan 2016 01:20:09 +0000 (11:20 +1000)
gfx/hud/default/buff_luck.tga [new file with mode: 0644]
gfx/hud/luma/buff_luck.tga [new file with mode: 0644]
models/relics/relic.md3_19.skin [new file with mode: 0644]
models/relics/sign_luck.tga [new file with mode: 0644]
models/relics/sign_luck_glow.tga [new file with mode: 0644]
mutators.cfg
qcsrc/common/mutators/mutator/buffs/all.inc
qcsrc/common/mutators/mutator/buffs/all.qh
qcsrc/common/mutators/mutator/buffs/buffs.qc
scripts/relics.shader

diff --git a/gfx/hud/default/buff_luck.tga b/gfx/hud/default/buff_luck.tga
new file mode 100644 (file)
index 0000000..74655cf
Binary files /dev/null and b/gfx/hud/default/buff_luck.tga differ
diff --git a/gfx/hud/luma/buff_luck.tga b/gfx/hud/luma/buff_luck.tga
new file mode 100644 (file)
index 0000000..e258e9f
Binary files /dev/null and b/gfx/hud/luma/buff_luck.tga differ
diff --git a/models/relics/relic.md3_19.skin b/models/relics/relic.md3_19.skin
new file mode 100644 (file)
index 0000000..7401d28
--- /dev/null
@@ -0,0 +1,3 @@
+ring,models/relics/relic_ring
+mesh,models/relics/relic
+sign,models/relics/sign_luck
\ No newline at end of file
diff --git a/models/relics/sign_luck.tga b/models/relics/sign_luck.tga
new file mode 100644 (file)
index 0000000..77048ee
Binary files /dev/null and b/models/relics/sign_luck.tga differ
diff --git a/models/relics/sign_luck_glow.tga b/models/relics/sign_luck_glow.tga
new file mode 100644 (file)
index 0000000..d046ce1
Binary files /dev/null and b/models/relics/sign_luck_glow.tga differ
index 229d656f231c3f268999268e174ca1527d24abb7..3711d1de6de2b33fa99432e5bf5e3f4910143bff 100644 (file)
@@ -355,6 +355,10 @@ set g_buffs_magnet 1 "magnet buff: greatly increased item pickup range"
 set g_buffs_magnet_time 60 "magnet buff carry time"
 set g_buffs_magnet_range_item 250 "range around player that items are automatically picked up (excludes other buffs)"
 set g_buffs_magnet_range_buff 100 "range around player that only buffs are picked up (drops magnet buff)"
+set g_buffs_luck 1 "luck buff: randomly increased damage"
+set g_buffs_luck_time 60 "luck buff carry time"
+set g_buffs_luck_chance 0.15 "chance for 'critical' hit (multiplied damage) with luck buff"
+set g_buffs_luck_damagemultiplier 3 "luck damage multiplier"
 
 
 // ==============
index 25fa72236cb9160f51e6a0b13bb0e87af0bedb71..de14e9f3635bc2d18bef5b98c9cd7d873d0f7c12 100644 (file)
@@ -116,3 +116,11 @@ REGISTER_BUFF(MAGNET) {
     this.m_color = '1 0.95 0.18';
 }
 BUFF_SPAWNFUNCS(magnet, BUFF_MAGNET)
+
+REGISTER_BUFF(LUCK) {
+    this.m_prettyName = _("Luck");
+    this.m_name = "luck";
+    this.m_skin = 19;
+    this.m_color = '1 0.23 0.44';
+}
+BUFF_SPAWNFUNCS(luck, BUFF_LUCK)
index d34d32d071ef10f42c1d9f26ec12d6e8ff4a130e..b45cb0621d87b85918358ada79411cf54905fdac 100644 (file)
@@ -1,9 +1,5 @@
 #ifndef BUFFS_ALL_H
 #define BUFFS_ALL_H
-// Welcome to the stuff behind the scenes
-// Below, you will find the list of buffs
-// Add new buffs here!
-// Note: Buffs also need spawnfuncs, which are set below
 
 #include <common/teams.qh>
 #include <common/util.qh>
@@ -11,7 +7,7 @@
 REGISTER_WAYPOINT(Buff, _("Buff"), '1 0.5 0', 1);
 REGISTER_RADARICON(Buff, 1);
 
-REGISTRY(Buffs, BITS(4))
+REGISTRY(Buffs, BITS(5))
 #define Buffs_from(i) _Buffs_from(i, BUFF_Null)
 REGISTER_REGISTRY(Buffs)
 REGISTRY_CHECK(Buffs)
index 59f189c24a9c340b76d29caf7cf6341548e92f1a..cba5abf85fc3fb652da310b4ef31c8534a738f99 100644 (file)
@@ -46,6 +46,8 @@ float autocvar_g_buffs_inferno_damagemultiplier;
 float autocvar_g_buffs_swapper_range;
 float autocvar_g_buffs_magnet_range_item;
 float autocvar_g_buffs_magnet_range_buff = 200;
+float autocvar_g_buffs_luck_chance = 0.15;
+float autocvar_g_buffs_luck_damagemultiplier = 3;
 
 // ammo
 .float buff_ammo_prev_infitems;
@@ -586,6 +588,12 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_Calculate)
                        frag_damage *= 0.5; // TODO: cvarize?
        }
 
+       if(frag_attacker.buffs & BUFF_LUCK.m_itemid)
+       if(frag_attacker != frag_target)
+       if(autocvar_g_buffs_luck_damagemultiplier > 0)
+       if(random() <= autocvar_g_buffs_luck_chance)
+               frag_damage *= autocvar_g_buffs_luck_damagemultiplier;
+
        if(frag_attacker.buffs & BUFF_INFERNO.m_itemid)
        if(frag_target != frag_attacker) {
                float btime = buff_Inferno_CalculateTime(
index f111a4b77b06f8258fb2e5299d6f36c575f9c22f..e070ea2b6c8bd673cb316aa5650370394264cdc1 100644 (file)
@@ -180,3 +180,14 @@ models/relics/sign_vengeance
                blendfunc add
        }
 }
+
+models/relics/sign_luck
+{
+       deformVertexes autosprite
+       cull none
+       nopicmip
+       {
+               map models/relics/sign_luck
+               blendfunc add
+       }
+}