Skip to content

Commit

Permalink
admin cmd fix, new mail types, const cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
whatston3 committed Jun 8, 2024
1 parent 0248975 commit e956cbb
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Content.Server/Nyanotrasen/Mail/MailCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public async void Execute(IConsoleShell shell, string argStr, string[] args)

// Frontier: Large Mail
bool isLarge = false;
if (args.Length >= 4 && !Boolean.TryParse(args[4], out isLarge))
if (args.Length > 4 && !Boolean.TryParse(args[4], out isLarge))
{
shell.WriteError(Loc.GetString("shell-invalid-bool"));
return;
Expand Down Expand Up @@ -115,7 +115,7 @@ public async void Execute(IConsoleShell shell, string argStr, string[] args)

mailComponent.IsFragile = isFragile;
mailComponent.IsPriority = isPriority;
mailComponent.IsPriority = isPriority;
mailComponent.IsLarge = isLarge;

_mailSystem.SetupMail(mailUid, teleporterComponent, recipient.Value);

Expand Down
8 changes: 5 additions & 3 deletions Content.Server/Nyanotrasen/Mail/MailSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,14 @@ private void OnAfterInteractUsing(EntityUid uid, MailComponent component, AfterI

private void OnExamined(EntityUid uid, MailComponent component, ExaminedEvent args)
{
MailEntityStrings mailEntityStrings = component.IsLarge ? MailConstants.MailLarge : MailConstants.Mail; //Frontier: mail types stored per type (large mail)
if (!args.IsInDetailsRange)
{
args.PushMarkup(Loc.GetString(component.IsLarge ? "mail-large-desc-far" : "mail-desc-far")); // Frontier: IsLarge switch
args.PushMarkup(Loc.GetString(mailEntityStrings.DescFar)); // Frontier: mail constants struct
return;
}

args.PushMarkup(Loc.GetString(component.IsLarge ? "mail-large-desc-close" : "mail-desc-close", ("name", component.Recipient), ("job", component.RecipientJob), ("station", component.RecipientStation))); // Frontier: IsLarge switch
args.PushMarkup(Loc.GetString(mailEntityStrings.DescClose, ("name", component.Recipient), ("job", component.RecipientJob), ("station", component.RecipientStation))); // Frontier: mail constants struct

if (component.IsFragile)
args.PushMarkup(Loc.GetString("mail-desc-fragile"));
Expand Down Expand Up @@ -470,6 +471,7 @@ public void SetupMail(EntityUid uid, MailTeleporterComponent component, MailReci
mailComp.RecipientStation = recipient.Ship; // Frontier

// Frontier: Large mail bonus
MailEntityStrings mailEntityStrings = mailComp.IsLarge ? MailConstants.MailLarge : MailConstants.Mail;
if (mailComp.IsLarge)
{
mailComp.Bounty += component.LargeBonus;
Expand Down Expand Up @@ -499,7 +501,7 @@ public void SetupMail(EntityUid uid, MailTeleporterComponent component, MailReci

_appearanceSystem.SetData(uid, MailVisuals.JobIcon, recipient.JobIcon);

_metaDataSystem.SetEntityName(uid, Loc.GetString(mailComp.IsLarge ? "mail-large-item-name-addressed" : "mail-item-name-addressed", // Frontier: IsLarge switch
_metaDataSystem.SetEntityName(uid, Loc.GetString(mailEntityStrings.NameAddressed, // Frontier: move constant to MailEntityString
("recipient", recipient.Name)));

var accessReader = EnsureComp<AccessReaderComponent>(uid);
Expand Down
38 changes: 38 additions & 0 deletions Content.Server/_NF/Mail/MailConstants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
namespace Content.Server.Mail
{
/// <summary>
/// A set of localized strings related to mail entities
/// </summary>
public struct MailEntityStrings
{
public string NameAddressed;
public string DescClose;
public string DescFar;
}

/// <summary>
/// Constants related to mail.
/// </summary>
public sealed class MailConstants : EntitySystem
{
/// <summary>
/// Locale strings related to small parcels.
/// <summary>
public static readonly MailEntityStrings Mail = new()
{
NameAddressed = "mail-item-name-addressed",
DescClose = "mail-desc-close",
DescFar = "mail-desc-far"
};

/// <summary>
/// Locale strings related to large packages.
/// <summary>
public static readonly MailEntityStrings MailLarge = new()
{
NameAddressed = "mail-large-item-name-addressed",
DescClose = "mail-large-desc-close",
DescFar = "mail-large-desc-far"
};
}
}
1 change: 1 addition & 0 deletions Resources/Prototypes/_NF/Entities/Objects/Fun/toys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@
state: white

# Rubber Throngler.
# Essentially a rubber hammer but with explosion noises and RSI
- type: entity
name: The Throngler
parent: BaseItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
map: ["enum.MailVisualLayers.FragileStamp"]
visible: false
- map: ["enum.MailVisualLayers.JobStamp"]
scale: 0.75, 0.75
offset: 0.230, 0.035
scale: 0.8, 0.8
offset: 0.235, -0.01
- state: locked
map: ["enum.MailVisualLayers.Lock"]
- state: priority
Expand Down
13 changes: 13 additions & 0 deletions Resources/Prototypes/_NF/Mail/mail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1520,3 +1520,16 @@
- type: Mail
contents:
- id: PowerCellMicroreactor

- type: entity
noSpawn: true
parent: BaseMailLarge
id: MailStationRepNFStationPet
suffix: station pet
components:
- type: Mail
- isFragile: true
contents:
- id: MaterialWoodPlank10
- id: PaperMailNFIkea
- id: DelayedPetCarrierNPCEmotionalSupportSafe
3 changes: 2 additions & 1 deletion Resources/Prototypes/_NF/Mail/mailDeliveries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
jobs:
StationRepresentative:
MailNFGoldCigars: 0.45
MailStationRepNFStationPet: 1
Sheriff:
MailSecurityNonlethalsKit: 2
MailNFGoldCigars: 0.45

MailStationRepNFStationPet: 1 # Don't see the harm in this with Smile and Cappy around
30 changes: 29 additions & 1 deletion Resources/Prototypes/_NF/Mail/mail_specific_items.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@
parent: BaseItem
noSpawn: true
name: delayed smoke
suffix: "Smoke (10s, delayed)"
suffix: "(10s)"
components:
- type: DelayedItem
item: AdminInstantEffectSmoke10

# Miscellaneous Items

# Delay the emotional support pet so they don't suffocate.
- type: entity
id: DelayedPetCarrierNPCEmotionalSupportSafe
parent: BaseItem
noSpawn: true
name: delayed emotional support pet
components:
- type: DelayedItem
item: PetCarrierNPCEmotionalSupportSafe

# Papers (letters, ad copy)
- type: entity
id: PaperMailNFPowerTool
Expand Down Expand Up @@ -329,3 +341,19 @@
[head=3]Sincerely,
[italic]The Frontier Paper Pusher's Club[/italic][/head]
- type: entity
id: PaperMailNFPetBedAssemblyManual
# noSpawn: true
suffix: "pet bed assembly manual"
parent: Paper
components:
- type: Paper
content: |2
[head=1]HÖGANÄS[/head]
[head=2](There is a black and white picture of a pet bed on the first page.)[/head]
[head=3](On the next few pages, you see a list of materials and a happy stick figure assembling furniture.)[/head]
[head=3](On the pages after that, you see a set of instructions to assemble a pet bed. You're sure you don't need them, how hard could it be?)[/head]

0 comments on commit e956cbb

Please sign in to comment.