Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ngines into add-trait-drunken-resilience
  • Loading branch information
angelofallars committed Aug 8, 2024
2 parents e47d39f + ba9a937 commit 6c78d43
Show file tree
Hide file tree
Showing 206 changed files with 713 additions and 256 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface;
using Content.Client.UserInterface.Fragments;
using Content.Shared.CartridgeLoader.Cartridges;
using Content.Shared.CartridgeLoader;

namespace Content.Client.Nyanotrasen.CartridgeLoader.Cartridges;
namespace Content.Client.CartridgeLoader.Cartridges;

public sealed partial class GlimmerMonitorUi : UIFragment
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<cartridges:GlimmerMonitorUiFragment xmlns:cartridges="clr-namespace:Content.Client.Nyanotrasen.CartridgeLoader.Cartridges"
<cartridges:GlimmerMonitorUiFragment xmlns:cartridges="clr-namespace:Content.Client.CartridgeLoader.Cartridges"
xmlns="https://spacestation14.io" Margin="1 0 2 0">
<PanelContainer StyleClasses="BackgroundDark"></PanelContainer>
<BoxContainer Name="SettingsBox" Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="False">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.Linq;
using System.Numerics;
using Content.Client.Nyanotrasen.UserInterface;
using Content.Client.UserInterface;
using Robust.Client.AutoGenerated;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.Nyanotrasen.CartridgeLoader.Cartridges;
namespace Content.Client.CartridgeLoader.Cartridges;

[GenerateTypedNameReferences]
public sealed partial class GlimmerMonitorUiFragment : BoxContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Content.Client.Chat.Managers;
using Robust.Client.Player;

namespace Content.Client.Nyanotrasen.Chat
namespace Content.Client.Chat
{
public sealed class PsionicChatUpdateSystem : EntitySystem
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;

namespace Content.Client.Nyanotrasen.UserInterface;
namespace Content.Client.UserInterface;

public sealed class GlimmerGraph : Control
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
using Robust.Shared.Replays;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Content.Client.Nyanotrasen.Chat; //Nyano - Summary: chat namespace.

namespace Content.Client.UserInterface.Systems.Chat;

Expand Down
11 changes: 5 additions & 6 deletions Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ public override void Update(float frameTime)
var damageScale = MathF.Min(((pressure / Atmospherics.HazardHighPressure) - 1) * Atmospherics.PressureDamageCoefficient, Atmospherics.MaxHighPressureDamage);

_damageableSystem.TryChangeDamage(uid, barotrauma.Damage * damageScale, true, false);

if (!barotrauma.TakingDamage)
{
barotrauma.TakingDamage = true;
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(uid):entity} started taking high pressure damage");
}
_alertsSystem.ShowAlert(uid, AlertType.HighPressure, 2);
}
else
Expand All @@ -258,11 +262,6 @@ public override void Update(float frameTime)
barotrauma.TakingDamage = false;
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(uid):entity} stopped taking pressure damage");
}
if (!barotrauma.TakingDamage)
{
barotrauma.TakingDamage = true;
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(uid):entity} started taking high pressure damage");
}
// Set correct alert.
switch (pressure)
{
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Body/Components/BloodstreamComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Content.Server.Body.Components
{
[RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem), typeof(BloodDeficiencySystem))]
[RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem), typeof(BloodDeficiencySystem), typeof(HemophiliaSystem))]
public sealed partial class BloodstreamComponent : Component
{
public static string DefaultChemicalsSolutionName = "chemicals";
Expand Down
31 changes: 31 additions & 0 deletions Content.Server/Botany/Components/TeleportingTraitComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
namespace Content.Server.Botany
{
[RegisterComponent]

public sealed partial class TeleportingTraitComponent : Component
{
/// <summary>
/// Teleportation radius of produce.
/// </summary>
[DataField]
public float ProduceTeleportRadius;

/// <summary>
/// How much to divide the potency.
/// </summary>
[DataField]
public float PotencyDivide = 10f;

/// <summary>
/// Potency of fruit.
/// </summary>
[DataField]
public float Potency;

/// <summary>
/// Chance of deletion.
/// </summary>
[DataField]
public float DeletionChance = .5f;
}
}
8 changes: 7 additions & 1 deletion Content.Server/Botany/SeedPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ public partial class SeedData
/// </summary>
[DataField("ligneous")] public bool Ligneous;

/// <summary>
/// If true, teleports both fruit and player if slippable.
/// </summary>
[DataField] public bool Teleporting;

// No, I'm not removing these.
// if you re-add these, make sure that they get cloned.
//public PlantSpread Spread { get; set; }
Expand All @@ -215,7 +220,6 @@ public partial class SeedData
//public bool Hematophage { get; set; }
//public bool Thorny { get; set; }
//public bool Stinging { get; set; }
// public bool Teleporting { get; set; }
// public PlantJuicy Juicy { get; set; }

#endregion
Expand Down Expand Up @@ -295,6 +299,7 @@ public SeedData Clone()
Slip = Slip,
Sentient = Sentient,
Ligneous = Ligneous,
Teleporting = Teleporting,

PlantRsi = PlantRsi,
PlantIconState = PlantIconState,
Expand Down Expand Up @@ -358,6 +363,7 @@ public SeedData SpeciesChange(SeedData other)
Slip = Slip,
Sentient = Sentient,
Ligneous = Ligneous,
Teleporting = Teleporting,

PlantRsi = other.PlantRsi,
PlantIconState = other.PlantIconState,
Expand Down
5 changes: 5 additions & 0 deletions Content.Server/Botany/Systems/BotanySystem.Seed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ public IEnumerable<EntityUid> GenerateProduct(SeedData proto, EntityCoordinates
var collisionWake = EnsureComp<CollisionWakeComponent>(entity);
_colWakeSystem.SetEnabled(entity, false, collisionWake);
}
if (proto.Teleporting)
{
var teleporting = EnsureComp<TeleportingTraitComponent>(entity);
TeleportingTraitSystem.SetPotencyRadius(proto.Potency, teleporting);
}
}

