Большой ребаланс милишки (#681)
* MeleeThrowOnHit rework * buff baseball bat * better mjolnir * telebaton system unhardcode + refactor + transform TelescopicBatonComponent to KnockDownOnHitComponent * fix telebaton prototype * darova * fix KnockDownOnHitSystem * chaplain weapons rebalance * fix nullrod hit sound * BloodstreamSystem cleanup * bleeding rebalance * damage rebalance * small baseball bat fix
This commit is contained in:
@@ -51,6 +51,14 @@ public sealed partial class ItemToggleComponent : Component
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
|
||||
public bool ToggleLight = true;
|
||||
|
||||
// WD added start
|
||||
[DataField]
|
||||
public string ActivatedDescription = "comp-item-toggle-on"; // fallback/standard text
|
||||
|
||||
[DataField]
|
||||
public string DeactivatedDescription = "comp-item-toggle-off"; // fallback/standard text
|
||||
// WD added end
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Item.ItemToggle.Components;
|
||||
using Content.Shared.Popups;
|
||||
@@ -23,6 +24,8 @@ public abstract class SharedItemToggleSystem : EntitySystem
|
||||
[Dependency] private readonly INetManager _netManager = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
|
||||
[Dependency] private readonly SharedItemSystem _item = default!; // WD
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -35,6 +38,9 @@ public abstract class SharedItemToggleSystem : EntitySystem
|
||||
SubscribeLocalEvent<ItemToggleHotComponent, IsHotEvent>(OnIsHotEvent);
|
||||
|
||||
SubscribeLocalEvent<ItemToggleActiveSoundComponent, ItemToggledEvent>(UpdateActiveSound);
|
||||
|
||||
SubscribeLocalEvent<ItemToggleComponent, ExaminedEvent>(OnExamined); // WD
|
||||
SubscribeLocalEvent<ItemToggleComponent, ItemToggledEvent>(UpdatePrefix); // WD
|
||||
}
|
||||
|
||||
private void OnStartup(Entity<ItemToggleComponent> ent, ref ComponentStartup args)
|
||||
@@ -255,4 +261,21 @@ public abstract class SharedItemToggleSystem : EntitySystem
|
||||
activeSound.PlayingStream = _audio.Stop(activeSound.PlayingStream);
|
||||
}
|
||||
}
|
||||
|
||||
// WD added start
|
||||
private void OnExamined(Entity<ItemToggleComponent> ent, ref ExaminedEvent args)
|
||||
{
|
||||
var onMsg = IsActivated(ent.Owner)
|
||||
? Loc.GetString(ent.Comp.ActivatedDescription)
|
||||
: Loc.GetString(ent.Comp.DeactivatedDescription);
|
||||
|
||||
args.PushMarkup(onMsg);
|
||||
}
|
||||
|
||||
private void UpdatePrefix(Entity<ItemToggleComponent> ent, ref ItemToggledEvent args)
|
||||
{
|
||||
_item.SetHeldPrefix(ent.Owner, args.Activated ? "on" : "off");
|
||||
}
|
||||
|
||||
// WD added end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user