diff --git a/Barotrauma/BarotraumaShared/SharedSource/StatusEffects/StatusEffect.cs b/Barotrauma/BarotraumaShared/SharedSource/StatusEffects/StatusEffect.cs index 0bb5c11b6..02bfd6578 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/StatusEffects/StatusEffect.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/StatusEffects/StatusEffect.cs @@ -377,6 +377,7 @@ namespace Barotrauma private readonly List talentTriggers; private readonly List giveExperiences; private readonly List giveSkills; + private readonly List luaHook; public float Duration => duration; @@ -431,6 +432,7 @@ namespace Barotrauma talentTriggers = new List(); giveExperiences = new List(); giveSkills = new List(); + luaHook = new List(); multiplyAfflictionsByMaxVitality = element.GetAttributeBool("multiplyafflictionsbymaxvitality", false); tags = new HashSet(element.GetAttributeString("tags", "").Split(',')); @@ -735,6 +737,9 @@ namespace Barotrauma case "giveskill": giveSkills.Add(new GiveSkill(subElement, parentDebugName)); break; + case "luahook": + luaHook.Add(subElement.GetAttributeString("name", "")); + break; } } InitProjSpecific(element, parentDebugName); @@ -1234,6 +1239,14 @@ namespace Barotrauma } } + foreach (string luaHooks in luaHook) + { + var result = new LuaResult(GameMain.Lua.hook.Call(luaHooks, this, deltaTime, entity, targets, worldPosition)); + + if (result.Bool()) + return; + } + Hull hull = GetHull(entity); Vector2 position = GetPosition(entity, targets, worldPosition); if (useItemCount > 0)