Skip to content

Commit

Permalink
scrunglus
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoe2013 committed Jul 19, 2024
1 parent 1a213e3 commit dc0a827
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@
list("Marine Radio Headset", round(scale * 15), /obj/item/device/radio/headset/almayer/sof/survivor_forecon, VENDOR_ITEM_REGULAR),

list("WEBBINGS", -1, null, null),
list("Brown Webbing Vest", 0, /obj/item/clothing/accessory/storage/black_vest/brown_vest, VENDOR_ITEM_REGULAR),
list("Black Webbing Vest", 0, /obj/item/clothing/accessory/storage/black_vest, VENDOR_ITEM_REGULAR),
list("Webbing", 0, /obj/item/clothing/accessory/storage/webbing, VENDOR_ITEM_REGULAR),
list("Drop Pouch", 0, /obj/item/clothing/accessory/storage/droppouch, VENDOR_ITEM_REGULAR),
list("Shoulder Holster", 0, /obj/item/clothing/accessory/storage/holster, VENDOR_ITEM_REGULAR),
list("Brown Webbing Vest", round(scale * 1.25), /obj/item/clothing/accessory/storage/black_vest/brown_vest, VENDOR_ITEM_REGULAR),
list("Black Webbing Vest", round(max(1,(scale * 0.5))), /obj/item/clothing/accessory/storage/black_vest, VENDOR_ITEM_REGULAR),
list("Webbing", round(scale * 2), /obj/item/clothing/accessory/storage/webbing, VENDOR_ITEM_REGULAR),
list("Drop Pouch", round(max(1,(scale * 0.5))), /obj/item/clothing/accessory/storage/droppouch, VENDOR_ITEM_REGULAR),
list("Shoulder Holster", round(max(1,(scale * 0.5))), /obj/item/clothing/accessory/storage/holster, VENDOR_ITEM_REGULAR),

list("ARMOR", -1, null, null),
list("M3-R Pattern Recon Armor", round(scale * 10), /obj/item/clothing/suit/storage/marine/rto/forecon, VENDOR_ITEM_REGULAR),
Expand Down
1 change: 1 addition & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ var/list/admin_verbs_major_event = list(
/client/proc/boss_finish_verb,
/client/proc/end_game_good,
/client/proc/end_game_bad,
/client/proc/close_all_inventories,
)

