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. 🥚
This commit is contained in:
TheFurryFeline
2019-04-30 23:55:51 -04:00
committed by GitHub
parent b7340c4f94
commit 29d7e1a74a
6 changed files with 244 additions and 15 deletions
+3 -4
View File
@@ -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("<span class='danger'>\the [user] promptly gets tackled by \the [prey] for trying to break their prefs! !</span>!")
user.Weaken(5)
if (preydator.will_eat(user))
+6 -3
View File
@@ -113,6 +113,9 @@
to_chat(M,"<span class='notice'>" + digest_alert_prey + "</span>")
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()
@@ -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,"<span class='warning'>As you squeeze the [name], it crumbles into dust and falls apart into nothing!</span>")
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"
+32
View File
@@ -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, "<span class='deptradio'><a href='?src=\ref[src];vore_prefs=1'>\[Mechanical Vore Preferences\]</a></span>")
/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 = "<b>[src]'s vore preferences</b><br><br><br>"
dispvoreprefs += "<b>Digestable:</b> [digestable ? "Enabled" : "Disabled"]<br>"
dispvoreprefs += "<b>Leaves Remains:</b> [digest_leave_remains ? "Enabled" : "Disabled"]<br>"
dispvoreprefs += "<b>Mob Vore:</b> [allowmobvore ? "Enabled" : "Disabled"]<br>"
dispvoreprefs += "<b>Drop-nom prey:</b> [can_be_drop_prey ? "Enabled" : "Disabled"]<br>"
dispvoreprefs += "<b>Drop-nom pred:</b> [can_be_drop_pred ? "Enabled" : "Disabled"]<br>"
user << browse("<html><head><title>Vore prefs: [src]</title></head><body><center>[dispvoreprefs]</center></body></html>", "window=[name];size=200x300;can_resize=0;can_minimize=0")
onclose(user, "[name]")
return
+13 -4
View File
@@ -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.
+26 -4
View File
@@ -285,6 +285,13 @@
if(0)
dat += "<a href='?src=\ref[src];toggledg=1'><span style='color:green;'>Toggle Digestable</span></a>"
//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 += "<a href='?src=\ref[src];toggledlm=1'><span style='color:red;'>Toggle Leaving Remains</span></a>"
if(0)
dat += "<a href='?src=\ref[src];toggledlm=1'>Toggle Leaving Remains</a>"
switch(user.allowmobvore)
if(1)
dat += "<a href='?src=\ref[src];togglemv=1'>Toggle Mob Vore</a>"
@@ -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,"<span class='notice'>Virgo-specific preferences saved!</span>")
to_chat(user,"<span class='notice'>ChompStation-specific preferences saved!</span>")
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,"<span class='notice'>Virgo-specific preferences applied from active slot!</span>")
to_chat(user,"<span class='notice'>ChompStation-specific preferences applied from active slot!</span>")
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)