Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rxup committed Sep 29, 2023
1 parent 3c9f5cb commit 27416ed
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 152 deletions.
2 changes: 0 additions & 2 deletions Content.Client/Blob/BlobObserverSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ namespace Content.Client.Blob;
public sealed class BlobObserverSystem : SharedBlobObserverSystem
{
[Dependency] private readonly ILightManager _lightManager = default!;
[Dependency] private readonly ActionsSystem _actionsSystem = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;

public override void Initialize()
{
Expand Down
9 changes: 7 additions & 2 deletions Content.Server/Backmen/Shipwrecked/ShipwreckedRuleSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.ComponentModel.Design;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Numerics;
using System.Text;
Expand Down Expand Up @@ -271,6 +270,12 @@ private void SpawnPlanet(EntityUid uid, ShipwreckedRuleComponent component)
var biome = AddComp<BiomeComponent>(planetMapUid);
_biomeSystem.SetSeed(biome, _random.Next());
_biomeSystem.SetTemplate(biome, _prototypeManager.Index<BiomeTemplatePrototype>(destination.BiomePrototype));
_biomeSystem.AddMarkerLayer(biome, "OreTin");
_biomeSystem.AddMarkerLayer(biome, "OreGold");
_biomeSystem.AddMarkerLayer(biome, "OreSilver");
_biomeSystem.AddMarkerLayer(biome, "OrePlasma");
_biomeSystem.AddMarkerLayer(biome, "OreUranium");
_biomeSystem.AddTemplate(biome, "Loot", _prototypeManager.Index<BiomeTemplatePrototype>("Caves"), 1);
Dirty(planetMapUid, biome);

// Gravity
Expand Down
26 changes: 25 additions & 1 deletion Content.Server/Blob/BlobCoreSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Linq;
using System.Numerics;
using Content.Server.Actions;
using Content.Server.AlertLevel;
using Content.Server.Backmen.GameTicking.Rules.Components;
using Content.Server.Chat.Managers;
Expand Down Expand Up @@ -56,6 +57,7 @@ public sealed class BlobCoreSystem : EntitySystem
[Dependency] private readonly ActorSystem _actorSystem = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly MetaDataSystem _metaDataSystem = default!;
[Dependency] private readonly ActionsSystem _action = default!;

[ValidatePrototypeId<EntityPrototype>] private const string BlobCaptureObjective = "BlobCaptureObjective";
public override void Initialize()
Expand Down Expand Up @@ -108,7 +110,7 @@ private void OnPlayerAttached(EntityUid uid, BlobCoreComponent component, Player
if (!_mapManager.TryGetGrid(xform.GridUid, out var map))
return;

Timer.Spawn(100,()=>CreateBlobObserver(uid, args.Player.UserId, component));
CreateBlobObserver(uid, args.Player.UserId, component);
}

public bool CreateBlobObserver(EntityUid blobCoreUid, NetUserId userId, BlobCoreComponent? core = null)
Expand Down Expand Up @@ -147,6 +149,17 @@ private void OnDamaged(EntityUid uid, BlobCoreComponent component, DamageChanged
_alerts.ShowAlert(component.Observer.Value, AlertType.BlobHealth, (short) Math.Clamp(Math.Round(currentHealth.Float() / 10f), 0, 20));
}

[ValidatePrototypeId<EntityPrototype>] private const string ActionHelpBlob = "ActionHelpBlob";
[ValidatePrototypeId<EntityPrototype>] private const string ActionSwapBlobChem = "ActionSwapBlobChem";
[ValidatePrototypeId<EntityPrototype>] private const string ActionTeleportBlobToCore = "ActionTeleportBlobToCore";
[ValidatePrototypeId<EntityPrototype>] private const string ActionTeleportBlobToNode = "ActionTeleportBlobToNode";
[ValidatePrototypeId<EntityPrototype>] private const string ActionCreateBlobFactory = "ActionCreateBlobFactory";
[ValidatePrototypeId<EntityPrototype>] private const string ActionCreateBlobResource = "ActionCreateBlobResource";
[ValidatePrototypeId<EntityPrototype>] private const string ActionCreateBlobNode = "ActionCreateBlobNode";
[ValidatePrototypeId<EntityPrototype>] private const string ActionCreateBlobbernaut = "ActionCreateBlobbernaut";
[ValidatePrototypeId<EntityPrototype>] private const string ActionSplitBlobCore = "ActionSplitBlobCore";
[ValidatePrototypeId<EntityPrototype>] private const string ActionSwapBlobCore = "ActionSwapBlobCore";

private void OnStartup(EntityUid uid, BlobCoreComponent component, ComponentStartup args)
{
ChangeBlobPoint(uid, 0, component);
Expand All @@ -161,6 +174,17 @@ private void OnStartup(EntityUid uid, BlobCoreComponent component, ComponentStar
component.BlobTiles.Add(uid);

ChangeChem(uid, component.DefaultChem, component);

_action.AddAction(uid, ref component.ActionHelpBlob, ActionHelpBlob);
_action.AddAction(uid, ref component.ActionSwapBlobChem, ActionSwapBlobChem);
_action.AddAction(uid, ref component.ActionTeleportBlobToCore, ActionTeleportBlobToCore);
_action.AddAction(uid, ref component.ActionTeleportBlobToNode, ActionTeleportBlobToNode);
_action.AddAction(uid, ref component.ActionCreateBlobFactory, ActionCreateBlobFactory);
_action.AddAction(uid, ref component.ActionCreateBlobResource, ActionCreateBlobResource);
_action.AddAction(uid, ref component.ActionCreateBlobNode, ActionCreateBlobNode);
_action.AddAction(uid, ref component.ActionCreateBlobbernaut, ActionCreateBlobbernaut);
_action.AddAction(uid, ref component.ActionSplitBlobCore, ActionSplitBlobCore);
_action.AddAction(uid, ref component.ActionSwapBlobCore, ActionSwapBlobCore);
}

public void ChangeChem(EntityUid uid, BlobChemType newChem, BlobCoreComponent? component = null)
Expand Down
Loading

0 comments on commit 27416ed

Please sign in to comment.