-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Описание PR <!-- Что вы изменили в этом пулл реквесте? --> добавила пиратов мидраунд ивентом Yar har fiddle de de Being a pirate is alright with me Do what you want 'cause a pirate is free You are a pirate Yo ho ahoy and avast Being a pirate is really badass Hang the black flag at the end of the mast You are a pirate ## Почему / Баланс <!-- Почему оно было изменено? Ссылайтесь на любые обсуждения или вопросы здесь. Пожалуйста, обсудите, как это повлияет на игровой баланс. --> разнообразие в мидраунд ## Медиа <!-- Пулл реквесты, которые вносят внутриигровые изменения (добавление одежды, предметов, новых возможностей и т.д.), должны содержать медиа, демонстрирующие изменения. Небольшие исправления/рефакторы не требуют медиа. Если Вы не уверены в том, что Ваш пулл реквест требует медиа, спросите мейнтейнера. --> ## Требования <!-- В связи с наплывом ПР'ов нам необходимо убедиться, что ПР'ы следуют правильным рекомендациям. Пожалуйста, уделите время прочтению, если делаете пулл реквест (ПР) впервые. Отметьте поля ниже, чтобы подтвердить, что Вы действительно видели их (поставьте X в скобках, например [X]): --> - [x] Я прочитал(а) и следую [Руководство по созданию пулл реквестов](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html). Я понимаю, что в противном случае мой ПР может быть закрыт по усмотрению мейнтейнера. - [x] Я добавил скриншоты/видео к этому пулл реквесту, демонстрирующие его изменения в игре, **или** этот пулл реквест не требует демонстрации в игре **Чейнджлог** <!-- Здесь Вы можете заполнить журнал изменений, который будет автоматически добавлен в игру при мердже Вашего пулл реквест. Чтобы игроки узнали о новых возможностях и изменениях, которые могут повлиять на их игру, добавьте запись в журнал изменений. Не считайте суффикс типа записи (например, add) "частью" предложения: плохо: - add: новый инструмент для инженеров хорошо: - add: добавлен новый инструмент для инженеров Помещение имени после символа 🆑 изменит имя, которое будет отображаться в журнале изменений (в противном случае будет использоваться ваше имя пользователя GitHub). Например: 🆑 AruMoon --> 🆑 Ratyyy - add: На часть секторов заметно участились нападения космических пиратов! --------- Co-authored-by: Jungar <[email protected]> Co-authored-by: KashRas2 <[email protected]> Co-authored-by: Eugeny <[email protected]> Co-authored-by: Unlumination <[email protected]>
- Loading branch information
1 parent
8fe09e1
commit 12ebc9c
Showing
39 changed files
with
5,691 additions
and
9 deletions.
There are no files selected for viewing
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
27 changes: 27 additions & 0 deletions
27
Content.Server/ADT/GameTicking/Rules/Components/PiratesRuleComponent.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,27 @@ | ||
using Robust.Shared.Audio; | ||
|
||
namespace Content.Server.GameTicking.Rules.Components; | ||
|
||
[RegisterComponent, Access(typeof(PiratesRuleSystem))] | ||
public sealed partial class PiratesRuleComponent : Component | ||
{ | ||
[ViewVariables] | ||
public List<EntityUid> Pirates = new(); | ||
[ViewVariables] | ||
public EntityUid PirateShip = EntityUid.Invalid; | ||
[ViewVariables] | ||
public HashSet<EntityUid> InitialItems = new(); | ||
[ViewVariables] | ||
public double InitialShipValue; | ||
|
||
/// <summary> | ||
/// Path to antagonist alert sound. | ||
/// </summary> | ||
[DataField("pirateAlertSound")] | ||
public SoundSpecifier PirateAlertSound = new SoundPathSpecifier( | ||
"/Audio/Ambience/Antag/pirate_start.ogg", | ||
AudioParams.Default.WithVolume(4)); | ||
|
||
[DataField] | ||
public string PiratesShuttlePath = "Maps/ADTMaps/Shuttles/ERT_base.yml"; | ||
} |
100 changes: 100 additions & 0 deletions
100
Content.Server/ADT/GameTicking/Rules/PiratesRuleSystem.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,100 @@ | ||
using Content.Server.Cargo.Systems; | ||
using Content.Server.GameTicking.Rules.Components; | ||
using Content.Shared.Mind; | ||
using Robust.Server.GameObjects; | ||
using Robust.Server.Maps; | ||
using Robust.Shared.Map; | ||
using Robust.Shared.Utility; | ||
using Content.Shared.GameTicking.Components; | ||
|
||
namespace Content.Server.GameTicking.Rules; | ||
|
||
/// <summary> | ||
/// This handles the Pirates minor antag, which is designed to coincide with other modes on occasion. | ||
/// </summary> | ||
public sealed class PiratesRuleSystem : GameRuleSystem<PiratesRuleComponent> | ||
{ | ||
[Dependency] private readonly IMapManager _mapManager = default!; | ||
[Dependency] private readonly PricingSystem _pricingSystem = default!; | ||
[Dependency] private readonly MapLoaderSystem _map = default!; | ||
|
||
|
||
/// <inheritdoc/> | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
} | ||
|
||
protected override void Started(EntityUid uid, PiratesRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args) | ||
{ | ||
base.Started(uid, component, gameRule, args); | ||
|
||
var shuttleMap = _mapManager.CreateMap(); | ||
var options = new MapLoadOptions { LoadMap = true }; | ||
|
||
if (!_map.TryLoad(shuttleMap, component.PiratesShuttlePath, out var shuttle, options)) | ||
return; | ||
component.PirateShip = shuttle[0]; | ||
|
||
component.InitialShipValue = _pricingSystem.AppraiseGrid(component.PirateShip, uid => | ||
{ | ||
component.InitialItems.Add(uid); | ||
return true; | ||
}); | ||
|
||
} | ||
protected override void AppendRoundEndText(EntityUid uid, PiratesRuleComponent component, GameRuleComponent gameRule, ref RoundEndTextAppendEvent args) | ||
{ | ||
if (Deleted(component.PirateShip)) | ||
{ | ||
// Major loss, the ship somehow got annihilated. | ||
args.AddLine(Loc.GetString("pirates-no-ship")); | ||
} | ||
else | ||
{ | ||
List<(double, EntityUid)> mostValuableThefts = new(); | ||
var comp1 = component; | ||
var finalValue = _pricingSystem.AppraiseGrid(component.PirateShip, uid => | ||
{ | ||
foreach (var mindId in component.Pirates) | ||
{ | ||
if (TryComp(mindId, out MindComponent? mind) && mind.CurrentEntity == uid) | ||
return false; // Don't appraise the pirates twice, we count them in separately. | ||
} | ||
|
||
return true; | ||
}, (uid, price) => | ||
{ | ||
if (comp1.InitialItems.Contains(uid)) | ||
return; | ||
mostValuableThefts.Add((price, uid)); | ||
mostValuableThefts.Sort((i1, i2) => i2.Item1.CompareTo(i1.Item1)); | ||
if (mostValuableThefts.Count > 5) | ||
mostValuableThefts.Pop(); | ||
}); | ||
|
||
foreach (var mindId in component.Pirates) | ||
{ | ||
if (TryComp(mindId, out MindComponent? mind) && mind.CurrentEntity is not null) | ||
finalValue += _pricingSystem.GetPrice(mind.CurrentEntity.Value); | ||
} | ||
|
||
var score = finalValue - component.InitialShipValue; | ||
|
||
args.AddLine(Loc.GetString("pirates-final-score", ("score", $"{score:F2}"))); | ||
args.AddLine(Loc.GetString("pirates-final-score-2", ("finalPrice", $"{finalValue:F2}"))); | ||
|
||
args.AddLine(""); | ||
args.AddLine(Loc.GetString("pirates-most-valuable")); | ||
|
||
foreach (var (price, obj) in mostValuableThefts) | ||
{ | ||
args.AddLine(Loc.GetString("pirates-stolen-item-entry", ("entity", obj), ("credits", $"{price:F2}"))); | ||
} | ||
|
||
if (mostValuableThefts.Count == 0) | ||
args.AddLine(Loc.GetString("pirates-stole-nothing")); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terror-pirate = Внимание экипажу! Похоже, кто-то со станции неожиданно вышел на связь с пиратским флотом в ближнем космосе. |
7 changes: 7 additions & 0 deletions
7
Resources/Locale/ru-RU/ADT/game-ticking/game-presets/preset-pirates.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pirates-no-ship = При неизвестных обстоятельствах корабль пиратов был полностью уничтожен. | ||
pirates-final-score = Пираты успешно украли товара на {$score} космобаксов. | ||
pirates-final-score-2 = Безделушек, в общей сложности на {$finalPrice} космобаксов. | ||
pirates-most-valuable = Самыми ценными украденными вещами были: | ||
pirates-stolen-item-entry = {$entity} с ценой в ({$credits} космобаксов) | ||
pirates-stole-nothing = - Пираты украли абсолютно ничего. [color=red][bold]Стыд и позор.[/bold][/color] | ||
roles-antag-pirate-objective = Украдите все ценное с этого одурманенного большого корабля... э-э... станции. |
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
10 changes: 10 additions & 0 deletions
10
Resources/Locale/ru-RU/ADT/prototypes/Entities/Objects/Specific/pirate.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ent-ADTPiratePiastr1 = пиастр | ||
.desc = Самая ЯРРРР валюта! | ||
.suffix = 1 | ||
ent-ADTPiratePiastr1000 = пиастр | ||
.desc = Самая ЯРРРР валюта! | ||
.suffix = 1000 | ||
ent-ADTBasePirateStore = магазин "Портовая крыса" | ||
.desc = Лавка портовой крысы. Все необходимые для грабежа и налётов товары, высшего качества и свежести, украденные прямо из космических портов всех мегакорпораций! |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
store-currency-display-Piastre = Пиастр |
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.