return products;
Expand Down
6 changes: 4 additions & 2 deletions Content.Server/Botany/Systems/MutationSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void MutateSeed(ref SeedData seed, float severity)
}

// Add up everything in the bits column and put the number here.
const int totalbits = 275;
const int totalbits = 285;

// Tolerances (55)
MutateFloat(ref seed.NutrientConsumption , 0.05f, 1.2f, 5, totalbits, severity);
Expand All @@ -66,11 +66,12 @@ public void MutateSeed(ref SeedData seed, float severity)
// Kill the plant (30)
MutateBool(ref seed.Viable , false, 30, totalbits, severity);

// Fun (90)
// Fun (100)
MutateBool(ref seed.Seedless , true , 10, totalbits, severity);
MutateBool(ref seed.Slip , true , 10, totalbits, severity);
MutateBool(ref seed.Sentient , true , 10, totalbits, severity);
MutateBool(ref seed.Ligneous , true , 10, totalbits, severity);
MutateBool(ref seed.Teleporting , true , 10, totalbits, severity);
MutateBool(ref seed.Bioluminescent, true , 10, totalbits, severity);
MutateBool(ref seed.TurnIntoKudzu , true , 10, totalbits, severity);
MutateBool(ref seed.CanScream , true , 10, totalbits, severity);
Expand Down Expand Up @@ -120,6 +121,7 @@ public SeedData Cross(SeedData a, SeedData b)
CrossBool(ref result.Slip, a.Slip);
CrossBool(ref result.Sentient, a.Sentient);
CrossBool(ref result.Ligneous, a.Ligneous);
CrossBool(ref result.Teleporting, a.Teleporting);
CrossBool(ref result.Bioluminescent, a.Bioluminescent);
CrossBool(ref result.TurnIntoKudzu, a.TurnIntoKudzu);
CrossBool(ref result.CanScream, a.CanScream);
Expand Down
51 changes: 51 additions & 0 deletions Content.Server/Botany/Systems/TeleportingTraitSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using Robust.Shared.Random;
using Content.Shared.Slippery;
using Content.Server.Fluids.EntitySystems;
using Content.Shared.Chemistry.Components;
using Content.Shared.Popups;

namespace Content.Server.Botany.Systems;

public sealed class TeleportingTraitSystem : EntitySystem
{
[Dependency] private readonly SharedTransformSystem _xform = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly PuddleSystem _puddle = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<TeleportingTraitComponent, SlipEvent>(Teleport);
}

// sets the potency and the radius
public static void SetPotencyRadius(float seedPotency, TeleportingTraitComponent comp)
{
comp.Potency = seedPotency;
comp.ProduceTeleportRadius = comp.Potency / comp.PotencyDivide;
}

// teleports both the produce and the foolish fool who slipped on it to a random postion limited by the radius
private void Teleport(EntityUid uid, TeleportingTraitComponent comp, ref SlipEvent args)
{
var coordinates = Transform(uid).Coordinates;
_xform.SetCoordinates(uid, coordinates.Offset(_random.NextVector2(comp.ProduceTeleportRadius)));
_popup.PopupEntity(Loc.GetString("teleporting-trait-component-slipped"), args.Slipped, args.Slipped, PopupType.SmallCaution);
_xform.SetCoordinates(args.Slipped, coordinates.Offset(_random.NextVector2(comp.ProduceTeleportRadius)));
VanishProbablity(uid, comp);
}

// chance of being deleted and then spawnin the goop
private void VanishProbablity(EntityUid uid, TeleportingTraitComponent comp)
{
if (!_random.Prob(comp.DeletionChance))
return;
Solution vanishSolution = new();
vanishSolution.AddReagent("Slime", comp.Potency / 2);
_puddle.TrySpillAt(uid, vanishSolution, out _);
QueueDel(uid);
}
}

