Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #24 from Lemirda/master-andromeda
Browse files Browse the repository at this point in the history
upstream
  • Loading branch information
Lemirda authored Apr 14, 2024
2 parents 050cacc + 6cd1e11 commit c06a8cb
Show file tree
Hide file tree
Showing 11 changed files with 163 additions and 63 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/conflict-labeler.yml

This file was deleted.

11 changes: 11 additions & 0 deletions Content.Server/Administration/Systems/AdminNotifySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
using Robust.Shared.Audio.Systems;
using Content.Server.Administration;
using Content.Server.Administration.Managers;
using Content.Server.Guardian; //A-13 Fix AdminNotifySystem
using Content.Server.GameTicking.Rules.Components; //A-13 Fix AdminNotifySystem
using System.Linq; //A-13 Fix AdminNotifySystem

namespace Content.Server.Administration.Systems;

Expand All @@ -30,6 +33,14 @@ private void OnMobStateChanged(MobStateChangedEvent ev)
if (!TryComp(ev.Target, out ActorComponent? actorComponent))
return;

//A-13 Fix AdminNotifySystem start
if (!HasComp<CanHostGuardianComponent>(ev.Target))
return;

if (EntityQuery<NukeopsRuleComponent>().Any())
return;
//A-13 Fix AdminNotifySystem end

if (actorComponent.PlayerSession.AttachedEntity == null || ev.NewMobState == MobState.Alive)
return;

Expand Down
45 changes: 34 additions & 11 deletions Content.Server/GameTicking/GameTicker.RoundFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using System.Linq;
using Content.Shared.Database;
using Robust.Shared.Asynchronous;
using Content.Server.Voting.Managers;
using Content.Shared.Voting;
using Content.Shared.CCVar;
using System.Text.RegularExpressions; //A-13 AnnonceRoundUpdate

namespace Content.Server.GameTicking
{
Expand Down Expand Up @@ -310,7 +308,6 @@ public void EndRound(string text = "")
RunLevel = GameRunLevel.PostRound;

ShowRoundEndScoreboard(text);
SendRoundEndDiscordMessage();
}

public void ShowRoundEndScoreboard(string text = "")
Expand Down Expand Up @@ -411,23 +408,49 @@ public void ShowRoundEndScoreboard(string text = "")

_replayRoundPlayerInfo = listOfPlayerInfoFinal;
_replayRoundText = roundEndText;
var roundEndSummary = GenerateRoundEndSummary(gamemodeTitle, roundEndText, listOfPlayerInfoFinal); //A-13 AnnonceRoundUpdate
SendRoundEndDiscordMessage(roundEndSummary); //A-13 AnnonceRoundUpdate
}

//A-13 AnnonceRoundUpdate start
private string ConvertBBCodeToMarkdown(string text)
{
text = Regex.Replace(text, @"\[.*?\]", "**");

return text;
}

private async void SendRoundEndDiscordMessage()
private string GenerateRoundEndSummary(string gamemodeTitle, string roundEndText, RoundEndMessageEvent.RoundEndPlayerInfo[] playerInfoArray)
{
var roundEndTextMarkdown = ConvertBBCodeToMarkdown(roundEndText);
var stringBuilder = new System.Text.StringBuilder();
stringBuilder.AppendLine($"**Режим**: {gamemodeTitle}\n");
stringBuilder.AppendLine($"**Информация**: {roundEndTextMarkdown}\n");
stringBuilder.AppendLine($"**Игроки**:\n");

foreach (var playerInfo in playerInfoArray)
{
stringBuilder.AppendLine($"*{playerInfo.PlayerOOCName}* '**{playerInfo.PlayerICName}**' в роли: {playerInfo.Role}");
}

return stringBuilder.ToString();
}
//A-13 AnnonceRoundUpdate end

private async void SendRoundEndDiscordMessage(string roundEndSummary) //A-13 AnnonceRoundUpdate
{
try
{
if (_webhookIdentifier == null)
return;

var duration = RoundDuration();
var content = Loc.GetString("discord-round-notifications-end",
("id", RoundId),
("hours", Math.Truncate(duration.TotalHours)),
("minutes", duration.Minutes),
("seconds", duration.Seconds));
//A-13 AnnonceRoundUpdate start
var content = $"**Раунд завершен!**\n" +
$"**Продолжительность**: {Math.Truncate(duration.TotalHours)} часов {duration.Minutes} минут {duration.Seconds} секунд\n" +
$"{roundEndSummary}";
var payload = new WebhookPayload { Content = content };

//A-13 AnnonceRoundUpdate end
await _discord.CreateMessage(_webhookIdentifier.Value, payload);

if (DiscordRoundEndRole == null)
Expand Down
5 changes: 2 additions & 3 deletions Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
using Content.Shared.Roles;
using Content.Shared.Store;
using Content.Shared.Tag;
using Content.Shared.Zombies;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Map;
Expand Down Expand Up @@ -205,7 +204,7 @@ private void OnRoundEndText(RoundEndTextAppendEvent ev)
}
}

