From 29d7e1a74a280ea2be2002059df7ead4e333b6ab Mon Sep 17 00:00:00 2001 From: TheFurryFeline <38586851+TheFurryFeline@users.noreply.github.com> Date: Tue, 30 Apr 2019 23:55:51 -0400 Subject: [PATCH] Bone Alert Add new file that focuses on prey leaving behind bones, specifying a need for prefs to match in mechanical settings. Added: Belly Mode Addon Handler to leave remains Add Prefs settings to Vore Panel - also include an egg. :egg: --- code/modules/vore/eating/belly_obj_vr.dm | 7 +- code/modules/vore/eating/bellymodes_vr.dm | 9 +- code/modules/vore/eating/leave_remains_vr.dm | 164 +++++++++++++++++++ code/modules/vore/eating/living_vr.dm | 32 ++++ code/modules/vore/eating/vore_vr.dm | 17 +- code/modules/vore/eating/vorepanel_vr.dm | 30 +++- 6 files changed, 244 insertions(+), 15 deletions(-) create mode 100644 code/modules/vore/eating/leave_remains_vr.dm diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index 6a45b64488..630f10602d 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -39,7 +39,7 @@ //Actual full digest modes var/tmp/static/list/digest_modes = list(DM_HOLD,DM_DIGEST,DM_ABSORB,DM_DRAIN,DM_UNABSORB,DM_HEAL,DM_SHRINK,DM_GROW,DM_SIZE_STEAL) //Digest mode addon flags - var/tmp/static/list/mode_flag_list = list("Numbing" = DM_FLAG_NUMBING, "Itemweak" = DM_FLAG_ITEMWEAK, "Stripping" = DM_FLAG_STRIPPING) + var/tmp/static/list/mode_flag_list = list("Numbing" = DM_FLAG_NUMBING, "Itemweak" = DM_FLAG_ITEMWEAK, "Stripping" = DM_FLAG_STRIPPING, "Leave Remains" = DM_FLAG_LEAVEREMAINS) //TFF 30/4/19: Ports VoreStation Remains Option - add new belly mode addon to toggle //Transformation modes var/tmp/static/list/transform_modes = list(DM_TRANSFORM_MALE,DM_TRANSFORM_FEMALE,DM_TRANSFORM_KEEP_GENDER,DM_TRANSFORM_CHANGE_SPECIES_AND_TAUR,DM_TRANSFORM_CHANGE_SPECIES_AND_TAUR_EGG,DM_TRANSFORM_REPLICA,DM_TRANSFORM_REPLICA_EGG,DM_TRANSFORM_KEEP_GENDER_EGG,DM_TRANSFORM_MALE_EGG,DM_TRANSFORM_FEMALE_EGG, DM_EGG) @@ -259,10 +259,9 @@ if(owner.stat == DEAD) return if(!prey.isEdible) //CHOMPEDIT: Trying to make pred mobs prey? N O U - + var/mob/living/simple_animal/preydator = prey - - if(preydator.icon_state == preydator.icon_living && preydator.size_multiplier >= 1) + if(preydator.icon_state == preydator.icon_living) user.visible_message("\the [user] promptly gets tackled by \the [prey] for trying to break their prefs! !!") user.Weaken(5) if (preydator.will_eat(user)) diff --git a/code/modules/vore/eating/bellymodes_vr.dm b/code/modules/vore/eating/bellymodes_vr.dm index 6c7a38633d..a632bdebcd 100644 --- a/code/modules/vore/eating/bellymodes_vr.dm +++ b/code/modules/vore/eating/bellymodes_vr.dm @@ -113,6 +113,9 @@ to_chat(M,"" + digest_alert_prey + "") play_sound = pick(death_sounds) + //TFF 30/4/19: Ports VoreStation Remains Option - handler to leave remains + if((mode_flags & DM_FLAG_LEAVEREMAINS) && M.digest_leave_remains) + handle_remains_leaving(M) digestion_death(M) owner.update_icons() if(compensation > 0) @@ -129,9 +132,9 @@ if(istype(M,/mob/living/simple_animal/retaliate/synx)) var/syntox = digest_brute+digest_burn owner.adjustToxLoss(syntox) - M.adjustBruteLoss(-syntox*2) //Should automaticaly clamp to 0 - M.adjustFireLoss(-syntox*2) //Should automaticaly clamp to 0 - //END SYNX hook. + if(M.health <= M.maxHealth) + M.health = M.health + syntox*2 + // Deal digestion damage (and feed the pred) var/old_brute = M.getBruteLoss() var/old_burn = M.getFireLoss() diff --git a/code/modules/vore/eating/leave_remains_vr.dm b/code/modules/vore/eating/leave_remains_vr.dm new file mode 100644 index 0000000000..46ac2f873e --- /dev/null +++ b/code/modules/vore/eating/leave_remains_vr.dm @@ -0,0 +1,164 @@ +//TFF 30/4/19: Ports VoreStation Remains Option - add new file to handle leaving some remains after digestion kills you +/obj/belly/proc/handle_remains_leaving(var/mob/living/M) + + if(istype(M,/mob/living/carbon/human)) //Are we even humanoid? + var/mob/living/carbon/human/H = M + + if((H.species.name in remainless_species) || H.isSynthetic()) //Don't leave anything if there is nothing to leave + return + + else + var/bones_amount = rand(2,3) //some random variety in amount of bones left + + if(prob(20)) //ribcage surviving whole is some luck + new /obj/item/weapon/digestion_remains/ribcage(src,owner) + bones_amount-- + + while(bones_amount) //throw in the rest + new /obj/item/weapon/digestion_remains(src,owner) + bones_amount-- + + var/skull_amount = 1 + switch(H.species.name) //oh boy here we go, finding us a right skull + if(SPECIES_HUMAN) + new /obj/item/weapon/digestion_remains/skull(src,owner) + skull_amount-- + if(SPECIES_TAJ) + new /obj/item/weapon/digestion_remains/skull/tajaran(src,owner) + skull_amount-- + if(SPECIES_UNATHI) + new /obj/item/weapon/digestion_remains/skull/unathi(src,owner) + skull_amount-- + if(SPECIES_SKRELL) + new /obj/item/weapon/digestion_remains/skull/skrell(src,owner) + skull_amount-- + if(SPECIES_VASILISSAN) + new /obj/item/weapon/digestion_remains/skull/vasilissan(src,owner) + skull_amount-- + if(SPECIES_AKULA) + new /obj/item/weapon/digestion_remains/skull/akula(src,owner) + skull_amount-- + if(SPECIES_RAPALA) + new /obj/item/weapon/digestion_remains/skull/rapala(src,owner) + skull_amount-- + if(SPECIES_VULPKANIN) + new /obj/item/weapon/digestion_remains/skull/vulpkanin(src,owner) + skull_amount-- + if(SPECIES_SERGAL) + new /obj/item/weapon/digestion_remains/skull/sergal(src,owner) + skull_amount-- + if(SPECIES_ZORREN_FLAT || SPECIES_ZORREN_HIGH) + new /obj/item/weapon/digestion_remains/skull/zorren(src,owner) + skull_amount-- + if(SPECIES_NEVREAN) + new /obj/item/weapon/digestion_remains/skull/nevrean(src,owner) + skull_amount-- + if(SPECIES_TESHARI) + new /obj/item/weapon/digestion_remains/skull/teshari(src,owner) + skull_amount-- + if(SPECIES_VOX) + new /obj/item/weapon/digestion_remains/skull/vox(src,owner) + skull_amount-- + if(SPECIES_XENOHYBRID) + new /obj/item/weapon/digestion_remains/skull/xenohybrid(src,owner) + skull_amount-- + if(skull_amount && H.species.selects_bodytype) //We still haven't found correct skull... + if(H.species.base_species == SPECIES_HUMAN) + new /obj/item/weapon/digestion_remains/skull/unknown(src,owner) + else + new /obj/item/weapon/digestion_remains/skull/unknown/anthro(src,owner) + else if(skull_amount) //Something entirely different... + new /obj/item/weapon/digestion_remains/skull/unknown(src,owner) + else + return + +/obj/item/weapon/digestion_remains + name = "bone" + desc = "A bleached bone. It's very non-descript and its hard to tell what species or part of the body it came from." + icon = 'icons/obj/bones_vr.dmi' + icon_state = "generic" + force = 0 + throwforce = 0 + item_state = "bone" + w_class = ITEMSIZE_SMALL + var/pred_ckey + var/pred_name + +/obj/item/weapon/digestion_remains/New(var/newloc,var/mob/living/pred) + ..(newloc) + pred_ckey = pred.ckey + pred_name = pred.name + +/obj/item/weapon/digestion_remains/attack_self(mob/user) + if(user.a_intent == I_HURT) + to_chat(user,"As you squeeze the [name], it crumbles into dust and falls apart into nothing!") + qdel(src) + +/obj/item/weapon/digestion_remains/ribcage + name = "ribcage" + desc = "A bleached ribcage. It's very white and definitely has seen better times. Hard to tell what it belonged to." + icon_state = "ribcage" + +/obj/item/weapon/digestion_remains/skull + name = "skull" + desc = "A bleached skull. It looks very weakened. Seems like it belonged to a human." + icon_state = "skull" + +/obj/item/weapon/digestion_remains/skull/tajaran + desc = "A bleached skull. It looks very weakened. Seems like it belonged to a tajara." + icon_state = "skull_taj" + +/obj/item/weapon/digestion_remains/skull/unathi + desc = "A bleached skull. It looks very weakened. Seems like it belonged to an unathi." + icon_state = "skull_unathi" + +/obj/item/weapon/digestion_remains/skull/skrell + desc = "A bleached skull. It looks very weakened. Seems like it belonged to a skrell." + icon_state = "skull" + +/obj/item/weapon/digestion_remains/skull/vasilissan + desc = "A bleached skull. It looks very weakened. Seems like it belonged to a vasilissan." + icon_state = "skull" + +/obj/item/weapon/digestion_remains/skull/akula + desc = "A bleached skull. It looks very weakened. Seems like it belonged to an akula." + icon_state = "skull_unathi" + +/obj/item/weapon/digestion_remains/skull/rapala + desc = "A bleached skull. It looks very weakened. Seems like it belonged to a rapala." + icon_state = "skull" + +/obj/item/weapon/digestion_remains/skull/vulpkanin + desc = "A bleached skull. It looks very weakened. Seems like it belonged to a vulpkanin." + icon_state = "skull_taj" + +/obj/item/weapon/digestion_remains/skull/sergal + desc = "A bleached skull. It looks very weakened. Seems like it belonged to a sergal." + icon_state = "skull_taj" + +/obj/item/weapon/digestion_remains/skull/zorren + desc = "A bleached skull. It looks very weakened. Seems like it belonged to a zorren." + icon_state = "skull_taj" + +/obj/item/weapon/digestion_remains/skull/nevrean + desc = "A bleached skull. It looks very weakened. Seems like it belonged to a nevrean." + icon_state = "skull_taj" + +/obj/item/weapon/digestion_remains/skull/teshari + desc = "A bleached skull. It looks very weakened. Seems like it belonged to a teshari." + icon_state = "skull_taj" + +/obj/item/weapon/digestion_remains/skull/vox + desc = "A bleached skull. It looks very weakened. Seems like it belonged to a vox." + icon_state = "skull_taj" + +/obj/item/weapon/digestion_remains/skull/unknown + desc = "A bleached skull. It looks very weakened. You can't quite tell what species it belonged to." + icon_state = "skull" + +/obj/item/weapon/digestion_remains/skull/unknown/anthro + icon_state = "skull_taj" + +/obj/item/weapon/digestion_remains/skull/xenohybrid + desc = "A bleached skull. It looks very weakened. Seems like it belonged to something with an elongated head." + icon_state = "skull_xenohybrid" \ No newline at end of file diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index a7bfc1af9c..8d1717b320 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -1,7 +1,11 @@ ///////////////////// Mob Living ///////////////////// /mob/living var/digestable = 1 // Can the mob be digested inside a belly? + //TFF 30/4/19: Ports VoreStation Remains Option - set var for leaving remains + var/digest_leave_remains = 0 // Will this mob leave bones/skull/etc after the melty demise? var/allowmobvore = 1 // Will simplemobs attempt to eat the mob? + //TFF 30/4/19: Ports VoreStation Mechanical Vore Prefs - set var for displaying vore prefs on examine + var/showvoreprefs = 1 // Determines if the mechanical vore preferences button will be displayed on the mob or not. var/obj/belly/vore_selected // Default to no vore capability. var/list/vore_organs = list() // List of vore containers inside a mob var/absorbed = 0 // If a mob is absorbed into another @@ -194,6 +198,8 @@ var/datum/vore_preferences/P = client.prefs_vr P.digestable = src.digestable + //TFF 30/4/19: Ports VoreStation Remains Option + P.digest_leave_remains = src.digest_leave_remains P.allowmobvore = src.allowmobvore P.vore_taste = src.vore_taste P.can_be_drop_prey = src.can_be_drop_prey @@ -219,6 +225,8 @@ var/datum/vore_preferences/P = client.prefs_vr digestable = P.digestable + //TFF 30/4/19: Ports VoreStation Remains Option + P.digest_leave_remains = src.digest_leave_remains allowmobvore = P.allowmobvore vore_taste = P.vore_taste can_be_drop_prey = P.can_be_drop_prey @@ -612,3 +620,27 @@ set category = "Preferences" set desc = "Switch sharp/fuzzy scaling for current mob." appearance_flags ^= PIXEL_SCALE + +//TFF 30/4/19: Ports VoreStation Mechanical Vore Prefs & Remains-leaving in 1 go +/mob/living/examine(mob/user) + . = ..() + if(showvoreprefs) + to_chat(user, "\[Mechanical Vore Preferences\]") + +/mob/living/Topic(href, href_list) //Can't find any instances of Topic() being overridden by /mob/living in polaris' base code, even though /mob/living/carbon/human's Topic() has a ..() call + if(href_list["vore_prefs"]) + display_voreprefs(usr) + return ..() + +/mob/living/proc/display_voreprefs(mob/user) //Called by Topic() calls on instances of /mob/living (and subtypes) containing vore_prefs as an argument + if(!user) + CRASH("display_voreprefs() was called without an associated user.") + var/dispvoreprefs = "[src]'s vore preferences


