Skip to content

Commit

Permalink
Merge branch 'new-frontiers-14:master' into 2024-01-06-AnomalousLab
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 authored Jan 7, 2024
2 parents e50e384 + 9fbf4e0 commit a478316
Show file tree
Hide file tree
Showing 16 changed files with 219 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public sealed partial class HumanoidProfileEditor

private void RandomizeEverything()
{
Profile = HumanoidCharacterProfile.Random();
Profile = HumanoidCharacterProfile.Random(balance : Profile?.BankBalance ?? HumanoidCharacterProfile.DefaultBalance);
UpdateControls();
IsDirty = true;
}
Expand Down
13 changes: 7 additions & 6 deletions Content.Shared/Preferences/HumanoidCharacterProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public sealed partial class HumanoidCharacterProfile : ICharacterProfile
public const int MaxNameLength = 32;
public const int MaxDescLength = 512;

public const int DefaultBalance = 25000;

private readonly Dictionary<string, JobPriority> _jobPriorities;
private readonly List<string> _antagPreferences;
private readonly List<string> _traitPreferences;
Expand Down Expand Up @@ -112,7 +114,7 @@ public HumanoidCharacterProfile() : this(
18,
Sex.Male,
Gender.Male,
25000,
DefaultBalance,
new HumanoidCharacterAppearance(),
ClothingPreference.Jumpsuit,
BackpackPreference.Backpack,
Expand Down Expand Up @@ -140,7 +142,7 @@ public static HumanoidCharacterProfile DefaultWithSpecies(string species = Share
18,
Sex.Male,
Gender.Male,
25000,
DefaultBalance,
HumanoidCharacterAppearance.DefaultWithSpecies(species),
ClothingPreference.Jumpsuit,
BackpackPreference.Backpack,
Expand All @@ -154,7 +156,7 @@ public static HumanoidCharacterProfile DefaultWithSpecies(string species = Share
}

// TODO: This should eventually not be a visual change only.
public static HumanoidCharacterProfile Random(HashSet<string>? ignoredSpecies = null)
public static HumanoidCharacterProfile Random(HashSet<string>? ignoredSpecies = null, int balance = DefaultBalance)
{
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
var random = IoCManager.Resolve<IRobustRandom>();
Expand All @@ -165,17 +167,16 @@ public static HumanoidCharacterProfile Random(HashSet<string>? ignoredSpecies =
.ToArray()
).ID;

return RandomWithSpecies(species);
return RandomWithSpecies(species: species, balance: balance);
}

public static HumanoidCharacterProfile RandomWithSpecies(string species = SharedHumanoidAppearanceSystem.DefaultSpecies)
public static HumanoidCharacterProfile RandomWithSpecies(string species = SharedHumanoidAppearanceSystem.DefaultSpecies, int balance = DefaultBalance)
{
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
var random = IoCManager.Resolve<IRobustRandom>();

var sex = Sex.Unsexed;
var age = 18;
var balance = 25000;
if (prototypeManager.TryIndex<SpeciesPrototype>(species, out var speciesPrototype))
{
sex = random.Pick(speciesPrototype.Sexes);
Expand Down
6 changes: 6 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2693,3 +2693,9 @@ Entries:
search for specific IFFs
id: 4729
time: '2024-01-04T05:02:27.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Add
message: Added wall-mounted suit storage units.
id: 4730
time: '2024-01-06T14:11:09.0000000+00:00'
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#SOFTSUITS
#Paramedic's hardsuit
- type: entity
id: SuitStorageWallmountParamedic
parent: [SuitStorageWallmount, SuitStorageParamedic]

#HARDSUITS
#Brigmedic's hardsuit
- type: entity
id: SuitStorageWallmountBrigmedic
parent: [SuitStorageWallmount, SuitStorageBrigmedic]

#Quartermaster hardsuit
- type: entity
id: SuitStorageWallmountQuartermaster
parent: [SuitStorageWallmount, SuitStorageQuartermaster]

#Mercenary hardsuit
- type: entity
id: SuitStorageWallmountMercenary
parent: [SuitStorageWallmount, SuitStorageMercenary]

#SOFTSUITS
#Basic EVA
- type: entity
id: SuitStorageWallmountEVA
parent: [SuitStorageWallmount, SuitStorageEVA]

#Basic EVA (Big Ass Helmet)
- type: entity
id: SuitStorageWallmountEVAAlternate
parent: [SuitStorageWallmount, SuitStorageEVAAlternate]

#Emergency EVA
- type: entity
id: SuitStorageWallmountEVAEmergency
parent: [SuitStorageWallmount, SuitStorageEVAEmergency]

#Prisoner EVA
- type: entity
id: SuitStorageWallmountEVAPrisoner
parent: [SuitStorageWallmount, SuitStorageEVAPrisoner]

#Syndicate EVA
- type: entity
id: SuitStorageWallmountEVASyndicate
parent: [SuitStorageWallmount, SuitStorageEVASyndicate]

#Pirate EVA
- type: entity
id: SuitStorageWallmountEVAPirate
parent: [SuitStorageWallmount, SuitStorageEVAPirate]

#NTSRA Voidsuit
- type: entity
id: SuitStorageWallmountNTSRA
parent: [SuitStorageWallmount, SuitStorageNTSRA]

#HARDSUITS
#Basic hardsuit
- type: entity
id: SuitStorageWallmountBasic
parent: [SuitStorageWallmount, SuitStorageBasic]

#Engineering hardsuit
- type: entity
id: SuitStorageWallmountEngi
parent: [SuitStorageWallmount, SuitStorageEngi]

#Atmospherics hardsuit
- type: entity
id: SuitStorageWallmountAtmos
parent: [SuitStorageWallmount, SuitStorageAtmos]

#Security hardsuit
- type: entity
id: SuitStorageWallmountSec
parent: [SuitStorageWallmount, SuitStorageSec]

#CE's hardsuit
- type: entity
id: SuitStorageWallmountCE
parent: [SuitStorageWallmount, SuitStorageCE]

#CMO's hardsuit
- type: entity
id: SuitStorageWallmountCMO
parent: [SuitStorageWallmount, SuitStorageCMO]

#RD's hardsuit
- type: entity
id: SuitStorageWallmountRD
parent: [SuitStorageWallmount, SuitStorageRD]

#HOS's hardsuit
- type: entity
id: SuitStorageWallmountHOS
parent: [SuitStorageWallmount, SuitStorageHOS]

#Warden's hardsuit
- type: entity
id: SuitStorageWallmountWarden
parent: [SuitStorageWallmount, SuitStorageWarden]

#Captain's hardsuit
- type: entity
id: SuitStorageWallmountCaptain
parent: [SuitStorageWallmount, SuitStorageCaptain]

#Salvage hardsuit
- type: entity
id: SuitStorageWallmountSalv
parent: [SuitStorageWallmount, SuitStorageSalv]

#Blood-red hardsuit
- type: entity
id: SuitStorageWallmountSyndie
parent: [SuitStorageWallmount, SuitStorageSyndie]

#Pirate Captain's hardsuit
- type: entity
id: SuitStorageWallmountPirateCap
parent: [SuitStorageWallmount, SuitStoragePirateCap]

#Wizard
- type: entity
id: SuitStorageWallmountWizard
parent: [SuitStorageWallmount, SuitStorageWizard]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- type: entity
id: SuitStorageWallmount
parent: [SuitStorageBase, BaseWallLocker]
name: suit wallstorage unit
placement:
mode: SnapgridCenter
components:
# Basic function components
- type: Transform
noRot: false
# Visual properties
- type: Sprite
drawdepth: WallMountedItems
noRot: false
sprite: _NF/Structures/Storage/suit_storage_wall.rsi
layers:
- state: generic
map: ["enum.StorageVisualLayers.Base"]
- state: generic_door
map: ["enum.StorageVisualLayers.Door"]
- state: locked
map: ["enum.StorageVisualLayers.Lock"]
shader: unshaded
- type: EntityStorageVisuals
stateBase: generic
stateBaseClosed: generic
stateDoorOpen: generic_open
stateDoorClosed: generic_door
stateLocked: locked
stateUnlocked: unlocked
closeSound:
path: /Audio/Machines/windoor_open.ogg
openSound:
path: /Audio/Machines/windoor_open.ogg
denySound:
path: /Audio/Machines/airlock_deny.ogg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Sprited for NF by erhardsteinhauer (discord), used as a base SS14 default sprites wall_locker.rsi, suit_storage.rsi, directional.rsi (window), basic.rsi (hardsuit), emergency.rsi (tank) and black.rsi (jetpack)",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "generic"
},
{
"name": "generic_door"
},
{
"name": "generic_open"
},
{
"name": "locked"
},
{
"name": "panel"
},
{
"name": "slot_jetpack"
},
{
"name": "slot_suit"
},
{
"name": "slot_tank"
},
{
"name": "unlocked"
},
{
"name": "welded"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a478316

Please sign in to comment.