mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 18:02:57 +00:00
Deletes the preferences_vore datum and migrates its contents to preferences.
This commit is contained in:
@@ -81,7 +81,8 @@
|
||||
|
||||
//Don't set this very much higher then 1024 unless you like inviting people in to dos your server with message spam
|
||||
#define MAX_MESSAGE_LEN 2048 //Citadel edit: What's the WORST that could happen?
|
||||
#define MAX_FAVOR_LEN 4096 //double the maximum message length.
|
||||
#define MAX_FLAVOR_LEN 4096 //double the maximum message length.
|
||||
#define MAX_TASTE_LEN 40 //lick... vore... ew...
|
||||
#define MAX_NAME_LEN 42
|
||||
#define MAX_BROADCAST_LEN 512
|
||||
#define MAX_CHARTER_LEN 80
|
||||
|
||||
@@ -113,7 +113,7 @@ GLOBAL_VAR_INIT(miscreants_allowed, FALSE)
|
||||
set desc = "Sets an extended description of your character's features."
|
||||
set category = "IC"
|
||||
|
||||
var/new_flavor = stripped_multiline_input(usr, "Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!", "Flavor Text", flavor_text, MAX_FAVOR_LEN, TRUE)
|
||||
var/new_flavor = stripped_multiline_input(usr, "Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!", "Flavor Text", flavor_text, MAX_FLAVOR_LEN, TRUE)
|
||||
if(!isnull(new_flavor))
|
||||
flavor_text = new_flavor
|
||||
to_chat(src, "Your flavor text has been updated.")
|
||||
@@ -124,7 +124,7 @@ GLOBAL_VAR_INIT(miscreants_allowed, FALSE)
|
||||
set desc = "Sets a description of your character's current appearance. Use this for emotions, poses etc."
|
||||
set category = "IC"
|
||||
|
||||
var/new_flavor = stripped_multiline_input(usr, "Set the temporary flavor text in your 'examine' verb. This should be used only for things pertaining to the current round!", "Short-Term Flavor Text", flavor_text_2, MAX_FAVOR_LEN, TRUE)
|
||||
var/new_flavor = stripped_multiline_input(usr, "Set the temporary flavor text in your 'examine' verb. This should be used only for things pertaining to the current round!", "Short-Term Flavor Text", flavor_text_2, MAX_FLAVOR_LEN, TRUE)
|
||||
if(!isnull(new_flavor))
|
||||
flavor_text_2 = new_flavor
|
||||
to_chat(src, "Your temporary flavor text has been updated.")
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
if(!is_operational()) //Autoeject if power is lost
|
||||
if(mob_occupant)
|
||||
go_out()
|
||||
mob_occupant.apply_vore_prefs()
|
||||
mob_occupant.copy_from_prefs_vr()
|
||||
connected_message("Clone Ejected: Loss of power.")
|
||||
|
||||
else if(mob_occupant && (mob_occupant.loc == src))
|
||||
@@ -226,7 +226,7 @@
|
||||
SPEAK("The cloning has been \
|
||||
aborted due to unrecoverable tissue failure.")
|
||||
go_out()
|
||||
mob_occupant.apply_vore_prefs()
|
||||
mob_occupant.copy_from_prefs_vr()
|
||||
|
||||
else if(mob_occupant.cloneloss > (100 - heal_level))
|
||||
mob_occupant.Unconscious(80)
|
||||
@@ -272,7 +272,7 @@
|
||||
BP.attach_limb(mob_occupant)
|
||||
|
||||
go_out()
|
||||
mob_occupant.apply_vore_prefs()
|
||||
mob_occupant.copy_from_prefs_vr()
|
||||
|
||||
else if (!mob_occupant || mob_occupant.loc != src)
|
||||
occupant = null
|
||||
@@ -320,7 +320,7 @@
|
||||
SPEAK("An emergency ejection of the current clone has occurred. Survival not guaranteed.")
|
||||
to_chat(user, "<span class='notice'>You force an emergency ejection. </span>")
|
||||
go_out()
|
||||
mob_occupant.apply_vore_prefs()
|
||||
mob_occupant.copy_from_prefs_vr()
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -418,7 +418,7 @@
|
||||
if(mob_occupant && prob(100/(severity*efficiency)))
|
||||
connected_message(Gibberish("EMP-caused Accidental Ejection", 0))
|
||||
SPEAK(Gibberish("Exposure to electromagnetic fields has caused the ejection of, ERROR: John Doe, prematurely." ,0))
|
||||
mob_occupant.apply_vore_prefs()
|
||||
mob_occupant.copy_from_prefs_vr()
|
||||
go_out()
|
||||
|
||||
/obj/machinery/clonepod/ex_act(severity, target)
|
||||
|
||||
@@ -223,7 +223,6 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
|
||||
new /datum/admins(localhost_rank, ckey, 1, 1)
|
||||
//preferences datum - also holds some persistent data for the client (because we may as well keep these datums to a minimum)
|
||||
prefs = GLOB.preferences_datums[ckey]
|
||||
prefs_vr = GLOB.vore_preferences_datums[ckey] //CITADEL EDIT bypassing a failing hook
|
||||
|
||||
if(prefs)
|
||||
prefs.parent = src
|
||||
@@ -231,13 +230,6 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
|
||||
prefs = new /datum/preferences(src)
|
||||
GLOB.preferences_datums[ckey] = prefs
|
||||
|
||||
if(prefs_vr) //CITADEL EDIT bypassing a failing hook START
|
||||
prefs_vr.client = src
|
||||
else
|
||||
prefs_vr = new/datum/vore_preferences(src)
|
||||
GLOB.vore_preferences_datums[ckey] = prefs_vr
|
||||
//CITADEL EDIT bypassing a failing hook END
|
||||
|
||||
prefs.last_ip = address //these are gonna be used for banning
|
||||
prefs.last_id = computer_id //these are gonna be used for banning
|
||||
fps = prefs.clientfps
|
||||
|
||||
@@ -205,6 +205,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
|
||||
var/action_buttons_screen_locs = list()
|
||||
|
||||
//bad stuff
|
||||
var/digestable = FALSE
|
||||
var/devourable = FALSE
|
||||
var/feeding = FALSE
|
||||
var/lickable = FALSE
|
||||
var/list/belly_prefs = list()
|
||||
var/vore_taste = "nothing in particular"
|
||||
|
||||
//backgrounds
|
||||
var/mutable_appearance/character_background
|
||||
var/icon/bgstate = "steel"
|
||||
@@ -1473,7 +1481,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
age = max(min( round(text2num(new_age)), AGE_MAX),AGE_MIN)
|
||||
|
||||
if("flavor_text")
|
||||
var/msg = stripped_multiline_input(usr, "Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!", "Flavor Text", features["flavor_text"], MAX_FAVOR_LEN, TRUE)
|
||||
var/msg = stripped_multiline_input(usr, "Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!", "Flavor Text", features["flavor_text"], MAX_FLAVOR_LEN, TRUE)
|
||||
if(msg)
|
||||
features["flavor_text"] = msg
|
||||
|
||||
@@ -2262,16 +2270,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
if("load")
|
||||
load_preferences()
|
||||
load_character()
|
||||
if(parent && parent.prefs_vr)
|
||||
attempt_vr(parent.prefs_vr,"load_vore","")
|
||||
|
||||
if("changeslot")
|
||||
if(!load_character(text2num(href_list["num"])))
|
||||
random_character()
|
||||
real_name = random_unique_name(gender)
|
||||
save_character()
|
||||
if(parent && parent.prefs_vr)
|
||||
attempt_vr(parent.prefs_vr,"load_vore","")
|
||||
|
||||
if("tab")
|
||||
if (href_list["tab"])
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// You do not need to raise this if you are adding new values that have sane defaults.
|
||||
// Only raise this value when changing the meaning/format/name/layout of an existing value
|
||||
// where you would want the updater procs below to run
|
||||
#define SAVEFILE_VERSION_MAX 25
|
||||
#define SAVEFILE_VERSION_MAX 26
|
||||
|
||||
/*
|
||||
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
|
||||
@@ -115,6 +115,36 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
if(digi == "Digitigrade Legs")
|
||||
WRITE_FILE(S["feature_lizard_legs"], "Digitigrade")
|
||||
|
||||
if(current_version < 26)
|
||||
var/vr_path = "data/player_saves/[parent.ckey[1]]/[parent.ckey]/vore/character[default_slot].json"
|
||||
if(fexists(vr_path))
|
||||
var/list/json_from_file = json_decode(file2text(vr_path))
|
||||
if(json_from_file)
|
||||
digestable = json_from_file["digestable"]
|
||||
devourable = json_from_file["devourable"]
|
||||
feeding = json_from_file["feeding"]
|
||||
lickable = json_from_file["lickable"]
|
||||
belly_prefs = json_from_file["belly_prefs"]
|
||||
vore_taste = json_from_file["vore_taste"]
|
||||
|
||||
for(var/V in all_quirks) // quirk migration
|
||||
switch(V)
|
||||
if("Acute hepatic pharmacokinesis")
|
||||
DISABLE_BITFIELD(cit_toggles, PENIS_ENLARGEMENT)
|
||||
DISABLE_BITFIELD(cit_toggles, BREAST_ENLARGEMENT)
|
||||
ENABLE_BITFIELD(cit_toggles,FORCED_FEM)
|
||||
ENABLE_BITFIELD(cit_toggles,FORCED_MASC)
|
||||
all_quirks -= V
|
||||
if("Crocin Immunity")
|
||||
ENABLE_BITFIELD(cit_toggles,NO_APHRO)
|
||||
all_quirks -= V
|
||||
if("Buns of Steel")
|
||||
ENABLE_BITFIELD(cit_toggles,NO_ASS_SLAP)
|
||||
all_quirks -= V
|
||||
|
||||
if(features["meat_type"] == "Inesct")
|
||||
features["meat_type"] = "Insect"
|
||||
|
||||
/datum/preferences/proc/load_path(ckey,filename="preferences.sav")
|
||||
if(!ckey)
|
||||
return
|
||||
@@ -226,6 +256,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
cit_toggles = sanitize_integer(cit_toggles, 0, 65535, initial(cit_toggles))
|
||||
auto_ooc = sanitize_integer(auto_ooc, 0, 1, initial(auto_ooc))
|
||||
|
||||
belly_prefs = SANITIZE_LIST(belly_prefs)
|
||||
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/save_preferences()
|
||||
@@ -446,6 +478,12 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
else //We have no old flavortext, default to new
|
||||
S["feature_flavor_text"] >> features["flavor_text"]
|
||||
|
||||
S["digestable"] >> digestable
|
||||
S["devourable"] >> devourable
|
||||
S["feeding"] >> feeding
|
||||
S["vore_taste"] >> vore_taste
|
||||
S["lickable"] >> lickable
|
||||
S["belly_prefs"] >> belly_prefs
|
||||
|
||||
//try to fix any outdated data if necessary
|
||||
if(needs_update >= 0)
|
||||
@@ -509,6 +547,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
features["insect_fluff"] = sanitize_inlist(features["insect_fluff"], GLOB.insect_fluffs_list)
|
||||
features["insect_markings"] = sanitize_inlist(features["insect_markings"], GLOB.insect_markings_list, "None")
|
||||
features["insect_wings"] = sanitize_inlist(features["insect_wings"], GLOB.insect_wings_list)
|
||||
features["flavor_text"] = copytext(features["flavor_text"], 1, MAX_FLAVOR_LEN)
|
||||
|
||||
joblessrole = sanitize_integer(joblessrole, 1, 3, initial(joblessrole))
|
||||
//Validate job prefs
|
||||
@@ -518,23 +557,11 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
|
||||
all_quirks = SANITIZE_LIST(all_quirks)
|
||||
|
||||
for(var/V in all_quirks) // quirk migration
|
||||
switch(V)
|
||||
if("Acute hepatic pharmacokinesis")
|
||||
DISABLE_BITFIELD(cit_toggles, PENIS_ENLARGEMENT)
|
||||
DISABLE_BITFIELD(cit_toggles, BREAST_ENLARGEMENT)
|
||||
ENABLE_BITFIELD(cit_toggles,FORCED_FEM)
|
||||
ENABLE_BITFIELD(cit_toggles,FORCED_MASC)
|
||||
all_quirks -= V
|
||||
if("Crocin Immunity")
|
||||
ENABLE_BITFIELD(cit_toggles,NO_APHRO)
|
||||
all_quirks -= V
|
||||
if("Buns of Steel")
|
||||
ENABLE_BITFIELD(cit_toggles,NO_ASS_SLAP)
|
||||
all_quirks -= V
|
||||
lickable = sanitize_integer(lickable, FALSE, TRUE, initial(lickable))
|
||||
devourable = sanitize_integer(devourable, FALSE, TRUE, initial(devourable))
|
||||
digestable = sanitize_integer(digestable, FALSE, TRUE, initial(digestable))
|
||||
vore_taste = copytext(vore_taste, 1, MAX_TASTE_LEN)
|
||||
|
||||
if(features["meat_type"] == "Inesct")
|
||||
features["meat_type"] = "Insect"
|
||||
cit_character_pref_load(S)
|
||||
|
||||
return 1
|
||||
@@ -613,6 +640,13 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
//Quirks
|
||||
WRITE_FILE(S["all_quirks"] , all_quirks)
|
||||
|
||||
WRITE_FILE(S["digestable"] , digestable)
|
||||
WRITE_FILE(S["devourable"] , devourable)
|
||||
WRITE_FILE(S["feeding"] , feeding)
|
||||
WRITE_FILE(S["vore_taste"] , vore_taste)
|
||||
WRITE_FILE(S["lickable"] , lickable)
|
||||
WRITE_FILE(S["belly_prefs"] , belly_prefs)
|
||||
|
||||
cit_character_pref_save(S)
|
||||
|
||||
return 1
|
||||
|
||||
@@ -24,4 +24,4 @@
|
||||
if(ranged_ability)
|
||||
ranged_ability.add_ranged_ability(src, "<span class='notice'>You currently have <b>[ranged_ability]</b> active!</span>")
|
||||
if(vore_init && !vorepref_init) //Vore's been initialized, voreprefs haven't. If this triggers then that means that voreprefs failed to load due to the client being missing.
|
||||
apply_vore_prefs()
|
||||
copy_from_prefs_vr()
|
||||
|
||||
@@ -732,3 +732,11 @@
|
||||
for(var/I in emote_lists[K])
|
||||
dupe.emote_lists[K] += I
|
||||
return dupe
|
||||
|
||||
//
|
||||
// Belly searching for simplifying other procs
|
||||
// Mostly redundant now with belly-objects and isbelly(loc)
|
||||
//
|
||||
/proc/check_belly(atom/movable/A)
|
||||
return isbelly(A.loc)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
return TRUE
|
||||
|
||||
//We'll load our client's organs if we have one
|
||||
if(client && client.prefs_vr)
|
||||
if(client?.prefs)
|
||||
if(!copy_from_prefs_vr())
|
||||
to_chat(src,"<span class='warning'>ERROR: You seem to have saved vore prefs, but they couldn't be loaded.</span>")
|
||||
return FALSE
|
||||
@@ -262,47 +262,22 @@
|
||||
else
|
||||
to_chat(src,"<span class='alert'>You aren't inside anyone, though, is the thing.</span>")
|
||||
|
||||
//
|
||||
// Verb for saving vore preferences to save file
|
||||
//
|
||||
/mob/living/proc/save_vore_prefs()
|
||||
if(!client || !client.prefs_vr)
|
||||
return FALSE
|
||||
if(!copy_to_prefs_vr())
|
||||
return FALSE
|
||||
if(!client.prefs_vr.save_vore())
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/mob/living/proc/apply_vore_prefs()
|
||||
if(!client || !client.prefs_vr)
|
||||
return FALSE
|
||||
if(!client.prefs_vr.load_vore())
|
||||
return FALSE
|
||||
if(!copy_from_prefs_vr())
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/mob/living/proc/copy_to_prefs_vr()
|
||||
if(!client || !client.prefs_vr)
|
||||
to_chat(src,"<span class='warning'>You attempted to save your vore prefs but somehow you're in this character without a client.prefs_vr variable. Tell a dev.</span>")
|
||||
if(!client || !client.prefs)
|
||||
to_chat(src,"<span class='warning'>You attempted to save your vore prefs but somehow you're in this character without a client.prefs variable. Tell a dev.</span>")
|
||||
return FALSE
|
||||
|
||||
var/datum/vore_preferences/P = client.prefs_vr
|
||||
|
||||
P.digestable = src.digestable
|
||||
P.devourable = src.devourable
|
||||
P.feeding = src.feeding
|
||||
P.vore_taste = src.vore_taste
|
||||
client.prefs.digestable = digestable
|
||||
client.prefs.devourable = devourable
|
||||
client.prefs.feeding = feeding
|
||||
client.prefs.vore_taste = vore_taste
|
||||
|
||||
var/list/serialized = list()
|
||||
for(var/belly in src.vore_organs)
|
||||
for(var/belly in vore_organs)
|
||||
var/obj/belly/B = belly
|
||||
serialized += list(B.serialize()) //Can't add a list as an object to another list in Byond. Thanks.
|
||||
|
||||
P.belly_prefs = serialized
|
||||
client.prefs.belly_prefs = serialized
|
||||
|
||||
return TRUE
|
||||
|
||||
@@ -310,21 +285,20 @@
|
||||
// Proc for applying vore preferences, given bellies
|
||||
//
|
||||
/mob/living/proc/copy_from_prefs_vr()
|
||||
if(!client || !client.prefs_vr)
|
||||
to_chat(src,"<span class='warning'>You attempted to apply your vore prefs but somehow you're in this character without a client.prefs_vr variable. Tell a dev.</span>")
|
||||
if(!client || !client.prefs)
|
||||
to_chat(src,"<span class='warning'>You attempted to apply your vore prefs but somehow you're in this character without a client.prefs variable. Tell a dev.</span>")
|
||||
return FALSE
|
||||
vorepref_init = TRUE
|
||||
|
||||
var/datum/vore_preferences/P = client.prefs_vr
|
||||
|
||||
digestable = P.digestable
|
||||
devourable = P.devourable
|
||||
feeding = P.feeding
|
||||
vore_taste = P.vore_taste
|
||||
digestable = client.prefs.digestable
|
||||
devourable = client.prefs.devourable
|
||||
feeding = client.prefs.feeding
|
||||
vore_taste = client.prefs.vore_taste
|
||||
|
||||
release_vore_contents(silent = TRUE)
|
||||
vore_organs.Cut()
|
||||
for(var/entry in P.belly_prefs)
|
||||
QDEL_LIST(vore_organs)
|
||||
for(var/entry in client.prefs.belly_prefs)
|
||||
list_to_object(entry,src)
|
||||
|
||||
return TRUE
|
||||
@@ -381,18 +355,12 @@
|
||||
set category = "Vore"
|
||||
set desc = "Lick someone nearby!"
|
||||
|
||||
if(!istype(tasted))
|
||||
if(!istype(tasted) || !(tasted.client?.prefs.lickable))
|
||||
return
|
||||
|
||||
if(!tasted.client?.prefs_vr.lickable)
|
||||
return
|
||||
setClickCooldown(100)
|
||||
|
||||
if(src == stat)
|
||||
return
|
||||
|
||||
src.setClickCooldown(100)
|
||||
|
||||
src.visible_message("<span class='warning'>[src] licks [tasted]!</span>","<span class='notice'>You lick [tasted]. They taste rather like [tasted.get_taste_message()].</span>","<b>Slurp!</b>")
|
||||
visible_message("<span class='warning'>[src] licks [tasted]!</span>","<span class='notice'>You lick [tasted]. They taste rather like [tasted.get_taste_message()].</span>","<b>Slurp!</b>")
|
||||
|
||||
|
||||
/mob/living/proc/get_taste_message(allow_generic = TRUE, datum/species/mrace)
|
||||
@@ -408,3 +376,11 @@
|
||||
else
|
||||
taste_message += "a plain old normal [src]"
|
||||
return taste_message
|
||||
// Check if an object is capable of eating things, based on vore_organs
|
||||
//
|
||||
/proc/is_vore_predator(var/mob/living/O)
|
||||
if(istype(O))
|
||||
if(O.vore_organs.len > 0)
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
@@ -1,174 +0,0 @@
|
||||
|
||||
/*
|
||||
VVVVVVVV VVVVVVVV OOOOOOOOO RRRRRRRRRRRRRRRRR EEEEEEEEEEEEEEEEEEEEEE
|
||||
V::::::V V::::::V OO:::::::::OO R::::::::::::::::R E::::::::::::::::::::E
|
||||
V::::::V V::::::V OO:::::::::::::OO R::::::RRRRRR:::::R E::::::::::::::::::::E
|
||||
V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEEEEE::::E
|
||||
V:::::V V:::::V O::::::O O::::::O R::::R R:::::R E:::::E EEEEEE
|
||||
V:::::V V:::::V O:::::O O:::::O R::::R R:::::R E:::::E
|
||||
V:::::V V:::::V O:::::O O:::::O R::::RRRRRR:::::R E::::::EEEEEEEEEE
|
||||
V:::::V V:::::V O:::::O O:::::O R:::::::::::::RR E:::::::::::::::E
|
||||
V:::::V V:::::V O:::::O O:::::O R::::RRRRRR:::::R E:::::::::::::::E
|
||||
V:::::V V:::::V O:::::O O:::::O R::::R R:::::R E::::::EEEEEEEEEE
|
||||
V:::::V:::::V O:::::O O:::::O R::::R R:::::R E:::::E
|
||||
V:::::::::V O::::::O O::::::O R::::R R:::::R E:::::E EEEEEE
|
||||
V:::::::V O:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEEEE:::::E
|
||||
V:::::V OO:::::::::::::OO R::::::R R:::::RE::::::::::::::::::::E
|
||||
V:::V OO:::::::::OO R::::::R R:::::RE::::::::::::::::::::E
|
||||
VVV OOOOOOOOO RRRRRRRR RRRRRRREEEEEEEEEEEEEEEEEEEEEE
|
||||
|
||||
-Aro <3 */
|
||||
|
||||
//
|
||||
// Overrides/additions to stock defines go here, as well as hooks. Sort them by
|
||||
// the object they are overriding. So all /mob/living together, etc.
|
||||
//
|
||||
|
||||
//
|
||||
// The datum type bolted onto normal preferences datums for storing Vore stuff
|
||||
//
|
||||
|
||||
#define VORE_VERSION 4
|
||||
|
||||
GLOBAL_LIST_EMPTY(vore_preferences_datums)
|
||||
|
||||
/client
|
||||
var/datum/vore_preferences/prefs_vr
|
||||
|
||||
/datum/vore_preferences
|
||||
//Actual preferences
|
||||
var/digestable = FALSE
|
||||
var/devourable = FALSE
|
||||
var/feeding = FALSE
|
||||
var/lickable = FALSE
|
||||
// var/allowmobvore = TRUE
|
||||
var/list/belly_prefs = list()
|
||||
var/vore_taste = "nothing in particular"
|
||||
// var/can_be_drop_prey = FALSE
|
||||
// var/can_be_drop_pred = FALSE
|
||||
|
||||
//Mechanically required
|
||||
var/path
|
||||
var/slot
|
||||
var/client/client
|
||||
var/client_ckey
|
||||
|
||||
/datum/vore_preferences/New(client/C)
|
||||
if(istype(C))
|
||||
client = C
|
||||
client_ckey = C.ckey
|
||||
load_vore()
|
||||
|
||||
//
|
||||
// Check if an object is capable of eating things, based on vore_organs
|
||||
//
|
||||
/proc/is_vore_predator(var/mob/living/O)
|
||||
if(istype(O,/mob/living))
|
||||
if(O.vore_organs.len > 0)
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
//
|
||||
// Belly searching for simplifying other procs
|
||||
// Mostly redundant now with belly-objects and isbelly(loc)
|
||||
//
|
||||
/proc/check_belly(atom/movable/A)
|
||||
return isbelly(A.loc)
|
||||
|
||||
//
|
||||
// Save/Load Vore Preferences
|
||||
//
|
||||
/datum/vore_preferences/proc/load_path(ckey,slot,filename="character",ext="json")
|
||||
if(!ckey || !slot) return
|
||||
path = "data/player_saves/[ckey[1]]/[ckey]/vore/[filename][slot].[ext]"
|
||||
|
||||
/datum/vore_preferences/proc/load_vore()
|
||||
if(!client || !client_ckey)
|
||||
return FALSE //No client, how can we save?
|
||||
if(!client.prefs || !client.prefs.default_slot)
|
||||
return FALSE //Need to know what character to load!
|
||||
|
||||
slot = client.prefs.default_slot
|
||||
|
||||
load_path(client_ckey,slot)
|
||||
|
||||
if(!path) return FALSE //Path couldn't be set?
|
||||
if(!fexists(path)) //Never saved before
|
||||
save_vore() //Make the file first
|
||||
return TRUE
|
||||
|
||||
var/list/json_from_file = json_decode(file2text(path))
|
||||
if(!json_from_file)
|
||||
return FALSE //My concern grows
|
||||
|
||||
var/version = json_from_file["version"]
|
||||
json_from_file = patch_version(json_from_file,version)
|
||||
|
||||
digestable = json_from_file["digestable"]
|
||||
devourable = json_from_file["devourable"]
|
||||
feeding = json_from_file["feeding"]
|
||||
lickable = json_from_file["lickable"]
|
||||
vore_taste = json_from_file["vore_taste"]
|
||||
belly_prefs = json_from_file["belly_prefs"]
|
||||
|
||||
//Quick sanitize
|
||||
if(isnull(digestable))
|
||||
digestable = FALSE
|
||||
if(isnull(devourable))
|
||||
devourable = FALSE
|
||||
if(isnull(feeding))
|
||||
feeding = FALSE
|
||||
if(isnull(lickable))
|
||||
lickable = FALSE
|
||||
if(isnull(belly_prefs))
|
||||
belly_prefs = list()
|
||||
|
||||
return TRUE
|
||||
|
||||
/datum/vore_preferences/proc/save_vore()
|
||||
if(!path)
|
||||
return FALSE
|
||||
|
||||
var/version = VORE_VERSION //For "good times" use in the future
|
||||
var/list/settings_list = list(
|
||||
"version" = version,
|
||||
"digestable" = digestable,
|
||||
"devourable" = devourable,
|
||||
"feeding" = feeding,
|
||||
"lickable" = lickable,
|
||||
"vore_taste" = vore_taste,
|
||||
"belly_prefs" = belly_prefs,
|
||||
)
|
||||
|
||||
//List to JSON
|
||||
var/json_to_file = json_encode(settings_list)
|
||||
if(!json_to_file)
|
||||
testing("Saving: [path] failed jsonencode")
|
||||
return FALSE
|
||||
|
||||
//Write it out
|
||||
//#ifdef RUST_G
|
||||
// call(RUST_G, "file_write")(json_to_file, path)
|
||||
//#else
|
||||
// Fall back to using old format if we are not using rust-g
|
||||
if(fexists(path))
|
||||
fdel(path) //Byond only supports APPENDING to files, not replacing.
|
||||
text2file(json_to_file, path)
|
||||
//#endif
|
||||
if(!fexists(path))
|
||||
testing("Saving: [path] failed file write")
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/* commented out list things
|
||||
"allowmobvore" = allowmobvore,
|
||||
"can_be_drop_prey" = can_be_drop_prey,
|
||||
"can_be_drop_pred" = can_be_drop_pred, */
|
||||
|
||||
//Can do conversions here
|
||||
datum/vore_preferences/proc/patch_version(var/list/json_from_file,var/version)
|
||||
return json_from_file
|
||||
|
||||
#undef VORE_VERSION
|
||||
@@ -6,7 +6,6 @@
|
||||
#define BELLIES_NAME_MIN 2
|
||||
#define BELLIES_NAME_MAX 12
|
||||
#define BELLIES_DESC_MAX 1024
|
||||
#define FLAVOR_MAX 40
|
||||
|
||||
/mob/living/proc/insidePanel()
|
||||
set name = "Vore Panel"
|
||||
@@ -247,8 +246,8 @@
|
||||
dat += "<br><a style='background:[user.digestable ? pref_on : pref_off];' href='?src=\ref[src];toggledg=1'>Toggle Digestable (Currently: [user.digestable ? "ON" : "OFF"])</a>"
|
||||
dat += "<br><a style='background:[user.devourable ? pref_on : pref_off];' href='?src=\ref[src];toggledvor=1'>Toggle Devourable (Currently: [user.devourable ? "ON" : "OFF"])</a>"
|
||||
dat += "<br><a style='background:[user.feeding ? pref_on : pref_off];' href='?src=\ref[src];toggledfeed=1'>Toggle Feeding (Currently: [user.feeding ? "ON" : "OFF"])</a>"
|
||||
if(user.client.prefs_vr)
|
||||
dat += "<br><a style='background:[user.client.prefs_vr.lickable ? pref_on : pref_off];' href='?src=\ref[src];toggledlickable=1'>Toggle Licking (Currently: [user.client.prefs_vr.lickable ? "ON" : "OFF"])</a>"
|
||||
if(user.client.prefs)
|
||||
dat += "<br><a style='background:[user.client.prefs.lickable ? pref_on : pref_off];' href='?src=\ref[src];toggledlickable=1'>Toggle Licking (Currently: [user.client.prefs.lickable ? "ON" : "OFF"])</a>"
|
||||
//Returns the dat html to the vore_look
|
||||
return dat
|
||||
|
||||
@@ -659,18 +658,19 @@
|
||||
user.vore_selected = user.vore_organs[1]
|
||||
|
||||
if(href_list["saveprefs"])
|
||||
if(!user.save_vore_prefs())
|
||||
if(!(user.client?.prefs))
|
||||
return FALSE
|
||||
if(!user.client.prefs.save_character())
|
||||
to_chat(user, "<span class='warning'>Belly Preferences not saved!</span>")
|
||||
|
||||
log_admin("Could not save vore prefs on USER: [user].")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>Belly Preferences were saved!</span>")
|
||||
log_admin("Could not save vore prefs on USER: [user].")
|
||||
|
||||
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")
|
||||
var/alert = alert("Are you sure you want to reload the current slot preferences? This will remove your current vore organs and eject their contents.","Confirmation","Reload","Cancel")
|
||||
if(!alert == "Reload")
|
||||
return FALSE
|
||||
if(!user.apply_vore_prefs())
|
||||
if(!user.copy_from_prefs_vr())
|
||||
alert("ERROR: Vore preferences failed to apply!","Error")
|
||||
else
|
||||
to_chat(user,"<span class='notice'>Vore preferences applied from active slot!</span>")
|
||||
@@ -681,13 +681,15 @@
|
||||
return FALSE
|
||||
|
||||
new_flavor = readd_quotes(new_flavor)
|
||||
if(length(new_flavor) > FLAVOR_MAX)
|
||||
alert("Entered flavor/taste text too long. [FLAVOR_MAX] character limit.","Error!")
|
||||
if(length(new_flavor) > MAX_TASTE_LEN)
|
||||
alert("Entered flavor/taste text too long. [MAX_TASTE_LEN] character limit.","Error!")
|
||||
return FALSE
|
||||
user.vore_taste = new_flavor
|
||||
|
||||
if(href_list["toggledg"])
|
||||
var/choice = alert(user, "This button is for those who don't like being digested. It can make you undigestable to all mobs. Digesting you is currently: [user.digestable ? "Allowed" : "Prevented"]", "", "Allow Digestion", "Cancel", "Prevent Digestion")
|
||||
if(!user || !user.client)
|
||||
return
|
||||
switch(choice)
|
||||
if("Cancel")
|
||||
return FALSE
|
||||
@@ -696,11 +698,12 @@
|
||||
if("Prevent Digestion")
|
||||
user.digestable = FALSE
|
||||
|
||||
if(user.client.prefs_vr)
|
||||
user.client.prefs_vr.digestable = user.digestable
|
||||
user.client.prefs.digestable = user.digestable
|
||||
|
||||
if(href_list["toggledvor"])
|
||||
var/choice = alert(user, "This button is for those who don't like vore at all. Devouring you is currently: [user.devourable ? "Allowed" : "Prevented"]", "", "Allow Devourment", "Cancel", "Prevent Devourment")
|
||||
if(!user || !user.client)
|
||||
return
|
||||
switch(choice)
|
||||
if("Cancel")
|
||||
return FALSE
|
||||
@@ -709,11 +712,12 @@
|
||||
if("Prevent Devourment")
|
||||
user.devourable = FALSE
|
||||
|
||||
if(user.client.prefs_vr)
|
||||
user.client.prefs_vr.devourable = user.devourable
|
||||
user.client.prefs.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")
|
||||
if(!user || !user.client)
|
||||
return
|
||||
switch(choice)
|
||||
if("Cancel")
|
||||
return FALSE
|
||||
@@ -722,19 +726,19 @@
|
||||
if("Prevent Feeding")
|
||||
user.feeding = FALSE
|
||||
|
||||
if(user.client.prefs_vr)
|
||||
user.client.prefs_vr.feeding = user.feeding
|
||||
user.client.prefs.feeding = user.feeding
|
||||
|
||||
if(href_list["toggledlickable"])
|
||||
if(user.client.prefs_vr)
|
||||
var/choice = alert(user, "This button is to toggle your ability to be licked. Being licked is currently: [user.client.prefs_vr.lickable ? "Allowed" : "Prevented"]", "", "Allow Licking", "Cancel", "Prevent Licking")
|
||||
switch(choice)
|
||||
if("Cancel")
|
||||
return FALSE
|
||||
if("Allow Licking")
|
||||
user.client.prefs_vr.lickable = TRUE
|
||||
if("Prevent Licking")
|
||||
user.client.prefs_vr.lickable = FALSE
|
||||
var/choice = alert(user, "This button is to toggle your ability to be licked. Being licked is currently: [user.client.prefs.lickable ? "Allowed" : "Prevented"]", "", "Allow Licking", "Cancel", "Prevent Licking")
|
||||
if(!user || !user.client)
|
||||
return
|
||||
switch(choice)
|
||||
if("Cancel")
|
||||
return FALSE
|
||||
if("Allow Licking")
|
||||
user.client.prefs.lickable = TRUE
|
||||
if("Prevent Licking")
|
||||
user.client.prefs.lickable = FALSE
|
||||
|
||||
//Refresh when interacted with, returning 1 makes vore_look.Topic update
|
||||
return TRUE
|
||||
|
||||
@@ -79,8 +79,8 @@
|
||||
#include "code\__DEFINES\obj_flags.dm"
|
||||
#include "code\__DEFINES\pinpointers.dm"
|
||||
#include "code\__DEFINES\pipe_construction.dm"
|
||||
#include "code\__DEFINES\power.dm"
|
||||
#include "code\__DEFINES\pool.dm"
|
||||
#include "code\__DEFINES\power.dm"
|
||||
#include "code\__DEFINES\preferences.dm"
|
||||
#include "code\__DEFINES\procpath.dm"
|
||||
#include "code\__DEFINES\profile.dm"
|
||||
@@ -3132,7 +3132,6 @@
|
||||
#include "code\modules\vore\eating\bellymodes.dm"
|
||||
#include "code\modules\vore\eating\digest_act.dm"
|
||||
#include "code\modules\vore\eating\living.dm"
|
||||
#include "code\modules\vore\eating\vore.dm"
|
||||
#include "code\modules\vore\eating\voreitems.dm"
|
||||
#include "code\modules\vore\eating\vorepanel.dm"
|
||||
#include "code\modules\VR\vr_mob.dm"
|
||||
|
||||
Reference in New Issue
Block a user