From fbadddfe3065eb4d86cd59798954d7e25f068f98 Mon Sep 17 00:00:00 2001 From: Hachem_Muche <Hachem_Muche@stanfordalumni.org> Date: Sat, 1 Apr 2017 13:10:23 -0700 Subject: [PATCH] Spellhunt remnants drain arcane resources when worn and are very annoying to arcane users. (Makes swap cheese painful.) Antimagic displays its casting penalties in its description. --- .../data/general/objects/world-artifacts.lua | 16 ++++++++++++++++ game/modules/tome/data/timed_effects/other.lua | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/game/modules/tome/data/general/objects/world-artifacts.lua b/game/modules/tome/data/general/objects/world-artifacts.lua index 979e2b29ed..9c774c76d6 100644 --- a/game/modules/tome/data/general/objects/world-artifacts.lua +++ b/game/modules/tome/data/general/objects/world-artifacts.lua @@ -3547,6 +3547,7 @@ newEntity{ base = "BASE_GAUNTLETS", name = "Spellhunt Remnants", color = colors.GREY, image = "object/artifact/spellhunt_remnants.png", unided_name = "heavily corroded voratun gauntlets", desc = [[These once brilliant voratun gauntlets have fallen into a deep decay. Originally used in the spellhunt, they were often used to destroy arcane artifacts, curing the world of their influence.]], + special_desc = function(self) return "Drains arcane resources while worn." end, -- material_level = 1, --Special: this artifact can appear anywhere and adjusts its material level to the zone level_range = {1, nil}, rarity = 550, -- Extra rare to make it not ALWAYS appear. @@ -3558,10 +3559,25 @@ newEntity{ base = "BASE_GAUNTLETS", self.power_up(self, nil, mat_level) end end, + on_wear = function(self, who) + if who:attr("has_arcane_knowledge") then + game.logPlayer(who, "#ORCHID#The %s begin draining your arcane resources as they are worn!", self:getName({do_color=true})) + end + end, on_preaddobject = function(self, who, inven) -- generated in an actor's inventory if not self.material_level then self.addedToLevel(self, game.level) end end, cost = 1000, + callbackOnAct = function(self, who) -- Burn the wearer's arcane resources while worn + if who:attr("has_arcane_knowledge") then + local burn = who:burnArcaneResources(self.material_level*2) + if burn > 0 then + game.logSeen(who, "#ORCHID#%s's %s drain %s magic!", who.name:capitalize(), self:getName({do_color=true}), who:his_her()) + who:restStop("Antimagic Drain") + who:runStop("Antimagic Drain") + end + end + end, wielder = { combat_mindpower=4, combat_mindcrit=1, diff --git a/game/modules/tome/data/timed_effects/other.lua b/game/modules/tome/data/timed_effects/other.lua index 65d4cf85da..a474e4a6a0 100644 --- a/game/modules/tome/data/timed_effects/other.lua +++ b/game/modules/tome/data/timed_effects/other.lua @@ -2290,7 +2290,10 @@ newEffect{ newEffect{ name = "ANTIMAGIC_DISRUPTION", desc = "Antimagic Disruption", - long_desc = function(self, eff) return ("Your arcane powers are disrupted by your antimagic equipment."):format() end, + long_desc = function(self, eff) + local chance = self:attr("spell_failure") or 0 + return ("Your arcane powers are disrupted by your antimagic equipment. Arcane talents fail %d%% of the time and arcane sustains have a %0.1f%% chance to deactivate each turn."):format(chance, chance/10) + end, type = "other", subtype = { antimagic=true }, no_stop_enter_worlmap = true, -- GitLab