Experimental Anomaly Vessel (#22233)

* experimental anomaly vessel

* sprote changes
This commit is contained in:
Nemanja
2023-12-08 13:50:41 -05:00
committed by GitHub
parent ea441ae876
commit e7e7974a24
20 changed files with 112 additions and 33 deletions

View File

@@ -20,7 +20,6 @@ public sealed partial class AnomalySystem
{ {
SubscribeLocalEvent<AnomalyVesselComponent, ComponentShutdown>(OnVesselShutdown); SubscribeLocalEvent<AnomalyVesselComponent, ComponentShutdown>(OnVesselShutdown);
SubscribeLocalEvent<AnomalyVesselComponent, MapInitEvent>(OnVesselMapInit); SubscribeLocalEvent<AnomalyVesselComponent, MapInitEvent>(OnVesselMapInit);
SubscribeLocalEvent<AnomalyVesselComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<AnomalyVesselComponent, UpgradeExamineEvent>(OnUpgradeExamine); SubscribeLocalEvent<AnomalyVesselComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<AnomalyVesselComponent, InteractUsingEvent>(OnVesselInteractUsing); SubscribeLocalEvent<AnomalyVesselComponent, InteractUsingEvent>(OnVesselInteractUsing);
SubscribeLocalEvent<AnomalyVesselComponent, ExaminedEvent>(OnExamined); SubscribeLocalEvent<AnomalyVesselComponent, ExaminedEvent>(OnExamined);
@@ -68,12 +67,6 @@ public sealed partial class AnomalySystem
UpdateVesselAppearance(uid, component); UpdateVesselAppearance(uid, component);
} }
private void OnRefreshParts(EntityUid uid, AnomalyVesselComponent component, RefreshPartsEvent args)
{
var modifierRating = args.PartRatings[component.MachinePartPointModifier] - 1;
component.PointMultiplier = MathF.Pow(component.PartRatingPointModifier, modifierRating);
}
private void OnUpgradeExamine(EntityUid uid, AnomalyVesselComponent component, UpgradeExamineEvent args) private void OnUpgradeExamine(EntityUid uid, AnomalyVesselComponent component, UpgradeExamineEvent args)
{ {
args.AddPercentageUpgrade("anomaly-vessel-component-upgrade-output", component.PointMultiplier); args.AddPercentageUpgrade("anomaly-vessel-component-upgrade-output", component.PointMultiplier);
@@ -93,6 +86,7 @@ public sealed partial class AnomalySystem
component.Anomaly = scanner.ScannedAnomaly; component.Anomaly = scanner.ScannedAnomaly;
anomalyComponent.ConnectedVessel = uid; anomalyComponent.ConnectedVessel = uid;
_radiation.SetSourceEnabled(uid, true);
UpdateVesselAppearance(uid, component); UpdateVesselAppearance(uid, component);
Popup.PopupEntity(Loc.GetString("anomaly-vessel-component-anomaly-assigned"), uid); Popup.PopupEntity(Loc.GetString("anomaly-vessel-component-anomaly-assigned"), uid);
} }
@@ -120,6 +114,7 @@ public sealed partial class AnomalySystem
component.Anomaly = null; component.Anomaly = null;
UpdateVesselAppearance(ent, component); UpdateVesselAppearance(ent, component);
_radiation.SetSourceEnabled(ent, false);
if (!args.Supercritical) if (!args.Supercritical)
continue; continue;

View File

@@ -3,13 +3,13 @@ using Content.Server.Atmos.EntitySystems;
using Content.Server.Audio; using Content.Server.Audio;
using Content.Server.Explosion.EntitySystems; using Content.Server.Explosion.EntitySystems;
using Content.Server.Materials; using Content.Server.Materials;
using Content.Server.Radiation.Systems;
using Content.Server.Radio.EntitySystems; using Content.Server.Radio.EntitySystems;
using Content.Server.Station.Systems; using Content.Server.Station.Systems;
using Content.Shared.Anomaly; using Content.Shared.Anomaly;
using Content.Shared.Anomaly.Components; using Content.Shared.Anomaly.Components;
using Content.Shared.DoAfter; using Content.Shared.DoAfter;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;
using Robust.Shared.Physics.Events; using Robust.Shared.Physics.Events;
@@ -33,6 +33,7 @@ public sealed partial class AnomalySystem : SharedAnomalySystem
[Dependency] private readonly SharedPointLightSystem _pointLight = default!; [Dependency] private readonly SharedPointLightSystem _pointLight = default!;
[Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly RadioSystem _radio = default!; [Dependency] private readonly RadioSystem _radio = default!;
[Dependency] private readonly RadiationSystem _radiation = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!;

View File

@@ -1,8 +1,6 @@
using Content.Shared.Anomaly; using Content.Shared.Anomaly;
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Anomaly.Components; namespace Content.Server.Anomaly.Components;
@@ -25,22 +23,9 @@ public sealed partial class AnomalyVesselComponent : Component
/// <summary> /// <summary>
/// A multiplier applied to the amount of points generated. /// A multiplier applied to the amount of points generated.
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite)] [DataField, ViewVariables(VVAccess.ReadWrite)]
public float PointMultiplier = 1; public float PointMultiplier = 1;
/// <summary>
/// The machine part that affects the point multiplier of the vessel
/// </summary>
[DataField("machinePartPointModifier", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartPointModifier = "Capacitor";
/// <summary>
/// A value used to scale the point multiplier
/// with the corresponding part rating.
/// </summary>
[DataField("partRatingPointModifier")]
public float PartRatingPointModifier = 1.25f;
/// <summary> /// <summary>
/// The maximum time between each beep /// The maximum time between each beep
/// </summary> /// </summary>

View File

@@ -44,6 +44,9 @@ public partial class RadiationSystem
var sourcesData = new ValueList<(EntityUid, RadiationSourceComponent, TransformComponent, Vector2)>(); var sourcesData = new ValueList<(EntityUid, RadiationSourceComponent, TransformComponent, Vector2)>();
while (sources.MoveNext(out var uid, out var source, out var sourceTrs)) while (sources.MoveNext(out var uid, out var source, out var sourceTrs))
{ {
if (!source.Enabled)
continue;
var worldPos = _transform.GetWorldPosition(sourceTrs, transformQuery); var worldPos = _transform.GetWorldPosition(sourceTrs, transformQuery);
var data = (uid, source, sourceTrs, worldPos); var data = (uid, source, sourceTrs, worldPos);
sourcesData.Add(data); sourcesData.Add(data);

View File

@@ -1,4 +1,5 @@
using Content.Server.Radiation.Components; using Content.Server.Radiation.Components;
using Content.Shared.Radiation.Components;
using Content.Shared.Radiation.Events; using Content.Shared.Radiation.Events;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;
using Robust.Shared.Map; using Robust.Shared.Map;
@@ -45,6 +46,14 @@ public sealed partial class RadiationSystem : EntitySystem
RaiseLocalEvent(uid, msg); RaiseLocalEvent(uid, msg);
} }
public void SetSourceEnabled(Entity<RadiationSourceComponent?> entity, bool val)
{
if (!Resolve(entity, ref entity.Comp, false))
return;
entity.Comp.Enabled = val;
}
/// <summary> /// <summary>
/// Marks entity to receive/ignore radiation rays. /// Marks entity to receive/ignore radiation rays.
/// </summary> /// </summary>

View File

@@ -23,4 +23,7 @@ public sealed partial class RadiationSourceComponent : Component
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField("slope")] [DataField("slope")]
public float Slope = 0.5f; public float Slope = 0.5f;
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool Enabled;
} }