File renamed without changes.
8 changes: 3 additions & 5 deletions Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Content.Server.Language;
using Content.Server.Speech.Components;
using Content.Server.Speech.EntitySystems;
using Content.Server.Nyanotrasen.Chat;
using Content.Server.Chat;
using Content.Server.Station.Components;
using Content.Server.Station.Systems;
using Content.Shared.ActionBlocker;
Expand Down Expand Up @@ -69,9 +69,7 @@ public sealed partial class ChatSystem : SharedChatSystem
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] private readonly ReplacementAccentSystem _wordreplacement = default!;
[Dependency] private readonly LanguageSystem _language = default!;

//Nyano - Summary: pulls in the nyano chat system for psionics.
[Dependency] private readonly NyanoChatSystem _nyanoChatSystem = default!;
[Dependency] private readonly TelepathicChatSystem _telepath = default!;

public const int VoiceRange = 10; // how far voice goes in world units
public const int WhisperClearRange = 2; // how far whisper goes while still being understandable, in world units
Expand Down Expand Up @@ -277,7 +275,7 @@ public void TrySendInGameICMessage(
break;
//Nyano - Summary: case adds the telepathic chat sending ability.
case InGameICChatType.Telepathic:
_nyanoChatSystem.SendTelepathicChat(source, message, range == ChatTransmitRange.HideChat);
_telepath.SendTelepathicChat(source, message, range == ChatTransmitRange.HideChat);
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
using System.Linq;
using System.Text;

namespace Content.Server.Nyanotrasen.Chat
namespace Content.Server.Chat
{
/// <summary>
/// Extensions for nyano's chat stuff
/// Extensions for Telepathic chat stuff
/// </summary>

public sealed class NyanoChatSystem : EntitySystem
public sealed class TelepathicChatSystem : EntitySystem
{
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Content.Server.Nyanotrasen.Chat
namespace Content.Server.Chat
{
/// <summary>
/// Repeats whatever is happening in telepathic chat.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Shared.Tools;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Content.Shared.Storage;
using Robust.Shared.Prototypes;

namespace Content.Server.Construction.Components
{
Expand All @@ -10,13 +11,13 @@ namespace Content.Server.Construction.Components
[RegisterComponent]
public sealed partial class WelderRefinableComponent : Component
{
[DataField("refineResult")]
public HashSet<string>? RefineResult = new();
[DataField]
public List<EntitySpawnEntry> RefineResult = new();

[DataField("refineTime")]
[DataField]
public float RefineTime = 2f;

[DataField("qualityNeeded", customTypeSerializer:typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
public string QualityNeeded = "Welding";
[DataField]
public ProtoId<ToolQualityPrototype> QualityNeeded = "Welding";
}
}
15 changes: 3 additions & 12 deletions Content.Server/Construction/RefiningSystem.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
using Content.Server.Construction.Components;
using Content.Server.Stack;
using Content.Shared.Construction;
using Content.Shared.DoAfter;
using Content.Shared.Interaction;
using Content.Shared.Stacks;
using Content.Shared.Tools;
using Robust.Shared.Serialization;
using Content.Shared.Storage;
using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;

namespace Content.Server.Construction
{
public sealed class RefiningSystem : EntitySystem
{
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
[Dependency] private readonly StackSystem _stackSystem = default!;
public override void Initialize()
{
base.Initialize();
Expand All @@ -39,14 +35,9 @@ private void OnDoAfter(EntityUid uid, WelderRefinableComponent component, Welder
EntityManager.DeleteEntity(uid);

// spawn each result after refine
foreach (var result in component.RefineResult!)
foreach (var ent in EntitySpawnCollection.GetSpawns(component.RefineResult))
{
var droppedEnt = EntityManager.SpawnEntity(result, resultPosition);

// TODO: If something has a stack... Just use a prototype with a single thing in the stack.
// This is not a good way to do it.
if (TryComp<StackComponent>(droppedEnt, out var stack))
_stackSystem.SetCount(droppedEnt, 1, stack);
Spawn(ent, resultPosition);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/DeltaV/NPC/Roboisseur/RoboisseurSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public override void Update(float frameTime)
}
else if (CheckTier(roboisseur.DesiredPrototype.ID, roboisseur) > 2)
message = Loc.GetString(_random.Pick(roboisseur.DemandMessagesTier2), ("item", roboisseur.DesiredPrototype.Name));
_chat.TrySendInGameICMessage(roboisseur.Owner, message, InGameICChatType.Speak, false);
_chat.TrySendInGameICMessage(roboisseur.Owner, message, InGameICChatType.Speak, true);
}

if (roboisseur.Accumulator >= roboisseur.ResetTime.TotalSeconds)
Expand Down Expand Up @@ -100,7 +100,7 @@ private void OnInteractHand(EntityUid uid, RoboisseurComponent component, Intera
if (CheckTier(component.DesiredPrototype.ID, component) > 1)
message = Loc.GetString(_random.Pick(component.DemandMessagesTier2), ("item", component.DesiredPrototype.Name));

_chat.TrySendInGameICMessage(component.Owner, message, InGameICChatType.Speak, false);
_chat.TrySendInGameICMessage(component.Owner, message, InGameICChatType.Speak, true);
}

private void OnInteractUsing(EntityUid uid, RoboisseurComponent component, InteractUsingEvent args)
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 6c78d43

Please sign in to comment.