AddComp<HealOnBuckleHealingComponent>(uid);
component.NextHealTime = _timing.CurTime + TimeSpan.FromSeconds(component.HealTime);
_actionsSystem.AddAction(args.BuckledEntity, ref component.SleepAction, SleepingSystem.SleepActionId, uid);
+ Dirty(uid, component);
return;
}
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
+ [Dependency] private readonly ActionContainerSystem _actionContainer = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
[Dependency] private readonly SharedPointLightSystem _light = default!;
SubscribeLocalEvent<UnpoweredFlashlightComponent, ToggleActionEvent>(OnToggleAction);
SubscribeLocalEvent<UnpoweredFlashlightComponent, MindAddedMessage>(OnMindAdded);
SubscribeLocalEvent<UnpoweredFlashlightComponent, GotEmaggedEvent>(OnGotEmagged);
+ SubscribeLocalEvent<UnpoweredFlashlightComponent, MapInitEvent>(OnMapInit);
+ }
+
+ private void OnMapInit(EntityUid uid, UnpoweredFlashlightComponent component, MapInitEvent args)
+ {
+ _actionContainer.EnsureAction(uid, ref component.ToggleActionEntity, component.ToggleAction);
+ Dirty(uid, component);
}
private void OnToggleAction(EntityUid uid, UnpoweredFlashlightComponent component, ToggleActionEvent args)
{
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
+ [Dependency] private readonly ActionContainerSystem _actionContainer = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly FixtureSystem _fixtureSystem = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
SubscribeLocalEvent<BlockingComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<BlockingComponent, GetVerbsEvent<ExamineVerb>>(OnVerbExamine);
+ SubscribeLocalEvent<BlockingComponent, MapInitEvent>(OnMapInit);
+ }
+
+ private void OnMapInit(EntityUid uid, BlockingComponent component, MapInitEvent args)
+ {
+ _actionContainer.EnsureAction(uid, ref component.BlockingToggleActionEntity, component.BlockingToggleAction);
+ Dirty(uid, component);
}
private void OnEquip(EntityUid uid, BlockingComponent component, GotEquippedHandEvent args)
{
component.User = args.User;
+ Dirty(uid, component);
//To make sure that this bodytype doesn't get set as anything but the original
if (TryComp<PhysicsComponent>(args.User, out var physicsComponent) && physicsComponent.BodyType != BodyType.Static && !HasComp<BlockingUserComponent>(args.User))
}
component.IsBlocking = true;
+ Dirty(item, component);
return true;
}
}
component.IsBlocking = false;
+ Dirty(item, component);
return true;
}
using Content.Shared.Damage;
using Robust.Shared.Audio;
+using Robust.Shared.GameStates;
using Robust.Shared.Physics.Collision.Shapes;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
/// <summary>
/// This component goes on an item that you want to use to block
/// </summary>
-[RegisterComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class BlockingComponent : Component
{
/// <summary>
/// The entity that's blocking
/// </summary>
- [ViewVariables]
+ [ViewVariables, AutoNetworkedField]
public EntityUid? User;
/// <summary>
/// Is it currently blocking?
/// </summary>
- [ViewVariables]
+ [ViewVariables, AutoNetworkedField]
public bool IsBlocking;
/// <summary>
[DataField("blockingToggleAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string BlockingToggleAction = "ActionToggleBlock";
- [DataField("blockingToggleActionEntity")]
+ [DataField, AutoNetworkedField]
public EntityUid? BlockingToggleActionEntity;
/// <summary>
/// <summary>
/// The action for enabling and disabling stealth.
/// </summary>
- [DataField("toggleActionEntity")] public EntityUid? ToggleActionEntity;
+ [DataField, AutoNetworkedField] public EntityUid? ToggleActionEntity;
}
/// <summary>
public sealed class StealthClothingSystem : EntitySystem
{
[Dependency] private readonly SharedStealthSystem _stealth = default!;
+ [Dependency] private readonly ActionContainerSystem _actionContainer = default!;
public override void Initialize()
{
SubscribeLocalEvent<StealthClothingComponent, ToggleStealthEvent>(OnToggleStealth);
SubscribeLocalEvent<StealthClothingComponent, AfterAutoHandleStateEvent>(OnHandleState);
SubscribeLocalEvent<StealthClothingComponent, GotUnequippedEvent>(OnUnequipped);
+ SubscribeLocalEvent<StealthClothingComponent, MapInitEvent>(OnMapInit);
+ }
+
+ private void OnMapInit(EntityUid uid, StealthClothingComponent component, MapInitEvent args)
+ {
+ _actionContainer.EnsureAction(uid, ref component.ToggleActionEntity, component.ToggleAction);
+ Dirty(uid, component);
}
/// <summary>
[Dependency] private readonly ClothingSystem _clothing = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly SharedActionsSystem _sharedActions = default!;
+ [Dependency] private readonly SharedActionsSystem _actionContainer = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedContainerSystem _sharedContainer = default!;
[Dependency] private readonly SharedItemSystem _item = default!;
SubscribeLocalEvent<MagbootsComponent, InventoryRelayedEvent<SlipAttemptEvent>>(OnSlipAttempt);
SubscribeLocalEvent<MagbootsComponent, GetItemActionsEvent>(OnGetActions);
SubscribeLocalEvent<MagbootsComponent, ToggleMagbootsEvent>(OnToggleMagboots);
+ SubscribeLocalEvent<MagbootsComponent, MapInitEvent>(OnMapInit);
+ }
+
+ private void OnMapInit(EntityUid uid, MagbootsComponent component, MapInitEvent args)
+ {
+ _actionContainer.AddAction(uid, ref component.ToggleActionEntity, component.ToggleAction);
+ Dirty(uid, component);
}
private void OnToggleMagboots(EntityUid uid, MagbootsComponent component, ToggleMagbootsEvent args)
_appearance.SetData(uid, ToggleVisuals.Toggled, magboots.On);
OnChanged(uid, magboots);
- Dirty(magboots);
+ Dirty(uid, magboots);
}
protected virtual void UpdateMagbootEffects(EntityUid parent, EntityUid uid, bool state, MagbootsComponent? component) { }
private void OnMapInit(EntityUid uid, CombatModeComponent component, MapInitEvent args)
{
_actionsSystem.AddAction(uid, ref component.CombatToggleActionEntity, component.CombatToggleAction);
+ Dirty(uid, component);
}
private void OnShutdown(EntityUid uid, CombatModeComponent component, ComponentShutdown args)
namespace Content.Shared.Movement.Components;
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class JetpackComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("moleUsage")]
[DataField] public EntProtoId ToggleAction = "ActionToggleJetpack";
- [DataField("toggleActionEntity")] public EntityUid? ToggleActionEntity;
+ [DataField, AutoNetworkedField] public EntityUid? ToggleActionEntity;
[ViewVariables(VVAccess.ReadWrite), DataField("acceleration")]
public float Acceleration = 1f;
[Dependency] private readonly SharedMoverController _mover = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
+ [Dependency] private readonly ActionContainerSystem _actionContainer = default!;
public override void Initialize()
{
SubscribeLocalEvent<JetpackUserComponent, EntParentChangedMessage>(OnJetpackUserEntParentChanged);
SubscribeLocalEvent<GravityChangedEvent>(OnJetpackUserGravityChanged);
+ SubscribeLocalEvent<JetpackComponent, MapInitEvent>(OnMapInit);
+ }
+
+ private void OnMapInit(EntityUid uid, JetpackComponent component, MapInitEvent args)
+ {
+ _actionContainer.EnsureAction(uid, ref component.ToggleActionEntity, component.ToggleAction);
+ Dirty(uid, component);
}
private void OnJetpackCanWeightlessMove(EntityUid uid, JetpackComponent component, ref CanWeightlessMoveEvent args)
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
+
+namespace Content.Shared.Ninja.Components;
/// <summary>
/// Adds an action to dash, teleport to clicked position, when this item is held.
/// </summary>
-[RegisterComponent, NetworkedComponent, Access(typeof(DashAbilitySystem))]
+[RegisterComponent, NetworkedComponent, Access(typeof(DashAbilitySystem)), AutoGenerateComponentState]
public sealed partial class DashAbilityComponent : Component
{
/// <summary>
/// The action id for dashing.
/// </summary>
- [DataField("dashAction", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>)), ViewVariables(VVAccess.ReadWrite)]
- public string DashAction = string.Empty;
+ [DataField]
+ public EntProtoId DashAction = "ActionEnergyKatanaDash";
- [DataField("dashActionEntity")]
+ [DataField, AutoNetworkedField]
public EntityUid? DashActionEntity;
/// <summary>
[DataField("toggleAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string ToggleAction = "ActionToggleNinjaGloves";
- [DataField("toggleActionEntity")]
+ [DataField, AutoNetworkedField]
public EntityUid? ToggleActionEntity;
/// <summary>
[DataField("createThrowingStarAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string CreateThrowingStarAction = "ActionCreateThrowingStar";
- [DataField("createThrowingStarActionEntity")]
+ [DataField, AutoNetworkedField]
public EntityUid? CreateThrowingStarActionEntity;
/// <summary>
[DataField("recallKatanaAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string RecallKatanaAction = "ActionRecallKatana";
- [DataField("recallKatanaActionEntity")]
+ [DataField, AutoNetworkedField]
public EntityUid? RecallKatanaActionEntity;
/// <summary>
[DataField("empAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string EmpAction = "ActionNinjaEmp";
- [DataField("empActionEntity")]
+ [DataField, AutoNetworkedField]
public EntityUid? EmpActionEntity;
/// <summary>
using Content.Shared.Ninja.Components;
using Content.Shared.Physics;
using Content.Shared.Popups;
-using Robust.Shared.Audio;
-using Robust.Shared.GameObjects;
using Robust.Shared.Timing;
namespace Content.Shared.Ninja.Systems;
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
+ [Dependency] private readonly ActionContainerSystem _actionContainer = default!;
public override void Initialize()
{
SubscribeLocalEvent<DashAbilityComponent, GetItemActionsEvent>(OnGetItemActions);
SubscribeLocalEvent<DashAbilityComponent, DashEvent>(OnDash);
+ SubscribeLocalEvent<DashAbilityComponent, MapInitEvent>(OnMapInit);
+ }
+
+ private void OnMapInit(EntityUid uid, DashAbilityComponent component, MapInitEvent args)
+ {
+ _actionContainer.EnsureAction(uid, ref component.DashActionEntity, component.DashAction);
+ Dirty(uid, component);
}
private void OnGetItemActions(EntityUid uid, DashAbilityComponent comp, GetItemActionsEvent args)
using Content.Shared.Actions;
using Content.Shared.CombatMode;
using Content.Shared.Communications;
-using Content.Shared.Doors.Components;
-using Content.Shared.DoAfter;
using Content.Shared.Examine;
using Content.Shared.Hands.Components;
-using Content.Shared.IdentityManagement;
using Content.Shared.Interaction;
using Content.Shared.Inventory.Events;
using Content.Shared.Ninja.Components;
using Content.Shared.Timing;
using Content.Shared.Toggleable;
using Robust.Shared.Timing;
-using System.Diagnostics.CodeAnalysis;
namespace Content.Shared.Ninja.Systems;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
[Dependency] private readonly SharedCombatModeSystem _combatMode = default!;
- [Dependency] protected readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] protected readonly SharedInteractionSystem Interaction = default!;
- [Dependency] private readonly SharedSpaceNinjaSystem _ninja = default!;
[Dependency] protected readonly SharedPopupSystem Popup = default!;
[Dependency] private readonly UseDelaySystem _useDelay = default!;
+ [Dependency] private readonly ActionContainerSystem _actionContainer = default!;
public override void Initialize()
{
SubscribeLocalEvent<NinjaGlovesComponent, GetItemActionsEvent>(OnGetItemActions);
SubscribeLocalEvent<NinjaGlovesComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<NinjaGlovesComponent, GotUnequippedEvent>(OnUnequipped);
+ SubscribeLocalEvent<NinjaGlovesComponent, MapInitEvent>(OnMapInit);
+ }
+
+ private void OnMapInit(EntityUid uid, NinjaGlovesComponent component, MapInitEvent args)
+ {
+ _actionContainer.EnsureAction(uid, ref component.ToggleActionEntity, component.ToggleAction);
+ Dirty(uid, component);
}
/// <summary>
using Content.Shared.Inventory.Events;
using Content.Shared.Ninja.Components;
using Content.Shared.Timing;
-using Robust.Shared.Audio;
-using Robust.Shared.Network;
-using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization;
namespace Content.Shared.Ninja.Systems;
[Dependency] protected readonly SharedSpaceNinjaSystem _ninja = default!;
[Dependency] protected readonly StealthClothingSystem StealthClothing = default!;
[Dependency] protected readonly UseDelaySystem UseDelay = default!;
+ [Dependency] private readonly ActionContainerSystem _actionContainer = default!;
public override void Initialize()
{
SubscribeLocalEvent<NinjaSuitComponent, GetItemActionsEvent>(OnGetItemActions);
SubscribeLocalEvent<NinjaSuitComponent, AddStealthActionEvent>(OnAddStealthAction);
SubscribeLocalEvent<NinjaSuitComponent, GotUnequippedEvent>(OnUnequipped);
+ SubscribeLocalEvent<NinjaSuitComponent, MapInitEvent>(OnMapInit);
+ }
+
+ private void OnMapInit(EntityUid uid, NinjaSuitComponent component, MapInitEvent args)
+ {
+ _actionContainer.EnsureAction(uid, ref component.RecallKatanaActionEntity, component.RecallKatanaAction);
+ _actionContainer.EnsureAction(uid, ref component.CreateThrowingStarActionEntity, component.CreateThrowingStarAction);
+ _actionContainer.EnsureAction(uid, ref component.EmpActionEntity, component.EmpAction);
+ Dirty(uid, component);
}
/// <summary>
- type: Reflect
enabled: true
reflectProb: .5
- spread: 90
+ spread: 90
- type: Item
size: 15
sprite: Objects/Weapons/Melee/captain_sabre.rsi
sprite: Objects/Weapons/Melee/energykatana.rsi
- type: EnergyKatana
- type: DashAbility
- dashAction: ActionEnergyKatanaDash
- type: LimitedCharges
maxCharges: 3
charges: 3