Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfixes for my centcom PR #606

Merged
merged 7 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 47 additions & 75 deletions _maps/map_files/generic/CentCom.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@
},
/obj/machinery/light/floor/has_bulb,
/turf/open/floor/iron/dark,
/area/centcom/central_command_areas/firing_range)
/area/centcom/tdome/observation)
"fP" = (
/obj/structure/table/wood/fancy,
/obj/item/storage/photo_album,
Expand Down Expand Up @@ -3769,7 +3769,7 @@
dir = 4
},
/turf/open/floor/iron/dark,
/area/centcom/central_command_areas/firing_range)
/area/centcom/tdome/observation)
"lb" = (
/obj/structure/railing,
/obj/machinery/atmospherics/pipe/smart/manifold4w/general/hidden,
Expand Down Expand Up @@ -5344,12 +5344,6 @@
},
/turf/open/space/basic,
/area/space)
"pK" = (
/obj/effect/turf_decal/siding/wood{
dir = 8
},
/turf/open/floor/wood/large,
/area/centcom/central_command_areas/firing_range)
"pN" = (
/obj/effect/turf_decal/siding/wood{
dir = 9
Expand Down Expand Up @@ -6771,7 +6765,7 @@
/area/centcom/syndicate_mothership/expansion_bombthreat)
"tU" = (
/turf/closed/indestructible/fakeglass,
/area/centcom/central_command_areas/firing_range)
/area/centcom/tdome/observation)
"tV" = (
/obj/machinery/atmospherics/pipe/smart/simple/general/visible,
/turf/closed/indestructible/opsglass,
Expand Down Expand Up @@ -9139,12 +9133,6 @@
/obj/structure/flora/bush/flowers_pp/style_random,
/turf/open/floor/grass,
/area/centcom/central_command_areas/hall)
"Bb" = (
/obj/effect/turf_decal/siding/wood{
dir = 10
},
/turf/open/floor/wood/large,
/area/centcom/central_command_areas/firing_range)
"Bc" = (
/obj/effect/turf_decal/tile/bar/opposingcorners,
/turf/open/floor/iron,
Expand Down Expand Up @@ -10859,7 +10847,7 @@
},
/obj/machinery/light/directional/west,
/turf/open/floor/wood/large,
/area/centcom/central_command_areas/firing_range)
/area/centcom/tdome/observation)
"Gh" = (
/obj/effect/turf_decal/siding/wood{
dir = 4
Expand Down Expand Up @@ -10950,6 +10938,9 @@
},
/turf/open/floor/plating,
/area/centcom/syndicate_mothership/control)
"Gs" = (
/turf/open/floor/iron/dark,
/area/centcom/tdome/observation)
"Gt" = (
/obj/machinery/door/airlock/centcom{
name = "Trapp's Office"
Expand Down Expand Up @@ -13282,12 +13273,6 @@
/obj/structure/noticeboard/directional/east,
/turf/open/floor/mineral/plastitanium,
/area/centcom/syndicate_mothership/expansion_bioterrorism)
"MU" = (
/obj/effect/turf_decal/siding/wood{
dir = 4
},
/turf/open/floor/wood/large,
/area/centcom/central_command_areas/firing_range)
"MV" = (
/obj/effect/turf_decal/siding/thinplating{
dir = 5
Expand Down Expand Up @@ -14570,12 +14555,6 @@
},
/turf/open/floor/iron/dark/herringbone,
/area/centcom/central_command_areas/admin_hangout)
"QT" = (
/obj/effect/turf_decal/siding/wood{
dir = 6
},
/turf/open/floor/wood/large,
/area/centcom/central_command_areas/firing_range)
"QU" = (
/obj/structure/flora/tree/pine/style_random,
/obj/structure/flora/grass/both/style_random,
Expand Down Expand Up @@ -14918,9 +14897,6 @@
},
/turf/open/lava/plasma/ice_moon,
/area/centcom/syndicate_mothership/control)
"RS" = (
/turf/open/floor/wood/large,
/area/centcom/central_command_areas/firing_range)
"RT" = (
/obj/machinery/light/directional/south,
/turf/open/floor/grass,
Expand Down Expand Up @@ -15720,10 +15696,6 @@
/obj/item/radio/headset,
/turf/open/floor/wood,
/area/centcom/wizard_station)
"Un" = (
/obj/effect/turf_decal/siding/wood,
/turf/open/floor/wood/large,
/area/centcom/central_command_areas/firing_range)
"Up" = (
/obj/effect/turf_decal/siding/wood,
/obj/machinery/light/neon_lining{
Expand Down Expand Up @@ -17223,7 +17195,7 @@
/area/centcom/central_command_areas/hall)
"YY" = (
/obj/machinery/computer/atmos_control/noreconnect{
atmos_chambers = list("nukiebase"="Burn Chamber");
atmos_chambers = list("nukiebase"="Burn Chamber");
desc = "Used to monitor the Syndicate Ordnance Laboratory's burn chamber.";
dir = 1;
name = "Ordnance Chamber Monitor"
Expand Down Expand Up @@ -57141,13 +57113,13 @@ pq
ew
gc
QC
Fn
Fn
Fn
Fn
Fn
Fn
Fn
QC
QC
QC
QC
QC
QC
QC
lr
lr
lr
Expand Down Expand Up @@ -57398,13 +57370,13 @@ Jd
xp
Ht
Ht
pK
pK
pK
Ht
Ht
Ht
Gg
pK
pK
Bb
Ht
Ht
aw
mw
rE
GM
Expand Down Expand Up @@ -57655,13 +57627,13 @@ Jd
TV
Nf
Wb
RS
RS
RS
RS
RS
RS
Un
Wb
Wb
Wb
Wb
Wb
Wb
Mo
oF
GM
GM
Expand Down Expand Up @@ -57912,13 +57884,13 @@ Jd
Xx
Mp
Mp
MU
MU
MU
MU
MU
MU
QT
Mp
Mp
Mp
Mp
Mp
Mp
Ro
mw
wq
GM
Expand Down Expand Up @@ -58426,13 +58398,13 @@ ae
ew
Fo
QC
Bo
Bo
Bo
Gs
Gs
Gs
tU
Bo
Bo
Bo
Gs
Gs
Gs
mw
Ra
GM
Expand Down Expand Up @@ -58940,13 +58912,13 @@ pq
ew
Ik
QC
Bo
Bo
Bo
Gs
Gs
Gs
tU
Bo
Bo
Bo
Gs
Gs
Gs
mw
UU
GM
Expand Down
32 changes: 32 additions & 0 deletions monkestation/code/datums/elements/area_locked.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//An element that when given to an atom will make it be deleted if it ever leaves the listed areas
/datum/element/area_locked
///areas we are restricted to
var/list/allowed_areas = list()
///whats our last area, used to reduce the amount of checks done
VAR_PRIVATE/last_area

/datum/element/area_locked/Attach(atom/movable/target, list/allowed_areas)
. = ..()

if(!ismovable(target))
return ELEMENT_INCOMPATIBLE

src.allowed_areas = allowed_areas
RegisterSignal(target, COMSIG_ENTER_AREA, PROC_REF(on_enter_area))
target.become_area_sensitive(REF(src))

/datum/element/area_locked/Detach(atom/movable/source, ...)
. = ..()

UnregisterSignal(source, COMSIG_ENTER_AREA)
source.lose_area_sensitivity(REF(src))

/datum/element/area_locked/proc/on_enter_area(atom/movable/source, area/new_area)
SIGNAL_HANDLER

if(new_area != last_area)
if(new_area && !is_type_in_list(new_area, allowed_areas))
source.lose_area_sensitivity(REF(src))
qdel(source)
return
last_area = new_area
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@
if(type in blacklisted_items) //should not be visible but just be extra sure we cant print these
return

new second_choice(get_turf(src))
spawn_chosen_item(second_choice)
say("[fabrication_phrase]")
playsound(src, 'sound/machines/ding.ogg', 50, TRUE)

///spawn our item, used if you want to add additional logic when an item is spawned
/obj/structure/centcom_item_spawner/proc/spawn_chosen_item(type_to_spawn)
return new type_to_spawn(get_turf(src))

///build our items to spawn, override this to generate items_to_spawn, call parent at the END of your override
/obj/structure/centcom_item_spawner/proc/build_items_to_spawn()
for(var/type as anything in blacklisted_types)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
blacklisted_items = list(
/obj/item/gun/ballistic,
/obj/item/gun/ballistic/automatic,
/obj/item/gun/ballistic/shotgun/doublebarrel/brazil/death,
/obj/item/gun/blastcannon,
/obj/item/gun/energy,
/obj/item/gun/energy/minigun, //might runtime
Expand Down Expand Up @@ -52,6 +53,10 @@
/obj/item/gun/medbeam,
)

/obj/structure/centcom_item_spawner/gun_and_ammo_creator/spawn_chosen_item(type_to_spawn)
var/obj/spawned_obj = new type_to_spawn(get_turf(src))
spawned_obj.AddElement(/datum/element/area_locked, list(/area/centcom/central_command_areas/firing_range))

/obj/structure/centcom_item_spawner/gun_and_ammo_creator/build_items_to_spawn()
items_to_spawn["Ballistic"] = subtypesof(/obj/item/gun/ballistic)
items_to_spawn["Energy"] = subtypesof(/obj/item/gun/energy)
Expand Down Expand Up @@ -81,4 +86,3 @@
if(istype(object, /obj/item/gun))
return FALSE
return ..()

1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -5631,6 +5631,7 @@
#include "monkestation\code\datums\components\throw_bounce.dm"
#include "monkestation\code\datums\components\turf_healing.dm"
#include "monkestation\code\datums\diseases\advance\symptoms\clockwork.dm"
#include "monkestation\code\datums\elements\area_locked.dm"
#include "monkestation\code\datums\keybinding\carbon.dm"
#include "monkestation\code\datums\keybinding\living.dm"
#include "monkestation\code\datums\quirks\negative_quirks.dm"
Expand Down
Loading