- add: Changeling antagonist (#2)
* Changeling WIP * UI * Pointers fix * Moved out abilities * Regenerate ability * Fixed Regenerate ability Prevent ghosting while regenerating * Cleanup * Base lesser form * Finished Lesser Form && Transform * Transform Sting * Blind Sting * Mute Sting Added OnExamine on absorbed human * Hallucination Sting Changeling Absorb and transfer absorbed entities to absorber * Cryogenic Sting * Adrenaline Sacs * Transform now uses Polymorph * Armblade, Shield, Armor * Tentacle Arm ability Tentacle Gun system * WIP with bugs * WiP bugs * fix implant transfer * Fixed bugs with shop transfer and actions transfer * Just in case * Vi sitter i ventrilo och spelar DotA * Fixes and proper LesserForm tracking * !!!!! * Fixed empty buttons * WIP Gamerule Ready - shop * nerf stun time cause its sucks * cleaning * just in case * Absorb DNA Objective. * Partial objectives with bugs * fix * fix pointer * Changeling objectives * Changeling objectives №2 * Admin verb, game rule * Fixed empty list check Icons for objectives * Changeling chat, changeling names etc. * fix some merge errors * - fix: Fixed all bugs with changeling --------- Co-authored-by: Y-Parvus <yevhen.parvus@gmail.com> Co-authored-by: Y-Parvus <61109031+Y-Parvus@users.noreply.github.com> Co-authored-by: HitPanda <104197232+EnefFlow@users.noreply.github.com> Co-authored-by: EnefFlow <regeto90@mail.ru>
This commit is contained in:
81
Content.Server/Changeling/ChangelingSystem.cs
Normal file
81
Content.Server/Changeling/ChangelingSystem.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using Content.Server.Store.Components;
|
||||
using Content.Server.Store.Systems;
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Changeling;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Implants;
|
||||
using Content.Shared.Implants.Components;
|
||||
|
||||
namespace Content.Server.Changeling;
|
||||
|
||||
public sealed partial class ChangelingSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedActionsSystem _action = default!;
|
||||
[Dependency] private readonly ChemicalsSystem _chemicalsSystem = default!;
|
||||
[Dependency] private readonly SharedSubdermalImplantSystem _implantSystem = default!;
|
||||
[Dependency] private readonly StoreSystem _storeSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<ChangelingComponent, ComponentInit>(OnInit);
|
||||
|
||||
SubscribeLocalEvent<AbsorbedComponent, ExaminedEvent>(OnExamine);
|
||||
|
||||
InitializeAbilities();
|
||||
InitializeShop();
|
||||
}
|
||||
|
||||
#region Handlers
|
||||
|
||||
private void OnInit(EntityUid uid, ChangelingComponent component, ComponentInit args)
|
||||
{
|
||||
SetupShop(uid, component);
|
||||
SetupInitActions(uid, component);
|
||||
CopyHumanoidData(uid, uid, component);
|
||||
|
||||
_chemicalsSystem.UpdateAlert(uid, component);
|
||||
component.IsInited = true;
|
||||
}
|
||||
|
||||
private void OnExamine(EntityUid uid, AbsorbedComponent component, ExaminedEvent args)
|
||||
{
|
||||
args.PushMarkup("[color=#A30000]His juices sucked up![/color]");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Helpers
|
||||
|
||||
private void SetupShop(EntityUid uid, ChangelingComponent component)
|
||||
{
|
||||
if (component.IsInited)
|
||||
return;
|
||||
|
||||
var coords = Transform(uid).Coordinates;
|
||||
var implant = Spawn("ChangelingShopImplant", coords);
|
||||
|
||||
if(!TryComp<SubdermalImplantComponent>(implant, out var implantComp))
|
||||
return;
|
||||
|
||||
_implantSystem.ForceImplant(uid, implant, implantComp);
|
||||
|
||||
if (!TryComp<StoreComponent>(implant, out var implantStore))
|
||||
return;
|
||||
|
||||
implantStore.Balance.Add("ChangelingPoint", component.StartingPointsBalance);
|
||||
}
|
||||
|
||||
private void SetupInitActions(EntityUid uid, ChangelingComponent component)
|
||||
{
|
||||
if (component.IsInited)
|
||||
return;
|
||||
|
||||
_action.AddAction(uid, ChangelingAbsorb);
|
||||
_action.AddAction(uid, ChangelingTransform);
|
||||
_action.AddAction(uid, ChangelingRegenerate);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user