Event pain

This commit is contained in:
Evil Factory
2026-02-15 17:58:25 -03:00
parent 13bfffa777
commit f70251fa3b
7 changed files with 294 additions and 39 deletions
@@ -651,11 +651,6 @@ namespace Barotrauma
return;
}
var should = GameMain.LuaCs.Hook.Call<bool?>("inventoryPutItem", this, item, user, i, removeItem);
if (should != null && should.Value)
return;
if (Owner == null) { return; }
Inventory prevInventory = item.ParentInventory;
@@ -765,11 +760,6 @@ namespace Barotrauma
if (slots[index].Items.Any(it => !it.IsInteractable(user))) { return false; }
if (!AllowSwappingContainedItems) { return false; }
var should = GameMain.LuaCs.Hook.Call<bool?>("inventoryItemSwap", this, item, user, index, swapWholeStack);
if (should != null)
return should.Value;
//swap to InvSlotType.Any if possible
Inventory otherInventory = item.ParentInventory;
bool otherIsEquipped = false;
@@ -1411,8 +1411,6 @@ namespace Barotrauma
if (Components.Any(ic => ic is Wire) && Components.All(ic => ic is Wire || ic is Holdable)) { isWire = true; }
if (HasTag(Barotrauma.Tags.LogicItem)) { isLogic = true; }
GameMain.LuaCs.Hook.Call<Item>("item.created", this);
ApplyStatusEffects(ActionType.OnSpawn, 1.0f);
// Set max condition multipliers from campaign settings for RecalculateConditionValues()
@@ -3364,10 +3362,6 @@ namespace Barotrauma
}
if (condition <= 0.0f) { return; }
var should = GameMain.LuaCs.Hook.Call<bool?>("item.use", new object[] { this, user, targetLimb, useTarget });
if (should != null && should.Value) { return; }
bool remove = false;
@@ -3400,11 +3394,6 @@ namespace Barotrauma
{
if (condition <= 0.0f) { return; }
var should = GameMain.LuaCs.Hook.Call<bool?>("item.secondaryUse", this, character);
if (should != null && should.Value)
return;
bool remove = false;
foreach (ItemComponent ic in components)
@@ -4621,8 +4610,6 @@ namespace Barotrauma
body.Remove();
body = null;
}
GameMain.LuaCs.Hook.Call<Item>("item.removed", this);
}
public override void Remove()
@@ -4707,8 +4694,6 @@ namespace Barotrauma
}
RemoveProjSpecific();
GameMain.LuaCs.Hook.Call<Item>("item.removed", this);
}
private void RemoveFromLists()