forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ling last resort ability (and bug fix) (space-wizards#527)
* last resort (and bug fix) * last resort part 2 * ling and absorbed body cant be put on meat spike * done??? * 2 minutes timer * rabbit said so (butcher) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * rabbit said so (:) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * requested changes --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ce37e18
commit c1592f3
Showing
18 changed files
with
310 additions
and
21 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
Content.Server/Goobstation/Changeling/ChangelingEggSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Robust.Shared.Timing; | ||
using Robust.Server.GameObjects; | ||
using Content.Shared.Changeling; | ||
using Content.Shared.Mind; | ||
using Content.Server.Body.Systems; | ||
using Content.Shared.Store.Components; | ||
|
||
namespace Content.Server.Changeling; | ||
|
||
public sealed partial class ChangelingEggSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IGameTiming _timing = default!; | ||
[Dependency] private readonly BodySystem _bodySystem = default!; | ||
[Dependency] private readonly SharedMindSystem _mind = default!; | ||
|
||
|
||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
|
||
if (!_timing.IsFirstTimePredicted) | ||
return; | ||
|
||
foreach (var comp in EntityManager.EntityQuery<ChangelingEggComponent>()) | ||
{ | ||
var uid = comp.Owner; | ||
|
||
if (_timing.CurTime < comp.UpdateTimer) | ||
continue; | ||
|
||
comp.UpdateTimer = _timing.CurTime + TimeSpan.FromSeconds(comp.UpdateCooldown); | ||
|
||
Cycle(uid, comp); | ||
} | ||
} | ||
public void Cycle(EntityUid uid, ChangelingEggComponent comp) | ||
{ | ||
if (comp.active == false) | ||
{ | ||
comp.active = true; | ||
return; | ||
} | ||
|
||
var newUid = Spawn("MobMonkey", Transform(uid).Coordinates); | ||
|
||
var mind = EnsureComp<MindComponent>(newUid); | ||
_mind.TransferTo(comp.lingMind, newUid); | ||
|
||
var ling = EnsureComp<ChangelingComponent>(newUid); | ||
ling = comp.lingComp; | ||
|
||
EntityManager.AddComponent(newUid, comp.lingStore); | ||
|
||
_bodySystem.GibBody((EntityUid) uid); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
Content.Shared/Goobstation/Changeling/ChangelingEggComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Content.Shared.Mind; | ||
using Content.Shared.Store.Components; | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.Changeling; | ||
|
||
[RegisterComponent, NetworkedComponent] | ||
|
||
public sealed partial class ChangelingEggComponent : Component | ||
{ | ||
public ChangelingComponent lingComp; | ||
public EntityUid lingMind; | ||
public StoreComponent lingStore; | ||
|
||
/// <summary> | ||
/// Countdown before spawning monkey. | ||
/// </summary> | ||
public TimeSpan UpdateTimer = TimeSpan.Zero; | ||
public float UpdateCooldown = 120f; | ||
public bool active = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Resources/Locale/en-US/kitchen/components/kitchen-spike-component.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.