View File

@@ -228,11 +228,28 @@
- type: MachineBoard - type: MachineBoard
prototype: MachineAnomalyVessel prototype: MachineAnomalyVessel
requirements: requirements:
Capacitor: 5 Capacitor: 3
materialRequirements: materialRequirements:
Cable: 1 Cable: 1
PlasmaGlass: 10 PlasmaGlass: 10
- type: entity
parent: BaseMachineCircuitboard
id: AnomalyVesselExperimentalCircuitboard
name: experimental anomaly vessel machine board
description: A machine printed circuit board for an experimental anomaly vessel.
components:
- type: Sprite
state: science
- type: MachineBoard
prototype: MachineAnomalyVesselExperimental
requirements:
Capacitor: 3
materialRequirements:
Cable: 5
PlasmaGlass: 15
MetalRod: 4
- type: entity - type: entity
parent: BaseMachineCircuitboard parent: BaseMachineCircuitboard
id: AnomalySynchronizerCircuitboard id: AnomalySynchronizerCircuitboard

View File

@@ -2,7 +2,7 @@
id: MachineAnomalyVessel id: MachineAnomalyVessel
parent: [ BaseMachinePowered, ConstructibleMachine ] parent: [ BaseMachinePowered, ConstructibleMachine ]
name: anomaly vessel name: anomaly vessel
description: A container able to harness a scan of an anomaly and turn it into research points. description: A container able to harness a scan of an anomaly and turn it into research data.
components: components:
- type: Sprite - type: Sprite
noRot: true noRot: true
@@ -77,12 +77,6 @@
canCreateVacuum: false canCreateVacuum: false
- type: Destructible - type: Destructible
thresholds: thresholds:
- trigger:
!type:DamageTrigger
damage: 300
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- trigger: - trigger:
!type:DamageTrigger !type:DamageTrigger
damage: 150 damage: 150
@@ -97,6 +91,32 @@
guides: guides:
- ScannersAndVessels - ScannersAndVessels
- type: entity
id: MachineAnomalyVesselExperimental
parent: MachineAnomalyVessel
name: experimental anomaly vessel
description: An advanced anomaly vessel capable of greater research potential at the cost of increased volatility and low-level radioactive decay into the environment.
components:
- type: Sprite
sprite: Structures/Machines/Anomaly/adv_anomaly_vessel.rsi
offset: 0,0.5
drawdepth: Mobs
- type: SpriteFade
- type: AnomalyVessel
pointMultiplier: 2
- type: RadiationSource
intensity: 0.75
slope: 0.1
enabled: false
- type: Machine
board: AnomalyVesselExperimentalCircuitboard
- type: Explosive
explosionType: Default
maxIntensity: 50
intensitySlope: 7.5
totalIntensity: 500
canCreateVacuum: true
- type: entity - type: entity
id: MachineAPE id: MachineAPE
parent: [ BaseMachinePowered, ConstructibleMachine ] parent: [ BaseMachinePowered, ConstructibleMachine ]

