removed applyAffliction and added character.applyDamage and character.applyAffliction
This commit is contained in:
@@ -387,12 +387,6 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (targetLimb == null)
|
if (targetLimb == null)
|
||||||
{
|
{
|
||||||
var should = new LuaResult(GameMain.Lua.hook.Call("afflictionApplied", new object[] { this, affliction }));
|
|
||||||
|
|
||||||
if (should.Bool())
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
|
||||||
//if a limb-specific affliction is applied to no specific limb, apply to all limbs
|
//if a limb-specific affliction is applied to no specific limb, apply to all limbs
|
||||||
foreach (LimbHealth limbHealth in limbHealths)
|
foreach (LimbHealth limbHealth in limbHealths)
|
||||||
{
|
{
|
||||||
@@ -402,21 +396,11 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var should = new LuaResult(GameMain.Lua.hook.Call("afflictionApplied", new object[] { this, affliction, targetLimb }));
|
|
||||||
|
|
||||||
if (should.Bool())
|
|
||||||
return;
|
|
||||||
|
|
||||||
AddLimbAffliction(targetLimb, affliction, allowStacking: allowStacking);
|
AddLimbAffliction(targetLimb, affliction, allowStacking: allowStacking);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var should = new LuaResult(GameMain.Lua.hook.Call("afflictionApplied", new object[] { this, affliction }));
|
|
||||||
|
|
||||||
if (should.Bool())
|
|
||||||
return;
|
|
||||||
|
|
||||||
AddAffliction(affliction, allowStacking: allowStacking);
|
AddAffliction(affliction, allowStacking: allowStacking);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -532,7 +516,7 @@ namespace Barotrauma
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var should = new LuaResult(GameMain.Lua.hook.Call("afflictionApplied", new object[] { this, attackResult, hitLimb }));
|
var should = new LuaResult(GameMain.Lua.hook.Call("character.applyDamage", new object[] { this, attackResult, hitLimb, allowStacking }));
|
||||||
|
|
||||||
if (should.Bool())
|
if (should.Bool())
|
||||||
return;
|
return;
|
||||||
@@ -664,6 +648,11 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var should = new LuaResult(GameMain.Lua.hook.Call("character.applyAffliction", new object[] { this, limbHealth, newAffliction, allowStacking }));
|
||||||
|
|
||||||
|
if (should.Bool())
|
||||||
|
return;
|
||||||
|
|
||||||
Affliction existingAffliction = null;
|
Affliction existingAffliction = null;
|
||||||
foreach (KeyValuePair<Affliction, LimbHealth> kvp in afflictions)
|
foreach (KeyValuePair<Affliction, LimbHealth> kvp in afflictions)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user