Skip to content

Commit

Permalink
small improvments, ditch the faction path for a real datum as soon as…
Browse files Browse the repository at this point in the history
… you can
  • Loading branch information
FalloutFalcon committed Jul 17, 2024
1 parent 238d3b1 commit a94c258
Show file tree
Hide file tree
Showing 25 changed files with 42 additions and 72 deletions.
7 changes: 5 additions & 2 deletions _maps/configs/independent_beluga.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"map_name": "Beluga-class Transport",
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "SV",
"namelists": ["CRUISE", "NATURAL"],
"namelists": [
"CRUISE",
"NATURAL"
],
"map_short_name": "Beluga-class",
"map_path": "_maps/shuttles/independent/independent_beluga.dmm",
"description": "The Beluga-Class is a transport vessel for those with especially rich blood. Featuring a modest kitchen, hired Inteq security, and luxurious decoration, the Beluga is a first choice pick for many wealthy spacers trying to get from point A to B. The independent ship features several rooms for its guests and a well furnished meeting room for any corporate occassion.",
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/independent_box.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"SPACE",
"NATURAL"
],
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "IMV",
"job_slots": {
"Chief Medical Officer": {
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/independent_bubble.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"GENERAL",
"SPACE"
],
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "ISV",
"limit": 1,
"job_slots": {
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/independent_dwayne.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"map_name": "Mark.II Dwayne-class Long Range Mining Transport",
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "ISV",
"namelists": [
"GENERAL",
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/independent_junker.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"map_name": "Junker-class Salvaged Ship",
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "SV",
"namelists": [
"GENERAL",
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/independent_kilo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"tags": [
"Generalist"
],
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "ISV",
"namelists": [
"GENERAL",
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/independent_lagoon.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"map_name": "Lagoon-class Cruise Ship",
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "SV",
"description": "An unusual sight in the relatively impoverished Frontier, the Lagoon-class is a large pleasure vessel dedicated to transporting its passengers to any number of exotic locales. Lagoons found on the Frontier tend to contain crews and passengers of a particularly daring – or foolhardy – character, willing to pay out the nose for a tour of some of the most dangerous regions in known space. Accordingly, Lagoons in these regions typically include a small but respectably equipped security contingent to protect (and, when necessary, rein in) the passengers, and come with a surprisingly powerful thermo-electric generator to move the ship’s prodigious bulk across vast expanses of space.",
"tags": [
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/independent_mudskipper.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"map_name": "Mudskipper-class Salvage Clipper",
"map_short_name": "Mudskipper-class",
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "ISV",
"description": "One of the cheapest (and yet, inexplicably popular) offerings from Miskilamo Spacefaring, the Mudskipper-class is a vessel purpose-built for enterprising scrappers and looters looking to salvage bombed-out ruins and harvest boatloads of materials. Featuring a diverse set of multipurpose rooms, a charitable supply of EVA/ruin raiding equipment, and a set of anti-radiation gear for dealing with industrial accidents, the Mudskipper-class just keeps on chuggin’!",
"tags": [
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/independent_rigger.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"map_name": "Riggs-class Sloop",
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "SV",
"namelists": [
"GENERAL",
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/independent_schmiedeberg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"map_name": "Schmiedeberg-class Pharmacology Ship",
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "IMV",
"map_short_name": "Schmiedeberg-class",
"description": "Interested in pharmacological science, but tired of sitting in front of a chemistry dispenser and pushing buttons all day? Eager to combine the culinary arts with the narcotic ones? Hoping to combine all of these qualities with the most important activity of all: making fat stacks of dosh? Then the Schmiedeberg-class is for you! Host to a robust ghetto chemistry lab, a high-efficiency botanical set-up and a complete kitchen-and-storefront, the Schmiedeberg is perfect for back-alley chemists and botanists everywhere.",
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/independent_shetland.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"map_name": "Shetland-class Multipurpose Frigate",
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "SV",
"namelists": [
"GENERAL",
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/independent_sunskipper.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"map_name": "Sunskipper-class Culinary Vessel",
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "ISV",
"namelists": ["CRUISE", "NATURAL"],
"map_short_name": "Sunskipper-class",
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/independent_tranquility.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"map_name": "Tranquility-class Flying Apartment Complex",
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "SV",
"namelists": [
"GENERAL",
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/nanotrasen_delta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"map_name": "Delta-class Frigate",
"faction": "/datum/faction/nt",
"faction": "/datum/faction/nt/ns_logi",
"prefix": "NSSV",
"namelists": [
"GENERAL",
Expand Down
19 changes: 10 additions & 9 deletions _maps/configs/nanotrasen_heron.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"faction": "/datum/faction/nt",
"prefix": "NTSV",
"namelists": ["WEAPONS"],
"namelists": [
"WEAPONS"
],
"map_name": "Heron-Class Dreadnaught",
"map_short_name": "Heron-class",
"map_path": "_maps/shuttles/nanotrasen/nanotrasen_heron.dmm",
Expand Down Expand Up @@ -34,40 +36,39 @@
"outfit": "/datum/outfit/job/nanotrasen/security",
"slots": 1
},
"ERT Officer":{
"ERT Officer": {
"outfit": "/datum/outfit/job/nanotrasen/security/ert",
"slots": 4
},
"ERT Medical Officer":{
"ERT Medical Officer": {
"outfit": "/datum/outfit/job/nanotrasen/security/ert/med",
"slots": 1
},
"ERT Engineering Officer":{
"ERT Engineering Officer": {
"outfit": "/datum/outfit/job/nanotrasen/security/ert/engi",
"slots": 1
},
"Mech Pilot":{
"Mech Pilot": {
"outfit": "/datum/outfit/job/nanotrasen/security/mech_pilot",
"slots": 1
},
"Engine Technician": {
"outfit": "/datum/outfit/job/nanotrasen/engineer",
"slots": 1
},
"Chief Engineer":{
"Chief Engineer": {
"outfit": "/datum/outfit/job/nanotrasen/ce",
"officer": true,
"slots": 1
},
"Roboticist": {
"outfit":"/datum/outfit/job/nanotrasen/roboticist",
"outfit": "/datum/outfit/job/nanotrasen/roboticist",
"slots": 1
},
"Medical Doctor":{
"Medical Doctor": {
"outfit": "/datum/outfit/job/nanotrasen/doctor",
"slots": 1
},

"Atmospheric Technician": 1,
"Quartermaster": 1,
"Cargo Technician": 1,
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/syndicate_cybersun_kansatsu.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"faction": "/datum/faction/syndicate",
"faction": "/datum/faction/syndicate/cybersun",
"prefix": "CSSV",
"namelists": [
"CYBERSUN",
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/syndicate_gorlex_hyena.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"faction": "/datum/faction/syndicate",
"faction": "/datum/faction/syndicate/ngr",
"prefix": "NGRV",
"namelists": [
"GORLEX",
Expand Down
2 changes: 1 addition & 1 deletion _maps/configs/syndicate_litieguai.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"map_name": "Li Tieguai-class Rescue Ship",
"faction": "/datum/faction/syndicate",
"faction": "/datum/faction/syndicate/cybersun",
"prefix": "CSSV",
"map_short_name": "Li Tieguai-class",
"description": "A small, nimble, and exceptionally well-built medical response vessel, the Li Tieguai is a recent addition to Cybersun’s fleet, forming a critical component of their Frontier stabilization program. Li Tieguais come equipped with high-end medical equipment, including a selection of Cybersun augments and prosthetics, as well as weaponry and armor sufficient to protect its personnel in the often-dangerous Frontier sectors, so that they can offer premium healthcare (at premium prices) in even the most dangerous of scenarios.",
Expand Down
2 changes: 1 addition & 1 deletion _maps/example_ship_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/shiptest-ss13/Shiptest/master/_maps/ship_config_schema.json",
"map_name": "Example-class Experimental Ship",
"map_short_name": "Test-class",
"faction": "/datum/faction/independant",
"faction": "/datum/faction/independent",
"prefix": "STSV",
"namelists": ["GENERAL", "SPACE", "MYTHOLOGICAL", "WEAPONS"],
"map_path": "_maps/shuttles/shiptest/null.dmm",
Expand Down
3 changes: 2 additions & 1 deletion code/controllers/subsystem/faction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ SUBSYSTEM_DEF(factions)

/datum/controller/subsystem/factions/proc/faction_path_to_datum(path)
for(var/datum/faction/faction in factions)
if(ispath(faction, path))
if(faction.type == path)
return faction
stack_trace("we did not return any faction with path [path]")
7 changes: 5 additions & 2 deletions code/controllers/subsystem/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,12 @@ SUBSYSTEM_DEF(mapping)

if(istext(data["prefix"]))
S.prefix = data["prefix"]
S.faction_name = SSfactions.ship_prefix_to_name(S.prefix)

S.faction_path = data["faction"]
if(istext(data["faction"]))
S.faction_path = text2path(data["faction"])
if(S.faction_path)
S.faction_datum = SSfactions.faction_path_to_datum(S.faction_path)
S.faction_name = S.faction_datum.name

S.category = S.faction_name

Expand Down
1 change: 1 addition & 0 deletions code/datums/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/// The full name of the ship's faction.
var/faction_name = "Independent"
var/faction_path = /datum/faction/independent
var/datum/faction/faction_datum
/// Whether or not players from other ships can open airlocks.
var/unique_ship_access = TRUE
/// Set by config JSON. If true, the template's ships' "default" spawn location (when bought by a player or loaded at roundstart)
Expand Down
39 changes: 0 additions & 39 deletions code/game/objects/structures/crates_lockers/crates/wooden.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,3 @@
new /obj/item/pneumatic_cannon/pie(src)
new /obj/item/reagent_containers/food/snacks/pie/cream(src)
new /obj/item/storage/crayons(src)

/obj/structure/closet/crate/wooden/sealed
name = "sealed wooden crate"
desc= "crowbar it"

/obj/structure/closet/crate/wooden/sealed/attack_hand(mob/user)
add_fingerprint(user)
if(manifest)
tear_manifest(user)
else
to_chat(user, "<span class='warning'>You need a crowbar to pry this open!</span>")

/obj/structure/closet/crate/wooden/sealed/attackby(obj/item/W, mob/user, params)
if(W.tool_behaviour == TOOL_CROWBAR)
if(manifest)
tear_manifest(user)

user.visible_message(
"<span class='notice'>[user] pries \the [src] open.</span>", \
"<span class='notice'>You pry open \the [src].</span>", \
"<span class='hear'>You hear splitting wood.</span>")
playsound(src.loc, 'sound/weapons/slashmiss.ogg', 75, TRUE)

var/turf/T = get_turf(src)
for(var/i in 1 to material_drop_amount)
new material_drop(src)
for(var/atom/movable/AM in contents)
AM.forceMove(T)

qdel(src)

else
if(user.a_intent == INTENT_HARM) //Only return ..() if intent is harm, otherwise return 0 or just end it.
return ..() //Stops it from opening and turning invisible when items are used on it.

else
to_chat(user, "<span class='warning'>You need a crowbar to pry this open!</span>")
return FALSE //Just stop. Do nothing. Don't turn into an invisible sprite. Don't open like a locker.
//The large crate has no non-attack interactions other than the crowbar, anyway.
2 changes: 1 addition & 1 deletion code/modules/mob/dead/new_player/ship_select.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
continue
var/list/ship_data = list(
"name" = T.name,
"faction" = SSfactions.ship_prefix_to_name(T.prefix),
"faction" = T.faction_name,
"desc" = T.description,
"tags" = T.tags,
"crewCount" = length(T.job_slots),
Expand Down
2 changes: 1 addition & 1 deletion code/modules/overmap/ships/controlled_ship_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@

refresh_engines()
ship_account = new(name, source_template.starting_funds)
faction_datum = SSfactions.faction_path_to_datum(source_template.faction_path)
faction_datum = source_template.faction_datum

#ifdef UNIT_TESTS
Rename("[source_template]", TRUE)
Expand Down

0 comments on commit a94c258

Please sign in to comment.