Skip to content

Commit

Permalink
Merge branch 'master' into ai-law-update
Browse files Browse the repository at this point in the history
  • Loading branch information
Schrodinger71 authored Oct 27, 2024
2 parents 484cea2 + 7488ad7 commit c289ed8
Show file tree
Hide file tree
Showing 12 changed files with 350,599 additions and 22 deletions.
3 changes: 3 additions & 0 deletions Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public sealed class PostMapInitTest
"Oasis",
"Cog",
// ADT-Start
"ADT_FrontierHalloween",
"ADT_TrainHalloween",
"ADT_SalternHalloween",
"ADT_Astra",
"ADT_Avrit",
"ADT_Bagel",
Expand Down
50 changes: 33 additions & 17 deletions Content.Server/ADT/DocumentPrinter/DocumentPrinterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,32 +75,48 @@ public void OnPrinting(EntityUid uid, DocumentPrinterComponent component, Printi
}
DateTime time = DateTime.UtcNow.AddYears(TIME_YEAR_SPACE_STATION_ADT).AddHours(3);
text = text.Replace("$time$", $"{_gameTiming.CurTime.Subtract(_ticker.RoundStartTimeSpan).ToString("hh\\:mm\\:ss")} | {(time.Day < 10 ? $"0{time.Day}" : time.Day)}.{(time.Month < 10 ? $"0{time.Month}" : time.Month)}.{time.Year}");
if (pda?.StationName is not null)
if (pda is not null)
{
text = text.Replace("Station XX-000", pda.StationName);
}
if (meta_id is null)
{
text = text.Replace("$name$", "");
text = text.Replace("$job$", "");
}
else
{
int startIndex = meta_id.EntityName.IndexOf("("); int endIndex = meta_id.EntityName.IndexOf(")");
if (startIndex.Equals(-1) || startIndex.Equals(-1))
if (pda?.StationName is not null)
{
text = text.Replace("Station XX-000", pda.StationName);
}
if (meta_id is null)
{
text = text.Replace("$name$", "");
text = text.Replace("$job$", "");
}
else
{
string id_card_word = "ID карта ";
text = text.Replace("$name$", meta_id.EntityName.Replace(id_card_word, "").Substring(0, startIndex - id_card_word.Length - 2));
text = text.Replace("$job$", meta_id.EntityName.Substring(startIndex + 1, endIndex - startIndex - 1));
int startIndex = meta_id.EntityName.IndexOf("("); int endIndex = meta_id.EntityName.IndexOf(")");
if (startIndex.Equals(-1) || endIndex.Equals(-1))
{
text = text.Replace("$name$", "");
text = text.Replace("$job$", "");
}
else
{
string id_card_word = "ID карта ";
if (startIndex - id_card_word.Length - 2 > 0)
text = text.Replace("$name$", meta_id.EntityName.Replace(id_card_word, "").Substring(0, startIndex - id_card_word.Length - 2));
else
text = text.Replace("$name$", "");
if (startIndex + 1 != endIndex)
text = text.Replace("$job$", meta_id.EntityName.Substring(startIndex + 1, endIndex - startIndex - 1));

else
text = text.Replace("$name$", "");
}
}
paperComponent.Content = text;
// if (!TryComp<MetaDataComponent>(args.Actor, out var comp)) return; // was for test, STFU JUST LEAVE IT HERE
}
else
{
text = text.Replace("$name$", "");
text = text.Replace("$job$", "");
paperComponent.Content = text;
}
paperComponent.Content = text;
// if (!TryComp<MetaDataComponent>(args.Actor, out var comp)) return; // was for test, STFU JUST LEAVE IT HERE
}
else
{
Expand Down
7 changes: 7 additions & 0 deletions Content.Server/Holosign/HolosignComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Content.Server.Holosign
{
[RegisterComponent]
public sealed partial class HolosignComponent : Component
{
}
}
16 changes: 13 additions & 3 deletions Content.Server/Holosign/HolosignSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
using Content.Server.PowerCell;
using Content.Shared.Interaction;
using Content.Shared.Storage;
using System.Linq;

namespace Content.Server.Holosign;

public sealed class HolosignSystem : EntitySystem
{
[Dependency] private readonly PowerCellSystem _powerCell = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!; // ADT-Tweak


public override void Initialize()
Expand Down Expand Up @@ -41,13 +43,21 @@ private void OnExamine(EntityUid uid, HolosignProjectorComponent component, Exam

private void OnBeforeInteract(EntityUid uid, HolosignProjectorComponent component, BeforeRangedInteractEvent args)
{

if (args.Handled
// ADT-Tweak-Start
if (
args.Handled
|| !args.CanReach // prevent placing out of range
|| HasComp<StorageComponent>(args.Target) // if it's a storage component like a bag, we ignore usage so it can be stored
)
return;

var entities = _lookup.GetEntitiesInRange(args.ClickLocation.SnapToGrid(EntityManager), .1f).ToList().Where(e => HasComp<HolosignComponent>(e));
if (
entities.Any()
|| !_powerCell.TryUseCharge(uid, component.ChargeUse) // if no battery or no charge, doesn't work
)
)
return;
// ADT-Tweak-End

// places the holographic sign at the click location, snapped to grid.
// overlapping of the same holo on one tile remains allowed to allow holofan refreshes
Expand Down
163,229 changes: 163,229 additions & 0 deletions Resources/Maps/ADTMaps/ADTStations/adt_frontier_halloween.yml

Large diffs are not rendered by default.

74,226 changes: 74,226 additions & 0 deletions Resources/Maps/ADTMaps/ADTStations/adt_saltern_halloween.yml

Large diffs are not rendered by default.

112,848 changes: 112,848 additions & 0 deletions Resources/Maps/ADTMaps/ADTStations/adt_train_halloween.yml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
- type: gameMap
id: ADT_FrontierHalloween
mapName: 'Halloween Frontier'
mapPath: /Maps/ADTMaps/ADTStations/adt_frontier_halloween.yml
minPlayers: 30
maxPlayers: 90
stations:
ADT_FrontierHalloween:
stationProto: StandardNanotrasenStation
components:
- type: StationNameSetup
mapNameTemplate: '{0} Frontier {1}'
nameGenerator:
!type:NanotrasenNameGenerator
prefixCreator: 'LS'
- type: StationEmergencyShuttle
emergencyShuttlePath: /Maps/Shuttles/emergency_courser.yml
- type: StationJobs
availableJobs:
# command
ChiefMedicalOfficer: [ 1, 1 ]
ResearchDirector: [ 1, 1 ]
HeadOfSecurity: [ 1, 1 ]
Captain: [ 1, 1 ]
IAA: [ 1, 1 ]
Quartermaster: [ 1, 1 ]
Magistrat: [ 1, 1 ] #ADT-Roles
ADTBlueShieldOfficer: [ 1, 1 ] #ADT-Roles
ChiefEngineer: [ 1, 1 ]
HeadOfPersonnel: [ 1, 1 ]
#service
Bartender: [ 1, 1 ]
Botanist: [ 3, 3 ]
Chef: [ 2, 2 ]
Janitor: [ 2, 2 ]
Chaplain: [ 1, 1 ]
Librarian: [ 1, 1 ]
Lawyer: [ 1, 1 ]
#Lawyer: [ 2, 2 ] # Corvax-IAA
ServiceWorker: [ 5, 5 ]
#engineering
AtmosphericTechnician: [ 2, 2 ]
StationEngineer: [ 2, 2 ]
TechnicalAssistant: [ 2, 2 ]
ADTSeniorEngineer: [ 1, 1 ] # ADT-roles
#medical
Chemist: [ 1, 1 ]
Paramedic: [ 1, 1 ]
MedicalDoctor: [ 3, 3 ]
Psychologist: [ 1, 1 ]
MedicalIntern: [ 2, 2 ]
ADTPathologist: [ 1, 1 ] #ADT-Roles
ADTSeniorPhysician: [ 1, 1 ] #ADT-Roles
#science
Scientist: [ 3, 3 ]
ResearchAssistant: [ 3, 3 ]
ADTRoboticist: [ 1, 1 ] #ADT-Roles
ADTSeniorResearcher: [ 1, 1 ] # ADT-roles
#security
Warden: [ 1, 1 ]
Detective: [ 1, 1 ]
SecurityOfficer: [ 4, 4 ]
SecurityCadet: [ 4, 4 ]
Pilot: [ 1, 1 ]
Brigmedic: [ 1, 1 ] #ADT-Roles
ADTSeniorOfficer: [ 1, 1 ] # ADT-Roles
#supply
SalvageSpecialist: [ 3, 3 ]
CargoTechnician: [ 3, 3 ]
#civillian
Zookeeper: [ 1, 1 ]
Passenger: [ -1, -1 ]
Clown: [ 1, 1 ]
Mime: [ 1, 1 ]
Musician: [ 1, 1 ]
Boxer: [ 1, 1 ]
Reporter: [ 1, 1 ]
#silicon 9
StationAi: [ 1, 1 ]
Borg: [ 8, 8 ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
- type: gameMap
id: ADT_SalternHalloween
mapName: 'Halloween Saltern'
mapPath: /Maps/ADTMaps/ADTStations/adt_saltern_halloween.yml
minPlayers: 0
maxPlayers: 35
fallback: true
stations:
ADT_SalternHalloween:
stationProto: StandardNanotrasenStation
components:
- type: StationNameSetup
mapNameTemplate: '{0} Saltern {1}'
nameGenerator:
!type:NanotrasenNameGenerator
prefixCreator: '14'
- type: StationEmergencyShuttle
emergencyShuttlePath: /Maps/Shuttles/corvax_emergency.yml # Corvax-EmergencyShuttle
- type: StationJobs
availableJobs:
# command
Captain: [ 1, 1 ]
ADTBlueShieldOfficer: [ 1, 1 ] #ADT-Roles
#service
HeadOfPersonnel: [ 1, 1 ]
Bartender: [ 1, 1 ]
Botanist: [ 1, 2 ]
Chef: [ 1, 1 ]
Janitor: [ 1, 1 ]
Chaplain: [ 1, 1 ]
Librarian: [ 1, 1 ]
ServiceWorker: [ 2, 2 ]
#engineering
ChiefEngineer: [ 1, 1 ]
AtmosphericTechnician: [ 2, 2 ]
StationEngineer: [ 4, 4 ]
TechnicalAssistant: [ 4, 4 ]
ADTSeniorEngineer: [ 1, 1 ] # ADT-roles
#medical
ChiefMedicalOfficer: [ 1, 1 ]
Chemist: [ 2, 2 ]
MedicalDoctor: [ 3, 3 ]
MedicalIntern: [ 4, 4 ]
Paramedic: [ 1, 1 ]
ADTPathologist: [ 1, 1 ] #ADT-Roles
ADTSeniorPhysician: [ 1, 1 ] #ADT-Roles
#science
ResearchDirector: [ 1, 1 ]
Scientist: [ 4, 4 ]
ResearchAssistant: [ 2, 2 ]
ADTRoboticist: [ 1, 1 ] #ADT-Roles
ADTSeniorResearcher: [ 1, 1 ] # ADT-roles
#security
HeadOfSecurity: [ 1, 1 ]
Warden: [ 1, 1 ]
Detective: [ 1, 1 ]
SecurityOfficer: [ 4, 4 ]
SecurityCadet: [ 4, 4 ]
Brigmedic: [ 1, 1 ] #ADT-Roles
ADTSeniorOfficer: [ 1, 1 ] # ADT-Roles
#supply
Quartermaster: [ 1, 1 ]
SalvageSpecialist: [ 1, 3 ]
CargoTechnician: [ 2, 2 ]
#civillian
Passenger: [ -1, -1 ]
Clown: [ 1, 1 ]
Mime: [ 1, 1 ]
Musician: [ 1, 1 ]
# juridical
Lawyer: [ 1, 1 ]
IAA: [ 1, 1 ]
Magistrat: [ 1, 1 ] #ADT-Roles
#silicon
StationAi: [ 1, 1 ]
Borg: [ 2, 2 ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
- type: gameMap
id: ADT_TrainHalloween
mapName: 'Halloween Train'
mapPath: /Maps/ADTMaps/ADTStations/adt_train_halloween.yml
maxRandomOffset: 0
randomRotation: false
minPlayers: 0
maxPlayers: 30
stations:
ADT_TrainHalloween:
stationProto: StandardNanotrasenStation
components:
- type: StationNameSetup
mapNameTemplate: 'Train "Sentipode" {0}-{1}'
nameGenerator:
!type:NanotrasenNameGenerator
prefixCreator: 'ED'
- type: StationEmergencyShuttle
emergencyShuttlePath: /Maps/Shuttles/emergency_omega.yml # TODO - add railway station
- type: StationJobs
availableJobs:
# command
Captain: [ 1, 1 ]
ADTBlueShieldOfficer: [ 1, 1 ] #ADT-Roles
#service
HeadOfPersonnel: [ 1, 1 ]
Bartender: [ 1, 1 ]
Botanist: [ 2, 2 ]
Chef: [ 1, 1 ]
Janitor: [ 1, 2 ]
Chaplain: [ 1, 1 ]
Librarian: [ 1, 1 ]
ServiceWorker: [ 2, 3 ]
Detective: [ 1, 1 ]
#engineering
ChiefEngineer: [ 1, 1 ]
AtmosphericTechnician: [ 3, 3 ]
StationEngineer: [ 5, 5 ]
TechnicalAssistant: [ 3, 3 ]
ADTSeniorEngineer: [ 1, 1 ] # ADT-roles
#medical
ChiefMedicalOfficer: [ 1, 1 ]
Chemist: [ 2, 2 ]
MedicalDoctor: [ 2, 2 ]
MedicalIntern: [ 2, 2 ]
Paramedic: [ 1, 1 ]
ADTPathologist: [ 1, 1 ] #ADT-Roles
ADTSeniorPhysician: [ 1, 1 ] #ADT-Roles
#science
ResearchDirector: [ 1, 1 ]
Scientist: [ 4, 4 ]
ResearchAssistant: [ 2, 2 ]
ADTRoboticist: [ 1, 1 ] #ADT-Roles
ADTSeniorResearcher: [ 1, 1 ] # ADT-roles
#security
HeadOfSecurity: [ 1, 1 ]
Warden: [ 1, 1 ]
SecurityOfficer: [ 6, 6 ]
SecurityCadet: [ 3, 3 ]
Brigmedic: [ 1, 1 ] #ADT-Roles
ADTSeniorOfficer: [ 1, 1 ] # ADT-Roles
#Lawyer: [ 1, 2 ] # Corvax-IAA
#supply
Quartermaster: [ 1, 1 ]
SalvageSpecialist: [ 2, 2 ]
CargoTechnician: [ 2, 2 ]
#civilian
Passenger: [ -1, -1 ]
Clown: [ 1, 1 ]
Mime: [ 1, 1 ]
Musician: [ 1, 1 ]
# juridical
Lawyer: [ 1, 1 ]
IAA: [ 1, 1 ]
Magistrat: [ 1, 1 ] #ADT-Roles
#silicon
StationAi: [ 1, 1 ]
Borg: [ 2, 2 ]
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Holosign #ADT-Tweak

- type: entity
id: HoloFan
Expand Down
7 changes: 5 additions & 2 deletions Resources/Prototypes/Maps/Pools/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
# - Train
# adt_maps
# - ADT_Astra в комментерии до ремапа
- ADT_FrontierHalloween
- ADT_TrainHalloween
- ADT_SalternHalloween
- ADT_Avrit
- ADT_Bagel
- ADT_Box
Expand All @@ -28,9 +31,9 @@
- ADT_Marathon
- ADT_Meta
- ADT_Origin
- ADT_Saltern
# - ADT_Saltern - до конца хеллоуинских дней
- ADT_Packed
- ADT_Train
# - ADT_Train - до конца хеллоуинских дней
- ADT_Delta
# - ADT_Oasis удалён чтоб жизнь малиной не казалась
- ADT_Gemini
Expand Down

0 comments on commit c289ed8

Please sign in to comment.