View File

@@ -370,6 +370,7 @@
- AnalysisComputerCircuitboard - AnalysisComputerCircuitboard
- ExosuitFabricatorMachineCircuitboard - ExosuitFabricatorMachineCircuitboard
- AnomalyVesselCircuitboard - AnomalyVesselCircuitboard
- AnomalyVesselExperimentalCircuitboard
- AnomalySynchronizerCircuitboard - AnomalySynchronizerCircuitboard
- APECircuitboard - APECircuitboard
- ArtifactAnalyzerMachineCircuitboard - ArtifactAnalyzerMachineCircuitboard

View File

@@ -248,6 +248,15 @@
Steel: 100 Steel: 100
Glass: 900 Glass: 900
- type: latheRecipe
id: AnomalyVesselExperimentalCircuitboard
result: AnomalyVesselExperimentalCircuitboard
completetime: 4
materials:
Steel: 100
Glass: 900
Gold: 100
- type: latheRecipe - type: latheRecipe
id: AnomalySynchronizerCircuitboard id: AnomalySynchronizerCircuitboard
result: AnomalySynchronizerCircuitboard result: AnomalySynchronizerCircuitboard

View File

@@ -110,6 +110,7 @@
recipeUnlocks: recipeUnlocks:
- WeaponPistolCHIMP - WeaponPistolCHIMP
- AnomalySynchronizerCircuitboard - AnomalySynchronizerCircuitboard
- AnomalyVesselExperimentalCircuitboard
technologyPrerequisites: technologyPrerequisites:
- BasicAnomalousResearch - BasicAnomalousResearch

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,35 @@
{
"version": 1,
"license": "CC0-1.0",
"copyright": "Created by EmoGarbage404 (github)",
"size": {
"x": 32,
"y": 64
},
"states": [
{
"name": "anomaly-1"
},
{
"name": "anomaly-2"
},
{
"name": "anomaly-3"
},
{
"name": "base"
},
{
"name": "panel"
},
{
"name": "powered-1"
},
{
"name": "powered-2"
},
{
"name": "powered-3"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B