Added several variables to make ClumsyComponent more modular for developers. (#33715)
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -38,6 +38,11 @@ public sealed class ClumsySystem : EntitySystem
|
||||
private void BeforeHyposprayEvent(Entity<ClumsyComponent> ent, ref SelfBeforeHyposprayInjectsEvent args)
|
||||
{
|
||||
// Clumsy people sometimes inject themselves! Apparently syringes are clumsy proof...
|
||||
|
||||
// checks if ClumsyHypo is false, if so, skips.
|
||||
if (!ent.Comp.ClumsyHypo)
|
||||
return;
|
||||
|
||||
if (!_random.Prob(ent.Comp.ClumsyDefaultCheck))
|
||||
return;
|
||||
|
||||
@@ -49,6 +54,11 @@ public sealed class ClumsySystem : EntitySystem
|
||||
private void BeforeDefibrillatorZapsEvent(Entity<ClumsyComponent> ent, ref SelfBeforeDefibrillatorZapsEvent args)
|
||||
{
|
||||
// Clumsy people sometimes defib themselves!
|
||||
|
||||
// checks if ClumsyDefib is false, if so, skips.
|
||||
if (!ent.Comp.ClumsyDefib)
|
||||
return;
|
||||
|
||||
if (!_random.Prob(ent.Comp.ClumsyDefaultCheck))
|
||||
return;
|
||||
|
||||
@@ -61,6 +71,10 @@ public sealed class ClumsySystem : EntitySystem
|
||||
{
|
||||
// Clumsy people sometimes can't shoot :(
|
||||
|
||||
// checks if ClumsyGuns is false, if so, skips.
|
||||
if (!ent.Comp.ClumsyGuns)
|
||||
return;
|
||||
|
||||
if (args.Gun.Comp.ClumsyProof)
|
||||
return;
|
||||
|
||||
@@ -82,6 +96,10 @@ public sealed class ClumsySystem : EntitySystem
|
||||
|
||||
private void OnBeforeClimbEvent(Entity<ClumsyComponent> ent, ref SelfBeforeClimbEvent args)
|
||||
{
|
||||
// checks if ClumsyVaulting is false, if so, skips.
|
||||
if (!ent.Comp.ClumsyVaulting)
|
||||
return;
|
||||
|
||||
// This event is called in shared, thats why it has all the extra prediction stuff.
|
||||
var rand = new System.Random((int)_timing.CurTick.Value);
|
||||
|
||||
@@ -102,8 +120,8 @@ public sealed class ClumsySystem : EntitySystem
|
||||
{
|
||||
// You are slamming yourself onto the table.
|
||||
_popup.PopupPredicted(
|
||||
Loc.GetString("bonkable-success-message-user", ("bonkable", args.BeingClimbedOn)),
|
||||
Loc.GetString("bonkable-success-message-others", ("victim", gettingPutOnTableName), ("bonkable", args.BeingClimbedOn)),
|
||||
Loc.GetString(ent.Comp.VaulingFailedMessageSelf, ("bonkable", args.BeingClimbedOn)),
|
||||
Loc.GetString(ent.Comp.VaulingFailedMessageOthers, ("victim", gettingPutOnTableName), ("bonkable", args.BeingClimbedOn)),
|
||||
ent,
|
||||
ent);
|
||||
}
|
||||
@@ -112,7 +130,7 @@ public sealed class ClumsySystem : EntitySystem
|
||||
// Someone else slamed you onto the table.
|
||||
// This is only run in server so you need to use popup entity.
|
||||
_popup.PopupPredicted(
|
||||
Loc.GetString("forced-bonkable-success-message",
|
||||
Loc.GetString(ent.Comp.VaulingFailedMessageForced,
|
||||
("bonker", puttingOnTableName),
|
||||
("victim", gettingPutOnTableName),
|
||||
("bonkable", args.BeingClimbedOn)),
|
||||
|
||||
Reference in New Issue
Block a user