Skip to content

Commit

Permalink
events, locals, cooldown tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
SkaldetSkaeg committed Jan 12, 2025
1 parent ceec6ff commit ebee5d7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ private void OnPlayerAttached(Entity<CultYoggSacrificialComponent> ent, ref Play
return;
}

var meta = MetaData(ent);

var ev = new CultYoggAnouncementEvent(ent, Loc.GetString("cult-yogg-sacraficial-cant-be-replaced", ("name", MetaData(ent).EntityName)));
RaiseLocalEvent(ent, ref ev, true);
}
Expand All @@ -89,9 +87,8 @@ private void ReplacamantStatusAnnounce(EntityUid uid)
if (!TryComp<CultYoggSacrificialComponent>(uid, out var comp))
return;

var meta = MetaData(uid);

var ev = new CultYoggAnouncementEvent(uid, Loc.GetString("cult-yogg-sacraficial-may-be-replaced", ("name", meta.EntityName)));
var time = (comp.ReplacementCooldown.TotalSeconds - comp.AnnounceReplacementCooldown.TotalSeconds).ToString();
var ev = new CultYoggAnouncementEvent(uid, Loc.GetString("cult-yogg-sacraficial-will-be-replaced", ("name", MetaData(uid).EntityName), ("time", time)));
RaiseLocalEvent(uid, ref ev, true);
}

Expand Down
3 changes: 1 addition & 2 deletions Content.Server/SS220/GameTicking/Rules/CultYoggRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private void SetSacraficeTarget(CultYoggRuleComponent component, EntityUid? uid,
if (mind.Session.AttachedEntity is null)
return;

var meta = MetaData(uid.Value);
//var meta = MetaData(uid.Value);

//_adminLogger.Add(LogType.EventRan, LogImpact.High, $"CultYogg person {meta.EntityName} where picked for a tier: {tier}");

Expand Down Expand Up @@ -295,7 +295,6 @@ private void SacraficialReplacement(ref SacraficialReplacementEvent args)

RemComp<CultYoggSacrificialComponent>(args.Entity);

var meta = MetaData(args.Entity);
var ev = new CultYoggAnouncementEvent(args.Entity, Loc.GetString("cult-yogg-sacraficial-was-replaced", ("name", MetaData(args.Entity).EntityName)));
RaiseLocalEvent(args.Entity, ref ev, true);
}
Expand Down
8 changes: 5 additions & 3 deletions Content.Server/SS220/Telepathy/TelepathySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public override void Initialize()
SubscribeLocalEvent<RoundStartedEvent>(OnRoundStart);

SubscribeLocalEvent<TelepathyComponent, TelepathySendEvent>(OnTelepathySend);
SubscribeLocalEvent<TelepathyComponent, TelepathyAnnouncementSendEvent>(OnTelepathyAnnouncementSend);
SubscribeLocalEvent<TelepathyAnnouncementSendEvent>(OnTelepathyAnnouncementSend);
}

private void OnRoundStart(RoundStartedEvent args)
Expand All @@ -43,7 +43,7 @@ private void OnRoundStart(RoundStartedEvent args)
}
}

private void OnTelepathyAnnouncementSend(Entity<TelepathyComponent> ent, ref TelepathyAnnouncementSendEvent args)
private void OnTelepathyAnnouncementSend(TelepathyAnnouncementSendEvent args)
{
SendMessageToEveryoneWithRightChannel(args.TelepathyChannel, args.Message, null);
}
Expand Down Expand Up @@ -151,7 +151,9 @@ private string GetWrappedTelepathyMessage(string messageString, EntityUid? sende
{
return Loc.GetString(
"chat-manager-send-telepathy-announce",
("announce", FormattedMessage.EscapeText(messageString))
("announce", FormattedMessage.EscapeText(messageString)),
("channel", $"\\[{Loc.GetString(telepathyChannelParameters.Name)}\\]"),
("color", telepathyChannelParameters.Color)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public sealed partial class CultYoggSacrificialComponent : Component
/// Time required for announcement
/// </summary>
[DataField]
public TimeSpan AnnounceReplacementCooldown = TimeSpan.FromSeconds(120);
public TimeSpan AnnounceReplacementCooldown = TimeSpan.FromSeconds(60);
/// <summary>
/// Time required for replacement
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cult-yogg-migo-can-replace = Ми-Го {$name}" утерян, верните его или замените
cult-yogg-migo-cancel-replace = Ми-Го "{$name}" вернулся к служению
cult-yogg-sacraficial-replaced = Жертва "{$name}" была заменена
cult-yogg-sacraficial-may-be-replaced = Жертва "{$name}" потеряла душу, в скором времени она будет заменена
cult-yogg-sacraficial-cant-be-replaced = Жертва "{$name}" смогла вернуться к сознанию, и снова подходит как жертва
cult-yogg-sacraficial-was-replaced = Жертва "{$name}" больше не доступна для жертвоприношения и была заменена
cult-yogg-sacraficial-was-picked = Жертвой был выбран "{$name}"
cult-yogg-migo-can-replace = Ми-Го {$name} утерян, верните его или замените
cult-yogg-migo-cancel-replace = Ми-Го {$name} вернулся к служению
cult-yogg-sacraficial-replaced = Жертва {$name} была заменена
cult-yogg-sacraficial-will-be-replaced = Жертва {$name} потеряла душу, через {$time} секунд она будет заменена
cult-yogg-sacraficial-cant-be-replaced = Жертва {$name} смогла вернуться к сознанию, и снова подходит как жертва
cult-yogg-sacraficial-was-replaced = Жертва {$name} больше не доступна для жертвоприношения и была заменена
cult-yogg-sacraficial-was-picked = Жертвой был выбран {$name}

0 comments on commit ebee5d7

Please sign in to comment.