mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge pull request #5812 from TheGreatKitsune/item-tf-spawn
Item TF spawnpoints
This commit is contained in:
@@ -13,6 +13,8 @@ var/global/list/vore_reagent_sounds = list(
|
|||||||
'sound/vore/walkslosh10.ogg',
|
'sound/vore/walkslosh10.ogg',
|
||||||
"None" = null)
|
"None" = null)
|
||||||
|
|
||||||
|
var/global/list/item_tf_spawnpoints = list() // Global variable tracking which items are item tf spawnpoints
|
||||||
|
|
||||||
/var/global/list/existing_metroids = list() //Global variable for tracking metroids for the event announcement. Needs to go here for load order.
|
/var/global/list/existing_metroids = list() //Global variable for tracking metroids for the event announcement. Needs to go here for load order.
|
||||||
|
|
||||||
//stuff that only synths can eat
|
//stuff that only synths can eat
|
||||||
|
|||||||
@@ -657,6 +657,7 @@ var/global/datum/controller/occupations/job_master
|
|||||||
var/fail_deadly = FALSE
|
var/fail_deadly = FALSE
|
||||||
var/obj/belly/vore_spawn_gut
|
var/obj/belly/vore_spawn_gut
|
||||||
var/mob/living/prey_to_nomph
|
var/mob/living/prey_to_nomph
|
||||||
|
var/obj/item/item_to_be
|
||||||
|
|
||||||
//CHOMPEdit - Remove fail_deadly addition on offmap_spawn
|
//CHOMPEdit - Remove fail_deadly addition on offmap_spawn
|
||||||
|
|
||||||
@@ -781,6 +782,91 @@ var/global/datum/controller/occupations/job_master
|
|||||||
else
|
else
|
||||||
to_chat(C, "<span class='warning'>No prey were available to accept you.</span>")
|
to_chat(C, "<span class='warning'>No prey were available to accept you.</span>")
|
||||||
return
|
return
|
||||||
|
//CHOMPEdit - Item TF spawnpoints!
|
||||||
|
else if(C.prefs.spawnpoint == "Item TF spawn")
|
||||||
|
var/list/items = list()
|
||||||
|
var/list/item_names = list()
|
||||||
|
var/list/carriers = list()
|
||||||
|
for(var/obj/item/I in item_tf_spawnpoints)
|
||||||
|
if(LAZYLEN(I.ckeys_allowed_itemspawn))
|
||||||
|
if(!(C.ckey in I.ckeys_allowed_itemspawn))
|
||||||
|
continue
|
||||||
|
var/atom/item_loc = I.loc
|
||||||
|
var/mob/living/carrier
|
||||||
|
while(!isturf(item_loc))
|
||||||
|
if(isliving(item_loc))
|
||||||
|
carrier = item_loc
|
||||||
|
break
|
||||||
|
else
|
||||||
|
item_loc = item_loc.loc
|
||||||
|
if(istype(carrier))
|
||||||
|
if(!(carrier.z in using_map.vorespawn_levels))
|
||||||
|
continue
|
||||||
|
if(carrier.stat == UNCONSCIOUS || carrier.stat == DEAD || carrier.client.is_afk(10 MINUTES))
|
||||||
|
continue
|
||||||
|
carriers += carrier
|
||||||
|
else
|
||||||
|
if(!(item_loc.z in using_map.vorespawn_levels))
|
||||||
|
continue
|
||||||
|
carriers += null
|
||||||
|
|
||||||
|
items += I
|
||||||
|
if(I.name == initial(I.name))
|
||||||
|
if(carrier)
|
||||||
|
item_names += "[carrier]'s [I.name] ([I.loc.name])"
|
||||||
|
else
|
||||||
|
item_names += "[I.name] ([I.loc.name])"
|
||||||
|
else
|
||||||
|
if(carrier)
|
||||||
|
item_names += "[carrier]'s [I.name] (\a [initial(I.name)] at [I.loc.name])"
|
||||||
|
else
|
||||||
|
item_names += "[I.name] (\a [initial(I.name)] at [I.loc.name])"
|
||||||
|
if(LAZYLEN(items))
|
||||||
|
var/backup = alert(C, "Do you want a mind backup?", "Confirm", "Yes", "No")
|
||||||
|
if(backup == "Yes")
|
||||||
|
backup = 1
|
||||||
|
var/item_name = input(C, "Choose an Item to spawn as.", "Item TF Spawnpoint") as null|anything in item_names
|
||||||
|
if(!item_name)
|
||||||
|
return
|
||||||
|
var/index = item_names.Find(item_name)
|
||||||
|
var/obj/item/item = items[index]
|
||||||
|
|
||||||
|
var/mob/living/carrier = carriers[index]
|
||||||
|
if(istype(carrier))
|
||||||
|
to_chat(C, "<b><span class='warning'>[carrier] has received your spawn request. Please wait.</span></b>")
|
||||||
|
log_and_message_admins("[key_name(C)] has requested to item spawn into [key_name(carrier)]'s possession")
|
||||||
|
|
||||||
|
var/confirm = alert(carrier, "[C.prefs.real_name] is attempting to join as the [item_name] in your possession.", "Confirm", "No", "Yes")
|
||||||
|
if(confirm != "Yes")
|
||||||
|
to_chat(C, "<span class='warning'>[carrier] has declined your spawn request.</span>")
|
||||||
|
var/message = sanitizeSafe(input(carrier,"Do you want to leave them a message?")as text|null)
|
||||||
|
if(message)
|
||||||
|
to_chat(C, "<span class='notice'>[carrier] message : [message]</span>")
|
||||||
|
return
|
||||||
|
if(carrier.stat == UNCONSCIOUS || carrier.stat == DEAD)
|
||||||
|
to_chat(C, "<span class='warning'>[carrier] is not conscious.</span>")
|
||||||
|
to_chat(carrier, "<span class='warning'>You must be conscious to accept.</span>")
|
||||||
|
return
|
||||||
|
if(!(carrier.z in using_map.vorespawn_levels))
|
||||||
|
to_chat(C, "<span class='warning'>[carrier] is no longer in station grounds.</span>")
|
||||||
|
to_chat(carrier, "<span class='warning'>You must be within station grounds to accept.</span>")
|
||||||
|
return
|
||||||
|
log_and_message_admins("[key_name(C)] has item spawned onto [key_name(carrier)]")
|
||||||
|
item_to_be = item
|
||||||
|
if(backup)
|
||||||
|
addtimer(CALLBACK(src, .proc/m_backup_client, C), 5 SECONDS)
|
||||||
|
else
|
||||||
|
var/confirm = alert(C, "\The [item.name] is currently not in any character's possession! Do you still want to spawn as it?", "Confirm", "No", "Yes")
|
||||||
|
if(confirm != "Yes")
|
||||||
|
return
|
||||||
|
log_and_message_admins("[key_name(C)] has item spawned into \a [item.name] that was not held by anyone")
|
||||||
|
item_to_be = item
|
||||||
|
if(backup)
|
||||||
|
addtimer(CALLBACK(src, .proc/m_backup_client, C), 5 SECONDS)
|
||||||
|
else
|
||||||
|
to_chat(C, "<span class='warning'>No items were available to accept you.</span>")
|
||||||
|
return
|
||||||
|
//CHOMPEdit End
|
||||||
else
|
else
|
||||||
if(!(C.prefs.spawnpoint in using_map.allowed_spawns))
|
if(!(C.prefs.spawnpoint in using_map.allowed_spawns))
|
||||||
if(fail_deadly)
|
if(fail_deadly)
|
||||||
@@ -793,11 +879,15 @@ var/global/datum/controller/occupations/job_master
|
|||||||
spawnpos = spawntypes[C.prefs.spawnpoint]
|
spawnpos = spawntypes[C.prefs.spawnpoint]
|
||||||
|
|
||||||
//We will return a list key'd by "turf" and "msg"
|
//We will return a list key'd by "turf" and "msg"
|
||||||
. = list("turf","msg", "voreny", "prey")
|
. = list("turf","msg", "voreny", "prey", "itemtf") //CHOMPEdit - Item TF spawnpoints
|
||||||
if(vore_spawn_gut)
|
if(vore_spawn_gut)
|
||||||
.["voreny"] = vore_spawn_gut
|
.["voreny"] = vore_spawn_gut
|
||||||
if(prey_to_nomph)
|
if(prey_to_nomph)
|
||||||
.["prey"] = prey_to_nomph //We pass this on later to reverse the vorespawn in new_player.dm
|
.["prey"] = prey_to_nomph //We pass this on later to reverse the vorespawn in new_player.dm
|
||||||
|
//CHOMPEdit Start - Item TF spawnpoints
|
||||||
|
if(item_to_be)
|
||||||
|
.["itemtf"] = item_to_be
|
||||||
|
//CHOMPEdit End
|
||||||
if(spawnpos && istype(spawnpos) && spawnpos.turfs.len)
|
if(spawnpos && istype(spawnpos) && spawnpos.turfs.len)
|
||||||
if(spawnpos.check_job_spawning(rank))
|
if(spawnpos.check_job_spawning(rank))
|
||||||
.["turf"] = spawnpos.get_spawn_position()
|
.["turf"] = spawnpos.get_spawn_position()
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
listening_objects |= src
|
listening_objects |= src
|
||||||
new_voice.verbs -= /mob/living/voice/verb/change_name //No changing your name! Bad!
|
new_voice.verbs -= /mob/living/voice/verb/change_name //No changing your name! Bad!
|
||||||
new_voice.verbs -= /mob/living/voice/verb/hang_up //Also you can't hang up. You are the item!
|
new_voice.verbs -= /mob/living/voice/verb/hang_up //Also you can't hang up. You are the item!
|
||||||
|
src.item_tf_spawnpoint_used() //CHOMPEdit - Item TF spawnpoints
|
||||||
|
|
||||||
// Chomp edit
|
// Chomp edit
|
||||||
/obj/item/proc/muffled_by_belly(var/mob/user)
|
/obj/item/proc/muffled_by_belly(var/mob/user)
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
var/datum/gear_tweak/item_tf_spawn/gear_tweak_item_tf_spawn = new()
|
||||||
|
|
||||||
|
/datum/gear_tweak/item_tf_spawn
|
||||||
|
|
||||||
|
/datum/gear_tweak/item_tf_spawn/get_contents(var/metadata)
|
||||||
|
if(metadata["state"] == "Not Enabled")
|
||||||
|
return "Item TF spawnpoint: Not Enabled"
|
||||||
|
else if(metadata["state"] == "Anyone")
|
||||||
|
return "Item TF spawnpoint: Enabled"
|
||||||
|
else
|
||||||
|
return "Item TF spawnpoint: Only ckeys [english_list(metadata["valid"], and_text = ", ")]"
|
||||||
|
|
||||||
|
/datum/gear_tweak/item_tf_spawn/get_default()
|
||||||
|
. = list()
|
||||||
|
.["state"] = "Not Enabled"
|
||||||
|
.["valid"] = list()
|
||||||
|
|
||||||
|
/datum/gear_tweak/item_tf_spawn/get_metadata(var/user, var/list/metadata)
|
||||||
|
. = list()
|
||||||
|
var/entry = tgui_input_list(user, "Choose an entry.", "Character Preference", list("Not Enabled", "Anyone", "Only Specific Players"), metadata["state"])
|
||||||
|
if(entry)
|
||||||
|
.["state"] = entry
|
||||||
|
if(entry == "Only Specific Players")
|
||||||
|
var/ckey_input = tgui_input_text(user, "Input ckeys allowed to join on separate lines", "Allowed Players", jointext(metadata["valid"], "\n"), multiline = TRUE)
|
||||||
|
.["valid"] = splittext(lowertext(ckey_input), "\n")
|
||||||
|
else
|
||||||
|
.["valid"] = metadata["valid"]
|
||||||
|
else
|
||||||
|
return metadata
|
||||||
|
|
||||||
|
/datum/gear_tweak/item_tf_spawn/tweak_item(var/obj/item/I, var/metadata)
|
||||||
|
if(metadata["state"] == "Not Enabled")
|
||||||
|
return
|
||||||
|
else if(metadata["state"] == "Anyone")
|
||||||
|
I.item_tf_spawnpoint_set()
|
||||||
|
else if(metadata["state"] == "Only Specific Players")
|
||||||
|
I.item_tf_spawnpoint_set()
|
||||||
|
I.ckeys_allowed_itemspawn = metadata["valid"]
|
||||||
@@ -264,7 +264,7 @@ var/list/gear_datums = list()
|
|||||||
if(!description)
|
if(!description)
|
||||||
var/obj/O = path
|
var/obj/O = path
|
||||||
description = initial(O.desc)
|
description = initial(O.desc)
|
||||||
gear_tweaks = list(gear_tweak_free_name, gear_tweak_free_desc)
|
gear_tweaks = list(gear_tweak_free_name, gear_tweak_free_desc, gear_tweak_item_tf_spawn) //CHOMPEdit - Item TF spawnpoints
|
||||||
|
|
||||||
/datum/gear_data
|
/datum/gear_data
|
||||||
var/path
|
var/path
|
||||||
|
|||||||
@@ -496,7 +496,16 @@
|
|||||||
ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn
|
ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn
|
||||||
var/gut = join_props["voreny"]
|
var/gut = join_props["voreny"]
|
||||||
var/mob/living/prey = join_props["prey"]
|
var/mob/living/prey = join_props["prey"]
|
||||||
if(prey)
|
//CHOMPEdit Start - Item TF
|
||||||
|
var/obj/item/itemtf = join_props["itemtf"]
|
||||||
|
if(itemtf)
|
||||||
|
itemtf.inhabit_item(character, itemtf.name, character)
|
||||||
|
var/mob/living/possessed_voice = itemtf.possessed_voice
|
||||||
|
itemtf.trash_eatable = character.devourable
|
||||||
|
itemtf.unacidable = !character.digestable
|
||||||
|
character.forceMove(possessed_voice)
|
||||||
|
//CHOMPEdit End
|
||||||
|
else if(prey)
|
||||||
character.copy_from_prefs_vr(1,1) //Yes I know we're reloading these, shut up
|
character.copy_from_prefs_vr(1,1) //Yes I know we're reloading these, shut up
|
||||||
var/obj/belly/gut_to_enter
|
var/obj/belly/gut_to_enter
|
||||||
for(var/obj/belly/B in character.vore_organs)
|
for(var/obj/belly/B in character.vore_organs)
|
||||||
|
|||||||
18
modular_chomp/code/game/objects/items.dm
Normal file
18
modular_chomp/code/game/objects/items.dm
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/obj/item
|
||||||
|
var/item_tf_spawn_allowed = FALSE
|
||||||
|
var/list/ckeys_allowed_itemspawn = list()
|
||||||
|
|
||||||
|
/obj/item/proc/item_tf_spawnpoint_set()
|
||||||
|
if(!item_tf_spawn_allowed)
|
||||||
|
item_tf_spawn_allowed = TRUE
|
||||||
|
item_tf_spawnpoints += src
|
||||||
|
|
||||||
|
/obj/item/proc/item_tf_spawnpoint_used()
|
||||||
|
if(item_tf_spawn_allowed)
|
||||||
|
item_tf_spawn_allowed = FALSE
|
||||||
|
item_tf_spawnpoints -= src
|
||||||
|
|
||||||
|
/obj/item/Destroy(force, ...)
|
||||||
|
if(item_tf_spawn_allowed)
|
||||||
|
item_tf_spawnpoints -= src
|
||||||
|
return ..()
|
||||||
@@ -16,6 +16,10 @@
|
|||||||
display_name = "Vorespawn - Pred"
|
display_name = "Vorespawn - Pred"
|
||||||
msg = "has arrived on the station"
|
msg = "has arrived on the station"
|
||||||
|
|
||||||
|
/datum/spawnpoint/vore/itemtf
|
||||||
|
display_name = "Item TF spawn"
|
||||||
|
msg = "has arrived on the station"
|
||||||
|
|
||||||
/datum/spawnpoint/vore/New()
|
/datum/spawnpoint/vore/New()
|
||||||
..()
|
..()
|
||||||
turfs = latejoin
|
turfs = latejoin
|
||||||
|
|||||||
@@ -2017,6 +2017,7 @@
|
|||||||
#include "code\modules\client\preference_setup\global\04_ooc.dm"
|
#include "code\modules\client\preference_setup\global\04_ooc.dm"
|
||||||
#include "code\modules\client\preference_setup\global\setting_datums.dm"
|
#include "code\modules\client\preference_setup\global\setting_datums.dm"
|
||||||
#include "code\modules\client\preference_setup\loadout\gear_tweaks.dm"
|
#include "code\modules\client\preference_setup\loadout\gear_tweaks.dm"
|
||||||
|
#include "code\modules\client\preference_setup\loadout\gear_tweaks_ch.dm"
|
||||||
#include "code\modules\client\preference_setup\loadout\gear_tweaks_vr.dm"
|
#include "code\modules\client\preference_setup\loadout\gear_tweaks_vr.dm"
|
||||||
#include "code\modules\client\preference_setup\loadout\loadout.dm"
|
#include "code\modules\client\preference_setup\loadout\loadout.dm"
|
||||||
#include "code\modules\client\preference_setup\loadout\loadout_accessories.dm"
|
#include "code\modules\client\preference_setup\loadout\loadout_accessories.dm"
|
||||||
@@ -4536,6 +4537,7 @@
|
|||||||
#include "modular_chomp\code\game\jobs\job\silicon.dm"
|
#include "modular_chomp\code\game\jobs\job\silicon.dm"
|
||||||
#include "modular_chomp\code\game\machinery\airconditioner_ch.dm"
|
#include "modular_chomp\code\game\machinery\airconditioner_ch.dm"
|
||||||
#include "modular_chomp\code\game\machinery\autolathe_armory.dm"
|
#include "modular_chomp\code\game\machinery\autolathe_armory.dm"
|
||||||
|
#include "modular_chomp\code\game\objects\items.dm"
|
||||||
#include "modular_chomp\code\game\objects\items\clockwork\ratvarian_spear.dm"
|
#include "modular_chomp\code\game\objects\items\clockwork\ratvarian_spear.dm"
|
||||||
#include "modular_chomp\code\game\objects\structures\desert_planet_structures.dm"
|
#include "modular_chomp\code\game\objects\structures\desert_planet_structures.dm"
|
||||||
#include "modular_chomp\code\game\objects\structures\gargoyle.dm"
|
#include "modular_chomp\code\game\objects\structures\gargoyle.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user