Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up, increase build stability #583

Merged
merged 6 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Content.Client/Audio/ContentAudioSystem.CP14AmbientLoop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ private void OnRoundEndMessageAmbientLoop()

private void CP14UpdateAmbientLoops()
{
return; //DISABLED UNTIL CLIENT ERROR SPAM FIXED

if (_timing.CurTime <= _nextUpdateTime)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ private void AddAntagVerbs(GetVerbsEvent<Verb> args)
var targetPlayer = targetActor.PlayerSession;


Verb CP14Bandit = new()
Verb CP14Sociopath = new()
{
Text = Loc.GetString("cp14-admin-verb-text-make-bandit"),
Text = Loc.GetString("cp14-admin-verb-text-make-sociopath"),
Category = VerbCategory.Antag,
Icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/Clothing/Hands/Gloves/Color/black.rsi"),
"icon"), //TODO
Expand All @@ -65,9 +65,9 @@ private void AddAntagVerbs(GetVerbsEvent<Verb> args)
//_antag.ForceMakeAntag<CP14BanditRoleComponent>(targetPlayer, "CP14Bandit"); //TODO
},
Impact = LogImpact.High,
Message = Loc.GetString("cp14-admin-verb-make-bandit"),
Message = Loc.GetString("cp14-admin-verb-make-sociopath"),
};
args.Verbs.Add(CP14Bandit);
args.Verbs.Add(CP14Sociopath);

