Singularity, Particle Accelerator & Radiation Collectors (#2169)
* basic radiation generator * might need this * thonk * big thonk * oop * e * werks * sprite * oopsy woopsy * radiation * clean up file * makes it work, probably * minor fixes * resources * progress on component * this will no longer be necessary * radiation go brrrr * finally fix container issues * out var Co-authored-by: Remie Richards <remierichards@gmail.com> * second out fix * another out fix Co-authored-by: Remie Richards <remierichards@gmail.com> * switch case * fix switch * sound and improvements * nullable * basic containment field system * ensure alignment * fix beam placement logic * field generation fully working * fix potential crash * working containment functionality * extremely basic emitter functionality * fix radiation panel naming * emitter stuff * oopsies * fixes * some fixes * cleanup * small fix and move emitter file * add sprite resources for PA * slight rework of the singulo adds rads * pushing for smugleaf :) * added radiationpanels * some fixes for the singulo * containmentfield * pa wip * progress * pa working * emitter fix * works :) * ui works * some work on ui & pa * progress * ui work & misc fixes * GREYSCALE * pa ui polish containmentfieldgen rework * singulo rework added snapgrid * getcomponent get out * singulo rework added collisiongroups underplating & passable * yaml work: - collision boxes - singulo now unshaded * no unlit * misc changes * pa wires * add usability check * nullable enable * minor fix * power need added * reenables containment field energy drain menu close button singularity collider fix * sprite replacement * finished singulo pulling * pjb fixes * fixing sprites & minor adjustments * decrease containmentfield power * some yml adjustments * unlit layers singulogenerator * singulogen * everything works just not the powergetting on the pa i wanna die * Adds PA construction graphs, PA construction works * Snap to grid parts when completing construction * updated to newest master * inb4 i work on power * fixes upstream merge adds power need to particleaccelerator * properly implements power & apc power * Emitters are now fancy. * I have actually no idea how this happened. * Give PA a wiring LayoutId * PA is an acronym * indicators fixes hacking * Singulo is a word you blasphemous IDE. * Rewrite the PA. * Fancy names for PA parts. * Wiring fixes, strength wire cutting. * fixes projectile & ignores components * nullability errors * fixes integration tests Co-authored-by: unusualcrow <unusualcrow@protonmail.com> Co-authored-by: L.E.D <10257081+unusualcrow@users.noreply.github.com> Co-authored-by: Remie Richards <remierichards@gmail.com> Co-authored-by: Víctor Aguilera Puerto <zddm@outlook.es> Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.Singularity
|
||||
{
|
||||
[NetSerializable, Serializable]
|
||||
public enum EmitterVisuals
|
||||
{
|
||||
VisualState,
|
||||
Locked
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public enum EmitterVisualState
|
||||
{
|
||||
On,
|
||||
Underpowered,
|
||||
Off
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using Robust.Shared.GameObjects.Components.UserInterface;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components
|
||||
{
|
||||
[NetSerializable, Serializable]
|
||||
public enum ParticleAcceleratorVisuals
|
||||
{
|
||||
VisualState
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public enum ParticleAcceleratorVisualState
|
||||
{
|
||||
//Open, //no prefix
|
||||
//Wired, //w prefix
|
||||
Unpowered, //c prefix
|
||||
Powered, //p prefix
|
||||
Level0, //0 prefix
|
||||
Level1, //1 prefix
|
||||
Level2, //2 prefix
|
||||
Level3 //3 prefix
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public enum ParticleAcceleratorPowerState
|
||||
{
|
||||
Standby = ParticleAcceleratorVisualState.Powered,
|
||||
Level0 = ParticleAcceleratorVisualState.Level0,
|
||||
Level1 = ParticleAcceleratorVisualState.Level1,
|
||||
Level2 = ParticleAcceleratorVisualState.Level2,
|
||||
Level3 = ParticleAcceleratorVisualState.Level3
|
||||
}
|
||||
|
||||
public enum ParticleAcceleratorVisualLayers
|
||||
{
|
||||
Base,
|
||||
Unlit
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum ParticleAcceleratorWireStatus
|
||||
{
|
||||
Power,
|
||||
Keyboard,
|
||||
Limiter,
|
||||
Strength,
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public class ParticleAcceleratorUIState : BoundUserInterfaceState
|
||||
{
|
||||
public bool Assembled;
|
||||
public bool Enabled;
|
||||
public ParticleAcceleratorPowerState State;
|
||||
public int PowerDraw;
|
||||
public int PowerReceive;
|
||||
|
||||
//dont need a bool for the controlbox because... this is sent to the controlbox :D
|
||||
public bool EmitterLeftExists;
|
||||
public bool EmitterCenterExists;
|
||||
public bool EmitterRightExists;
|
||||
public bool PowerBoxExists;
|
||||
public bool FuelChamberExists;
|
||||
public bool EndCapExists;
|
||||
|
||||
public bool InterfaceBlock;
|
||||
public ParticleAcceleratorPowerState MaxLevel;
|
||||
public bool WirePowerBlock;
|
||||
|
||||
public ParticleAcceleratorUIState(bool assembled, bool enabled, ParticleAcceleratorPowerState state, int powerReceive, int powerDraw, bool emitterLeftExists, bool emitterCenterExists, bool emitterRightExists, bool powerBoxExists, bool fuelChamberExists, bool endCapExists, bool interfaceBlock, ParticleAcceleratorPowerState maxLevel, bool wirePowerBlock)
|
||||
{
|
||||
Assembled = assembled;
|
||||
Enabled = enabled;
|
||||
State = state;
|
||||
PowerDraw = powerDraw;
|
||||
PowerReceive = powerReceive;
|
||||
EmitterLeftExists = emitterLeftExists;
|
||||
EmitterCenterExists = emitterCenterExists;
|
||||
EmitterRightExists = emitterRightExists;
|
||||
PowerBoxExists = powerBoxExists;
|
||||
FuelChamberExists = fuelChamberExists;
|
||||
EndCapExists = endCapExists;
|
||||
InterfaceBlock = interfaceBlock;
|
||||
MaxLevel = maxLevel;
|
||||
WirePowerBlock = wirePowerBlock;
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public class ParticleAcceleratorSetEnableMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly bool Enabled;
|
||||
public ParticleAcceleratorSetEnableMessage(bool enabled)
|
||||
{
|
||||
Enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public class ParticleAcceleratorRescanPartsMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public ParticleAcceleratorRescanPartsMessage()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public class ParticleAcceleratorSetPowerStateMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly ParticleAcceleratorPowerState State;
|
||||
|
||||
public ParticleAcceleratorSetPowerStateMessage(ParticleAcceleratorPowerState state)
|
||||
{
|
||||
State = state;
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public enum ParticleAcceleratorControlBoxUiKey
|
||||
{
|
||||
Key
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.Singularity
|
||||
{
|
||||
[NetSerializable, Serializable]
|
||||
public enum RadiationCollectorVisuals
|
||||
{
|
||||
VisualState
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public enum RadiationCollectorVisualState
|
||||
{
|
||||
Active,
|
||||
Activating,
|
||||
Deactivating,
|
||||
Deactive
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@
|
||||
public const uint STORABLE = 1077;
|
||||
public const uint PULLABLE = 1078;
|
||||
public const uint GAS_TANK = 1079;
|
||||
|
||||
public const uint SINGULARITY = 1080;
|
||||
|
||||
// Net IDs for integration tests.
|
||||
public const uint PREDICTION_TEST = 10001;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.EntitySystemMessages
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public class SingularitySoundMessage : ComponentMessage
|
||||
{
|
||||
public bool Start { get; }
|
||||
|
||||
public SingularitySoundMessage(bool start)
|
||||
{
|
||||
Directed = true;
|
||||
Start = start;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -21,7 +21,8 @@ namespace Content.Shared.Physics
|
||||
SmallImpassable = 1 << 4, // 16 Things a smaller object - a cat, a crab - can't go through - a wall, but not a computer terminal or a table
|
||||
Clickable = 1 << 5, // 32 Temporary "dummy" layer to ensure that objects can still be clicked even if they don't collide with anything (you can't interact with objects that have no layer, including items)
|
||||
GhostImpassable = 1 << 6, // 64 Things impassible by ghosts/observers, ie blessed tiles or forcefields
|
||||
|
||||
Underplating = 1 << 7, // 128 Things that are under plating
|
||||
Passable = 1 << 8, // 256 Things that are passable
|
||||
MapGrid = MapGridHelpers.CollisionGroup, // Map grids, like shuttles. This is the actual grid itself, not the walls or other entities connected to the grid.
|
||||
|
||||
MobMask = Impassable | MobImpassable | VaultImpassable | SmallImpassable,
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.Physics;
|
||||
|
||||
namespace Content.Shared.Physics
|
||||
{
|
||||
public class ContainmentFieldCollisionController : VirtualController
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
14
Content.Shared/Physics/ContainmentFieldRepellController.cs
Normal file
14
Content.Shared/Physics/ContainmentFieldRepellController.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.Numerics;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
|
||||
namespace Content.Shared.Physics
|
||||
{
|
||||
public class ContainmentFieldRepellController : FrictionController
|
||||
{
|
||||
public void Repell(Direction dir, float speed)
|
||||
{
|
||||
LinearVelocity = dir.ToVec() * speed;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Content.Shared/Physics/FrictionController.cs
Normal file
24
Content.Shared/Physics/FrictionController.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using Robust.Shared.Interfaces.Physics;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Physics;
|
||||
|
||||
namespace Content.Shared.Physics
|
||||
{
|
||||
public abstract class FrictionController : VirtualController
|
||||
{
|
||||
[Dependency] private IPhysicsManager _physicsManager = default!;
|
||||
|
||||
public override void UpdateAfterProcessing()
|
||||
{
|
||||
base.UpdateAfterProcessing();
|
||||
|
||||
if (ControlledComponent != null && !_physicsManager.IsWeightless(ControlledComponent.Owner.Transform.Coordinates))
|
||||
{
|
||||
LinearVelocity *= 0.85f;
|
||||
if (MathF.Abs(LinearVelocity.Length) < 1f)
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Content.Shared/Physics/SingularityController.cs
Normal file
18
Content.Shared/Physics/SingularityController.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
#nullable enable
|
||||
using Robust.Shared.GameObjects.Components;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
|
||||
namespace Content.Shared.Physics
|
||||
{
|
||||
public class SingularityController : VirtualController
|
||||
{
|
||||
public override IPhysicsComponent? ControlledComponent { protected get; set; }
|
||||
|
||||
|
||||
public void Push(Vector2 velocityDirection, float speed)
|
||||
{
|
||||
LinearVelocity = velocityDirection * speed;
|
||||
}
|
||||
}
|
||||
}
|
||||
22
Content.Shared/Physics/SingularityPullController.cs
Normal file
22
Content.Shared/Physics/SingularityPullController.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
#nullable enable
|
||||
using Robust.Shared.GameObjects.Components;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Singularity
|
||||
{
|
||||
public class SingularityPullController : VirtualController
|
||||
{
|
||||
public override IPhysicsComponent? ControlledComponent { protected get; set; }
|
||||
|
||||
public void StopPull()
|
||||
{
|
||||
LinearVelocity = Vector2.Zero;
|
||||
}
|
||||
|
||||
public void Pull(Vector2 velocityDirection, float speed)
|
||||
{
|
||||
LinearVelocity = velocityDirection * speed;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user