Vore mode button and feeding

This commit is contained in:
Poojawa
2019-03-25 04:19:00 -05:00
parent bdfc3273b8
commit b11e3bbc96
14 changed files with 94 additions and 14 deletions
@@ -5,7 +5,7 @@
var/obj/belly/vore_selected // Default to no vore capability.
var/list/vore_organs = list() // List of vore containers inside a mob
var/devourable = FALSE // Can the mob be vored at all?
// var/feeding = FALSE // Are we going to feed someone else?
var/feeding = FALSE // Are we going to feed someone else?
var/vore_taste = null // What the character tastes like
var/no_vore = FALSE // If the character/mob can vore.
var/openpanel = 0 // Is the vore panel open?
@@ -77,13 +77,15 @@
// Critical adjustments due to TG grab changes - Poojawa
/mob/living/proc/vore_attack(var/mob/living/user, var/mob/living/prey)
if(!user || !prey)
/mob/living/proc/vore_attack(var/mob/living/user, var/mob/living/prey, var/mob/living/pred)
if(!user || !prey || !pred)
return
if(prey == src && user.zone_selected == "mouth") //you click your target
// if(!feeding(src))
// return
if(prey == src) //you click your target
if(!src.feeding)
to_chat(user, "<span class='notice'>They aren't able to be fed.</span>")
to_chat(src, "<span class='notice'>[user] tried to feed you themselves, but you aren't voracious enough to be fed.</span>")
return
if(!is_vore_predator(prey))
to_chat(user, "<span class='notice'>They aren't voracious enough.</span>")
return
@@ -96,8 +98,14 @@
user.feed_grabbed_to_self(src, prey)
else // click someone other than you/prey
// if(!feeding(src))
// return
if(!src.feeding)
to_chat(user, "<span class='notice'>They aren't voracious enough to be fed.</span>")
to_chat(src, "<span class='notice'>[user] tried to feed you [prey], but you aren't voracious enough to be fed.</span>")
return
if(!prey.feeding)
to_chat(user, "<span class='notice'>They aren't able to be fed to someone.</span>")
to_chat(prey, "<span class='notice'>[user] tried to feed you to [src], but you aren't able to be fed to them.</span>")
return
if(!is_vore_predator(src))
to_chat(user, "<span class='notice'>They aren't voracious enough.</span>")
return
@@ -122,7 +130,7 @@
return perform_the_nom(user, user, pred, belly)
/mob/living/proc/feed_grabbed_to_other(var/mob/living/user, var/mob/living/prey, var/mob/living/pred)
return//disabled until I can make that toggle work
// return//disabled until I can make that toggle work
var/belly = input("Choose Belly") in pred.vore_organs
return perform_the_nom(user, prey, pred, belly)
@@ -39,6 +39,7 @@ GLOBAL_LIST_EMPTY(vore_preferences_datums)
//Actual preferences
var/digestable = FALSE
var/devourable = FALSE
var/feeding = FALSE
// var/allowmobvore = TRUE
var/list/belly_prefs = list()
var/vore_taste = "nothing in particular"
@@ -105,6 +106,7 @@ GLOBAL_LIST_EMPTY(vore_preferences_datums)
digestable = json_from_file["digestable"]
devourable = json_from_file["devourable"]
feeding = json_from_file["feeding"]
vore_taste = json_from_file["vore_taste"]
belly_prefs = json_from_file["belly_prefs"]
@@ -113,6 +115,8 @@ GLOBAL_LIST_EMPTY(vore_preferences_datums)
digestable = FALSE
if(isnull(devourable))
devourable = FALSE
if(isnull(feeding))
feeding = FALSE
if(isnull(belly_prefs))
belly_prefs = list()
@@ -127,6 +131,7 @@ GLOBAL_LIST_EMPTY(vore_preferences_datums)
"version" = version,
"digestable" = digestable,
"devourable" = devourable,
"feeding" = feeding,
"vore_taste" = vore_taste,
"belly_prefs" = belly_prefs,
)
@@ -110,7 +110,7 @@
if(DM_DIGEST)
spanstyle = "color:red;"
if(DM_HEAL)
spanstyle = "color:green;"
spanstyle = "color:darkgreen;"
if(DM_NOISY)
spanstyle = "color:purple;"
if(DM_ABSORB)
@@ -238,15 +238,21 @@
dat += "<HR>"
switch(user.digestable)
if(TRUE)
dat += "<a href='?src=\ref[src];toggledg=1'>Toggle Digestable (Currently: ON)</a>"
dat += "<a href='?src=\ref[src];toggledg=1'>Toggle Digestable <font color='darkgreen'>(Currently: ON)</font></a>"
if(FALSE)
dat += "<a href='?src=\ref[src];toggledg=1'>Toggle Digestable (Currently: OFF)</a>"
dat += "<a href='?src=\ref[src];toggledg=1'>Toggle Digestable <font color='red'>(Currently: OFF)</font></a>"
switch(user.devourable)
if(TRUE)
dat += "<a href='?src=\ref[src];toggledvor=1'>Toggle Devourable (Currently: ON)</a>"
dat += "<br><a href='?src=\ref[src];toggledvor=1'>Toggle Devourable <font color='darkgreen'>(Currently: ON)</font></a>"
if(FALSE)
dat += "<a href='?src=\ref[src];toggledvor=1'>Toggle Devourable (Currently: OFF)</a>"
dat += "<br><a href='?src=\ref[src];toggledvor=1'>Toggle Devourable <font color='red'>(Currently: OFF)</font></a>"
switch(user.feeding)
if(TRUE)
dat += "<br><a href='?src=\ref[src];toggledfeed=1'>Toggle Feeding <font color='darkgreen'>(Currently: ON)</font></a>"
if(FALSE)
dat += "<br><a href='?src=\ref[src];toggledfeed=1'>Toggle Feeding <font color='red'>(Currently: OFF)</font></a>"
//Returns the dat html to the vore_look
return dat
@@ -708,5 +714,18 @@
if(user.client.prefs_vr)
user.client.prefs_vr.devourable = user.devourable
if(href_list["toggledfeed"])
var/choice = alert(user, "This button is to toggle your ability to be fed to others. Feeding predators is currently: [user.feeding ? "Allowed" : "Prevented"]", "", "Allow Feeding", "Cancel", "Prevent Feeding")
switch(choice)
if("Cancel")
return
if("Allow Feeding")
user.feeding = TRUE
if("Prevent Feeding")
user.feeding = FALSE
if(user.client.prefs_vr)
user.client.prefs_vr.feeding = user.feeding
//Refresh when interacted with, returning 1 makes vore_look.Topic update
return 1