Skip to content

Commit

Permalink
god coords + acsending tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
SkaldetSkaeg committed Dec 26, 2024
1 parent e9746ad commit 8480c44
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
9 changes: 2 additions & 7 deletions Content.Server/SS220/CultYogg/Altar/CultYoggAltarSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
using Content.Shared.SS220.CultYogg.Cultists;
using Content.Shared.SS220.CultYogg.MiGo;
using Content.Shared.Actions;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs;

namespace Content.Server.SS220.CultYogg.Altar;

Expand Down Expand Up @@ -53,12 +51,9 @@ private void OnDoAfter(Entity<CultYoggAltarComponent> ent, ref MiGoSacrificeDoAf
}

//sending all cultists updating stage event
var queryCultists = EntityQueryEnumerator<CultYoggComponent, MobStateComponent>(); //ToDo ask if this code is ok
while (queryCultists.MoveNext(out var uid, out _, out var mobstate))
var queryCultists = EntityQueryEnumerator<CultYoggComponent>(); //ToDo ask if this code is ok
while (queryCultists.MoveNext(out var uid, out _))
{
if (mobstate.CurrentState == MobState.Dead) //if he is dead we skip him
return;

var ev = new ChangeCultYoggStageEvent(stage);
RaiseLocalEvent(uid, ref ev, true);
}
Expand Down
11 changes: 9 additions & 2 deletions Content.Server/SS220/CultYogg/Cultists/CultYoggSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
using Robust.Shared.Prototypes;
using System.Linq;
using Robust.Shared.Audio.Systems;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs;

namespace Content.Server.SS220.CultYogg.Cultists;

Expand Down Expand Up @@ -112,9 +114,14 @@ private void UpdateStage(Entity<CultYoggComponent> entity, ref ChangeCultYoggSta
}
break;
case 3:
var ev = new CultYoggForceAscendingEvent();//making cultist MiGo
RaiseLocalEvent(entity, ref ev);
if (!TryComp<MobStateComponent>(entity, out var mobstate))
return;

if (mobstate.CurrentState != MobState.Dead) //if he is dead we skip him
{
var ev = new CultYoggForceAscendingEvent();//making cultist MiGo
RaiseLocalEvent(entity, ref ev);
}
break;
default:
Log.Error("Something went wrong with CultYogg stages");
Expand Down
14 changes: 4 additions & 10 deletions Content.Server/SS220/GameTicking/Rules/CultYoggRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
using Content.Server.Administration.Logs;
using Content.Server.SS220.Objectives.Systems;
using Content.Server.SS220.Objectives.Components;
using Robust.Shared.Utility;
using Content.Server.Pinpointer;

namespace Content.Server.SS220.GameTicking.Rules;

Expand All @@ -50,6 +52,7 @@ public sealed class CultYoggRuleSystem : GameRuleSystem<CultYoggRuleComponent>
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly RoundEndSystem _roundEnd = default!;
[Dependency] private readonly SharedRoleSystem _role = default!;
[Dependency] private readonly NavMapSystem _navMap = default!;

private List<List<string>> _sacraficialTiers = [];
public TimeSpan DefaultShuttleArriving { get; set; } = TimeSpan.FromSeconds(85);
Expand Down Expand Up @@ -411,7 +414,7 @@ private void OnGodSummoned(ref CultYoggSummonedEvent args)
{
foreach (var station in _station.GetStations())
{
_chat.DispatchStationAnnouncement(station, Loc.GetString("cult-yogg-shuttle-call"), colorOverride: Color.Crimson);
_chat.DispatchStationAnnouncement(station, Loc.GetString("cult-yogg-shuttle-call", ("location", FormattedMessage.RemoveMarkupOrThrow(_navMap.GetNearestBeaconString(args.Entity)))), colorOverride: Color.Crimson);
}
_roundEnd.RequestRoundEnd(DefaultShuttleArriving, null);

Expand All @@ -421,15 +424,6 @@ private void OnGodSummoned(ref CultYoggSummonedEvent args)
return;

cultRuleComp.Summoned = true;//Win EndText

var ev = new CultYoggForceAscendingEvent();

//Event hadn't raised on Cultists even with broadcast, so i made this
var query = EntityQueryEnumerator<CultYoggComponent>();
while (query.MoveNext(out var ent, out var comp))
{
RaiseLocalEvent(ent, ref ev, true);//Make all cultists MiGo
}
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ objective-cult-yogg-sacrafice-start = Призовите темного бога
objective-cult-yogg-sacrafice-task-job = в должности
objective-condition-cult-yogg-sacrafice-person = {$targetName}, в должности {CAPITALIZE($job)}
cult-yogg-shuttle-call = Датчики станции зафиксировали гигантский подвижный объект. Аварийный шаттл был отправлен для эвакуации оставшегося персонала.
cult-yogg-shuttle-call = Датчики станции зафиксировали { $location } гигантский подвижный объект. Аварийный шаттл был отправлен для эвакуации оставшегося персонала.

0 comments on commit 8480c44

Please sign in to comment.