Reduce door hacking time (#8852)
This commit is contained in:
@@ -34,8 +34,8 @@ public sealed class WiresSystem : EntitySystem
|
|||||||
// This is where all the wire layouts are stored.
|
// This is where all the wire layouts are stored.
|
||||||
[ViewVariables] private readonly Dictionary<string, WireLayout> _layouts = new();
|
[ViewVariables] private readonly Dictionary<string, WireLayout> _layouts = new();
|
||||||
|
|
||||||
private const float ScrewTime = 2.5f;
|
private const float ScrewTime = 1f;
|
||||||
private const float ToolTime = 1f;
|
private float _toolTime = 0f;
|
||||||
|
|
||||||
private static DummyWireAction _dummyWire = new DummyWireAction();
|
private static DummyWireAction _dummyWire = new DummyWireAction();
|
||||||
|
|
||||||
@@ -649,28 +649,36 @@ public sealed class WiresSystem : EntitySystem
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var args = new DoAfterEventArgs(user, ToolTime, default, used)
|
if (_toolTime > 0f)
|
||||||
{
|
{
|
||||||
NeedHand = true,
|
var args = new DoAfterEventArgs(user, _toolTime, default, used)
|
||||||
BreakOnStun = true,
|
|
||||||
BreakOnDamage = true,
|
|
||||||
BreakOnUserMove = true,
|
|
||||||
TargetFinishedEvent = new OnWireDoAfterEvent
|
|
||||||
{
|
{
|
||||||
Target = used,
|
NeedHand = true,
|
||||||
User = user,
|
BreakOnStun = true,
|
||||||
Tool = toolEntity,
|
BreakOnDamage = true,
|
||||||
Action = action,
|
BreakOnUserMove = true,
|
||||||
Id = id
|
TargetFinishedEvent = new OnWireDoAfterEvent
|
||||||
},
|
{
|
||||||
TargetCancelledEvent = new OnWireDoAfterCancelEvent
|
Target = used,
|
||||||
{
|
User = user,
|
||||||
Id = id
|
Tool = toolEntity,
|
||||||
}
|
Action = action,
|
||||||
};
|
Id = id
|
||||||
_doAfter.DoAfter(args);
|
},
|
||||||
|
TargetCancelledEvent = new OnWireDoAfterCancelEvent
|
||||||
|
{
|
||||||
|
Id = id
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
wires.WiresQueue.Add(id);
|
_doAfter.DoAfter(args);
|
||||||
|
|
||||||
|
wires.WiresQueue.Add(id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UpdateWires(used, user, toolEntity, id, action, wires);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user