Skip to content

Commit

Permalink
Merge pull request #176 from Gorox221/supermatter_huyater
Browse files Browse the repository at this point in the history
суперматерия
  • Loading branch information
Yuoko authored Jul 14, 2024
2 parents 49fd9f7 + 1cf7f37 commit e8a6345
Show file tree
Hide file tree
Showing 27 changed files with 1,349 additions and 9 deletions.
629 changes: 629 additions & 0 deletions Content.Server/Ganimed/SM/SupermatterSystem.cs

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions Content.Server/Singularity/EntitySystems/SingularitySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
using Content.Shared.Singularity.Components;
using Content.Shared.Singularity.EntitySystems;
using Content.Shared.Singularity.Events;
using Content.Shared.Supermatter.Components;
using Robust.Server.GameStates;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Player;
using Robust.Shared.Timing;

namespace Content.Server.Singularity.EntitySystems;
Expand Down Expand Up @@ -37,6 +36,11 @@ public sealed class SingularitySystem : SharedSingularitySystem
/// </summary>
public const float BaseEntityEnergy = 1f;

/// <summary>
/// Whether or not the singuloo has eaten the supermatter crystal
/// </summary>
public bool HasEatenSM = false;

public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -103,7 +107,7 @@ public void SetEnergy(EntityUid uid, float value, SingularityComponent? singular
{
// Normally, a level 6 singularity requires the supermatter + 3000 energy.
// The required amount of energy has been bumped up to compensate for the lack of the supermatter.
>= 5000 => 6,
>= 5000 when HasEatenSM => 6,
>= 2000 => 5,
>= 1000 => 4,
>= 500 => 3,
Expand Down Expand Up @@ -216,7 +220,8 @@ public void OnConsumedEntity(EntityUid uid, SingularityComponent comp, ref Entit
// Don't double count singulo food
if (HasComp<SinguloFoodComponent>(args.Entity))
return;

if (HasComp<SupermatterComponent>(uid))
HasEatenSM = true;
AdjustEnergy(uid, BaseEntityEnergy, singularity: comp);
}

Expand Down Expand Up @@ -306,4 +311,4 @@ private void UpdateGravityWell(EntityUid uid, GravityWellComponent comp, Singula
}

#endregion Event Handlers
}
}
49 changes: 49 additions & 0 deletions Content.Shared/Ganimed/SM/SharedSupermatterSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using Content.Shared.Supermatter.Components;
using Robust.Shared.Serialization;

namespace Content.Shared.Supermatter.Systems;

public abstract class SharedSupermatterSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SupermatterComponent, ComponentStartup>(OnSupermatterStartup);
}

public enum SuperMatterSound : sbyte
{
Aggressive = 0,
Delam = 1
}

public enum DelamType : sbyte
{
Explosion = 0,
Singulo = 1,
Tesla = 2,
Cascade = 3 // save for later
}
#region Getters/Setters

public void OnSupermatterStartup(EntityUid uid, SupermatterComponent comp, ComponentStartup args)
{
}

#endregion Getters/Setters

#region Serialization
/// <summary>
/// A state wrapper used to sync the supermatter between the server and client.
/// </summary>
[Serializable, NetSerializable]
protected sealed class SupermatterComponentState : ComponentState
{
public SupermatterComponentState(SupermatterComponent supermatter)
{
}
}

#endregion Serialization

}
Loading

0 comments on commit e8a6345

Please sign in to comment.