From 82f5c6019ae5c3c27e1db60024b68f4a7875d816 Mon Sep 17 00:00:00 2001 From: BlackMajor Date: Tue, 12 Jan 2021 02:19:43 +1300 Subject: [PATCH 1/3] this took way too long --- code/game/jobs/job_controller.dm | 100 +++++++++++++----- .../client/preferences_spawnpoints_ch.dm | 10 +- code/modules/mob/new_player/new_player.dm | 7 +- code/modules/vore/eating/living_vr.dm | 10 +- code/modules/vore/eating/vore_vr.dm | 13 ++- code/modules/vore/eating/vorepanel_vr.dm | 29 +++-- tgui/packages/tgui/interfaces/VorePanel.js | 13 +++ tgui/packages/tgui/public/tgui.bundle.js | 16 +-- 8 files changed, 144 insertions(+), 54 deletions(-) diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 4e53589c2f..243b115d13 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -371,8 +371,7 @@ var/global/datum/controller/occupations/job_master if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf)) H.forceMove(S.loc) else - var/list/spawn_props = LateSpawn(H.client, rank) - var/turf/T = spawn_props["turf"] + var/turf/T = get_turf(pick(latejoin)) if(!T) to_chat(H, "You were unable to be spawned at your chosen late-join spawnpoint. Please verify your job/spawn point combination makes sense, and try another one.") return @@ -511,21 +510,22 @@ var/global/datum/controller/occupations/job_master to_chat(H, "Failed to locate a storage object on your mob, either you spawned with no arms and no backpack or this is a bug.") if(istype(H)) //give humans wheelchairs, if they need them. - var/obj/item/organ/external/l_foot = H.get_organ("l_foot") - var/obj/item/organ/external/r_foot = H.get_organ("r_foot") - var/obj/item/weapon/storage/S = locate() in H.contents - var/obj/item/wheelchair/R = null - if(S) - R = locate() in S.contents - if(!l_foot || !r_foot || R) - var/obj/structure/bed/chair/wheelchair/W = new /obj/structure/bed/chair/wheelchair(H.loc) - W.buckle_mob(H) - H.update_canmove() - W.set_dir(H.dir) - W.add_fingerprint(H) - if(R) - W.color = R.color - qdel(R) + if(istype(H.loc, /obj/belly)) //unless in a gut + var/obj/item/organ/external/l_foot = H.get_organ("l_foot") + var/obj/item/organ/external/r_foot = H.get_organ("r_foot") + var/obj/item/weapon/storage/S = locate() in H.contents + var/obj/item/wheelchair/R = null + if(S) + R = locate() in S.contents + if(!l_foot || !r_foot || R) + var/obj/structure/bed/chair/wheelchair/W = new /obj/structure/bed/chair/wheelchair(H.loc) + W.buckle_mob(H) + H.update_canmove() + W.set_dir(H.dir) + W.add_fingerprint(H) + if(R) + W.color = R.color + qdel(R) to_chat(H, "You are [job.total_positions == 1 ? "the" : "a"] [alt_title ? alt_title : rank].") @@ -649,24 +649,74 @@ var/global/datum/controller/occupations/job_master var/datum/spawnpoint/spawnpos var/fail_deadly = FALSE + var/obj/belly/vore_spawn_gut var/datum/job/J = SSjob.get_job(rank) fail_deadly = J?.offmap_spawn //Spawn them at their preferred one if(C && C.prefs.spawnpoint) - if(!(C.prefs.spawnpoint in using_map.allowed_spawns)) - if(fail_deadly) - to_chat(C, "Your chosen spawnpoint is unavailable for this map and your job requires a specific spawnpoint. Please correct your spawn point choice.") - return + if(C.prefs.spawnpoint == "Vore Belly") + var/list/preds = list() + var/list/pred_names = list() //This is cringe + for(var/client/V in GLOB.clients) + if(!isliving(V.mob)) + continue + var/mob/living/M = V.mob + if(M.stat == UNCONSCIOUS || M.stat == DEAD) + continue + if(!M.latejoin_vore) + continue + if(!(M.z in using_map.station_levels)) + continue + preds += M + pred_names += M.real_name //very cringe + + if(preds.len) + var/pred_name = input(C, "Choose a Predator.", "Pred Spawnpoint") as null|anything in pred_names + if(!pred_name) + return + var/index = pred_names.Find(pred_name) + var/mob/living/pred = preds[index] + vore_spawn_gut = input(C, "Choose a Belly.", "Belly Spawnpoint") as null|anything in pred.vore_organs + if(!vore_spawn_gut) + return + log_admin("[key_name(C)] has requested to vore spawn into [key_name(pred)]") + message_admins("[key_name(C)] has requested to vore spawn into [key_name(pred)]") + + var/confirm = alert(pred, "[C.prefs.real_name] is attempting to spawn into your [vore_spawn_gut]. Let them?", "Confirm", "No", "Yes") + if(confirm != "Yes") + to_chat(C, "[pred] has declined your spawn request.") + return + if(pred.stat == UNCONSCIOUS || pred.stat == DEAD) + to_chat(C, "[pred] is not conscious.") + to_chat(pred, "You must be conscious to accept.") + return + if(!(pred.z in using_map.station_levels)) + to_chat(C, "[pred] is no longer on station.") + to_chat(pred, "You must be on the station to accept.") + return + log_admin("[key_name(C)] has vore spawned into [key_name(pred)]") + message_admins("[key_name(C)] has vore spawned into [key_name(pred)]") else - to_chat(C, "Your chosen spawnpoint ([C.prefs.spawnpoint]) is unavailable for the current map. Spawning you at one of the enabled spawn points instead.") - spawnpos = null - else + to_chat(C, "No predators were available to accept you.") + return spawnpos = spawntypes[C.prefs.spawnpoint] + else + if(!(C.prefs.spawnpoint in using_map.allowed_spawns)) + if(fail_deadly) + to_chat(C, "Your chosen spawnpoint is unavailable for this map and your job requires a specific spawnpoint. Please correct your spawn point choice.") + return + else + to_chat(C, "Your chosen spawnpoint ([C.prefs.spawnpoint]) is unavailable for the current map. Spawning you at one of the enabled spawn points instead.") + spawnpos = null + else + spawnpos = spawntypes[C.prefs.spawnpoint] //We will return a list key'd by "turf" and "msg" - . = list("turf","msg") + . = list("turf","msg", "voreny") + if(vore_spawn_gut) + .["voreny"] = vore_spawn_gut if(spawnpos && istype(spawnpos) && spawnpos.turfs.len) if(spawnpos.check_job_spawning(rank)) .["turf"] = spawnpos.get_spawn_position() diff --git a/code/modules/client/preferences_spawnpoints_ch.dm b/code/modules/client/preferences_spawnpoints_ch.dm index bcea0c153f..c6ae667f36 100644 --- a/code/modules/client/preferences_spawnpoints_ch.dm +++ b/code/modules/client/preferences_spawnpoints_ch.dm @@ -4,4 +4,12 @@ /datum/spawnpoint/stationgateway/New() ..() - turfs = latejoin_gatewaystation \ No newline at end of file + turfs = latejoin_gatewaystation + +/datum/spawnpoint/vore + display_name = "Vore Belly" + msg = "has arrived to the station via unknown means" + +/datum/spawnpoint/vore/New() + ..() + turfs = latejoin \ No newline at end of file diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index d46363f7b9..f1b92dc012 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -164,7 +164,7 @@ if(!ticker || ticker.current_state != GAME_STATE_PLAYING) to_chat(usr, "The round is either not ready, or has already finished...") return - + var/time_till_respawn = time_till_respawn() if(time_till_respawn == -1) // Special case, never allowed to respawn to_chat(usr, "Respawning is not allowed!") @@ -352,7 +352,7 @@ /mob/new_player/proc/time_till_respawn() if(!ckey) return -1 // What? - + var/timer = GLOB.respawn_timers[ckey] // No timer at all if(!timer) @@ -461,6 +461,9 @@ AnnounceArrival(character, rank, join_message, announce_channel, character.z) data_core.manifest_inject(character) ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn + var/gut = join_props["voreny"] + if(gut) + character.forceMove(gut) qdel(src) // Delete new_player mob diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 21ec8fdca3..1cb18f9f65 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -32,7 +32,8 @@ var/adminbus_trash = FALSE // For abusing trash eater for event shenanigans. var/adminbus_eat_minerals = FALSE // This creature subsists on a diet of pure adminium. var/vis_height = 32 // Sprite height used for resize features. - var/show_vore_fx = TRUE // Show belly fullscreens + var/show_vore_fx = TRUE // Show belly fullscreens + var/latejoin_vore = FALSE // If enabled, latejoiners can spawn into this, assuming they have a client // // Hook for generic creation of stuff on new creatures @@ -242,7 +243,8 @@ P.can_be_drop_pred = src.can_be_drop_pred - //CHOMP reagent belly + //CHOMP stuff + P.latejoin_vore = src.latejoin_vore P.receive_reagents = src.receive_reagents P.give_reagents = src.give_reagents @@ -279,7 +281,8 @@ can_be_drop_prey = P.can_be_drop_prey can_be_drop_pred = P.can_be_drop_pred - //CHOMP reagents belly + //CHOMP stuff + latejoin_vore = P.latejoin_vore receive_reagents = P.receive_reagents give_reagents = P.give_reagents @@ -865,6 +868,7 @@ dispvoreprefs += "Healbelly permission: [permit_healbelly ? "Allowed" : "Disallowed"]
" dispvoreprefs += "Spontaneous vore prey: [can_be_drop_prey ? "Enabled" : "Disabled"]
" dispvoreprefs += "Spontaneous vore pred: [can_be_drop_pred ? "Enabled" : "Disabled"]
" + dispvoreprefs += "Late join spawn point belly: [latejoin_vore ? "Enabled" : "Disabled"]
" //CHOMPstation edit dispvoreprefs += "Receiving liquids: [receive_reagents ? "Enabled" : "Disabled"]
" //CHOMPstation edit dispvoreprefs += "Giving liquids: [give_reagents ? "Enabled" : "Disabled"]
" //CHOMPstation edit user << browse("Vore prefs: [src]
[dispvoreprefs]
", "window=[name]mvp;size=200x300;can_resize=0;can_minimize=0") diff --git a/code/modules/vore/eating/vore_vr.dm b/code/modules/vore/eating/vore_vr.dm index b41c4a4f15..e0cf4d22fb 100644 --- a/code/modules/vore/eating/vore_vr.dm +++ b/code/modules/vore/eating/vore_vr.dm @@ -58,9 +58,10 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE var/can_be_drop_pred = FALSE - //CHOMP reagent belly + //CHOMP stuff var/receive_reagents = FALSE var/give_reagents = FALSE + var/latejoin_vore = FALSE //Mechanically required @@ -139,7 +140,8 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE belly_prefs = json_from_file["belly_prefs"] - //CHOMP reagent belly + //CHOMP stuff + latejoin_vore = json_from_file["latejoin_vore"] receive_reagents = json_from_file["receive_reagents"] give_reagents = json_from_file["give_reagents"] @@ -168,7 +170,9 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE if(isnull(belly_prefs)) belly_prefs = list() - //CHOMP reagent belly + //CHOMP stuff + if(isnull(latejoin_vore)) + latejoin_vore = FALSE if(isnull(receive_reagents)) receive_reagents = FALSE if(isnull(give_reagents)) @@ -192,9 +196,10 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE "vore_taste" = vore_taste, "vore_smell" = vore_smell, "permit_healbelly" = permit_healbelly, - "show_vore_fx" = show_vore_fx, + "show_vore_fx" = show_vore_fx, "can_be_drop_prey" = can_be_drop_prey, "can_be_drop_pred" = can_be_drop_pred, + "latejoin_vore" = latejoin_vore, "belly_prefs" = belly_prefs, "receive_reagents" = receive_reagents, "give_reagents" = give_reagents, diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 7c9537037a..5aad5921e8 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -200,7 +200,7 @@ if(M.absorbed) info["absorbed"] = TRUE data["selected"]["contents"].Add(list(info)) - + data["selected"]["show_liq"] = selected.show_liquids //CHOMPedit start: liquid belly options data["selected"]["liq_interacts"] = list() if(selected.show_liquids) @@ -243,6 +243,7 @@ "show_vore_fx" = host.show_vore_fx, "can_be_drop_prey" = host.can_be_drop_prey, "can_be_drop_pred" = host.can_be_drop_pred, + "latejoin_vore" = host.latejoin_vore, "noisy" = host.noisy, //CHOMPedit start, liquid belly prefs "liq_rec" = host.receive_reagents, @@ -271,7 +272,7 @@ // Host is inside someone else, and is trying to interact with something else inside that person. if("pick_from_inside") return pick_from_inside(usr, params) - + // Host is trying to interact with something in host's belly. if("pick_from_outside") return pick_from_outside(usr, params) @@ -302,7 +303,7 @@ host.vore_selected = NB unsaved_changes = TRUE return TRUE - + if("bellypick") host.vore_selected = locate(params["bellypick"]) return TRUE @@ -375,6 +376,12 @@ host.client.prefs_vr.can_be_drop_prey = host.can_be_drop_prey unsaved_changes = TRUE return TRUE + if("toggle_latejoin_vore") + host.latejoin_vore = !host.latejoin_vore + if(host.client.prefs_vr) + host.client.prefs_vr.latejoin_vore = host.latejoin_vore + unsaved_changes = TRUE + return TRUE if("toggle_digest") host.digestable = !host.digestable if(host.client.prefs_vr) @@ -459,11 +466,11 @@ if(!(target in OB)) return TRUE // Aren't here anymore, need to update menu - + var/intent = "Examine" if(isliving(target)) intent = alert("What do you want to do to them?","Query","Examine","Help Out","Devour") - + else if(istype(target, /obj/item)) intent = alert("What do you want to do to that?","Query","Examine","Use Hand") @@ -561,7 +568,7 @@ host.vore_selected.transfer_contents(target, choice, 1) return TRUE return - + var/atom/movable/target = locate(params["pick"]) if(!(target in host.vore_selected)) return TRUE // Not in our X anymore, update UI @@ -652,7 +659,7 @@ if(!toggle_addon) return FALSE host.vore_selected.mode_flags ^= host.vore_selected.mode_flag_list[toggle_addon] - host.vore_selected.items_preserved.Cut() //Re-evaltuate all items in belly on + host.vore_selected.items_preserved.Cut() //Re-evaltuate all items in belly on . = TRUE if("b_item_mode") var/list/menu_list = host.vore_selected.item_digest_modes.Copy() @@ -682,7 +689,7 @@ host.vore_selected.contamination_color = new_color host.vore_selected.items_preserved.Cut() //To re-contaminate for new color . = TRUE - if("b_desc") + if("b_desc") var/new_desc = html_encode(input(usr,"Belly Description ([BELLIES_DESC_MAX] char limit):","New Description",host.vore_selected.desc) as message|null) if(new_desc) @@ -915,7 +922,7 @@ qdel(host.vore_selected) host.vore_selected = host.vore_organs[1] . = TRUE - + if(.) unsaved_changes = TRUE @@ -928,7 +935,7 @@ var/attr = params["liq_attribute"] switch(attr) if("b_show_liq") - if(!host.vore_selected.show_liquids) + if(!host.vore_selected.show_liquids) host.vore_selected.show_liquids = 1 to_chat(usr,"Your [lowertext(host.vore_selected.name)] now has liquid options.") else @@ -1028,7 +1035,7 @@ var/attr = params["liq_messages"] switch(attr) if("b_show_liq_fullness") - if(!host.vore_selected.show_fullness_messages) + if(!host.vore_selected.show_fullness_messages) host.vore_selected.show_fullness_messages = 1 to_chat(usr,"Your [lowertext(host.vore_selected.name)] now has liquid examination options.") else diff --git a/tgui/packages/tgui/interfaces/VorePanel.js b/tgui/packages/tgui/interfaces/VorePanel.js index 667a2cb383..7756d4b513 100644 --- a/tgui/packages/tgui/interfaces/VorePanel.js +++ b/tgui/packages/tgui/interfaces/VorePanel.js @@ -800,6 +800,7 @@ const VoreUserPreferences = (props, context) => { show_vore_fx, can_be_drop_prey, can_be_drop_pred, + latejoin_vore, noisy, liq_rec, liq_giv, @@ -910,6 +911,18 @@ const VoreUserPreferences = (props, context) => { : "Click here to disable being spontaneous pred.")} content={can_be_drop_pred ? "Spontaneous Pred Enabled" : "Spontaneous Pred Disabled"} /> + +