ev.AddLine(Loc.GetString("nukeops-list-start"));
//ev.AddLine(Loc.GetString("nukeops-list-start"));

var nukiesQuery = EntityQueryEnumerator<NukeopsRoleComponent, MindContainerComponent>();
while (nukiesQuery.MoveNext(out var nukeopsUid, out _, out var mindContainer))
Expand Down Expand Up @@ -456,7 +455,7 @@ private void DistributeExtraTc(NukeopsRuleComponent nukieRule)
if (Transform(uid).MapID != Transform(nukieRule.NukieOutpost.Value).MapID) // Will receive bonus TC only on their start outpost
continue;

_store.TryAddCurrency(new () { { TelecrystalCurrencyPrototype, nukieRule.WarTCAmountPerNukie } }, uid, component);
_store.TryAddCurrency(new() { { TelecrystalCurrencyPrototype, nukieRule.WarTCAmountPerNukie } }, uid, component);

var msg = Loc.GetString("store-currency-war-boost-given", ("target", uid));
_popupSystem.PopupEntity(msg, uid);
Expand Down
41 changes: 18 additions & 23 deletions Content.Server/Shuttles/Systems/EmergencyShuttleSystem.Console.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public sealed partial class EmergencyShuttleSystem
/// </summary>
private float _authorizeTime;

private float _AndromedaEmergency60 = 60; // Andromeda Emergency
private float _AndromedaEmergency30 = 30; // Andromeda Emergency
private float trashcheck60 = 0; // Andromeda Emergency
private float trashcheck30 = 0; // Andromeda Emergency
private float _andromedaEmergency60 = 60; // Andromeda Emergency
private float _andromedaEmergency30 = 30; // Andromeda Emergency
private float _trashcheck60 = 0; // Andromeda Emergency
private float _trashcheck30 = 0; // Andromeda Emergency

private CancellationTokenSource? _roundEndCancelToken;

Expand Down Expand Up @@ -160,34 +160,29 @@ private void UpdateEmergencyConsole(float frameTime)
if (!EarlyLaunchAuthorized)
AnnounceLaunch();
}

// Andromeda Emergency
if (!_launchedShuttles && _consoleAccumulator <= _AndromedaEmergency60 && trashcheck60 == 0)
// Andromeda Emergency start
if (!_launchedShuttles && !_announced && _consoleAccumulator <= _andromedaEmergency60 && _trashcheck60 == 0)
{
if (_announced == false)
{
_chatSystem.DispatchGlobalAnnouncement(
Loc.GetString("emergency-shuttle-andromeda-60", ("AndromedaEmergency60", $"{_AndromedaEmergency60:0}")),
playSound: false,
colorOverride: DangerColor);
_audio.PlayGlobal("/Audio/Announcements/announce.ogg", Filter.Broadcast(), recordReplay: true);
trashcheck60++;
}
_chatSystem.DispatchGlobalAnnouncement(
Loc.GetString("emergency-shuttle-andromeda-60", ("AndromedaEmergency60", $"{_andromedaEmergency60:0}")),
playSound: false,
colorOverride: DangerColor);
_audio.PlayGlobal("/Audio/Announcements/announce.ogg", Filter.Broadcast(), recordReplay: true);
_trashcheck60++;
}

// Andromeda Emergency
if (!_launchedShuttles && _consoleAccumulator <= _AndromedaEmergency30 && trashcheck30 == 0)
if (!_launchedShuttles && _consoleAccumulator <= _andromedaEmergency30 && _trashcheck30 == 0)
{
if (_announced == false)
{
_chatSystem.DispatchGlobalAnnouncement(
Loc.GetString("emergency-shuttle-andromeda-30", ("AndromedaEmergency30", $"{_AndromedaEmergency30:0}")),
Loc.GetString("emergency-shuttle-andromeda-30", ("AndromedaEmergency30", $"{_andromedaEmergency30:0}")),
playSound: false,
colorOverride: DangerColor);
_audio.PlayGlobal("/Audio/Announcements/announce.ogg", Filter.Broadcast(), recordReplay: true);
trashcheck30++;
_trashcheck30++;
}
}
// Andromeda Emergency end

// Imminent departure
if (!_launchedShuttles && _consoleAccumulator <= ShuttleSystem.DefaultStartupTime)
Expand Down Expand Up @@ -357,8 +352,8 @@ private void CleanupEmergencyConsole()
ShuttlesLeft = false;
_launchedShuttles = false;
_consoleAccumulator = float.MinValue;
trashcheck60 = 0; // Andromeda Emergency
trashcheck30 = 0; // Andromeda Emergency
_trashcheck60 = 0; // Andromeda Emergency
_trashcheck30 = 0; // Andromeda Emergency
EarlyLaunchAuthorized = false;
EmergencyShuttleArrived = false;
TransitTime = MinimumTransitTime + (MaximumTransitTime - MinimumTransitTime) * _random.NextFloat();
Expand Down
91 changes: 91 additions & 0 deletions Resources/Prototypes/Andromeda/Lemird Prototype's/wedding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
- type: entity
parent: ClothingHeadBase
id: ClothingHeadHatWeddingVeill
name: cвадебный венок
description: Красивый венок, созданный для роскошных свадеб.
components:
- type: Sprite
sprite: Andromeda/Clothing/Head/weddingveil.rsi
- type: Clothing
sprite: Andromeda/Clothing/Head/weddingveil.rsi