var/list/admin_verbs_spawn = list(
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/suits/marine_armor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
/obj/item/tool/lighter,
/obj/item/storage/bible,
/obj/item/attachable/bayonet,
/obj/item/storage/backpack/general_belt,
/obj/item/storage/large_holster/machete,
/obj/item/storage/belt/gun/type47,
/obj/item/storage/belt/gun/m4a3,
Expand Down
12 changes: 6 additions & 6 deletions code/modules/simulacrum/simulacrumevent.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <p>The USS Rover has detected a distorted signal on the desert planet of LV-739. In accordance with standard procedure, ship has been taken out of FTL travel and crew awakened for possible distress signal. Signal is detected 73.8 meters at heading 98.6 degrees from landing zone.</p>
// <p>The USS Rover has detected a distorted signal on the desert planet of LV-739. In accordance with standard procedure, ship has been taken out of FTL travel and crew awakened for possible distress signal. Signal is detected 73.8 meters at heading 98.6 degrees from landing zone.</p><br><p>ASRS malfunction occurred during FTL travel. Uniform attachments unavailable for use.</p>

/turf/open/floor/void
name = "empty space"
Expand Down Expand Up @@ -116,18 +116,18 @@
breakable = TRUE
indestructible = FALSE
unacidable = FALSE
health = 5000
health = 4000
debris = list(/obj/item/stack/sheet/mineral/chitin/metal)
var/been_shot = FALSE

/obj/structure/simulacrum_device/central/destructable/get_examine_text(mob/user)
. = ..()
if(health > 4000)
. += SPAN_INFO("It looks undamaged.")
if(health > 3500)
. += SPAN_BOLDNOTICE("It looks undamaged.")
else if(health > 2500)
. += SPAN_INFO("It looks fairly damaged.")
. += SPAN_BOLDWARNING("It looks fairly damaged.")
else if(health > 1000)
. += SPAN_INFO("It looks like it's falling apart!")
. += SPAN_BOLDWARNING("It looks like it's falling apart!")

/obj/structure/simulacrum_device/central/destructable/bullet_act(obj/projectile/P)
. = ..()
Expand Down
16 changes: 16 additions & 0 deletions code/modules/simulacrum/simulacrumprocs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
human.ghost_locked = TRUE
human.hudswitch_blocked = TRUE
human.hud_used.show_hud(HUD_STYLE_NOHUD, human)
message_admins("close inventories now")
sleep(5 SECONDS)
if(human.client) // devious shenanigans
winset(human.client, "mainwindow.split", "splitter=1000")
Expand Down Expand Up @@ -352,3 +353,18 @@ GLOBAL_DATUM_INIT(simulation_controller, /datum/simulation_controller, new)
// final_fates += replacetext(fate, "%NAME%", human_names[1])

GLOB.simulation_controller.fate_list = final_fates


/client/proc/close_all_inventories()
set name = "Close All Inventories"
set category = "Admin.Simulation"

if(!check_rights(R_EVENT))
return

for(var/savename in GLOB.simulacrum_playersaves)
var/datum/simulacrum_humansave/save = GLOB.simulacrum_playersaves[savename]
for(var/obj/item/storage/SI in get_recursive_contents(save.tied_human))
SI.storage_close(save.tied_human)

to_chat(src, SPAN_NOTICE("Inventories closed."))
82 changes: 82 additions & 0 deletions code/modules/simulacrum/simulacrumsavedata.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
GLOBAL_LIST_EMPTY(simulacrum_playersaves)

/proc/get_recursive_contents(atom/thing)
var/list/L = list()
for(var/atom/A in thing.contents)
if(istype(A, /obj/item/storage))
L += get_recursive_contents(A)

L += A

return L

/datum/simulacrum_humansave
var/obj/item/boots
var/obj/item/gloves
Expand All @@ -26,6 +36,11 @@ GLOBAL_LIST_EMPTY(simulacrum_playersaves)
var/list/pocket1_contents = list()
var/list/pocket2_contents = list()
var/list/back_contents = list()
var/list/uniform_accessory_contents = list()

// These two are paths, not instances
var/list/uniform_accessories = list()
var/list/armor_accessories = list()

var/tied_ckey
var/mob/living/carbon/human/tied_human
Expand All @@ -37,6 +52,25 @@ GLOBAL_LIST_EMPTY(simulacrum_playersaves)
// hell
/proc/save_human(mob/living/carbon/human/human)
var/datum/simulacrum_humansave/save = new()

if(human.w_uniform)
for(var/obj/item/I as anything in human.w_uniform.accessories)
if(istype(I, /obj/item/clothing/accessory/storage))
var/obj/item/clothing/accessory/storage/webbing = I
for(var/obj/item/I2 as anything in webbing.hold)
save.uniform_accessory_contents += DuplicateObject(I2, perfectcopy = TRUE, sameloc = FALSE, newloc = null)
save.uniform_accessories += I.type
human.w_uniform.remove_accessory(human, I)
qdel(I)

if(human.wear_suit)
for(var/obj/item/I as anything in human.wear_suit.accessories)
save.armor_accessories += I.type
human.wear_suit.remove_accessory(human, I)

for(var/obj/item/storage/SI in get_recursive_contents(human))
SI.storage_close(human)

save.boots = DuplicateObject(human.shoes, perfectcopy = TRUE, sameloc = FALSE, newloc = null)
save.gloves = DuplicateObject(human.gloves, perfectcopy = TRUE, sameloc = FALSE, newloc = null)
save.uniform = DuplicateObject(human.w_uniform, perfectcopy = TRUE, sameloc = FALSE, newloc = null)
Expand Down Expand Up @@ -124,6 +158,26 @@ GLOBAL_LIST_EMPTY(simulacrum_playersaves)
human.equip_to_slot(DuplicateObject(save.pocket2, perfectcopy = TRUE, sameloc = FALSE, newloc = null), WEAR_R_STORE)
human.equip_to_slot(DuplicateObject(save.back, perfectcopy = TRUE, sameloc = FALSE, newloc = null), WEAR_BACK)

for(var/obj/item/storage/backpack/BP in get_recursive_contents(human))
BP.boxes = new
BP.boxes.name = "storage"
BP.boxes.master = BP
BP.boxes.icon_state = "block"
BP.boxes.screen_loc = "7,7 to 10,8"
BP.boxes.layer = HUD_LAYER
BP.storage_start = new /atom/movable/screen/storage()
BP.storage_start.name = "storage"
BP.storage_start.master = BP
BP.storage_start.icon_state = "storage_start"
BP.storage_start.screen_loc = "7,7 to 10,8"
BP.storage_end = new /atom/movable/screen/storage()
BP.storage_end.name = "storage"
BP.storage_end.master = BP
BP.storage_end.icon_state = "storage_end"
BP.storage_end.screen_loc = "7,7 to 10,8"
BP.closer = new
BP.closer.master = BP

if(istype(human.wear_suit, /obj/item/clothing/suit/storage))
var/obj/item/clothing/suit/storage/storage_suit = human.wear_suit
for(var/obj/item/I as anything in save.suit_contents)
Expand Down Expand Up @@ -170,3 +224,31 @@ GLOBAL_LIST_EMPTY(simulacrum_playersaves)
qdel(I2)
for(var/obj/item/I as anything in save.back_contents)
pouch.handle_item_insertion(DuplicateObject(I, perfectcopy = TRUE, sameloc = FALSE, newloc = null), TRUE, human)

/*if(human.w_uniform)
for(var/obj/item/I as anything in human.w_uniform.accessories)
if(istype(I, /obj/item/clothing/accessory/storage))
var/obj/item/clothing/accessory/storage/webbing = I
for(var/obj/item/I2 as anything in webbing.hold)
uniform_accessory_contents += DuplicateObject(I2, perfectcopy = TRUE, sameloc = FALSE, newloc = null)
uniform_accessories += I.type
human.w_uniform.remove_accessory(human, I)
qdel(I)
if(human.wear_suit)
for(var/obj/item/I as anything in human.wear_suit.accessories)
armor_accessories += I.type*/

if(human.w_uniform)
for(var/path in save.uniform_accessories)
var/obj/item/clothing/accessory/attachment = new path
human.w_uniform.attach_accessory(human, attachment, TRUE)
if(istype(attachment, /obj/item/clothing/accessory/storage))
var/obj/item/clothing/accessory/storage/pouch = attachment
for(var/obj/item/I as anything in save.uniform_accessory_contents)
pouch.hold.handle_item_insertion(DuplicateObject(I, perfectcopy = TRUE, sameloc = FALSE, newloc = null), TRUE, human)

if(human.wear_suit)
for(var/path in save.armor_accessories)
var/obj/item/clothing/accessory/attachment = new path
human.wear_suit.attach_accessory(human, attachment, TRUE)

0 comments on commit dc0a827

Please sign in to comment.