From 7a7ab6484cbfb75b4c0809900a543873c6628e4d Mon Sep 17 00:00:00 2001 From: Verkister Date: Fri, 14 Jul 2017 18:09:48 +0300 Subject: [PATCH] Done with the tweaks and shit. -Gurgled items no longer drop their invisible pocket space holder thingies while dumping their contents. -IDs and probably some other special items shouldn't randomly vanish now. -Transfering contents from gut to another now also transfers their preserved status and cleans up the list entries from source gut. -Ejection, single and complete, now properly clears the lists from ejected stuff. -Some other cleanups yadda yadda. -Added a commented example part hinting that the system is pretty much ready for a trait based item-weak gurgle option. -All should be well now unless you try to gurgle a synth expecting a preserved brain on borgo gut right now. I just remembered I forgot to steal the posibrain yankage bits from the voreorgan code. Oh well it's not like you could've done that with the old code either :v --- .../silicon/robot/dogborg/dog_sleeper_vr.dm | 52 +++++++++++++------ code/modules/vore/eating/belly_vr.dm | 23 ++++---- code/modules/vore/eating/bellymodes_vr.dm | 16 ++++-- 3 files changed, 61 insertions(+), 30 deletions(-) diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm index 926ec97410..e68178f937 100644 --- a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm +++ b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm @@ -368,23 +368,40 @@ for(var/mob/hearer in range(1,src.hound)) hearer << deathsound T << deathsound - for(var/obj/item/I in T.contents) - if(!istype(I,/obj/item/organ)) - T.drop_from_inventory(I, src) + if(is_vore_predator(T)) + for (var/bellytype in T.vore_organs) + var/datum/belly/belly = T.vore_organs[bellytype] + for (var/obj/thing in belly.internal_contents) + thing.loc = src + belly.internal_contents -= thing + for (var/mob/subprey in belly.internal_contents) + subprey.loc = src + belly.internal_contents -= subprey + subprey << "As [T] melts away around you, you find yourself in [hound]'s [name]" + for(var/obj/item/I in T) + T.drop_from_inventory(I, src) qdel(T) src.update_patient() //Handle the target being anything but a /mob/living/carbon/human else var/obj/T = target - - //If the object is in the items_preserved global list //POLARISTODO - - if(T.type in important_items) - src.items_preserved += T - - //If the object is not one to preserve - else + if(!(T in items_preserved)) + if(T.type in important_items) + src.items_preserved += T + return + if(T in items_preserved) + return + //If the object is not one to preserve + if(istype(T, /obj/item/device/pda)) + var/obj/item/device/pda/PDA = T + if (PDA.id) + PDA.id.forceMove(src) + PDA.id = null + src.hound.cell.charge += (50 * T.w_class) + contents -= T + qdel(T) + src.update_patient() //Special case for IDs to make them digested if(istype(T, /obj/item/weapon/card/id)) var/obj/item/weapon/card/id/ID = T @@ -393,21 +410,24 @@ ID.icon_state = "digested" ID.access = list() // No access src.items_preserved += ID - - //Anything not perserved, or ID + return + //Anything not preserved, PDA, or ID else if(istype(T, /obj/item)) for(var/obj/item/SubItem in T) - if(istype(SubItem, /obj/item/weapon/storage/internal)) - for(var/obj/item/SubSubItem in SubItem) + if(istype(SubItem,/obj/item/weapon/storage/internal)) + var/obj/item/weapon/storage/internal/SI = SubItem + for(var/obj/item/SubSubItem in SI) SubSubItem.forceMove(src) - qdel(SubItem) + qdel(SI) else SubItem.forceMove(src) src.hound.cell.charge += (50 * T.w_class) + contents -= T qdel(T) src.update_patient() else src.hound.cell.charge += 120 + contents -= T qdel(T) src.update_patient() return diff --git a/code/modules/vore/eating/belly_vr.dm b/code/modules/vore/eating/belly_vr.dm index c9f73ce0c4..0a9b54e710 100644 --- a/code/modules/vore/eating/belly_vr.dm +++ b/code/modules/vore/eating/belly_vr.dm @@ -121,11 +121,10 @@ M.forceMove(owner.loc) // Move the belly contents into the same location as belly's owner. internal_contents -= M // Remove from the belly contents - var/datum/belly/B = check_belly(owner) // This makes sure that the mob behaves properly if released into another mob if(B) B.internal_contents += M - + items_preserved.Cut() owner.visible_message("[owner] expels everything from their [lowertext(name)]!") return 1 @@ -138,6 +137,8 @@ M.forceMove(owner.loc) // Move the belly contents into the same location as belly's owner. src.internal_contents -= M // Remove from the belly contents + if(M in items_preserved) + src.items_preserved -= M if(istype(M,/mob/living)) var/mob/living/ML = M @@ -321,15 +322,12 @@ internal_contents += W else - if(istype(W, /obj/item/weapon/storage/internal)) - for (var/obj/item/SubItem in W) - _handle_digested_item(SubItem,M) - qdel(W) - for (var/obj/item/SubItem in W) + for(var/obj/item/SubItem in W) _handle_digested_item(SubItem,M) - if(!istype(W,/obj/item/organ)) - M.remove_from_mob(W,owner) - internal_contents += W + if(!istype(W,/obj/item/organ))// Don't drop organs or pocket spaces. + if(!istype(W,/obj/item/weapon/storage/internal)) + M.remove_from_mob(W,owner) + internal_contents += W /datum/belly/proc/_is_digestable(var/obj/item/I) if(is_type_in_list(I,important_items)) @@ -459,7 +457,10 @@ if(!(content in internal_contents)) return internal_contents -= content - target.internal_contents |= content + target.internal_contents += content + if(content in items_preserved) + items_preserved -= content + target.items_preserved += content if(isliving(content)) var/mob/living/M = content if(target.inside_flavor) diff --git a/code/modules/vore/eating/bellymodes_vr.dm b/code/modules/vore/eating/bellymodes_vr.dm index ec84952f32..5d686531cf 100644 --- a/code/modules/vore/eating/bellymodes_vr.dm +++ b/code/modules/vore/eating/bellymodes_vr.dm @@ -77,18 +77,28 @@ else owner.nutrition += (10/difference) + //if(owner.weakgurgles < 1) // An example for possible trait modifier. (Not existing currently) + //The "Handle leftovers" spaghetti below should be moved here if above gets done. + // Handle leftovers. var/obj/item/T = pick(internal_contents) if(istype(T, /obj/item)) if(istype(T, /obj/item) && _is_digestable(T) && !(T in items_preserved)) - for(var/obj/item/SubItem in T.contents) - SubItem.forceMove(internal_contents) + if(T in items_preserved)// Doublecheck just in case. + return + for(var/obj/item/SubItem in T) + if(istype(SubItem,/obj/item/weapon/storage/internal)) + var/obj/item/weapon/storage/internal/SI = SubItem + for(var/obj/item/SubSubItem in SI) + SubSubItem.forceMove(internal_contents) + qdel(SI) + else + SubItem.forceMove(internal_contents) owner.nutrition += (1 * T.w_class) internal_contents -= T qdel(T) else return - return //////////////////////////// DM_ABSORB ////////////////////////////