-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
314 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Robust.Shared.Audio; | ||
|
||
namespace Content.Server.Fugitive | ||
{ | ||
[RegisterComponent] | ||
public sealed partial class FugitiveComponent : Component | ||
{ | ||
[DataField("spawnSound")] | ||
public SoundSpecifier SpawnSoundPath = new SoundPathSpecifier("/Audio/Effects/clang.ogg"); | ||
|
||
[DataField("firstMindAdded")] | ||
public bool FirstMindAdded = false; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Content.Server/Nyanotrasen/Fugitive/FugitiveCountdownComponent.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,11 @@ | ||
namespace Content.Server.Fugitive | ||
{ | ||
[RegisterComponent] | ||
public sealed partial class FugitiveCountdownComponent : Component | ||
{ | ||
public TimeSpan? AnnounceTime = null; | ||
|
||
[DataField("AnnounceCD")] | ||
public TimeSpan AnnounceCD = TimeSpan.FromMinutes(5); | ||
} | ||
} |
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,158 @@ | ||
using System.Linq; | ||
using System.Text; | ||
using Content.Shared.Ghost; | ||
using Content.Shared.Mind; | ||
using Content.Shared.Mind.Components; | ||
using Content.Server.Ghost.Roles.Events; | ||
using Content.Server.Traitor; | ||
using Content.Server.Objectives; | ||
using Content.Server.Chat.Systems; | ||
using Content.Server.Communications; | ||
using Content.Server.Paper; | ||
using Content.Server.Humanoid; | ||
using Content.Server.Popups; | ||
using Content.Server.Stunnable; | ||
using Content.Server.Ghost.Components; | ||
using Content.Server.Roles; | ||
using Content.Server.GameTicking; | ||
using Content.Shared.Roles; | ||
using Content.Shared.Movement.Systems; | ||
using Content.Shared.Humanoid.Prototypes; | ||
using Content.Shared.Humanoid; | ||
using Content.Shared.Random.Helpers; | ||
using Content.Shared.Examine; | ||
using Content.Shared.Preferences; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Timing; | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.Utility; | ||
using Robust.Shared.Physics.Components; | ||
using Robust.Shared.Player; | ||
using Robust.Server.GameObjects; | ||
using Robust.Server.Audio; | ||
using static Content.Shared.Examine.ExamineSystemShared; | ||
|
||
namespace Content.Server.Fugitive | ||
{ | ||
public sealed class FugitiveSystem : EntitySystem | ||
{ | ||
private const string FugitiveRole = "Fugitive"; | ||
private const string EscapeObjective = "EscapeShuttleObjectiveFugitive"; | ||
|
||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
[Dependency] private readonly HumanoidAppearanceSystem _humanoidSystem = default!; | ||
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeed = default!; | ||
[Dependency] private readonly IGameTiming _timing = default!; | ||
[Dependency] private readonly ChatSystem _chat = default!; | ||
[Dependency] private readonly PaperSystem _paperSystem = default!; | ||
[Dependency] private readonly PopupSystem _popupSystem = default!; | ||
[Dependency] private readonly StunSystem _stun = default!; | ||
[Dependency] private readonly AudioSystem _audioSystem = default!; | ||
[Dependency] private readonly SharedMindSystem _mindSystem = default!; | ||
[Dependency] private readonly MetaDataSystem _metaData = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<FugitiveComponent, GhostRoleSpawnerUsedEvent>(OnSpawned); | ||
} | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
foreach (var (cd, _) in EntityQuery<FugitiveCountdownComponent, FugitiveComponent>()) | ||
{ | ||
if (cd.AnnounceTime != null && _timing.CurTime > cd.AnnounceTime) | ||
{ | ||
_chat.DispatchGlobalAnnouncement(Loc.GetString("station-event-fugitive-hunt-announcement"), sender: Loc.GetString("fugitive-announcement-GALPOL"), colorOverride: Color.Yellow); | ||
|
||
foreach (var console in EntityQuery<CommunicationsConsoleComponent>()) | ||
{ | ||
if (HasComp<GhostComponent>(console.Owner)) | ||
continue; | ||
|
||
var paperEnt = Spawn("Paper", Transform(console.Owner).Coordinates); | ||
var fugireport = Loc.GetString("fugi-report-ent-name", ("name", cd.Owner)); | ||
_metaData.SetEntityName(paperEnt, fugireport); | ||
|
||
if (!TryComp<PaperComponent>(paperEnt, out var paper)) | ||
continue; | ||
|
||
var report = GenerateFugiReport(cd.Owner); | ||
|
||
_paperSystem.SetContent(paperEnt, report.ToMarkup(), paper); | ||
} | ||
|
||
RemCompDeferred<FugitiveCountdownComponent>(cd.Owner); | ||
} | ||
} | ||
} | ||
|
||
private void OnSpawned(EntityUid uid, FugitiveComponent component, GhostRoleSpawnerUsedEvent args) | ||
{ | ||
if (!TryComp<HumanoidAppearanceComponent>(uid, out var humanoid)) | ||
return; | ||
|
||
var pref = HumanoidCharacterProfile.Random(); | ||
var species = pref.Species; | ||
_humanoidSystem.SetSpecies(uid, species, true, humanoid); | ||
_humanoidSystem.LoadProfile(uid, pref); | ||
|
||
if (TryComp<FugitiveCountdownComponent>(uid, out var cd)) | ||
cd.AnnounceTime = _timing.CurTime + cd.AnnounceCD; | ||
|
||
_popupSystem.PopupEntity(Loc.GetString("fugitive-spawn", ("name", uid)), uid, | ||
Filter.Pvs(uid).RemoveWhereAttachedEntity(entity => !ExamineSystemShared.InRangeUnOccluded(uid, entity, ExamineRange, null)), true, Shared.Popups.PopupType.LargeCaution); | ||
|
||
_stun.TryParalyze(uid, TimeSpan.FromSeconds(2), false); | ||
_audioSystem.PlayPvs(component.SpawnSoundPath, uid, AudioParams.Default.WithVolume(-6f)); | ||
|
||
var tile = Spawn("FloorTileItemSteel", Transform(uid).Coordinates); | ||
} | ||
|
||
private FormattedMessage GenerateFugiReport(EntityUid uid) | ||
{ | ||
FormattedMessage report = new(); | ||
report.AddMarkup(Loc.GetString("fugi-report-title", ("name", uid))); | ||
report.PushNewline(); | ||
report.PushNewline(); | ||
report.AddMarkup(Loc.GetString("fugitive-report-first-line", ("name", uid))); | ||
report.PushNewline(); | ||
report.PushNewline(); | ||
|
||
|
||
if (!TryComp<HumanoidAppearanceComponent>(uid, out var humanoidComponent) || | ||
!_prototypeManager.TryIndex<SpeciesPrototype>(humanoidComponent.Species, out var species)) | ||
{ | ||
report.AddMarkup(Loc.GetString("fugitive-report-inhuman", ("name", uid))); | ||
return report; | ||
} | ||
|
||
report.AddMarkup(Loc.GetString("fugitive-report-morphotype", ("species", Loc.GetString(species.Name)))); | ||
report.PushNewline(); | ||
report.AddMarkup(Loc.GetString("fugitive-report-age", ("age", humanoidComponent.Age))); | ||
report.PushNewline(); | ||
|
||
string sexLine = string.Empty; | ||
sexLine += humanoidComponent.Sex switch | ||
{ | ||
Sex.Male => Loc.GetString("fugitive-report-sex-m"), | ||
Sex.Female => Loc.GetString("fugitive-report-sex-f"), | ||
_ => Loc.GetString("fugitive-report-sex-n") | ||
}; | ||
|
||
report.AddMarkup(sexLine); | ||
|
||
if (TryComp<PhysicsComponent>(uid, out var physics)) | ||
{ | ||
report.PushNewline(); | ||
report.AddMarkup(Loc.GetString("fugitive-report-weight", ("weight", Math.Round(physics.FixturesMass)))); | ||
} | ||
report.PushNewline(); | ||
report.PushNewline(); | ||
report.AddMarkup(Loc.GetString("fugitive-report-last-line")); | ||
|
||
return report; | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
roles-antag-fugitive-name = Fugitive | ||
roles-antag-fugitive-description = Survive. Escape. |
30 changes: 30 additions & 0 deletions
30
Resources/Locale/en-US/nyanotrasen/station-events/events/fugitive.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,30 @@ | ||
station-event-fugitive-hunt-announcement = Please check communications consoles for a sensitive message. | ||
fugitive-spawn = {CAPITALIZE(THE($name))} falls from the ceiling! | ||
fugitive-announcement-GALPOL = GALPOL | ||
fugi-report-ent-name = FUGITIVE REPORT: {$name} | ||
fugi-report-title = WANTED: {$name} | ||
fugitive-report-first-line = Escaped fugitive {$name} has been spotted in the sector. They may be a stowaway on a station somewhere. | ||
fugitive-report-inhuman = {CAPITALIZE(THE($name))} {CONJUGATE-BE($name)} inhuman. We have no further details. | ||
fugitive-report-morphotype = MORPHOTYPE: {$species} | ||
fugitive-report-sex-m = SEX: M | ||
fugitive-report-sex-f = SEX: F | ||
fugitive-report-sex-n = SEX: N/A | ||
fugitive-report-weight = WEIGHT: {$weight} kg | ||
fugitive-report-age = AGE: {$age} | ||
fugitive-report-last-line = The above individual is wanted across the sector; preferably alive. | ||
fugitive-round-end-result = {$fugitiveCount -> | ||
[one] There was one fugitive. | ||
*[other] There were {$fugitiveCount} fugitives. | ||
} | ||
fugitive-user-was-a-fugitive = [color=gray]{$user}[/color] was a fugitive. | ||
fugitive-user-was-a-fugitive-named = [color=White]{$name}[/color] ([color=gray]{$user}[/color]) was a fugitive. | ||
fugitive-was-a-fugitive-named = [color=White]{$name}[/color] was a fugitive. | ||
fugitive-user-was-a-fugitive-with-objectives = [color=gray]{$user}[/color] was a fugitive who had the following objectives: | ||
fugitive-user-was-a-fugitive-with-objectives-named = [color=White]{$name}[/color] ([color=gray]{$user}[/color]) was a fugitive who had the following objectives: | ||
fugitive-was-a-fugitive-with-objectives-named = [color=White]{$name}[/color] was a fugitive who had the following objectives: |
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
- type: playTimeTracker | ||
id: JobBrigmedic | ||
|
||
- type: playTimeTracker | ||
id: JobFugitive |
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
49 changes: 49 additions & 0 deletions
49
Resources/Prototypes/Nyanotrasen/Entities/Mobs/NPCs/humanoid.yml
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,49 @@ | ||
# Unfortunate, isn't it, that these don't work for ghost roles? | ||
|
||
# - type: entity | ||
# id: RandomHumanoidSpawnerFugitive | ||
# name: fugitive | ||
# components: | ||
# - type: Icon | ||
# sprite: Mobs/Species/Human/parts.rsi | ||
# state: full | ||
# - type: RandomHumanoidSpawner | ||
# settings: Fugitive | ||
|
||
# - type: randomHumanoidSettings | ||
# id: Fugitive | ||
# components: | ||
# - type: Loadout | ||
# prototypes: [FugitiveStartingGear] | ||
|
||
- type: entity | ||
parent: MobHuman | ||
id: MobHumanFugitive | ||
name: Fugitive | ||
noSpawn: true | ||
components: | ||
- type: Loadout | ||
prototypes: [FugitiveStartingGear] | ||
- type: Fugitive | ||
- type: FugitiveCountdown | ||
- type: RandomHumanoidAppearance | ||
|
||
#- type: entity | ||
# parent: MarkerBase | ||
# id: MobEvilTwinSpawn | ||
# name: paradox anomaly | ||
# components: | ||
# - type: EvilTwinSpawner | ||
# - type: Sprite | ||
# sprite: Markers/jobs.rsi | ||
# layers: | ||
# - state: green | ||
# - sprite: Mobs/Ghosts/ghost_human.rsi | ||
# state: icon | ||
# - type: GhostRole | ||
# name: paradox anomaly | ||
# description: Replace your double, or befriend them. | ||
# rules: | | ||
# Try and replace your twin with this funny roleplay antag rather than | ||
# plasma flooding the station or something. You can also just befriend them. | ||
# - type: GhostTakeoverAvailable |
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
26 changes: 26 additions & 0 deletions
26
Resources/Prototypes/Nyanotrasen/Roles/Jobs/Antag/fugitive.yml
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,26 @@ | ||
- type: job | ||
id: Fugitive | ||
name: job-name-fugitive | ||
description: job-description-fugitive | ||
playTimeTracker: JobFugitive | ||
startingGear: FugitiveStartingGear | ||
setPreference: false | ||
icon: "Prisoner" | ||
|
||
- type: antag | ||
id: Fugitive | ||
name: roles-antag-fugitive-name | ||
antagonist: true | ||
setPreference: false | ||
objective: roles-antag-fugitive-objective | ||
|
||
- type: startingGear | ||
id: FugitiveStartingGear | ||
equipment: | ||
jumpsuit: ClothingUniformJumpsuitPrisoner | ||
gloves: ClothingHandsGlovesColorYellow | ||
back: ClothingBackpack | ||
shoes: ClothingShoesColorBlack | ||
inhand: | ||
- ToolboxElectricalFilled | ||
innerClothingSkirt: ClothingUniformJumpskirtPrisoner |