Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9f37343

Browse filesBrowse files
authored
Chaplains can now choose their chapel (yogstation13#20528)
* Chaplain choice * removal * das * f
1 parent a049cff commit 9f37343
Copy full SHA for 9f37343

11 files changed

+157-20Lines changed: 157 additions & 20 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎_maps/RandomRuins/StationRuins/BoxStation/chapel1.dmm‎

Copy file name to clipboardExpand all lines: _maps/RandomRuins/StationRuins/BoxStation/chapel1.dmm
+2-17Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,7 @@
434434
},
435435
/turf/open/floor/plasteel/dark,
436436
/area/chapel/main)
437-
"xO" = (
438-
/obj/effect/landmark/start/assistant,
439-
/turf/open/floor/plasteel/chapel{
440-
dir = 4
441-
},
442-
/area/chapel/main)
443437
"Ar" = (
444-
/obj/effect/landmark/start/chaplain,
445438
/obj/structure/chair,
446439
/obj/structure/disposalpipe/segment{
447440
dir = 4
@@ -572,14 +565,6 @@
572565
},
573566
/turf/open/floor/plasteel/dark,
574567
/area/chapel/main)
575-
"MC" = (
576-
/obj/effect/landmark/start/assistant,
577-
/obj/structure/disposalpipe/segment,
578-
/obj/structure/cable{
579-
icon_state = "1-2"
580-
},
581-
/turf/open/floor/carpet/purple,
582-
/area/chapel/main)
583568
"ML" = (
584569
/obj/machinery/door/airlock/maintenance{
585570
name = "Crematorium Maintenance";
@@ -1073,7 +1058,7 @@ ZS
10731058
Wy
10741059
ZS
10751060
PM
1076-
xO
1061+
ZS
10771062
PM
10781063
QT
10791064
JH
@@ -1138,7 +1123,7 @@ Tv
11381123
Tv
11391124
rk
11401125
Od
1141-
MC
1126+
Od
11421127
Od
11431128
Od
11441129
Od
Collapse file

‎_maps/RandomRuins/StationRuins/BoxStation/chapel2.dmm‎

Copy file name to clipboardExpand all lines: _maps/RandomRuins/StationRuins/BoxStation/chapel2.dmm
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
/turf/open/floor/carpet/red,
5151
/area/chapel/main)
5252
"cB" = (
53-
/obj/effect/landmark/start/chaplain,
5453
/obj/machinery/camera{
5554
c_tag = "Chapel Office"
5655
},
Collapse file

‎_maps/map_files/YogStation/YogStation.dmm‎

Copy file name to clipboardExpand all lines: _maps/map_files/YogStation/YogStation.dmm
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64113,6 +64113,10 @@
6411364113
},
6411464114
/turf/open/floor/plasteel,
6411564115
/area/hallway/primary/fore)
64116+
"viS" = (
64117+
/obj/effect/landmark/start/chaplain,
64118+
/turf/template_noop,
64119+
/area/template_noop)
6411664120
"viU" = (
6411764121
/obj/structure/table,
6411864122
/obj/structure/mirror{
@@ -120689,7 +120693,7 @@ qQV
120689120693
qQV
120690120694
qQV
120691120695
qQV
120692-
qQV
120696+
viS
120693120697
qQV
120694120698
qQV
120695120699
qQV
Collapse file

‎code/_globalvars/lists/mapping.dm‎

Copy file name to clipboardExpand all lines: code/_globalvars/lists/mapping.dm
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ GLOBAL_LIST_EMPTY(bar_areas)
4646
// IF YOU ARE MAKING A NEW BAR TEMPLATE AND WANT IT ROUNDSTART ADD IT TO THIS LIST!
4747
GLOBAL_LIST_INIT(potential_box_bars, list("Bar Trek", "Bar Spacious", "Bar Box", "Bar Casino", "Bar Citadel", "Bar Conveyor", "Bar Diner", "Bar Disco", "Bar Purple", "Bar Cheese", "Bar Grassy", "Bar Clock", "Bar Arcade"))
4848
GLOBAL_LIST_INIT(potential_box_clerk, list("Clerk Box", "Clerk Pod", "Clerk Meta", "Clerk Gambling Hall"))
49-
49+
GLOBAL_LIST_INIT(potential_box_chapels, list("Chapel 1", "Chapel 2"))
5050
/// Away missions
5151
GLOBAL_LIST_EMPTY(awaydestinations) //a list of landmarks that the warpgate can take you to
5252
GLOBAL_LIST_EMPTY(vr_spawnpoints)
Collapse file

‎code/controllers/subsystem/job.dm‎

Copy file name to clipboardExpand all lines: code/controllers/subsystem/job.dm
+67Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,8 @@ SUBSYSTEM_DEF(job)
610610
job.give_bar_choice(living_mob, M)
611611
else if(living_mob.job == "Clerk")
612612
job.give_clerk_choice(living_mob, M)
613+
else if(living_mob.job == "Chaplain")
614+
job.give_chapel_choice(living_mob, M)
613615
log_game("[living_mob.real_name]/[M.client.ckey] joined the round as [living_mob.job].") //yogs - Job logging
614616

615617
return living_mob
@@ -621,6 +623,71 @@ SUBSYSTEM_DEF(job)
621623
template.load(B.loc, centered = FALSE)
622624
qdel(B)
623625

626+
627+
/datum/controller/subsystem/job/proc/random_chapel_init()
628+
try
629+
var/list/player_box = list()
630+
for(var/mob/H in GLOB.player_list)
631+
if(H.client && H.client.prefs) // Prefs was null once and there was no CHAPEL
632+
player_box += H.client.prefs.read_preference(/datum/preference/choiced/chapel_choice)
633+
634+
var/choice
635+
if(player_box.len == 0)
636+
choice = "Random"
637+
else
638+
choice = pick(player_box)
639+
640+
if(choice != "Random")
641+
var/chapel_sanitize = FALSE
642+
for(var/A in GLOB.potential_box_chapels)
643+
if(choice == A)
644+
chapel_sanitize = TRUE
645+
break
646+
647+
if(!chapel_sanitize)
648+
choice = "Random"
649+
650+
if(choice == "Random")
651+
choice = pick(GLOB.potential_box_chapels)
652+
653+
var/datum/map_template/template = SSmapping.station_room_templates[choice]
654+
655+
if(isnull(template))
656+
message_admins("WARNING: CHAPEL TEMPLATE [choice] FAILED TO LOAD! ATTEMPTING TO LOAD BACKUP")
657+
log_game("WARNING: CHAPEL TEMPLATE [choice] FAILED TO LOAD! ATTEMPTING TO LOAD BACKUP")
658+
for(var/backup_chapel in GLOB.potential_box_chapels)
659+
template = SSmapping.station_room_templates[backup_chapel]
660+
if(!isnull(template))
661+
break
662+
message_admins("WARNING: CHAPEL TEMPLATE [backup_chapel] FAILED TO LOAD! ATTEMPTING TO LOAD BACKUP")
663+
log_game("WARNING: CHAPEL TEMPLATE [backup_chapel] FAILED TO LOAD! ATTEMPTING TO LOAD BACKUP")
664+
665+
if(isnull(template))
666+
message_admins("WARNING: CHAPEL RECOVERY FAILED! THERE WILL BE NO CHAPEL FOR THIS ROUND!")
667+
log_game("WARNING: CHAPEL RECOVERY FAILED! THERE WILL BE NO CHAPEL FOR THIS ROUND!")
668+
return
669+
670+
for(var/obj/effect/landmark/stationroom/box/chapel/B in GLOB.landmarks_list)
671+
template.load(B.loc, centered = FALSE)
672+
qdel(B)
673+
catch(var/exception/e)
674+
message_admins("RUNTIME IN RANDOM_CHAPEL_INIT")
675+
spawn_chapel()
676+
throw e
677+
678+
/proc/spawn_chapel()
679+
var/datum/map_template/template
680+
for(var/backup_chapel in GLOB.potential_box_chapels)
681+
template = SSmapping.station_room_templates[backup_chapel]
682+
if(!isnull(template))
683+
break
684+
if(isnull(template))
685+
message_admins("UNABLE TO SPAWN CHAPEL")
686+
687+
for(var/obj/effect/landmark/stationroom/box/chapel/B in GLOB.landmarks_list)
688+
template.load(B.loc, centered = FALSE)
689+
qdel(B)
690+
624691
/datum/controller/subsystem/job/proc/random_bar_init()
625692
try
626693
var/list/player_box = list()
Collapse file

‎code/controllers/subsystem/ticker.dm‎

Copy file name to clipboardExpand all lines: code/controllers/subsystem/ticker.dm
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ SUBSYSTEM_DEF(ticker)
421421
var/no_cyborgs = TRUE
422422
var/no_bartender = TRUE
423423
var/no_clerk = TRUE
424+
var/no_chaplain = TRUE
424425

425426
for(var/mob/dead/new_player/N in GLOB.player_list)
426427
var/mob/living/carbon/human/player = N.new_character
@@ -433,6 +434,8 @@ SUBSYSTEM_DEF(ticker)
433434
no_bartender = FALSE
434435
if(player.mind.assigned_role == "Clerk")
435436
no_clerk = FALSE
437+
if(player.mind.assigned_role == "Chaplain")
438+
no_chaplain = FALSE
436439
if(player.mind.assigned_role != player.mind.special_role)
437440
SSjob.EquipRank(N, player.mind.assigned_role, FALSE)
438441
if(CONFIG_GET(flag/roundstart_traits) && ishuman(N.new_character))
@@ -462,6 +465,8 @@ SUBSYSTEM_DEF(ticker)
462465
SSjob.random_bar_init()
463466
if(no_clerk)
464467
SSjob.random_clerk_init()
468+
if(no_chaplain)
469+
SSjob.random_chapel_init()
465470

466471
/datum/controller/subsystem/ticker/proc/transfer_characters()
467472
var/list/livings = list()
Collapse file
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/// Which chapel to spawn on boxstation
2+
/datum/preference/choiced/chapel_choice
3+
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
4+
savefile_key = "chapel_choice"
5+
savefile_identifier = PREFERENCE_CHARACTER
6+
can_randomize = FALSE
7+
8+
/datum/preference/choiced/chapel_choice/create_default_value()
9+
return "Random"
10+
11+
/datum/preference/choiced/chapel_choice/init_possible_values()
12+
return GLOB.potential_box_chapels + "Random"
13+
14+
/datum/preference/choiced/chapel_choice/is_accessible(datum/preferences/preferences)
15+
if (!..(preferences))
16+
return FALSE
17+
18+
// Job needs to be medium or high for the preference to show up
19+
return preferences.job_preferences["Chaplain"] >= JP_MEDIUM
20+
21+
/datum/preference/choiced/chapel_choice/apply_to_human(mob/living/carbon/human/target, value)
22+
return
23+
Collapse file
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { FeatureChoiced, FeatureDropdownInput } from "../base";
2+
3+
export const chapel_choice: FeatureChoiced = {
4+
name: "Chapel choice",
5+
component: FeatureDropdownInput,
6+
};
Collapse file

‎yogstation.dme‎

Copy file name to clipboardExpand all lines: yogstation.dme
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,6 +2116,7 @@
21162116
#include "code\modules\client\preferences\balloon_alerts.dm"
21172117
#include "code\modules\client\preferences\bar_choice.dm"
21182118
#include "code\modules\client\preferences\clerk_choice.dm"
2119+
#include "code\modules\client\preferences\chapel_choice.dm"
21192120
#include "code\modules\client\preferences\clothing.dm"
21202121
#include "code\modules\client\preferences\credits.dm"
21212122
#include "code\modules\client\preferences\donor.dm"
Collapse file

‎yogstation/code/game/objects/effects/landmarks.dm‎

Copy file name to clipboardExpand all lines: yogstation/code/game/objects/effects/landmarks.dm
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ GLOBAL_LIST_EMPTY(chosen_station_templates)
143143
/obj/effect/landmark/stationroom/box/chapel
144144
template_names = list("Chapel 1", "Chapel 2")
145145

146+
/obj/effect/landmark/stationroom/box/chapel/load(template_name)
147+
GLOB.stationroom_landmarks -= src
148+
return TRUE
149+
146150
/obj/effect/landmark/stationroom/meta/engine
147151
template_names = list("Meta SM" = 25, "Meta Nuclear Reactor" = 75) // tesla is loud as fuck and singulo doesn't make sense, so SM/reactor only
148152

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.