[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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user