Skip to content

Commit

Permalink
Fixes Narnia again. (#5471)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->

# About the pull request
Fixes the Narnia closet again.
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
Runtimes bad. Funny closet good.
<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding, and may discourage maintainers from reviewing or merging
your PR. This section is not strictly required for (non-controversial)
fix PRs or backend PRs. -->


# Testing Photographs and Procedure
<!-- Include any screenshots/videos/debugging steps of the modified code
functioning successfully, ideally including edge cases. -->
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
label your changes in the changelog. Please note that maintainers freely
reserve the right to remove and add tags should they deem it
appropriate. You can attempt to finagle the system all you want, but
it's best to shoot for clear communication right off the bat. -->
<!-- If you add a name after the ':cl', that name will be used in the
changelog. You must add your CKEY after the CL if your GitHub name
doesn't match. Maintainers freely reserve the right to remove and add
tags should they deem it appropriate. -->

:cl:
fix: Fancy closet now works as desired and runtime free.
add: Added an area for the closet to use instead of APC interior.
code: Repathed /area/vehicle to /area/interior/vehicle.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! -->
  • Loading branch information
realforest2001 committed Jan 18, 2024
1 parent 97c203e commit 8065484
Show file tree
Hide file tree
Showing 11 changed files with 183 additions and 139 deletions.
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/egg_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
to_chat(user, SPAN_XENOWARNING("[src] can only be planted on [lowertext(hive.prefix)]hive weeds."))
return

if(istype(get_area(T), /area/vehicle))
if(istype(get_area(T), /area/interior))
to_chat(user, SPAN_XENOWARNING("[src] cannot be planted inside a vehicle."))
return

Expand Down
16 changes: 10 additions & 6 deletions code/modules/vehicles/interior/areas.dm
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
/area/vehicle
/area/interior
ceiling = CEILING_METAL
requires_power = 0
unlimited_power = 1
icon = 'icons/turf/areas_interiors.dmi'
icon_state = "interior"
base_lighting_alpha = 255

ambience_exterior = 'sound/ambience/vehicle_interior1.ogg'
sound_environment = SOUND_ENVIRONMENT_ROOM

/area/vehicle/tank
/area/interior/vehicle/tank
name = "tank interior"
icon_state = "tank"

/area/vehicle/apc
/area/interior/vehicle/apc
name = "\improper APC interior"
icon_state = "apc"

/area/vehicle/apc/med
/area/interior/vehicle/apc/med
name = "\improper MED APC interior"
icon_state = "apc_med"

/area/vehicle/apc/command
/area/interior/vehicle/apc/command
name = "\improper CMD APC interior"
icon_state = "apc_cmd"

/area/vehicle/van
/area/interior/vehicle/van
name = "van interior"
icon_state = "van"

/area/interior/fancylocker
name = "closet interior"
43 changes: 41 additions & 2 deletions code/modules/vehicles/interior/objects/fancy_locker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
name = "fancy closet"
desc = "It's a fancy storage unit."

icon_state = "cabinet_closed"
icon_closed = "cabinet_closed"
icon_opened = "cabinet_open"

unacidable = TRUE

var/interior_map = /datum/map_template/interior/fancy_locker
var/datum/interior/interior = null
var/entrance_speed = 1 SECONDS
var/passengers_slots = 2
Expand All @@ -19,20 +26,52 @@
INVOKE_ASYNC(src, PROC_REF(do_create_interior))

/obj/structure/closet/fancy/proc/do_create_interior()
interior.create_interior("fancylocker")
interior.create_interior(interior_map)

/obj/structure/closet/fancy/Destroy()
QDEL_NULL(interior)
return ..()

/obj/structure/closet/fancy/can_close()
for(var/obj/structure/closet/closet in get_turf(src))
if(closet != src && !closet.wall_mounted)
return FALSE
return TRUE

/obj/structure/closet/fancy/store_mobs(stored_units)
for(var/mob/M in loc)
var/succ = interior.enter(M, "default")
var/succ = interior.enter(M, "fancy")
if(!succ)
break

/obj/structure/closet/fancy/ex_act(severity)
return

/obj/structure/interior_exit/fancy
name = "fancy wooden door"
icon = 'icons/obj/structures/doors/mineral_doors.dmi'
icon_state = "wood"
density = TRUE

/obj/structure/interior_exit/fancy/attackby(obj/item/O, mob/M)
attack_hand(M)

/obj/structure/interior_exit/fancy/attack_hand(mob/escapee)
var/obj/structure/closet/fancy/closet = find_closet()
if(istype(closet) && !closet.can_open())
to_chat(escapee, SPAN_WARNING("Something is blocking the exit!"))
return
..()

/obj/structure/interior_exit/fancy/attack_alien(mob/living/carbon/xenomorph/escapee, dam_bonus)
var/obj/structure/closet/fancy/closet = find_closet()
if(istype(closet) && !closet.can_open())
to_chat(escapee, SPAN_XENOWARNING("Something is blocking the exit!"))
return
..()

/obj/structure/interior_exit/fancy/proc/find_closet()
var/obj/structure/closet/fancy/possible_closet = interior.exterior
if(istype(possible_closet))
return possible_closet
return
Binary file modified icons/turf/areas_interiors.dmi
Binary file not shown.
42 changes: 21 additions & 21 deletions maps/interiors/apc.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_3_13"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"c" = (
/obj/structure/bed/chair/vehicle{
dir = 1;
Expand All @@ -35,7 +35,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_3_5"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"d" = (
/obj/structure/bed/chair/vehicle{
dir = 1;
Expand All @@ -48,7 +48,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_3_8_1"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"e" = (
/obj/structure/interior_wall/apc{
icon_state = "rear_1"
Expand All @@ -65,7 +65,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_3_12"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"g" = (
/obj/structure/interior_wall/apc{
icon_state = "corner_small_R"
Expand All @@ -86,7 +86,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_0_1_15"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"j" = (
/turf/open/void/vehicle,
/area/space)
Expand All @@ -112,7 +112,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_3_9_1"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"n" = (
/obj/structure/interior_wall/apc{
icon_state = "front_2"
Expand Down Expand Up @@ -155,7 +155,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_1_13"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"t" = (
/obj/structure/interior_wall/apc{
icon_state = "rear_3"
Expand All @@ -167,7 +167,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_3_6"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"v" = (
/obj/structure/bed/chair/vehicle{
pixel_x = 8
Expand All @@ -183,7 +183,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_3_9_1"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"w" = (
/obj/effect/landmark/interior/spawn/entrance{
alpha = 50;
Expand All @@ -201,7 +201,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_1_11"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"y" = (
/obj/structure/interior_wall/apc{
icon_state = "front_6"
Expand All @@ -212,12 +212,12 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_1_5"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"A" = (
/turf/open/shuttle/vehicle{
icon_state = "floor_1_6"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"B" = (
/obj/structure/interior_wall/apc{
icon_state = "corner_inverse_R";
Expand All @@ -236,7 +236,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_1_11"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"D" = (
/obj/structure/interior_wall/apc{
icon_state = "wall";
Expand Down Expand Up @@ -274,7 +274,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_3_13"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"H" = (
/obj/structure/bed/chair/vehicle{
pixel_x = -8
Expand All @@ -294,7 +294,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_3_13"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"I" = (
/obj/effect/landmark/interior/spawn/vehicle_support_gunner_seat{
dir = 1
Expand All @@ -307,7 +307,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_3_11"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"J" = (
/obj/structure/interior_wall/apc{
icon_state = "corner_small_L";
Expand All @@ -324,7 +324,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_1_14"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"L" = (
/obj/structure/interior_wall/apc{
icon_state = "corner_small_L"
Expand Down Expand Up @@ -364,7 +364,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_1_1_3"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"S" = (
/obj/structure/interior_wall/apc{
alpha = 100;
Expand Down Expand Up @@ -402,7 +402,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_3_13"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"V" = (
/obj/structure/interior_wall/apc{
icon_state = "wall"
Expand All @@ -420,7 +420,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_3_8_1"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"X" = (
/obj/structure/interior_wall/apc{
icon_state = "front_wheel_R"
Expand All @@ -442,7 +442,7 @@
/turf/open/shuttle/vehicle{
icon_state = "floor_1_12"
},
/area/vehicle/apc)
/area/interior/vehicle/apc)
"Z" = (
/obj/structure/interior_wall/apc{
icon_state = "rear_4"
Expand Down
Loading

0 comments on commit 8065484

Please sign in to comment.