" + dispvoreprefs += "Digestable: [digestable ? "Enabled" : "Disabled"]
" + dispvoreprefs += "Leaves Remains: [digest_leave_remains ? "Enabled" : "Disabled"]
" + dispvoreprefs += "Mob Vore: [allowmobvore ? "Enabled" : "Disabled"]
" + dispvoreprefs += "Drop-nom prey: [can_be_drop_prey ? "Enabled" : "Disabled"]
" + dispvoreprefs += "Drop-nom pred: [can_be_drop_pred ? "Enabled" : "Disabled"]
" + user << browse("Vore prefs: [src]
[dispvoreprefs]
", "window=[name];size=200x300;can_resize=0;can_minimize=0") + onclose(user, "[name]") + return diff --git a/code/modules/vore/eating/vore_vr.dm b/code/modules/vore/eating/vore_vr.dm index d6939e9c95..84c421c214 100644 --- a/code/modules/vore/eating/vore_vr.dm +++ b/code/modules/vore/eating/vore_vr.dm @@ -42,6 +42,8 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE /datum/vore_preferences //Actual preferences var/digestable = TRUE + //TFF 30/4/19: Ports VoreStation Remains Option - set boolean for leaving remains + var/digest_leave_remains = FALSE var/allowmobvore = TRUE var/list/belly_prefs = list() var/vore_taste = "nothing in particular" @@ -92,9 +94,9 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE return 0 //Need to know what character to load! slot = client.prefs.default_slot - + load_path(client_ckey,slot) - + if(!path) return 0 //Path couldn't be set? if(!fexists(path)) //Never saved before save_vore() //Make the file first @@ -108,6 +110,8 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE json_from_file = patch_version(json_from_file,version) digestable = json_from_file["digestable"] + //TFF 30/4/19: Ports VoreStation Remains Option - add json stuff for whether a char's player allows said char to leave bones behind + digest_leave_remains = json_from_file["digest_leave_remains"] allowmobvore = json_from_file["allowmobvore"] vore_taste = json_from_file["vore_taste"] can_be_drop_prey = json_from_file["can_be_drop_prey"] @@ -117,6 +121,9 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE //Quick sanitize if(isnull(digestable)) digestable = TRUE + //TFF 30/4/19: Ports VoreStation Remains Option - sanitise for setting to false if left null + if(isnull(digest_leave_remains)) + digest_leave_remains = FALSE if(isnull(allowmobvore)) allowmobvore = TRUE if(isnull(can_be_drop_prey)) @@ -130,11 +137,13 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE /datum/vore_preferences/proc/save_vore() if(!path) return 0 - + var/version = 1 //For "good times" use in the future var/list/settings_list = list( "version" = version, "digestable" = digestable, + //TFF 30/4/19: Ports VoreStation Remains Option - add toggleable setting to the list on Vore Panel + "digest_leave_remains" = digest_leave_remains, "allowmobvore" = allowmobvore, "vore_taste" = vore_taste, "can_be_drop_prey" = can_be_drop_prey, @@ -147,7 +156,7 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE if(!json_to_file) log_debug("Saving: [path] failed jsonencode") return 0 - + //Write it out if(fexists(path)) fdel(path) //Byond only supports APPENDING to files, not replacing. diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index f76cc11c59..5b7be77ea5 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -285,6 +285,13 @@ if(0) dat += "Toggle Digestable" + //TFF 30/4/19: Ports VoreStation Remains Option - add option to leave remains after you digest a meal + switch(user.digest_leave_remains) + if(1) + dat += "Toggle Leaving Remains" + if(0) + dat += "Toggle Leaving Remains" + switch(user.allowmobvore) if(1) dat += "Toggle Mob Vore" @@ -742,20 +749,21 @@ selected = user.vore_organs[1] user.vore_selected = user.vore_organs[1] +//TFF 30/4/19: We're not Virgo here, change to the right server name if(href_list["saveprefs"]) if(!user.save_vore_prefs()) - alert("ERROR: Virgo-specific preferences failed to save!","Error") + alert("ERROR: ChompStation-specific preferences failed to save!","Error") else - to_chat(user,"Virgo-specific preferences saved!") + to_chat(user,"ChompStation-specific preferences saved!") if(href_list["applyprefs"]) var/alert = alert("Are you sure you want to reload character slot preferences? This will remove your current vore organs and eject their contents.","Confirmation","Reload","Cancel") if(!alert == "Reload") return 0 if(!user.apply_vore_prefs()) - alert("ERROR: Virgo-specific preferences failed to apply!","Error") + alert("ERROR: ChompStation-specific preferences failed to apply!","Error") else - to_chat(user,"Virgo-specific preferences applied from active slot!") + to_chat(user,"ChompStation-specific preferences applied from active slot!") if(href_list["setflavor"]) var/new_flavor = html_encode(input(usr,"What your character tastes like (40ch limit). This text will be printed to the pred after 'X tastes of...' so just put something like 'strawberries and cream':","Character Flavor",user.vore_taste) as text|null) @@ -803,6 +811,20 @@ if(user.client.prefs_vr) user.client.prefs_vr.digestable = user.digestable + //TFF 30/4/19: Ports VoreStation Remains Option - add option that goes paw in paw with belly setting; allow yourself to leave bones behind after you're digested + if(href_list["toggledlm"]) + var/choice = alert(user, "This button allows preds to have your remains be left in their belly after you are digested. This will only happen if pred sets their belly to do so. Remains consist of skeletal parts. Currently you are [user.digest_leave_remains? "" : "not"] leaving remains.", "", "Allow Post-digestion Remains", "Cancel", "Disallow Post-digestion Remains") + switch(choice) + if("Cancel") + return 0 + if("Allow Post-digestion Remains") + user.digest_leave_remains = TRUE + if("Disallow Post-digestion Remains") + user.digest_leave_remains = FALSE + + if(user.client.prefs_vr) + user.client.prefs_vr.digest_leave_remains = user.digest_leave_remains + if(href_list["togglemv"]) var/choice = alert(user, "This button is for those who don't like being eaten by mobs. Messages admins when changed, so don't try to use it for mechanical benefit. Set it once and save it. Mobs are currently: [user.allowmobvore ? "Allowed to eat" : "Prevented from eating"] you.", "", "Allow Mob Predation", "Cancel", "Prevent Mob Predation") switch(choice)