From 9ae2c2a2ae303d8797b43e437b4ef2d54a68e364 Mon Sep 17 00:00:00 2001 From: DarkGod <darkgod@net-core.org> Date: Tue, 19 May 2020 17:39:36 +0200 Subject: [PATCH] ploush --- game/engines/default/engine/interface/ActorInventory.lua | 2 ++ game/modules/tome/class/Actor.lua | 1 + game/modules/tome/data/general/objects/world-artifacts.lua | 6 ++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/game/engines/default/engine/interface/ActorInventory.lua b/game/engines/default/engine/interface/ActorInventory.lua index 5414d153f9..43b078c562 100644 --- a/game/engines/default/engine/interface/ActorInventory.lua +++ b/game/engines/default/engine/interface/ActorInventory.lua @@ -579,6 +579,7 @@ function _M:onWear(o, inven_id) -- Apply wielder properties o.wielded = {} o:check("on_wear", self, inven_id) + self:triggerHook{"Actor:onWear", o=o, inven_id=inven_id} if o.wielder then for k, e in pairs(o.wielder) do o.wielded[k] = self:addTemporaryValue(k, e) @@ -601,6 +602,7 @@ function _M:onTakeoff(o, inven_id) end end o:check("on_takeoff", self, inven_id) + self:triggerHook{"Actor:onTakeoff", o=o, inven_id=inven_id} o.wielded = nil end diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 10e36e0ba1..6d388ffbe8 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -4543,6 +4543,7 @@ function _M:onWear(o, inven_id, bypass_set, silent) self:checkMindstar(o) o:check("on_wear", self, inven_id) + self:triggerHook{"Actor:onWear", o=o, inven_id=inven_id} if o.wielder then for k, e in pairs(o.wielder) do diff --git a/game/modules/tome/data/general/objects/world-artifacts.lua b/game/modules/tome/data/general/objects/world-artifacts.lua index bb561b86a7..f259da6d5e 100644 --- a/game/modules/tome/data/general/objects/world-artifacts.lua +++ b/game/modules/tome/data/general/objects/world-artifacts.lua @@ -358,7 +358,7 @@ newEntity{ base = "BASE_AMULET", define_as = "SET_GARKUL_TEETH", end, } -newEntity{ base = "BASE_LITE", +newEntity{ base = "BASE_LITE", define_as = "SUMMERTIDE_PHIAL", power_source = {nature=true}, unique = true, name = "Summertide Phial", image="object/artifact/summertide_phial.png", @@ -497,7 +497,9 @@ newEntity{ use_simple = { name = _t"quaff the Blood of Life to grant an extra life", use = function(self, who) game.logSeen(who, "%s quaffs the %s!", who:getName():capitalize(), self:getName({no_add_name = true, do_color = true})) - if not who:attr("undead") then + if self:triggerHook{"Artifact:BloodOfLife:used", who=who} then + -- let addons do stuff + elseif not who:attr("undead") then who.blood_life = true game.logPlayer(who, "#LIGHT_RED#You feel the Blood of Life rushing through your veins.") else -- GitLab