[Tweak] Много всякого. В основном генокрады. (#79)

* tweak: Снижено дополнительное тк за войну 40 -> 20

* add: репутация больше не влияет на выпадение антажки

* fix: фикс награды карго на лазеры

* tweak: игроков на 1 генокрада 10 -> 15.

* tweak: максимум генокрадов 5 -> 4

* tweak: Время регенерации генокрада 20 -> 60 секунд

* add: переводы для генокрадов

* tweak: убить папку Miracle

* add: переводы сущностей генокрадов

* tweak: снижение эффективности и цены мешков с адреналином

* fix: опечатка

* add: еще переводики

* fix: теперь броня линга не замедляет навсегда

* tweak: измеено получение очков за генокрадов

Больше нельзя получать очки за поглощение людей. Теперь их можно получать только за поглощение других генокрадов. Это также повышает максимальный запас химикатов на 40

* add: жало извлечения днк для генокрада

* add: перезарядка способностей снаряжения генокрада

* tweak: правильное расположение иконок способностей генокрада

* add: способность биоразложения для генокрада

* fix: фикс иконок

* add: последние детали переводов

* add: никаких больше воров пацифистов
This commit is contained in:
Remuchi
2024-02-16 01:07:59 +07:00
committed by GitHub
parent aaab87d1c7
commit 86d16f175e
41 changed files with 520 additions and 254 deletions

View File

@@ -69,7 +69,7 @@ public sealed partial class AdminVerbSystem
{
Text = Loc.GetString("admin-verb-text-make-changeling"),
Category = VerbCategory.Antag,
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/Actions/ling_absorb.png")),
Icon = new SpriteSpecifier.Texture(new ("/Textures/White/Actions/changeling.rsi/absorb.png")),
Act = () =>
{
if (!_minds.TryGetSession(targetMindComp.Mind, out var session))
@@ -160,7 +160,7 @@ public sealed partial class AdminVerbSystem
if (!_minds.TryGetSession(targetMindComp.Mind, out var session))
return;
_thief.AdminMakeThief(session, false); //Midround add pacific is bad
_thief.AdminMakeThief(session); //Midround add pacific is bad
},
Impact = LogImpact.High,
Message = Loc.GetString("admin-verb-make-thief"),

View File

@@ -13,7 +13,6 @@ using System.Numerics;
using Content.Shared.Inventory;
using Content.Server.Storage.EntitySystems;
using Robust.Shared.Audio;
using Robust.Server.GameObjects;
using Content.Server.Chat.Managers;
using Content.Server.GameTicking;
using Content.Server.Roles;
@@ -27,7 +26,6 @@ using Robust.Server.Containers;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Content.Server.Shuttles.Components;
using Content.Server._White.Reputation;
using Content.Shared.Players;
namespace Content.Server.Antag;
@@ -48,7 +46,6 @@ public sealed class AntagSelectionSystem : GameRuleSystem<GameRuleComponent>
[Dependency] private readonly EmergencyShuttleSystem _emergencyShuttle = default!;
[Dependency] private readonly RoleSystem _roles = default!; // WD
[Dependency] private readonly SharedPlayerSystem _sharedPlayerSystem = default!; // WD
[Dependency] private readonly ReputationManager _reputationManager = default!; // WD
/// <summary>
/// Attempts to start the game rule by checking if there are enough players in lobby and readied.
@@ -135,11 +132,7 @@ public sealed class AntagSelectionSystem : GameRuleSystem<GameRuleComponent>
}
else
{
//chosenPlayer = _random.PickAndTake(prefList);
// WD EDIT START
chosenPlayer = _reputationManager.PickPlayerBasedOnReputation(prefList);
prefList.Remove(chosenPlayer);
// WD EDIT END
chosenPlayer = _random.PickAndTake(prefList);
playerList.Remove(chosenPlayer);
}
@@ -223,12 +216,7 @@ public sealed class AntagSelectionSystem : GameRuleSystem<GameRuleComponent>
for (var i = 0; i < antagCount; i++)
{
//results.Add(_random.PickAndTake(prefList));
// WD EDIT START
var pref = _reputationManager.PickPlayerBasedOnReputation(prefList);
prefList.Remove(pref);
results.Add(pref);
// WD EDIT END
results.Add(_random.PickAndTake(prefList));
Log.Info("Selected a preferred antag.");
}
return results;

View File

@@ -10,7 +10,6 @@ using Content.Server.Objectives;
using Content.Server.Roles;
using Content.Shared.Changeling;
using Content.Shared.GameTicking;
using Content.Shared.Mobs.Systems;
using Content.Shared.Objectives.Components;
using Content.Shared.Roles;
using Robust.Shared.Player;
@@ -33,8 +32,8 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
[Dependency] private readonly ObjectivesSystem _objectives = default!;
[Dependency] private readonly ChangelingNameGenerator _nameGenerator = default!;
private const int PlayersPerChangeling = 10;
private const int MaxChangelings = 5;
private const int PlayersPerChangeling = 15;
private const int MaxChangelings = 4;
private const float ChangelingStartDelay = 3f * 60;
private const float ChangelingStartDelayVariance = 3f * 60;
@@ -56,11 +55,16 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
SubscribeLocalEvent<ChangelingRuleComponent, ObjectivesTextGetInfoEvent>(OnObjectivesTextGetInfo);
}
protected override void ActiveTick(EntityUid uid, ChangelingRuleComponent component, GameRuleComponent gameRule, float frameTime)
protected override void ActiveTick(
EntityUid uid,
ChangelingRuleComponent component,
GameRuleComponent gameRule,
float frameTime)
{
base.ActiveTick(uid, component, gameRule, frameTime);
if (component.SelectionStatus == ChangelingRuleComponent.SelectionState.ReadyToSelect && _gameTiming.CurTime > component.AnnounceAt)
if (component.SelectionStatus == ChangelingRuleComponent.SelectionState.ReadyToSelect &&
_gameTiming.CurTime > component.AnnounceAt)
DoChangelingStart(component);
}
@@ -72,11 +76,11 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
if (!GameTicker.IsGameRuleAdded(uid, gameRule))
continue;
var minPlayers = ChangelingMinPlayers;
if (!ev.Forced && ev.Players.Length < minPlayers)
if (!ev.Forced && ev.Players.Length < ChangelingMinPlayers)
{
_chatManager.SendAdminAnnouncement(Loc.GetString("changeling-not-enough-ready-players",
("readyPlayersCount", ev.Players.Length), ("minimumPlayers", minPlayers)));
("readyPlayersCount", ev.Players.Length), ("minimumPlayers", ChangelingMinPlayers)));
ev.Cancel();
continue;
}
@@ -88,16 +92,21 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
}
}
}
private void DoChangelingStart(ChangelingRuleComponent component)
{
if (!component.StartCandidates.Any())
if (component.StartCandidates.Count == 0)
{
Log.Error("Tried to start Changeling mode without any candidates.");
return;
}
var numChangelings = MathHelper.Clamp(component.StartCandidates.Count / PlayersPerChangeling, 1, MaxChangelings);
var changelingPool = _antagSelection.FindPotentialAntags(component.StartCandidates, component.ChangelingPrototypeId);
var numChangelings =
MathHelper.Clamp(component.StartCandidates.Count / PlayersPerChangeling, 1, MaxChangelings);
var changelingPool =
_antagSelection.FindPotentialAntags(component.StartCandidates, component.ChangelingPrototypeId);
var selectedChangelings = _antagSelection.PickAntag(numChangelings, changelingPool);
foreach (var changeling in selectedChangelings)
@@ -115,6 +124,7 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
{
if (!GameTicker.IsGameRuleAdded(uid, gameRule))
continue;
foreach (var player in ev.Players)
{
if (!ev.Profiles.ContainsKey(player.UserId))
@@ -123,7 +133,8 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
changeling.StartCandidates[player] = ev.Profiles[player.UserId];
}
var delay = TimeSpan.FromSeconds(ChangelingStartDelay + _random.NextFloat(0f, ChangelingStartDelayVariance));
var delay = TimeSpan.FromSeconds(ChangelingStartDelay +
_random.NextFloat(0f, ChangelingStartDelayVariance));
changeling.AnnounceAt = _gameTiming.CurTime + delay;
@@ -183,21 +194,18 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
readyChangeling.HiveName = _nameGenerator.GetName();
Dirty(entity, readyChangeling);
if (!giveObjectives)
return true;
if (giveObjectives)
var difficulty = 0f;
for (var pick = 0; pick < ChangelingMaxPicks && ChangelingMaxDifficulty > difficulty; pick++)
{
var maxDifficulty = ChangelingMaxDifficulty;
var maxPicks = ChangelingMaxPicks;
var difficulty = 0f;
for (var pick = 0; pick < maxPicks && maxDifficulty > difficulty; pick++)
{
var objective = _objectives.GetRandomObjective(mindId, mind, "ChangelingObjectiveGroups");
if (objective == null)
continue;
var objective = _objectives.GetRandomObjective(mindId, mind, "ChangelingObjectiveGroups");
if (objective == null)
continue;
_mindSystem.AddObjective(mindId, mind, objective.Value);
difficulty += Comp<ObjectiveComponent>(objective.Value).Difficulty;
}
_mindSystem.AddObjective(mindId, mind, objective.Value);
difficulty += Comp<ObjectiveComponent>(objective.Value).Difficulty;
}
return true;
@@ -221,8 +229,10 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
if (changeling.TotalChangelings >= MaxChangelings)
continue;
if (!ev.LateJoin)
continue;
if (!ev.Profile.AntagPreferences.Contains(changeling.ChangelingPrototypeId))
continue;
@@ -249,7 +259,7 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
}
else
{
chance *= ((ev.JoinOrder + 1) - target);
chance *= ev.JoinOrder + 1 - target;
}
if (chance > 1)
@@ -262,7 +272,10 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
}
}
private void OnObjectivesTextGetInfo(EntityUid uid, ChangelingRuleComponent comp, ref ObjectivesTextGetInfoEvent args)
private void OnObjectivesTextGetInfo(
EntityUid uid,
ChangelingRuleComponent comp,
ref ObjectivesTextGetInfoEvent args)
{
args.Minds = comp.ChangelingMinds;
args.AgentName = Loc.GetString("changeling-round-end-agent-name");

View File

@@ -2,6 +2,7 @@
using Content.Server.Administration.Systems;
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Server.Cuffs;
using Content.Server.DoAfter;
using Content.Server.Forensics;
using Content.Server.Humanoid;
@@ -14,6 +15,7 @@ using Content.Server.Temperature.Systems;
using Content.Shared.Actions;
using Content.Shared.Changeling;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Cuffs.Components;
using Content.Shared.Damage;
using Content.Shared.DoAfter;
using Content.Shared.Eye.Blinding.Components;
@@ -34,7 +36,6 @@ using Content.Shared.StatusEffect;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects.Components.Localization;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager;
namespace Content.Server.Changeling;
@@ -59,12 +60,11 @@ public sealed partial class ChangelingSystem
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly InventorySystem _inventorySystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ActionContainerSystem _actionContainerSystem = default!;
[Dependency] private readonly SharedPullingSystem _pullingSystem = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly BloodstreamSystem _blood = default!;
[Dependency] private readonly CuffableSystem _cuffable = default!;
private void InitializeAbilities()
{
@@ -73,6 +73,7 @@ public sealed partial class ChangelingSystem
SubscribeLocalEvent<ChangelingComponent, RegenerateActionEvent>(OnRegenerate);
SubscribeLocalEvent<ChangelingComponent, LesserFormActionEvent>(OnLesserForm);
SubscribeLocalEvent<ChangelingComponent, ExtractionStingActionEvent>(OnExtractionSting);
SubscribeLocalEvent<ChangelingComponent, TransformStingActionEvent>(OnTransformSting);
SubscribeLocalEvent<ChangelingComponent, TransformStingItemSelectedMessage>(OnTransformStingMessage);
SubscribeLocalEvent<ChangelingComponent, BlindStingActionEvent>(OnBlindSting);
@@ -82,6 +83,8 @@ public sealed partial class ChangelingSystem
SubscribeLocalEvent<ChangelingComponent, AdrenalineSacsActionEvent>(OnAdrenalineSacs);
SubscribeLocalEvent<ChangelingComponent, FleshmendActionEvent>(OnFleshMend);
SubscribeLocalEvent<ChangelingComponent, BiodegradeActionEvent>(OnBiodegrade);
SubscribeLocalEvent<ChangelingComponent, ArmbladeActionEvent>(OnArmBlade);
SubscribeLocalEvent<ChangelingComponent, OrganicShieldActionEvent>(OnShield);
SubscribeLocalEvent<ChangelingComponent, ChitinousArmorActionEvent>(OnArmor);
@@ -95,7 +98,7 @@ public sealed partial class ChangelingSystem
SubscribeLocalEvent<ChangelingComponent, ListViewItemSelectedMessage>(OnTransformUiMessage);
}
#region Data
#region Data
private const string ChangelingAbsorb = "ActionChangelingAbsorb";
private const string ChangelingTransform = "ActionChangelingTransform";
@@ -113,62 +116,55 @@ public sealed partial class ChangelingSystem
private const string ChangelingArmor = "ActionArmor";
private const string ChangelingTentacleArm = "ActionTentacleArm";
#endregion
#endregion
#region Handlers
#region Handlers
private void OnAbsorb(EntityUid uid, ChangelingComponent component, AbsorbDnaActionEvent args)
{
if (!HasComp<HumanoidAppearanceComponent>(args.Target))
{
_popup.PopupEntity("You can't absorb not humans!", args.Performer, args.Performer);
_popup.PopupEntity(Loc.GetString("changeling-popup-absorb-not-human"), args.Performer, args.Performer);
return;
}
if (HasComp<AbsorbedComponent>(args.Target))
{
_popup.PopupEntity("This person already absorbed!", args.Performer, args.Performer);
_popup.PopupEntity(Loc.GetString("changeling-popup-already-absorbed"), args.Performer, args.Performer);
return;
}
if (!TryComp<DnaComponent>(args.Target, out var dnaComponent))
if (!TryComp<DnaComponent>(args.Target, out _))
{
_popup.PopupEntity("Unknown creature!", uid, uid);
return;
}
if (component.AbsorbedEntities.ContainsKey(dnaComponent.DNA))
{
_popup.PopupEntity("This DNA already absorbed!", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-absorb-unknown"), uid, uid);
return;
}
if (!_stateSystem.IsDown(args.Target))
{
_popup.PopupEntity("Target must be down!", args.Performer, args.Performer);
_popup.PopupEntity(Loc.GetString("changeling-popup-absorb-down"), args.Performer, args.Performer);
return;
}
if (!TryComp<SharedPullableComponent>(args.Target, out var pulled))
{
_popup.PopupEntity("You must pull target!", args.Performer, args.Performer);
_popup.PopupEntity(Loc.GetString("changeling-popup-absorb-pull"), args.Performer, args.Performer);
return;
}
if (!pulled.BeingPulled)
{
_popup.PopupEntity("You must pull target!", args.Performer, args.Performer);
_popup.PopupEntity(Loc.GetString("changeling-popup-absorb-pull"), args.Performer, args.Performer);
return;
}
_doAfterSystem.TryStartDoAfter(
new DoAfterArgs(EntityManager, args.Performer, component.AbsorbDnaDelay, new AbsorbDnaDoAfterEvent(), uid,
args.Target, uid)
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, args.Performer, component.AbsorbDnaDelay,
new AbsorbDnaDoAfterEvent(), uid, args.Target, uid)
{
BreakOnTargetMove = true,
BreakOnUserMove = true
});
}
);
}
private void OnTransform(EntityUid uid, ChangelingComponent component, TransformActionEvent args)
@@ -178,7 +174,7 @@ public sealed partial class ChangelingSystem
if (component.AbsorbedEntities.Count <= 1 && !component.IsLesserForm)
{
_popup.PopupEntity("You don't have any persons to transform!", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-transform-no-dna"), uid, uid);
return;
}
@@ -211,11 +207,11 @@ public sealed partial class ChangelingSystem
_doAfterSystem.TryStartDoAfter(
new DoAfterArgs(EntityManager, user, component.TransformDelay,
new TransformDoAfterEvent { SelectedDna = selectedDna }, user,
user, user)
new TransformDoAfterEvent { SelectedDna = selectedDna }, user, user, user)
{
BreakOnUserMove = true
});
}
);
if (!TryComp<ActorComponent>(uid, out var actorComponent))
return;
@@ -233,7 +229,7 @@ public sealed partial class ChangelingSystem
if (component.ChemicalsBalance < 15)
{
_popup.PopupEntity("We're lacking of chemicals!", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-lack-chemicals"), uid, uid);
return;
}
@@ -242,7 +238,7 @@ public sealed partial class ChangelingSystem
KillUser(uid, "Cellular");
}
_popup.PopupEntity("We beginning our regeneration.", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-start-regeneration"), uid, uid);
_doAfterSystem.TryStartDoAfter(
new DoAfterArgs(EntityManager, args.Performer, component.RegenerateDelay,
@@ -259,13 +255,13 @@ public sealed partial class ChangelingSystem
{
if (_mobStateSystem.IsDead(uid) || component.IsRegenerating)
{
_popup.PopupEntity("We can do this right now!", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-cant-perform"), uid, uid);
return;
}
if (component.IsLesserForm)
{
_popup.PopupEntity("We're already in the lesser form!", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-already-lesser-form"), uid, uid);
return;
}
@@ -276,11 +272,47 @@ public sealed partial class ChangelingSystem
});
}
private void OnExtractionSting(EntityUid uid, ChangelingComponent component, ExtractionStingActionEvent args)
{
if (!HasComp<HumanoidAppearanceComponent>(args.Target))
{
_popup.PopupEntity(Loc.GetString("changeling-popup-absorb-not-human"), args.Performer, args.Performer);
return;
}
if (HasComp<AbsorbedComponent>(args.Target))
{
_popup.PopupEntity(Loc.GetString("changeling-popup-already-absorbed"), args.Performer, args.Performer);
return;
}
if (!TryComp<DnaComponent>(args.Target, out var dnaComponent))
{
_popup.PopupEntity(Loc.GetString("changeling-popup-absorb-unknown"), uid, uid);
return;
}
if (component.AbsorbedEntities.ContainsKey(dnaComponent.DNA))
{
_popup.PopupEntity(Loc.GetString("changeling-popup-already-absorbed"), uid, uid);
return;
}
if (!TakeChemicals(uid, component, 25))
return;
_popup.PopupEntity(Loc.GetString("changeling-popup-dna-taken"), uid, uid);
CopyHumanoidData(uid, args.Target, component);
args.Handled = true;
}
private void OnTransformSting(EntityUid uid, ChangelingComponent component, TransformStingActionEvent args)
{
if (!HasComp<HumanoidAppearanceComponent>(args.Target))
{
_popup.PopupEntity("We can't transform that!", args.Performer, args.Performer);
_popup.PopupEntity(Loc.GetString("changeling-popup-cant-transform-someone"), args.Performer,
args.Performer);
return;
}
@@ -289,7 +321,7 @@ public sealed partial class ChangelingSystem
if (component.AbsorbedEntities.Count < 1)
{
_popup.PopupEntity("You don't have any persons to transform!", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-transform-no-dna"), uid, uid);
return;
}
@@ -306,7 +338,9 @@ public sealed partial class ChangelingSystem
_ui.OpenUi(bui, actorComponent.PlayerSession);
}
private void OnTransformStingMessage(EntityUid uid, ChangelingComponent component,
private void OnTransformStingMessage(
EntityUid uid,
ChangelingComponent component,
TransformStingItemSelectedMessage args)
{
var selectedDna = args.SelectedItem;
@@ -322,7 +356,7 @@ public sealed partial class ChangelingSystem
if (HasComp<ChangelingComponent>(target))
{
_popup.PopupEntity("Transform virus was ineffective!", user, user);
_popup.PopupEntity(Loc.GetString("changeling-popup-transform-not-effective"), user, user);
return;
}
@@ -331,7 +365,9 @@ public sealed partial class ChangelingSystem
if (TryComp(target, out SharedPullerComponent? puller) && puller.Pulling is { } pulled &&
TryComp(pulled, out SharedPullableComponent? pullable))
{
_pullingSystem.TryStopPull(pullable);
}
TransformPerson(target, humanData);
@@ -345,7 +381,7 @@ public sealed partial class ChangelingSystem
if (!HasComp<HumanoidAppearanceComponent>(args.Target) ||
!HasComp<BlindableComponent>(args.Target))
{
_popup.PopupEntity("We cannot sting that!", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-cant-sting"), uid, uid);
return;
}
@@ -363,7 +399,7 @@ public sealed partial class ChangelingSystem
{
if (!HasComp<HumanoidAppearanceComponent>(args.Target))
{
_popup.PopupEntity("We cannot sting that!", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-cant-sting"), uid, uid);
return;
}
@@ -371,8 +407,7 @@ public sealed partial class ChangelingSystem
return;
var statusTimeSpan = TimeSpan.FromSeconds(30);
_statusEffectsSystem.TryAddStatusEffect(args.Target, "Muted",
statusTimeSpan, false, "Muted");
_statusEffectsSystem.TryAddStatusEffect(args.Target, "Muted", statusTimeSpan, false, "Muted");
args.Handled = true;
}
@@ -381,7 +416,7 @@ public sealed partial class ChangelingSystem
{
if (!HasComp<HumanoidAppearanceComponent>(args.Target))
{
_popup.PopupEntity("We cannot sting that!", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-cant-sting"), uid, uid);
return;
}
@@ -389,8 +424,7 @@ public sealed partial class ChangelingSystem
return;
var statusTimeSpan = TimeSpan.FromSeconds(30);
_statusEffectsSystem.TryAddStatusEffect(args.Target, "BlurryVision",
statusTimeSpan, false, "BlurryVision");
_statusEffectsSystem.TryAddStatusEffect(args.Target, "BlurryVision", statusTimeSpan, false, "BlurryVision");
args.Handled = true;
}
@@ -399,7 +433,7 @@ public sealed partial class ChangelingSystem
{
if (!HasComp<HumanoidAppearanceComponent>(args.Target))
{
_popup.PopupEntity("We cannot sting that!", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-cant-sting"), uid, uid);
return;
}
@@ -407,8 +441,7 @@ public sealed partial class ChangelingSystem
return;
var statusTimeSpan = TimeSpan.FromSeconds(30);
_statusEffectsSystem.TryAddStatusEffect(args.Target, "SlowedDown",
statusTimeSpan, false, "SlowedDown");
_statusEffectsSystem.TryAddStatusEffect(args.Target, "SlowedDown", statusTimeSpan, false, "SlowedDown");
_temperatureSystem.ForceChangeTemperature(args.Target, 100);
@@ -426,7 +459,7 @@ public sealed partial class ChangelingSystem
if (!TakeChemicals(uid, component, 30))
return;
_solutionContainer.TryAddReagent(injectable.Value, "Stimulants", 10);
_solutionContainer.TryAddReagent(injectable.Value, "Stimulants", 5);
args.Handled = true;
}
@@ -444,7 +477,31 @@ public sealed partial class ChangelingSystem
_solutionContainer.TryAddReagent(injectable.Value, "Omnizine", 25);
if (TryComp(uid, out BloodstreamComponent? bloodstream))
{
_blood.TryModifyBleedAmount(uid, -bloodstream.BleedAmount, bloodstream);
}
args.Handled = true;
}
private void OnBiodegrade(EntityUid uid, ChangelingComponent component, BiodegradeActionEvent args)
{
if (_mobStateSystem.IsDead(uid))
return;
if (!TryComp(uid, out CuffableComponent? cuffs) || cuffs.Container.ContainedEntities.Count < 1)
return;
if (!TakeChemicals(uid, component, 30))
return;
var lastAddedCuffs = cuffs.LastAddedCuffs;
_cuffable.Uncuff(uid, lastAddedCuffs, lastAddedCuffs);
Del(lastAddedCuffs);
_popup.PopupEntity(Loc.GetString("changeling-popup-biodegrade"), uid);
args.Handled = true;
}
@@ -488,7 +545,7 @@ public sealed partial class ChangelingSystem
if (meta.EntityPrototype.ID == protoName)
{
_inventorySystem.TryUnequip(uid, outerName, out var removedItem);
_inventorySystem.TryUnequip(uid, outerName, out var removedItem, force: true);
QueueDel(removedItem);
return;
}
@@ -507,9 +564,9 @@ public sealed partial class ChangelingSystem
args.Handled = true;
}
#endregion
#endregion
#region DoAfters
#region DoAfters
private void OnTransformDoAfter(EntityUid uid, ChangelingComponent component, TransformDoAfterEvent args)
{
@@ -535,18 +592,21 @@ public sealed partial class ChangelingSystem
return;
}
if(!_mindSystem.TryGetMind(uid, out var mindId, out _))
if (!_mindSystem.TryGetMind(uid, out var mindId, out _))
return;
if (TryComp(uid, out SharedPullerComponent? puller) && puller.Pulling is { } pulled &&
TryComp(pulled, out SharedPullableComponent? pullable))
{
_pullingSystem.TryStopPull(pullable);
}
if (TryComp<ChangelingComponent>(args.Target.Value, out var changelingComponent))
{
var total = component.AbsorbedEntities
.Concat(changelingComponent.AbsorbedEntities)
.ToDictionary(pair => pair.Key, pair => pair.Value);
component.AbsorbedEntities = total;
}
else
@@ -554,7 +614,10 @@ public sealed partial class ChangelingSystem
CopyHumanoidData(uid, args.Target.Value, component);
}
AddCurrency(uid, args.Target.Value);
if (TryComp<ChangelingComponent>(args.Target.Value, out _))
{
AbsorbLing(uid, component);
}
KillUser(args.Target.Value, "Cellular");
@@ -578,7 +641,7 @@ public sealed partial class ChangelingSystem
if (HasComp<AbsorbedComponent>(args.Target))
{
_popup.PopupEntity("You're lost.", args.Target.Value, args.Target.Value);
_popup.PopupEntity(Loc.GetString("changeling-popup-was-absorbed"), args.Target.Value, args.Target.Value);
component.IsRegenerating = false;
return;
}
@@ -588,7 +651,7 @@ public sealed partial class ChangelingSystem
_rejuvenate.PerformRejuvenate(args.Target.Value);
_popup.PopupEntity("We're fully regenerated!", args.Target.Value, args.Target.Value);
_popup.PopupEntity(Loc.GetString("changeling-popup-fully-regenerated"), args.Target.Value, args.Target.Value);
component.IsRegenerating = false;
@@ -632,9 +695,9 @@ public sealed partial class ChangelingSystem
args.Handled = true;
}
#endregion
#endregion
#region Helpers
#region Helpers
private void RemoveLesserFormActions(EntityUid uid)
{
@@ -680,20 +743,29 @@ public sealed partial class ChangelingSystem
{
if (!TryComp<MetaDataComponent>(target, out var targetMeta))
return;
if (!TryComp<HumanoidAppearanceComponent>(target, out var targetAppearance))
return;
if (!TryComp<DnaComponent>(target, out var targetDna))
return;
if (!TryPrototype(target, out var prototype, targetMeta))
return;
if (component.AbsorbedEntities.ContainsKey(targetDna.DNA))
return;
if (component.AbsorbedEntities.Count == 7)
{
component.AbsorbedEntities.Remove(component.AbsorbedEntities.ElementAt(2).Key);
}
var appearance = _serializationManager.CreateCopy(targetAppearance, notNullableOverride: true);
var meta = _serializationManager.CreateCopy(targetMeta, notNullableOverride: true);
var name = string.IsNullOrEmpty(meta.EntityName)
? "Unknown Creature"
? Loc.GetString("changeling-unknown-creature")
: meta.EntityName;
component.AbsorbedEntities.Add(targetDna.DNA, new HumanoidData
@@ -778,7 +850,7 @@ public sealed partial class ChangelingSystem
_implantSystem.TransferImplants(uid, reverted.Value);
_actionContainerSystem.TransferAllActionsFiltered(uid, reverted.Value);
_action.GrantContainedActions(reverted.Value,reverted.Value);
_action.GrantContainedActions(reverted.Value, reverted.Value);
if (component.IsLesserForm)
{
@@ -797,7 +869,9 @@ public sealed partial class ChangelingSystem
/// <param name="target">Acceptor</param>
/// <param name="sourceHumanoid">Source appearance</param>
/// <param name="targetHumanoid">Acceptor appearance component</param>
private void ClonePerson(EntityUid target, HumanoidAppearanceComponent sourceHumanoid,
private void ClonePerson(
EntityUid target,
HumanoidAppearanceComponent sourceHumanoid,
HumanoidAppearanceComponent targetHumanoid)
{
targetHumanoid.Species = sourceHumanoid.Species;
@@ -808,6 +882,7 @@ public sealed partial class ChangelingSystem
_humanoidAppearance.SetSpecies(target, sourceHumanoid.Species);
targetHumanoid.CustomBaseLayers = new Dictionary<HumanoidVisualLayers,
CustomBaseLayerInfo>(sourceHumanoid.CustomBaseLayers);
targetHumanoid.MarkingSet = new MarkingSet(sourceHumanoid.MarkingSet);
targetHumanoid.Gender = sourceHumanoid.Gender;
@@ -835,7 +910,7 @@ public sealed partial class ChangelingSystem
if (!_handsSystem.TryGetEmptyHand(target, out var hand))
{
_popup.PopupEntity("We need to have at least one empty hand!", target, target);
_popup.PopupEntity(Loc.GetString("changeling-popup-need-hand"), target, target);
return;
}
@@ -851,17 +926,19 @@ public sealed partial class ChangelingSystem
{
if (!_chemicalsSystem.RemoveChemicals(uid, component, quantity))
{
_popup.PopupEntity("We're lacking of chemicals!", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-lack-chemicals"), uid, uid);
return false;
}
_popup.PopupEntity($"Used {quantity} of chemicals.", uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-popup-used-chemicals", ("quantity", quantity)), uid, uid);
return true;
}
private void AddCurrency(EntityUid uid, EntityUid absorbed)
private void AbsorbLing(EntityUid uid, ChangelingComponent changelingComponent)
{
changelingComponent.ChemicalCapacity += 40;
if (!TryComp<ImplantedComponent>(uid, out var implant))
return;
@@ -870,22 +947,12 @@ public sealed partial class ChangelingSystem
if (!TryComp<StoreComponent>(entity, out var store))
continue;
if (_mobStateSystem.IsDead(absorbed))
{
var points = _random.Next(1, 3);
var toAdd = new Dictionary<string, FixedPoint2> { { "ChangelingPoint", points } };
_storeSystem.TryAddCurrency(toAdd, entity, store);
}
else
{
var points = _random.Next(2, 4);
var toAdd = new Dictionary<string, FixedPoint2> { { "ChangelingPoint", points } };
_storeSystem.TryAddCurrency(toAdd, entity, store);
}
var toAdd = new Dictionary<string, FixedPoint2> { { "ChangelingPoint", 5 } };
_storeSystem.TryAddCurrency(toAdd, entity, store);
return;
}
}
#endregion
#endregion
}

View File

@@ -27,7 +27,7 @@ public sealed partial class ChangelingSystem : EntitySystem
InitializeShop();
}
#region Handlers
#region Handlers
private void OnInit(EntityUid uid, ChangelingComponent component, ComponentInit args)
{
@@ -41,12 +41,12 @@ public sealed partial class ChangelingSystem : EntitySystem
private void OnExamine(EntityUid uid, AbsorbedComponent component, ExaminedEvent args)
{
args.PushMarkup("[color=#A30000]His juices sucked up![/color]");
args.PushMarkup(Loc.GetString("changeling-juices-sucked-up"));
}
#endregion
#endregion
#region Helpers
#region Helpers
private void SetupShop(EntityUid uid, ChangelingComponent component)
{
@@ -56,7 +56,7 @@ public sealed partial class ChangelingSystem : EntitySystem
var coords = Transform(uid).Coordinates;
var implant = Spawn("ChangelingShopImplant", coords);
if(!TryComp<SubdermalImplantComponent>(implant, out var implantComp))
if (!TryComp<SubdermalImplantComponent>(implant, out var implantComp))
return;
_implantSystem.ForceImplant(uid, implant, implantComp);
@@ -77,5 +77,5 @@ public sealed partial class ChangelingSystem : EntitySystem
_action.AddAction(uid, ChangelingRegenerate);
}
#endregion
#endregion
}

View File

@@ -90,7 +90,7 @@ public sealed partial class NukeopsRuleComponent : Component
/// This amount of TC will be given to each nukie
/// </summary>
[DataField]
public int WarTCAmountPerNukie = 40;
public int WarTCAmountPerNukie = 20;
/// <summary>
/// Time allowed for declaration of war

View File

@@ -12,12 +12,6 @@ namespace Content.Server.GameTicking.Rules.Components;
[RegisterComponent, Access(typeof(ThiefRuleSystem))]
public sealed partial class ThiefRuleComponent : Component
{
/// <summary>
/// Add a Pacified comp to thieves
/// </summary>
[DataField]
public bool PacifistThieves = true;
/// <summary>
/// A chance for this mode to be added to the game.
/// </summary>

View File

@@ -52,7 +52,7 @@ public sealed class ThiefRuleSystem : GameRuleSystem<ThiefRuleComponent>
var query = EntityQueryEnumerator<ThiefRuleComponent, GameRuleComponent>();
while (query.MoveNext(out var uid, out var thief, out var gameRule))
{
//Chance to not lauch gamerule
//Chance to not lauch gamerule
if (_random.Prob(thief.RuleChance))
{
if (!GameTicker.IsGameRuleAdded(uid, gameRule))
@@ -92,12 +92,12 @@ public sealed class ThiefRuleSystem : GameRuleSystem<ThiefRuleComponent>
var selectedThieves = _antagSelection.PickAntag(numberOfThievesToSelect - component.ThievesMinds.Count, thiefPool);
foreach (var thief in selectedThieves)
{
MakeThief(component, thief, component.PacifistThieves);
MakeThief(component, thief);
}
}
}
public bool MakeThief(ThiefRuleComponent thiefRule, ICommonSession thief, bool addPacified)
public bool MakeThief(ThiefRuleComponent thiefRule, ICommonSession thief)
{
//checks
if (!_mindSystem.TryGetMind(thief, out var mindId, out var mind))
@@ -122,13 +122,6 @@ public sealed class ThiefRuleSystem : GameRuleSystem<ThiefRuleComponent>
PrototypeId = thiefRule.ThiefPrototypeId
});
//Add Pacified
//To Do: Long-term this should just be using the antag code to add components.
if (addPacified) //This check is important because some servers may want to disable the thief's pacifism. Do not remove.
{
EnsureComp<PacifiedComponent>(mind.OwnedEntity.Value);
}
// Notificate player about new role assignment
if (_mindSystem.TryGetSession(mindId, out var session))
{
@@ -171,7 +164,7 @@ public sealed class ThiefRuleSystem : GameRuleSystem<ThiefRuleComponent>
return true;
}
public void AdminMakeThief(ICommonSession thief, bool addPacified)
public void AdminMakeThief(ICommonSession thief)
{
var thiefRule = EntityQuery<ThiefRuleComponent>().FirstOrDefault();
if (thiefRule == null)
@@ -180,7 +173,7 @@ public sealed class ThiefRuleSystem : GameRuleSystem<ThiefRuleComponent>
thiefRule = Comp<ThiefRuleComponent>(ruleEntity);
}
MakeThief(thiefRule, thief, addPacified);
MakeThief(thiefRule, thief);
}
//Add mind briefing