rename hooks, introduce statusEffect.apply and update docs

This commit is contained in:
Evil Factory
2022-02-02 12:26:29 -03:00
parent 6b723c6fd0
commit 53231347bb
3 changed files with 36 additions and 15 deletions
@@ -2343,7 +2343,7 @@ namespace Barotrauma
if (condition == 0.0f) { return; }
var should = new LuaResult(GameMain.Lua.hook.Call("itemUse", new object[] { this, character, targetLimb }));
var should = new LuaResult(GameMain.Lua.hook.Call("item.use", new object[] { this, character, targetLimb }));
if (should.Bool())
return;
@@ -2381,7 +2381,7 @@ namespace Barotrauma
{
if (condition == 0.0f) { return; }
var should = new LuaResult(GameMain.Lua.hook.Call("itemSecondaryUse", new object[] { this, character}));
var should = new LuaResult(GameMain.Lua.hook.Call("item.secondaryUse", new object[] { this, character}));
if (should.Bool())
return;
@@ -1138,7 +1138,10 @@ namespace Barotrauma
{
if (entity is Item item)
{
GameMain.Lua.hook.Call("statusEffect.apply." + item.Prefab.Identifier, this, deltaTime, entity, targets, worldPosition);
var result = new LuaResult(GameMain.Lua.hook.Call("statusEffect.apply." + item.Prefab.Identifier, this, deltaTime, entity, targets, worldPosition));
if (result.Bool())
return;
}
}