From: Mario Date: Fri, 13 Mar 2015 18:42:24 +0000 (+1100) Subject: Magnet buff: greatly increased item pickup range X-Git-Tag: xonotic-v0.8.1~18^2~17 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=eb1a0c9d5dd9da67b7ac31f38255fd04abcf757b;p=xonotic%2Fxonotic-data.pk3dir.git Magnet buff: greatly increased item pickup range --- diff --git a/models/relics/relic.md3_18.skin b/models/relics/relic.md3_18.skin new file mode 100644 index 000000000..b89d51cec --- /dev/null +++ b/models/relics/relic.md3_18.skin @@ -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 index 000000000..fe4ffe0f8 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 index 000000000..fe4ffe0f8 Binary files /dev/null and b/models/relics/sign_magnet_glow.tga differ diff --git a/mutators.cfg b/mutators.cfg index 5bc4c5706..3bfcbf339 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -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" diff --git a/qcsrc/common/buffs.qh b/qcsrc/common/buffs.qh index 685e88652..bebf5ec59 100644 --- a/qcsrc/common/buffs.qh +++ b/qcsrc/common/buffs.qh @@ -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) diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 1e31cafa8..9cdfe5ecd 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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 diff --git a/qcsrc/server/mutators/mutator_buffs.qc b/qcsrc/server/mutators/mutator_buffs.qc index 6fda5d39f..5d16d94d7 100644 --- a/qcsrc/server/mutators/mutator_buffs.qc +++ b/qcsrc/server/mutators/mutator_buffs.qc @@ -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) diff --git a/scripts/relics.shader b/scripts/relics.shader index 368df1919..daa898e41 100644 --- a/scripts/relics.shader +++ b/scripts/relics.shader @@ -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 + } +}