/* CP14 disable default antags
Verb traitor = new()
Expand Down
19 changes: 13 additions & 6 deletions Content.Server/_CP14/Currency/CP14CurrencySystem.Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ private void OnGetVerb(Entity<CP14CurrencyConverterComponent> ent, ref GetVerbsE
}



private void OnConverterExamine(Entity<CP14CurrencyConverterComponent> ent, ref ExaminedEvent args)
{
var push = $"{Loc.GetString("cp14-currency-converter-examine-title")} {GetCurrencyPrettyString(ent.Comp.Balance)}";
var push =
$"{Loc.GetString("cp14-currency-converter-examine-title")} {GetCurrencyPrettyString(ent.Comp.Balance)}";
args.PushMarkup(push);
}

Expand All @@ -129,7 +129,10 @@ private void OnInteractUsing(Entity<CP14CurrencyConverterComponent> ent, ref Int
_audio.PlayPvs(ent.Comp.InsertSound, ent, AudioParams.Default.WithMaxDistance(3));
}

public HashSet<EntityUid> GenerateMoney(EntProtoId currencyType, int target, EntityCoordinates coordinates, out int remainder)
public HashSet<EntityUid> GenerateMoney(EntProtoId currencyType,
int target,
EntityCoordinates coordinates,
out int remainder)
{
remainder = target;
HashSet<EntityUid> spawns = new();
Expand Down Expand Up @@ -164,15 +167,20 @@ private bool ProcessEntity(EntityUid ent, ref int remainder, HashSet<EntityUid>
spawns.Add(ent);
remainder -= singleCurrency;

if (TryComp<StackComponent>(ent, out var stack) && _proto.TryIndex<StackPrototype>(stack.StackTypeId, out var indexedStack))
if (TryComp<StackComponent>(ent, out var stack) &&
_proto.TryIndex<StackPrototype>(stack.StackTypeId, out var indexedStack))
{
AdjustStack(ent, stack, indexedStack, singleCurrency, ref remainder);
}

return false;
}

private void AdjustStack(EntityUid ent, StackComponent stack, StackPrototype stackProto, float singleCurrency, ref int remainder)
private void AdjustStack(EntityUid ent,
StackComponent stack,
StackPrototype stackProto,
float singleCurrency,
ref int remainder)
{
var singleStackCurrency = singleCurrency / stack.Count;
var stackLeftSpace = stackProto.MaxCount - stack.Count;
Expand All @@ -188,5 +196,4 @@ private void AdjustStack(EntityUid ent, StackComponent stack, StackPrototype sta
}
}
}

}
2 changes: 2 additions & 0 deletions Content.Server/_CP14/Currency/CP14CurrencySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Content.Shared.Whitelist;
using Robust.Server.Audio;
using Robust.Shared.Prototypes;

namespace Content.Server._CP14.Currency;

public sealed partial class CP14CurrencySystem : CP14SharedCurrencySystem
Expand All @@ -17,6 +18,7 @@ public sealed partial class CP14CurrencySystem : CP14SharedCurrencySystem
[Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;

public override void Initialize()
{
base.Initialize();
Expand Down
11 changes: 0 additions & 11 deletions Content.Server/_CP14/Roles/CP14BanditRoleComponent.cs

This file was deleted.

11 changes: 11 additions & 0 deletions Content.Server/_CP14/Roles/CP14SociopathRoleComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Content.Shared.Roles;

namespace Content.Server._CP14.Roles;

/// <summary>
/// Added to mind role entities to tag that they are a sociopath.
/// </summary>
[RegisterComponent]
public sealed partial class CP14SociopathRoleComponent : BaseMindRoleComponent
{
}
7 changes: 5 additions & 2 deletions Content.Server/_CP14/Temperature/CP14FireSpreadSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public sealed partial class CP14FireSpreadSystem : EntitySystem
[Dependency] private readonly ITileDefinitionManager _tiledef = default!;

private EntProtoId _fireProto = "CP14Fire";

public override void Initialize()
{
SubscribeLocalEvent<CP14FireSpreadComponent, OnFireChangedEvent>(OnCompInit);
Expand Down Expand Up @@ -103,7 +104,9 @@ private void UpdateFireSpread()

private void IgniteEntities(EntityUid uid, CP14FireSpreadComponent spread)
{
var targets = _lookup.GetEntitiesInRange<FlammableComponent>(_transform.GetMapCoordinates(uid), spread.Radius, LookupFlags.Uncontained);
var targets = _lookup.GetEntitiesInRange<FlammableComponent>(_transform.GetMapCoordinates(uid),
spread.Radius,
LookupFlags.Uncontained);
foreach (var target in targets)
{
if (!_random.Prob(spread.Prob))
Expand Down Expand Up @@ -143,7 +146,7 @@ private void IgniteTiles(EntityUid uid, CP14FireSpreadComponent spread)
continue;

Spawn(_fireProto, _mapSystem.ToCenterCoordinates(tileref, grid));
_tile.ReplaceTile(tileref, (ContentTileDefinition) _tiledef[tile.BurnedTile]);
_tile.ReplaceTile(tileref, (ContentTileDefinition)_tiledef[tile.BurnedTile]);
}
}
}
4 changes: 2 additions & 2 deletions Resources/Locale/en-US/_CP14/administration/antag.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cp14-admin-verb-text-make-bandit = Make bandit
cp14-admin-verb-make-bandit = Add to target antagonist role “Bandit
cp14-admin-verb-text-make-sociopath = Make sociopath
cp14-admin-verb-make-sociopath = Add to target antagonist role “Sociopath
6 changes: 3 additions & 3 deletions Resources/Locale/en-US/_CP14/antags/antags.ftl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cp14-roles-antag-bandit-name = Bandit
cp14-roles-antag-bandit-objective = Defy morality and the law. You need money. A lot of money, and you can earn it in any way you want, including robbery and murder.
cp14-roles-antag-bandit-briefing = The cruel past has opened your eyes: the creatures around you are weaklings trying to cling to so-called “morality”. That word is foreign to you. You know that murder or robbery is just one of the tools to achieve your goals.
cp14-roles-antag-sociopath-name = Sociopath
cp14-roles-antag-sociopath-objective = You don't understand morality or empathy. As long as other people are constrained by them, you don't have to worry about exactly how to accomplish your tasks.
cp14-roles-antag-sociopath-briefing = From birth you don't know what emotion, morality or empathy are. You only know that other people are constrained by them, and this prevents them from being effective. You have certain goals - and you can strive to accomplish them by ANY means.
4 changes: 2 additions & 2 deletions Resources/Locale/ru-RU/_CP14/administration/antag.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cp14-admin-verb-text-make-bandit = Сделать бандитом
cp14-admin-verb-make-bandit = Добавить цели роль антагониста "Бандит"
cp14-admin-verb-text-make-sociopath = Сделать социопатом
cp14-admin-verb-make-sociopath = Добавить цели роль антагониста "Социопат"
6 changes: 3 additions & 3 deletions Resources/Locale/ru-RU/_CP14/antags/antags.ftl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cp14-roles-antag-bandit-name = Бандит
cp14-roles-antag-bandit-objective = Отриньте моральные нормы и закон. Вам нужны деньги. Много денег, и вы можете зарабатывать их любыми способами, включая грабежи, разбой и убийства.
cp14-roles-antag-bandit-briefing = Жестокое прошлое открыло вам глаза: окружающие вас существа - слабаки, старающиеся держаться за так называемую "мораль". Вам это слово чуждо. Вы знаете, что убийство или грабежи - это просто один из инструментов достижения ваших целей.
cp14-roles-antag-sociopath-name = Социопат
cp14-roles-antag-sociopath-objective = Вам непонятны принципы морали или сочувствия. Пока остальные люди скованы ими, вам не нужно заботиться о том, как именно выполнить свои задачи.
cp14-roles-antag-sociopath-briefing = С самого рождения вы не знаете что такое эмоции, мораль или сочувствие. Вы знаете только, что остальные люди скованы ими, и это мешает им действовать эффективно. У вас есть определенные задачи - и вы можете стремиться к их выполнению ЛЮБЫМИ методами.
Loading
Loading