Skip to content

Commit

Permalink
Better shelter 2: Bluespace boogaloo (#8314)
Browse files Browse the repository at this point in the history
* does it work?

* oh my god it actually works

* thank god I don't need this

* and this too

* hands and pockets check

* leftover

* inventory check

* Dusty go away

* Update last_shelter.dm

* better func?

* blacklist

* fix runtime

* smelter can't destroy cruciform

* it works!

* Update last_shelter.dm

* remove Search

* qdel check, resus unlist
  • Loading branch information
TheLeopold authored Mar 15, 2024
1 parent 2884e19 commit 680e95a
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 27 deletions.
10 changes: 10 additions & 0 deletions code/__HELPERS/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@

return null//If we get here, the holder must be buried many layers deep in nested containers, or else is somehow contained in nullspace

/atom/proc/is_inside(LIST)
var/atom/A = loc
while(!is_type_in_list(A, LIST))
if(isnull(A))
return null
A = A.loc
if(isturf(A))
return FALSE
return A

/atom/proc/add_overlay(overlay)
ASSERT(overlay)

Expand Down
28 changes: 26 additions & 2 deletions code/game/objects/items/devices/last_shelter.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
GLOBAL_DATUM(last_shelter, /obj/item/device/last_shelter)

//can't get cruciform from inside one of these
var/list/shelter_blacklist = list(
/mob,
/obj/machinery/neotheology/reader,
/obj/item/storage/bsdm,
/obj/machinery/recycle_vendor,
/obj/machinery/r_n_d/destructive_analyzer
)

/obj/item/device/last_shelter
name = "Last Shelter"
desc = "Powerful scanner that can teleport a cruciforms of pilgrims lost in this sector of space."
Expand Down Expand Up @@ -64,12 +73,12 @@ GLOBAL_DATUM(last_shelter, /obj/item/device/last_shelter)
scan = FALSE
if(istype(src.loc, /mob/living/carbon/human))
user.put_in_hands(cruciform)
to_chat(user, SPAN_NOTICE("The [src] has found the lost cruciform in a deep space. Now this fate of the disciple rests in your hands."))
to_chat(user, SPAN_NOTICE("The [src] has found the lost cruciform. Now this fate of the disciple rests in your hands."))
else
visible_message(SPAN_NOTICE("[src] drops [cruciform]."))
cruciform.forceMove(get_turf(src))
else
to_chat(user, SPAN_WARNING("The [src] can't find any working cruciforms in deep space. You can try to use [src] again later."))
to_chat(user, SPAN_WARNING("The [src] can't find any working cruciforms. You can try to use [src] again later."))
scan = FALSE

if(alert)
Expand All @@ -91,8 +100,23 @@ GLOBAL_DATUM(last_shelter, /obj/item/device/last_shelter)

/obj/item/device/last_shelter/proc/get_cruciform()
var/datum/mind/MN = request_player()

if(!MN)
var/list/cruciforms_temporary = lost_cruciforms.Copy()
while(cruciforms_temporary.len)
var/obj/item/implant/core_implant/picked = pick_n_take(cruciforms_temporary)
var/container = picked.is_inside(shelter_blacklist)
if(container)
if(ishuman(container))
var/mob/living/carbon/human/body = container
if((body.stat == DEAD) && (world.time >= (body.timeofdeath + NECROZTIME)))
picked.uninstall()
return picked
continue
else
return picked
return FALSE

var/mob/living/carbon/human/H = new /mob/living/carbon/human(src)
H.randomize_appearance()
for(var/stat in ALL_STATS)
Expand Down
7 changes: 6 additions & 1 deletion code/modules/core_implant/cruciform/cruciform.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#define OBELISK_UPDATE_TIME 5 SECONDS

var/list/disciples = list()
var/list/lost_cruciforms = list()

/obj/item/implant/core_implant/cruciform
name = "cruciform"
Expand Down Expand Up @@ -64,6 +65,11 @@ var/list/disciples = list()
unregister_wearer()
wearer.stats.removePerk(/datum/perk/sanityboost)
wearer.stats.removePerk(/datum/perk/active_sanityboost)
lost_cruciforms |= src
return ..()

/obj/item/implant/core_implant/cruciform/Destroy()
lost_cruciforms -= src
return ..()

/obj/item/implant/core_implant/cruciform/get_mob_overlay(gender)
Expand Down Expand Up @@ -220,7 +226,6 @@ var/list/disciples = list()

add_module(new CRUCIFORM_CLONING)


//////////////////////////
//////////////////////////

Expand Down
1 change: 1 addition & 0 deletions code/modules/core_implant/cruciform/rituals/base.dm
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
fail("Soul transfer failed.", user, C)
return FALSE
set_personal_cooldown(user)
lost_cruciforms -= CI


return TRUE
Expand Down
24 changes: 0 additions & 24 deletions code/modules/core_implant/cruciform/rituals/priest.dm
Original file line number Diff line number Diff line change
Expand Up @@ -507,27 +507,3 @@

eotp.nano_ui_interact(H)
return TRUE

/datum/ritual/cruciform/priest/acolyte/search
name = "Search"
phrase = "Ut ostenderet viam filio suo."
desc = "Find the location of disciple."
success_message = "Your prayers have been heard."
fail_message = "Your prayers have not been answered."
power = 25

/datum/ritual/cruciform/priest/acolyte/search/perform(mob/living/carbon/human/user, obj/item/implant/core_implant/C, list/targets)
var/list/OBJS = get_front(user)

var/obj/machinery/power/eotp/EOTP = locate(/obj/machinery/power/eotp) in OBJS
if(!EOTP)
fail("You must be in front of the Eye of the Protector.", user, C)
return FALSE

var/mob/living/carbon/human/H = pick_disciple_global(user, TRUE)
if (!H)
return
var/area/t = get_area(H)
log_game("[key_name(user)] locates [H] in [t] using Search litany.")
to_chat(user, span_info("[H], faithful cruciform follower, currently at [t.name]."))
return TRUE
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/human/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@

var/obj/item/implant/core_implant/cruciform/C = get_core_implant(/obj/item/implant/core_implant/cruciform)
if(C && C.active)
lost_cruciforms |= C
var/obj/item/cruciform_upgrade/upgrade = C.upgrade
if(upgrade && upgrade.active && istype(upgrade, CUPGRADE_MARTYR_GIFT))
var/obj/item/cruciform_upgrade/martyr_gift/martyr = upgrade
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,11 @@ var/list/rank_prefix = list(\
jitteriness += 3 SECONDS
updatehealth()
switch_from_dead_to_living_mob_list()

var/obj/item/implant/core_implant/cruciform/CI = get_core_implant(/obj/item/implant/core_implant/cruciform, req_activated = FALSE)
if(CI && CI.active)
lost_cruciforms -= CI

if(mind)
for(var/mob/observer/ghost/G in GLOB.player_list)
if(G.can_reenter_corpse && G.mind == mind)
Expand Down

0 comments on commit 680e95a

Please sign in to comment.