From: Mario Date: Fri, 22 Jan 2016 01:20:09 +0000 (+1000) Subject: New buff: Luck (random chance to deal 3x damage) X-Git-Tag: xonotic-v0.8.2~1222 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4d4866c75066ca3c73f5c6e6b9309d2938f06679;p=xonotic%2Fxonotic-data.pk3dir.git New buff: Luck (random chance to deal 3x damage) --- diff --git a/gfx/hud/default/buff_luck.tga b/gfx/hud/default/buff_luck.tga new file mode 100644 index 000000000..74655cfb9 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 index 000000000..e258e9f51 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 index 000000000..7401d28f9 --- /dev/null +++ b/models/relics/relic.md3_19.skin @@ -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 index 000000000..77048eef7 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 index 000000000..d046ce1ad Binary files /dev/null and b/models/relics/sign_luck_glow.tga differ diff --git a/mutators.cfg b/mutators.cfg index 229d656f2..3711d1de6 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -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" // ============== diff --git a/qcsrc/common/mutators/mutator/buffs/all.inc b/qcsrc/common/mutators/mutator/buffs/all.inc index 25fa72236..de14e9f36 100644 --- a/qcsrc/common/mutators/mutator/buffs/all.inc +++ b/qcsrc/common/mutators/mutator/buffs/all.inc @@ -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) diff --git a/qcsrc/common/mutators/mutator/buffs/all.qh b/qcsrc/common/mutators/mutator/buffs/all.qh index d34d32d07..b45cb0621 100644 --- a/qcsrc/common/mutators/mutator/buffs/all.qh +++ b/qcsrc/common/mutators/mutator/buffs/all.qh @@ -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 #include @@ -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) diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qc b/qcsrc/common/mutators/mutator/buffs/buffs.qc index 59f189c24..cba5abf85 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qc @@ -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( diff --git a/scripts/relics.shader b/scripts/relics.shader index f111a4b77..e070ea2b6 100644 --- a/scripts/relics.shader +++ b/scripts/relics.shader @@ -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 + } +}