Re-organize all projects (#4166)
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
using Content.Shared.Singularity.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Client.Singularity.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(IClientSingularityInstance))]
|
||||
class ClientSingularityComponent : SharedSingularityComponent, IClientSingularityInstance
|
||||
{
|
||||
[ViewVariables]
|
||||
public int Level { get; set; }
|
||||
|
||||
//I am lazy
|
||||
[ViewVariables]
|
||||
public float Intensity
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (Level)
|
||||
{
|
||||
case 0:
|
||||
return 0.0f;
|
||||
case 1:
|
||||
return 2.7f;
|
||||
case 2:
|
||||
return 14.4f;
|
||||
case 3:
|
||||
return 47.2f;
|
||||
case 4:
|
||||
return 180.0f;
|
||||
case 5:
|
||||
return 600.0f;
|
||||
case 6:
|
||||
return 800.0f;
|
||||
}
|
||||
return -1.0f;
|
||||
}
|
||||
}
|
||||
[ViewVariables]
|
||||
public float Falloff
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (Level)
|
||||
{
|
||||
case 0:
|
||||
return 9999f;
|
||||
case 1:
|
||||
return 6.4f;
|
||||
case 2:
|
||||
return 7.0f;
|
||||
case 3:
|
||||
return 8.0f;
|
||||
case 4:
|
||||
return 10.0f;
|
||||
case 5:
|
||||
return 12.0f;
|
||||
case 6:
|
||||
return 12.0f;
|
||||
}
|
||||
return -1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
|
||||
{
|
||||
if (curState is not SingularityComponentState state)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Level = state.Level;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Log;
|
||||
|
||||
namespace Content.Client.Singularity.Components
|
||||
{
|
||||
public class ContainmentFieldComponent : Component
|
||||
{
|
||||
public override string Name => "Containment Field";
|
||||
|
||||
private SpriteComponent? _spriteComponent;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
if (!Owner.TryGetComponent(out _spriteComponent))
|
||||
{
|
||||
Logger.Error("Containmentfieldcomponent created without spritecomponent");
|
||||
}
|
||||
else
|
||||
{
|
||||
_spriteComponent.Directional = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Content.Client/Singularity/Components/ISingularity.cs
Normal file
12
Content.Client/Singularity/Components/ISingularity.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
|
||||
|
||||
namespace Content.Client.Singularity.Components
|
||||
{
|
||||
interface IClientSingularityInstance
|
||||
{
|
||||
public float Intensity { get; }
|
||||
public float Falloff { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Client.Singularity.Components
|
||||
{
|
||||
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(IClientSingularityInstance))]
|
||||
public class ToySingularityComponent : Component, IClientSingularityInstance
|
||||
{
|
||||
public override string Name => "ToySingularity";
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Falloff { get; set; } = 2.0f;
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Intensity { get; set; } = 0.25f;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user