--- /dev/null
+ring,models/relics/relic_ring
+mesh,models/relics/relic
+sign,models/relics/sign_luck
\ No newline at end of file
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"
// ==============
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)
#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>
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)
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;
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(
blendfunc add
}
}
+
+models/relics/sign_luck
+{
+ deformVertexes autosprite
+ cull none
+ nopicmip
+ {
+ map models/relics/sign_luck
+ blendfunc add
+ }
+}