/// </summary>
[DataField]
public SoundSpecifier GunShootFailSound = new SoundPathSpecifier("/Audio/Weapons/Guns/Gunshots/bang.ogg");
+
+ /// <summary>
+ /// Whether or not to apply Clumsy to hyposprays.
+ /// </summary>
+ [DataField, AutoNetworkedField]
+ public bool ClumsyHypo = true;
+
+ /// <summary>
+ /// Whether or not to apply Clumsy to defibs.
+ /// </summary>
+ [DataField, AutoNetworkedField]
+ public bool ClumsyDefib = true;
+
+ /// <summary>
+ /// Whether or not to apply Clumsy to guns.
+ /// </summary>
+ [DataField, AutoNetworkedField]
+ public bool ClumsyGuns = true;
+
+ /// <summary>
+ /// Whether or not to apply Clumsy to vaulting.
+ /// </summary>
+ [DataField, AutoNetworkedField]
+ public bool ClumsyVaulting = true;
+
+ /// <summary>
+ /// Lets you define a new "failed" message for each event.
+ /// </summary>
+ [DataField]
+ public LocId HypoFailedMessage = "hypospray-component-inject-self-clumsy-message";
+
+ [DataField]
+ public LocId GunFailedMessage = "gun-clumsy";
+
+ [DataField]
+ public LocId VaulingFailedMessageSelf = "bonkable-success-message-user";
+
+ [DataField]
+ public LocId VaulingFailedMessageOthers = "bonkable-success-message-others";
+
+ [DataField]
+ public LocId VaulingFailedMessageForced = "forced-bonkable-success-message";
}
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;
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;
{
// 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;
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);
{
// 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);
}
// 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)),