forked from DeltaV-Station/Delta-v
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makes the singularity engine actually work stably. (#4068)
* Add GNU Octave script for tuning singularity engine. startsingularityengine is now properly tuned & sets up radiation collectors. FTLize RadiationCollectorComponent. * Fix bugs with radiation collectors producing infinite power. * Ensure singularities don't instantly annihilate other singularities (causing new singularities to instantly dissolve) Technically found by a "bug" where a singularity generator would make multiple singularities, but this renders that bug harmless. * Tune singularity shield emitters to hopefully randomly fail less, and add an Octave script for looking into that * Fix singularity shader * Map in an unfinished PA into Saltern * Correct PA particles being counted twice by singularity calculations, add singulo food component * Hopefully stop "level 1 singulo stuck in a corner" issues by freezing it when it goes to level 1 from any other level * Apply suggestions on 'jazz' PR
- Loading branch information
Showing
20 changed files
with
422 additions
and
151 deletions.
There are no files selected for viewing
55 changes: 49 additions & 6 deletions
55
Content.Client/GameObjects/Components/Singularity/ClientSingularityComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,75 @@ | ||
using Content.Shared.GameObjects.Components.Singularity; | ||
using Robust.Shared.GameObjects; | ||
using Robust.Shared.ViewVariables; | ||
|
||
namespace Content.Client.GameObjects.Components.Singularity | ||
{ | ||
[RegisterComponent] | ||
[ComponentReference(typeof(IClientSingularityInstance))] | ||
class ClientSingularityComponent : SharedSingularityComponent, IClientSingularityInstance | ||
{ | ||
public int Level | ||
[ViewVariables] | ||
public int Level { get; set; } | ||
|
||
//I am lazy | ||
[ViewVariables] | ||
public float Intensity | ||
{ | ||
get | ||
{ | ||
return _level; | ||
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; | ||
} | ||
set | ||
} | ||
[ViewVariables] | ||
public float Falloff | ||
{ | ||
get | ||
{ | ||
_level = value; | ||
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; | ||
} | ||
} | ||
private int _level; | ||
|
||
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState) | ||
{ | ||
if (curState is not SingularityComponentState state) | ||
{ | ||
return; | ||
} | ||
_level = state.Level; | ||
Level = state.Level; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.