Files
wwdpublic/Content.Shared/_Goobstation/Blob/Components/BlobCoreComponent.cs
Kyoth25f ed2301f840 Port Blob (#2441)
Ports Blob from https://github.com/Goob-Station/Goob-Station/pull/975
that was ported from https://github.com/Rxup/space-station-14.

Credit to VigersRay for original code, Roudenn and Rxup for maintaining
and jorgun for the Goob port.

---

- [X] Port https://github.com/Goob-Station/Goob-Station/pull/975;
- [X] Port https://github.com/Goob-Station/Goob-Station/pull/1209;
- [X] Port Blob related code from
https://github.com/Goob-Station/Goob-Station/pull/1262;
- [X] Port Blob related code from
https://github.com/Goob-Station/Goob-Station/pull/1340;
- [X] Port https://github.com/Goob-Station/Goob-Station/pull/1408;
- [X] Port https://github.com/Goob-Station/Goob-Station/pull/1419;
- [X] Port https://github.com/Goob-Station/Goob-Station/pull/1440;
- [X] Port https://github.com/Goob-Station/Goob-Station/pull/1817;
- [X] Port https://github.com/Goob-Station/Goob-Station/pull/2077;
- [ ] ~Port https://github.com/Goob-Station/Goob-Station/pull/1916~;
- [ ] ~Port https://github.com/Goob-Station/Goob-Station/pull/1917~;
- [X] Port https://github.com/Goob-Station/Goob-Station/pull/2077;
- [X] Port https://github.com/Goob-Station/Goob-Station/pull/2092;
- [X] Port https://github.com/Goob-Station/Goob-Station/pull/2546;
- [X] Port https://github.com/Rxup/space-station-14/pull/963;
- [X] Port https://github.com/Rxup/space-station-14/pull/998;
- [ ] ~Port https://github.com/Goob-Station/Goob-Station/pull/2563~.

- [X] Enable Blob and Blob gamemode;
- [X] Add `StationGlobConfig` to all stations;
- [X] Use `AnnouncerSystem` in `BlobRuleSystem.cs`;
- [X] Blob language and Hivemind (from
https://github.com/Rxup/space-station-14/pull/176);
- [x] Change CVars location;
- [X] Add media.

---

<details><summary><h1>Media</h1></summary>
<p>
https://youtu.be/-WtMQwRcmrU?si=su3An6RtiCTZg-DV
</p>
</details>

---

🆑 VigersRay, Roudenn, Rxup, vladospupuos, fishbait and Kyoth25f
- add: Added a new antagonist: Blob

---------

Co-authored-by: fishbait <gnesse@gmail.com>
Co-authored-by: Fishbait <Fishbait@git.ml>
Co-authored-by: Aiden <aiden@djkraz.com>
Co-authored-by: beck-thompson <107373427+beck-thompson@users.noreply.github.com>
Co-authored-by: lanse12 <cloudability.ez@gmail.com>
Co-authored-by: BombasterDS <deniskaporoshok@gmail.com>
Co-authored-by: Aviu00 <93730715+Aviu00@users.noreply.github.com>
Co-authored-by: Piras314 <p1r4s@proton.me>
Co-authored-by: shibe <95730644+shibechef@users.noreply.github.com>
Co-authored-by: Ilya246 <57039557+Ilya246@users.noreply.github.com>
Co-authored-by: JohnOakman <sremy2012@hotmail.fr>
Co-authored-by: Fat Engineer Gaming <159075414+Fat-Engineer-Gaming@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Rouden <149893554+Roudenn@users.noreply.github.com>
2025-07-12 12:20:25 +10:00

224 lines
5.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Content.Shared.Damage;
using Content.Shared.Explosion;
using Content.Shared.FixedPoint;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared._Goobstation.Blob.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class BlobCoreComponent : Component
{
#region Live Data
[ViewVariables]
public EntityUid? Observer = default!;
[ViewVariables]
public HashSet<EntityUid> BlobTiles = [];
[ViewVariables]
public List<EntityUid> Actions = [];
[ViewVariables]
public TimeSpan NextAction = TimeSpan.Zero;
[ViewVariables]
public BlobChemType CurrentChem = BlobChemType.ReactiveSpines;
[ViewVariables]
public FixedPoint2 MaxStorageAmount = 500;
#endregion
#region Balance
[DataField]
public FixedPoint2 CoreBlobTotalHealth = 400;
[DataField]
public float StartingMoney = 250f; // enough for 2 resource nodes and a bit of defensive action
[DataField]
public float AttackRate = 0.3f;
[DataField]
public float GrowRate = 0.1f;
[DataField]
public bool CanSplit = true;
[DataField]
public float TilesRadiusLimit = 9f;
#endregion
#region Damage Specifiers
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public BlobChemDamage ChemDamageDict { get; set; } = new()
{
{
BlobChemType.BlazingOil, new DamageSpecifier()
{
DamageDict = new Dictionary<string, FixedPoint2>
{
{ "Heat", 15 },
{ "Structural", 150 },
}
}
},
{
BlobChemType.ReactiveSpines, new DamageSpecifier()
{
DamageDict = new Dictionary<string, FixedPoint2>
{
{ "Blunt", 8 },
{ "Slash", 8 },
{ "Piercing", 8 },
{ "Structural", 150 },
}
}
},
{
BlobChemType.ExplosiveLattice, new DamageSpecifier()
{
DamageDict = new Dictionary<string, FixedPoint2>
{
{ "Heat", 5 },
{ "Structural", 150 },
}
}
},
{
BlobChemType.ElectromagneticWeb, new DamageSpecifier()
{
DamageDict = new Dictionary<string, FixedPoint2>
{
{ "Structural", 150 },
{ "Heat", 20 },
},
}
},
{
BlobChemType.RegenerativeMateria, new DamageSpecifier()
{
DamageDict = new Dictionary<string, FixedPoint2>
{
{ "Structural", 150 },
{ "Poison", 15 },
}
}
},
};
#endregion
#region Blob Chems
[ViewVariables]
public readonly BlobChemColors ChemСolors = new()
{
{BlobChemType.ReactiveSpines, Color.FromHex("#637b19")},
{BlobChemType.BlazingOil, Color.FromHex("#937000")},
{BlobChemType.RegenerativeMateria, Color.FromHex("#441e59")},
{BlobChemType.ExplosiveLattice, Color.FromHex("#6e1900")},
{BlobChemType.ElectromagneticWeb, Color.FromHex("#0d7777")},
};
[DataField]
public BlobChemType DefaultChem = BlobChemType.ReactiveSpines;
#endregion
#region Blob Costs
[DataField]
public int ResourceBlobsTotal;
[DataField]
public FixedPoint2 AttackCost = 4;
[DataField]
public BlobTileCosts BlobTileCosts = new()
{
{BlobTileType.Core, 0},
{BlobTileType.Invalid, 0},
{BlobTileType.Resource, 60},
{BlobTileType.Factory, 80},
{BlobTileType.Node, 50},
{BlobTileType.Reflective, 15},
{BlobTileType.Strong, 15},
{BlobTileType.Normal, 6},
{BlobTileType.Storage, 50},
// {BlobTileType.Turret, 75},
};
[DataField]
public FixedPoint2 BlobbernautCost = 60;
[DataField]
public FixedPoint2 SplitCoreCost = 400;
[DataField]
public FixedPoint2 SwapCoreCost = 200;
[DataField]
public FixedPoint2 SwapChemCost = 70;
#endregion
#region Prototypes
[DataField]
public BlobTileProto TilePrototypes = new()
{
{BlobTileType.Resource, "ResourceBlobTile"},
{BlobTileType.Factory, "FactoryBlobTile"},
{BlobTileType.Node, "NodeBlobTile"},
{BlobTileType.Reflective, "ReflectiveBlobTile"},
{BlobTileType.Strong, "StrongBlobTile"},
{BlobTileType.Normal, "NormalBlobTile"},
{BlobTileType.Invalid, "NormalBlobTile"}, // wtf
{BlobTileType.Storage, "StorageBlobTile"},
//{BlobTileType.Turret, "TurretBlobTile"},
{BlobTileType.Core, "CoreBlobTile"},
};
[DataField(required: true)]
public List<ProtoId<EntityPrototype>> ActionPrototypes = [];
[DataField]
public ProtoId<ExplosionPrototype> BlobExplosive = "Blob";
[DataField]
public EntProtoId<BlobObserverComponent> ObserverBlobPrototype = "MobObserverBlob";
[DataField]
public EntProtoId MindRoleBlobPrototypeId = "MindRoleBlob";
#endregion
#region Sounds
[DataField]
public SoundSpecifier GreetSoundNotification = new SoundPathSpecifier("/Audio/Effects/clang.ogg");
[DataField]
public SoundSpecifier AttackSound = new SoundPathSpecifier("/Audio/Animals/Blob/blobattack.ogg");
#endregion
}
[Serializable, NetSerializable]
public enum BlobChemType : byte
{
BlazingOil,
ReactiveSpines,
RegenerativeMateria,
ExplosiveLattice,
ElectromagneticWeb
}