More artifact effects (#13300)
This commit is contained in:
@@ -0,0 +1,55 @@
|
|||||||
|
using Content.Server.Actions;
|
||||||
|
using Content.Server.Popups;
|
||||||
|
using Content.Shared.Actions;
|
||||||
|
using Content.Shared.Actions.ActionTypes;
|
||||||
|
using Content.Shared.Xenoarchaeology.XenoArtifacts;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
|
namespace Content.Server.Xenoarchaeology.XenoArtifacts;
|
||||||
|
|
||||||
|
public partial class ArtifactSystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly ActionsSystem _actions = default!;
|
||||||
|
[Dependency] private readonly PopupSystem _popup = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used to add the artifact activation action (hehe), which lets sentient artifacts activate themselves,
|
||||||
|
/// either through admemery or the sentience effect.
|
||||||
|
/// </summary>
|
||||||
|
public void InitializeActions()
|
||||||
|
{
|
||||||
|
SubscribeLocalEvent<ArtifactComponent, ComponentStartup>(OnStartup);
|
||||||
|
SubscribeLocalEvent<ArtifactComponent, ComponentRemove>(OnRemove);
|
||||||
|
|
||||||
|
SubscribeLocalEvent<ArtifactComponent, ArtifactSelfActivateEvent>(OnSelfActivate);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnStartup(EntityUid uid, ArtifactComponent component, ComponentStartup args)
|
||||||
|
{
|
||||||
|
if (_prototype.TryIndex<InstantActionPrototype>("ArtifactActivate", out var proto))
|
||||||
|
{
|
||||||
|
_actions.AddAction(uid, new InstantAction(proto), null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnRemove(EntityUid uid, ArtifactComponent component, ComponentRemove args)
|
||||||
|
{
|
||||||
|
if (_prototype.TryIndex<InstantActionPrototype>("ArtifactActivate", out var proto))
|
||||||
|
{
|
||||||
|
_actions.RemoveAction(uid, new InstantAction(proto));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSelfActivate(EntityUid uid, ArtifactComponent component, ArtifactSelfActivateEvent args)
|
||||||
|
{
|
||||||
|
if (component.CurrentNode == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var curNode = component.CurrentNode.Id;
|
||||||
|
_popup.PopupEntity(Loc.GetString("activate-artifact-popup-self", ("node", curNode)), uid, uid);
|
||||||
|
TryActivateArtifact(uid, uid, component);
|
||||||
|
|
||||||
|
args.Handled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -29,6 +29,7 @@ public sealed partial class ArtifactSystem : EntitySystem
|
|||||||
SubscribeLocalEvent<RoundEndTextAppendEvent>(OnRoundEnd);
|
SubscribeLocalEvent<RoundEndTextAppendEvent>(OnRoundEnd);
|
||||||
|
|
||||||
InitializeCommands();
|
InitializeCommands();
|
||||||
|
InitializeActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnInit(EntityUid uid, ArtifactComponent component, MapInitEvent args)
|
private void OnInit(EntityUid uid, ArtifactComponent component, MapInitEvent args)
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes the masks/layers of hard fixtures from the artifact when added, allowing it to pass through walls
|
||||||
|
/// and such.
|
||||||
|
/// </summary>
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed class ClearFixturesArtifactComponent : Component
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
|
||||||
|
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
|
||||||
|
using Content.Shared.Physics;
|
||||||
|
using Robust.Shared.Physics;
|
||||||
|
using Robust.Shared.Physics.Dynamics;
|
||||||
|
|
||||||
|
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles allowing activated artifacts to phase through walls.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class ClearFixturesArtifactSystem : EntitySystem
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
SubscribeLocalEvent<ClearFixturesArtifactComponent, ArtifactActivatedEvent>(OnActivate);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnActivate(EntityUid uid, ClearFixturesArtifactComponent component, ArtifactActivatedEvent args)
|
||||||
|
{
|
||||||
|
if (!TryComp<FixturesComponent>(uid, out var fixtures))
|
||||||
|
return;
|
||||||
|
|
||||||
|
foreach (var (_, fixture) in fixtures.Fixtures)
|
||||||
|
{
|
||||||
|
if (!fixture.Hard)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
fixture.CollisionLayer = (int) CollisionGroup.None;
|
||||||
|
fixture.CollisionMask = (int) CollisionGroup.None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Robust.Shared.Serialization;
|
using Content.Shared.Actions;
|
||||||
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
namespace Content.Shared.Xenoarchaeology.XenoArtifacts;
|
namespace Content.Shared.Xenoarchaeology.XenoArtifacts;
|
||||||
|
|
||||||
@@ -8,3 +9,10 @@ public enum SharedArtifactsVisuals : byte
|
|||||||
SpriteIndex,
|
SpriteIndex,
|
||||||
IsActivated
|
IsActivated
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raised as an instant action event when a sentient artifact activates itself using an action.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class ArtifactSelfActivateEvent : InstantActionEvent
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ artifact-effect-hint-storage = Internal chamber
|
|||||||
artifact-effect-hint-drill = Serrated rotator
|
artifact-effect-hint-drill = Serrated rotator
|
||||||
artifact-effect-hint-soap = Lubricated surface
|
artifact-effect-hint-soap = Lubricated surface
|
||||||
artifact-effect-hint-communication = Long-distance communication
|
artifact-effect-hint-communication = Long-distance communication
|
||||||
|
artifact-effect-hint-fixtures = Structural phasing
|
||||||
|
artifact-effect-hint-sentience = Neurological activity
|
||||||
|
|
||||||
# the triggers should be more obvious than the effects
|
# the triggers should be more obvious than the effects
|
||||||
# gives people an idea of what to do: don't be too specific (i.e. no "welders")
|
# gives people an idea of what to do: don't be too specific (i.e. no "welders")
|
||||||
|
|||||||
@@ -2,4 +2,9 @@ blink-artifact-popup = The artifact disappeared in an instant!
|
|||||||
foam-artifact-popup = Strange foam pours out of the artifact!
|
foam-artifact-popup = Strange foam pours out of the artifact!
|
||||||
|
|
||||||
shuffle-artifact-popup = You feel yourself teleport instantly!
|
shuffle-artifact-popup = You feel yourself teleport instantly!
|
||||||
charge-artifact-popup = You feel the air buzz with electricity.
|
charge-artifact-popup = You feel the air buzz with electricity.
|
||||||
|
|
||||||
|
activate-artifact-action-name = Activate Artifact
|
||||||
|
activate-artifact-action-desc = Immediately activates your current artifact node.
|
||||||
|
|
||||||
|
activate-artifact-popup-self = You activate node {$node}.
|
||||||
|
|||||||
@@ -88,6 +88,16 @@
|
|||||||
useDelay: 30
|
useDelay: 30
|
||||||
event: !type:VendingMachineSelfDispenseEvent
|
event: !type:VendingMachineSelfDispenseEvent
|
||||||
|
|
||||||
|
- type: instantAction
|
||||||
|
id: ArtifactActivate
|
||||||
|
name: activate-artifact-action-name
|
||||||
|
description: activate-artifact-action-desc
|
||||||
|
icon:
|
||||||
|
sprite: Objects/Specific/Xenoarchaeology/xeno_artifacts.rsi
|
||||||
|
state: ano01
|
||||||
|
useDelay: 60
|
||||||
|
event: !type:ArtifactSelfActivateEvent
|
||||||
|
|
||||||
- type: instantAction
|
- type: instantAction
|
||||||
id: ToggleBlock
|
id: ToggleBlock
|
||||||
name: action-name-blocking
|
name: action-name-blocking
|
||||||
@@ -125,4 +135,4 @@
|
|||||||
description: action-desc-wake
|
description: action-desc-wake
|
||||||
icon: { sprite: Objects/Consumable/Food/egg.rsi, state: icon }
|
icon: { sprite: Objects/Consumable/Food/egg.rsi, state: icon }
|
||||||
checkCanInteract: false
|
checkCanInteract: false
|
||||||
event: !type:WakeActionEvent
|
event: !type:WakeActionEvent
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
size: 40
|
size: 40
|
||||||
sprite: Objects/Specific/Xenoarchaeology/item_artifacts.rsi
|
sprite: Objects/Specific/Xenoarchaeology/item_artifacts.rsi
|
||||||
heldPrefix: ano01
|
heldPrefix: ano01
|
||||||
|
- type: Actions
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: BaseXenoArtifactItem
|
parent: BaseXenoArtifactItem
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
- type: Appearance
|
- type: Appearance
|
||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
price: 500
|
price: 500
|
||||||
|
- type: Actions
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: BaseXenoArtifact
|
parent: BaseXenoArtifact
|
||||||
|
|||||||
@@ -420,7 +420,7 @@
|
|||||||
|
|
||||||
- type: artifactEffect
|
- type: artifactEffect
|
||||||
id: EffectMitosis
|
id: EffectMitosis
|
||||||
targetDepth: 4
|
targetDepth: 3
|
||||||
effectHint: artifact-effect-hint-creation
|
effectHint: artifact-effect-hint-creation
|
||||||
components:
|
components:
|
||||||
- type: SpawnArtifact
|
- type: SpawnArtifact
|
||||||
|
|||||||
@@ -47,6 +47,24 @@
|
|||||||
- type: Storage
|
- type: Storage
|
||||||
capacity: 50
|
capacity: 50
|
||||||
|
|
||||||
|
- type: artifactEffect
|
||||||
|
id: EffectClearFixtures
|
||||||
|
targetDepth: 2
|
||||||
|
effectHint: artifact-effect-hint-fixtures
|
||||||
|
permanentComponents:
|
||||||
|
- type: ClearFixturesArtifact
|
||||||
|
|
||||||
|
- type: artifactEffect
|
||||||
|
id: EffectWandering
|
||||||
|
targetDepth: 2
|
||||||
|
effectHint: artifact-effect-hint-displacement
|
||||||
|
permanentComponents:
|
||||||
|
- type: RandomWalk
|
||||||
|
minSpeed: 12
|
||||||
|
maxSpeed: 20
|
||||||
|
minStepCooldown: 1
|
||||||
|
maxStepCooldown: 3
|
||||||
|
|
||||||
- type: artifactEffect
|
- type: artifactEffect
|
||||||
id: EffectSolutionStorage
|
id: EffectSolutionStorage
|
||||||
targetDepth: 2
|
targetDepth: 2
|
||||||
@@ -146,6 +164,23 @@
|
|||||||
soundGunshot:
|
soundGunshot:
|
||||||
path: /Audio/Weapons/Guns/Gunshots/revolver.ogg
|
path: /Audio/Weapons/Guns/Gunshots/revolver.ogg
|
||||||
|
|
||||||
|
- type: artifactEffect
|
||||||
|
id: EffectSentience
|
||||||
|
targetDepth: 3
|
||||||
|
effectHint: artifact-effect-hint-sentience
|
||||||
|
permanentComponents:
|
||||||
|
- type: GhostTakeoverAvailable
|
||||||
|
allowMovement: true
|
||||||
|
allowSpeech: true
|
||||||
|
makeSentient: true
|
||||||
|
name: sentient artifact
|
||||||
|
description: |
|
||||||
|
Enact your eldritch whims.
|
||||||
|
Forcibly activate your nodes for good or for evil.
|
||||||
|
- type: MovementSpeedModifier
|
||||||
|
baseWalkSpeed: 0.25
|
||||||
|
baseSprintSpeed: 0.5
|
||||||
|
|
||||||
- type: artifactEffect
|
- type: artifactEffect
|
||||||
id: EffectMultitool
|
id: EffectMultitool
|
||||||
targetDepth: 3
|
targetDepth: 3
|
||||||
|
|||||||
Reference in New Issue
Block a user