Merge pull request #14320 from Seris02/ingestionportbutbetter

adds a button for ingesting dogborg sleeper contents + couple other miscellaneous slightly related fixes
This commit is contained in:
Heroman3003
2023-01-16 18:44:25 +10:00
committed by GitHub
2 changed files with 61 additions and 8 deletions
@@ -164,7 +164,39 @@
message_admins("[key_name(hound)] has eaten [key_name(patient)] as a dogborg. ([hound ? "<a href='?_src_=holder;[HrefToken()];adminplayerobservecoodjump=1;X=[hound.x];Y=[hound.y];Z=[hound.z]'>JMP</a>" : "null"])")
playsound(src, gulpsound, vol = 100, vary = 1, falloff = 0.1, preference = /datum/client_preference/eating_noises)
/obj/item/device/dogborg/sleeper/proc/go_out(var/target)
/obj/item/device/dogborg/sleeper/proc/ingest_atom(var/atom/ingesting)
if (!ingesting || ingesting == hound)
return
var/obj/belly/belly = hound.vore_selected
if (!istype(hound) || !istype(belly) || !(belly in hound.vore_organs))
return
if (isliving(ingesting))
ingest_living(ingesting, belly)
else if (istype(ingesting, /obj/item))
var/obj/item/to_eat = ingesting
if (is_type_in_list(to_eat, item_vore_blacklist))
return
if (istype(to_eat, /obj/item/weapon/holder)) //just in case
var/obj/item/weapon/holder/micro = ingesting
var/delete_holder = TRUE
for (var/mob/living/M in micro.contents)
if (!ingest_living(M, belly) || M.loc == micro)
delete_holder = FALSE
if (delete_holder)
micro.held_mob = null
qdel(micro)
return
to_eat.forceMove(belly)
log_admin("VORE: [hound] used their [src] to swallow [to_eat].")
/obj/item/device/dogborg/sleeper/proc/ingest_living(var/mob/living/victim, var/obj/belly/belly)
if (victim.devourable && is_vore_predator(hound))
belly.nom_mob(victim, hound)
add_attack_logs(hound, victim, "Eaten via [belly.name]")
return TRUE
return FALSE
/obj/item/device/dogborg/sleeper/proc/go_out()
hound = src.loc
items_preserved.Cut()
cleaning = 0
@@ -181,9 +213,20 @@
var/obj/T = C
T.loc = hound.loc
playsound(src, 'sound/effects/splat.ogg', 50, 1)
update_patient()
else //You clicked eject with nothing in you, let's just reset stuff to be sure.
update_patient()
update_patient()
/obj/item/device/dogborg/sleeper/proc/vore_ingest_all()
hound = src.loc
if (!istype(hound) || length(contents) <= 0)
return
if (!hound.vore_selected)
to_chat(hound, "<span class='warning'>You don't have a belly selected to empty the contents into!</span>")
return
for (var/C in contents)
if (isliving(C) || isitem(C))
ingest_atom(C)
hound.updateVRPanel()
update_patient()
/obj/item/device/dogborg/sleeper/proc/drain(var/amt = 3) //Slightly reduced cost (before, it was always injecting inaprov)
hound = src.loc
@@ -213,21 +256,23 @@
dat += "<span class='linkOff'>Inject [C.name]</span><BR>"
dat += "<h3>[name] Status</h3>"
dat += "<div style='display: flex; flex-wrap: wrap; flex-direction: row;'>"
dat += "<A id='refbutton' href='?src=\ref[src];refresh=1'>Refresh</A>"
dat += "<A href='?src=\ref[src];eject=1'>Eject All</A>"
dat += "<A href='?src=\ref[src];port=1'>Eject port: [eject_port]</A>"
dat += "<A href='?src=\ref[src];ingest=1'>Vore All</A>" //might as well make it obvious
if(!cleaning)
dat += "<A href='?src=\ref[src];clean=1'>Self-Clean</A>"
if(medsensor)
dat += "<A href='?src=\ref[src];analyze=1'>Analyze Patient</A>"
else
dat += "<span class='linkOff'>Self-Clean</span>"
if(medsensor)
dat += "<A href='?src=\ref[src];analyze=1'>Analyze Patient</A>"
if(delivery)
dat += "<BR><h3>Cargo Compartment</h3><BR>"
dat += "<A href='?src=\ref[src];deliveryslot=1'>Active Slot: [delivery_tag]</A>"
if(islist(deliverylists[delivery_tag]))
dat += "<A href='?src=\ref[src];slot_eject=1'>Eject Slot</A>"
dat += "</div>"
dat += "<div class='statusDisplay'>"
if(!delivery && compactor && length(contents))//garbage counter for trashpup
@@ -301,7 +346,7 @@
dat += "<div class='line'><div style='width: 170px;' class='statusLabel'>[R.name]:</div><div class='statusValue'>[round(R.volume, 0.1)] units</div></div><br>"
dat += "</div>"
var/datum/browser/popup = new(user, "sleeper_b", "[name] Console", 400, 500, src)
var/datum/browser/popup = new(user, "sleeper_b", "[name] Console", 450, 500, src)
popup.set_content(dat)
popup.open()
UI_open = TRUE
@@ -350,6 +395,10 @@
eject_port = "ingestion"
sleeperUI(usr)
return
if (href_list["ingest"])
vore_ingest_all()
sleeperUI(usr)
return
if(href_list["deliveryslot"])
var/tag = tgui_input_list(usr, "Select active delivery slot:", "Slot Choice", deliverylists)
if(!tag)
@@ -87,6 +87,10 @@
return
return feed_grabbed_to_self(src,T)
/mob/living/silicon/robot/lay_down()
. = ..()
updateicon()
/mob/living/silicon/robot/proc/rest_style()
set name = "Switch Rest Style"
set category = "IC"