]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Magnet buff: greatly increased item pickup range
authorMario <zacjardine@y7mail.com>
Fri, 13 Mar 2015 18:42:24 +0000 (05:42 +1100)
committerMario <zacjardine@y7mail.com>
Fri, 13 Mar 2015 18:42:24 +0000 (05:42 +1100)
models/relics/relic.md3_18.skin [new file with mode: 0644]
models/relics/sign_magnet.tga [new file with mode: 0644]
models/relics/sign_magnet_glow.tga [new file with mode: 0644]
mutators.cfg
qcsrc/common/buffs.qh
qcsrc/server/autocvars.qh
qcsrc/server/mutators/mutator_buffs.qc
scripts/relics.shader

diff --git a/models/relics/relic.md3_18.skin b/models/relics/relic.md3_18.skin
new file mode 100644 (file)
index 0000000..b89d51c
--- /dev/null
@@ -0,0 +1,3 @@
+ring,models/relics/relic_ring
+mesh,models/relics/relic
+sign,models/relics/sign_magnet
\ No newline at end of file
diff --git a/models/relics/sign_magnet.tga b/models/relics/sign_magnet.tga
new file mode 100644 (file)
index 0000000..fe4ffe0
Binary files /dev/null and b/models/relics/sign_magnet.tga differ
diff --git a/models/relics/sign_magnet_glow.tga b/models/relics/sign_magnet_glow.tga
new file mode 100644 (file)
index 0000000..fe4ffe0
Binary files /dev/null and b/models/relics/sign_magnet_glow.tga differ
index 5bc4c5706133915bc38a0c6daf884cc70913d203..3bfcbf339e787ccffdf9ab7bb144f94ca3ac8644 100644 (file)
@@ -338,4 +338,9 @@ set g_buffs_inferno_burntime_factor 2 "burn time logarithm base. 0 < x < 1: incr
 set g_buffs_inferno_burntime_min_time 0.5 "minimum seconds of burn time"
 set g_buffs_inferno_burntime_target_damage 150 "damage required for g_buffs_inferno_burntime_target_time seconds of burn"
 set g_buffs_inferno_burntime_target_time 5 "seconds of burn given g_buffs_inferno_burntime_target_damage damage"
+set g_buffs_swapper 1 "swapper buff: press dropweapon to switch places with a nearby enemy"
+set g_buffs_swapper_time 60 "swapper buff carry time"
 set g_buffs_swapper_range 1500 "maximum range of swapping with enemy"
+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 450 "item pickup range"
index 685e886525df80fc5e6d5772a661c962bcd84c84..bebf5ec59ac2808068a916bfba1da9f6ffc2a999 100644 (file)
@@ -67,6 +67,7 @@ REGISTER_BUFF(_("Flight"),flight,FLIGHT,11,'1 0.2 0.5');
 REGISTER_BUFF(_("Invisible"),invisible,INVISIBLE,12,'0.9 0.9 0.9');
 REGISTER_BUFF(_("Inferno"),inferno,INFERNO,16,'2 0 0');
 REGISTER_BUFF(_("Swapper"),swapper,SWAPPER,17,'0.59 0 0.95');
+REGISTER_BUFF(_("Magnet"),magnet,MAGNET,18,'0.45 0.45 0.45');
 #undef REGISTER_BUFF
 
 #ifdef SVQC
@@ -96,6 +97,7 @@ BUFF_SPAWNFUNCS(flight,                       BUFF_FLIGHT)
 BUFF_SPAWNFUNCS(invisible,             BUFF_INVISIBLE)
 BUFF_SPAWNFUNCS(inferno,               BUFF_INFERNO)
 BUFF_SPAWNFUNCS(swapper,               BUFF_SWAPPER)
+BUFF_SPAWNFUNCS(magnet,                        BUFF_MAGNET)
 BUFF_SPAWNFUNCS(random,                        0)
 
 BUFF_SPAWNFUNC_Q3TA_COMPAT(doubler,    BUFF_MEDIC)
index 1e31cafa848b9d9820a0534ea6c9d512feb470bb..9cdfe5ecd06f1ee370fefe67d89a03c87825774a 100644 (file)
@@ -891,4 +891,5 @@ float autocvar_g_buffs_inferno_burntime_target_damage;
 float autocvar_g_buffs_inferno_burntime_target_time;
 float autocvar_g_buffs_inferno_damagemultiplier;
 float autocvar_g_buffs_swapper_range;
+float autocvar_g_buffs_magnet_range_item;
 #endif
index 6fda5d39f1dfa484d9b60f6d1f3cd077138c4049..5d16d94d7918b693ebed7deb913d6bd0ebb8e1eb 100644 (file)
@@ -735,6 +735,22 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThink)
                }
        }
 
+       if(self.buffs & BUFF_MAGNET)
+       {
+               vector pickup_size = '1 1 1' * autocvar_g_buffs_magnet_range_item;
+               for(other = world; (other = findflags(other, flags, FL_ITEM)); )
+               if(boxesoverlap(self.absmin - pickup_size, self.absmax + pickup_size, other.absmin, other.absmax))
+               {
+                       entity oldself = self;
+                       self = other;
+                       other = oldself;
+                       if(self.touch)
+                               self.touch();
+                       other = self;
+                       self = oldself;
+               }
+       }
+
        if((self.buffs & BUFF_INVISIBLE) && (self.oldbuffs & BUFF_INVISIBLE))
        if(self.alpha != autocvar_g_buffs_invisible_alpha)
                self.alpha = autocvar_g_buffs_invisible_alpha; // powerups reset alpha, so we must enforce this (TODO)
index 368df1919974300a5697e1b6bde7f302b29a901d..daa898e41e4c178ed852971e111b70627d5dc19e 100644 (file)
@@ -176,3 +176,12 @@ models/relics/sign_swapper
                rgbgen lightingDiffuse
        }
 }
+models/relics/sign_magnet
+{
+       cull none
+       {
+               map models/relics/sign_magnet
+               blendfunc add
+               rgbgen lightingDiffuse
+       }
+}