- type: entity
parent: ClothingUniformSkirtBase
id: ClothingUniformJumpskirtWeddingDress
name: платье невесты
description: Роскошное платье невесты, она всегда должна выглядеть прекрасно.
components:
- type: Sprite
sprite: Andromeda/Clothing/Uniforms/weddingdress.rsi
- type: Clothing
sprite: Andromeda/Clothing/Uniforms/weddingdress.rsi


- type: entity
parent: ClothingShoesBaseButcherable
id: ClothingShoesWeddingShoes
name: свадебные туфельки
description: Прекрасная обувь, что прекрасно подчёркивает походку невесты.
components:
- type: Sprite
sprite: Andromeda/Clothing/Shoes/weddingshoes.rsi
- type: Clothing
sprite: Andromeda/Clothing/Shoes/weddingshoes.rsi


- type: entity
parent: ClothingUniformBase
id: ClothingUniformWeddingtuxedo
name: свадебный смокинг
description: Не верится, что нужно надеть именно вам, верно?
components:
- type: Sprite
sprite: Andromeda/Clothing/Uniforms/weddingtuxedo.rsi
- type: Clothing
sprite: Andromeda/Clothing/Uniforms/weddingtuxedo.rsi


- type: entity
parent: ClothingShoesBaseButcherable
id: ClothingShoesWeddingGlaceups
name: свадебные туфли
description: На самом деле универсальны, но с костюмом смотрятся лучше.
components:
- type: Sprite
sprite: Andromeda/Clothing/Shoes/weddinglaceups.rsi
- type: Clothing
sprite: Andromeda/Clothing/Shoes/weddinglaceups.rsi


- type: entity
parent: ClothingHandsBase
id: ClothingHandsWeddingRing
name: обручальное кольцо
description: Главное не уронить в важный момент, или потерять палец.
components:
- type: Sprite
sprite: Andromeda/Clothing/Hands/weddingring.rsi
- type: Clothing
sprite: Andromeda/Clothing/Hands/weddingring.rsi
- type: FingerprintMask


- type: entity
parent: BaseItem
id: Bouquet
name: букет
description: Стоит дарить это даме чаще.
components:
- type: Sharp
- type: Sprite
sprite: Andromeda/Objects/Weapons/bouquet.rsi
state: icon
- type: MeleeWeapon
damage:
types:
Slash: 1
- type: Item
size: Small
sprite: Objects/Weapons/Melee/bouquet.rsi
- type: DisarmMalus
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
ClothingMaskPlague: 1
ClothingHeadsetService: 2
ClothingHandsWeddingRing: 2 # A-13
bouquet: 1 # A-13
ClothingHeadHatWeddingVeill: 2 # A-13
ClothingUniformJumpskirtWeddingDress: 2 # A-13
ClothingShoesWeddingShoes: 2 # A-13
ClothingUniformWeddingtuxedo: 2 # A-13
ClothingShoesWeddingGlaceups: 2 # A-13
Bouquet: 1 # A-13
BoxCandle: 2
BoxCandleSmall: 2
Urn: 5
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Maps/Pools/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
- Cluster
- Packed
# - CorvaxAvrite
- Train
- Marathon
- CorvaxOutpost
# - CorvaxOutpost
- Meta
# - CorvaxDelta
- Fland
Expand All @@ -22,4 +23,3 @@
- Atlas
- Saltern
# - Reach
# - Train <- return after station anchoring PR is finished and merged
2 changes: 1 addition & 1 deletion Resources/Prototypes/Recipes/Construction/furniture.yml
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@
- !type:TileNotBlocked

- type: construction
name: красивй красный стол #A-13 Translation
name: красивый красный стол #A-13 Translation
id: TableFancyRed
graph: Table
startNode: start
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Recipes/Construction/machines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
state: 4

- type: construction
name: маркас машины #A-13 Translation
name: каркас машины #A-13 Translation
description: Машина в стадии строительства. Нужно больше запчастей. #A-13 Translation
id: MachineFrame
graph: Machine
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/secret_weights.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: Secret
weights:
Nukeops: 0.2
Traitor: 0.8
Traitor: 0.85
Zombie: 0.01
Extended: 0.1 # A-13
Extended: 0.05 # A-13
Survival: 0.1

0 comments on commit c06a8cb

Please sign in to comment.