Replaced all the extraneous flags with bitflags

This commit is contained in:
Putnam
2020-04-13 16:47:43 -07:00
parent 7cb2057bb0
commit 1e8fffbf0b
18 changed files with 146 additions and 190 deletions

View File

@@ -7,6 +7,19 @@
#define DM_ABSORB "Absorb" #define DM_ABSORB "Absorb"
#define DM_UNABSORB "Un-absorb" #define DM_UNABSORB "Un-absorb"
#define DIGESTABLE (1<<0)
#define SHOW_VORE_PREFS (1<<1)
#define DEVOURABLE (1<<2)
#define FEEDING (1<<3)
#define NO_VORE (1<<4)
#define OPEN_PANEL (1<<5)
#define ABSORBED (1<<6)
#define VORE_INIT (1<<7)
#define VOREPREF_INIT (1<<8)
#define LICKABLE (1<<9)
#define MAX_VORE_FLAG (1<<10)-1 // change this whenever you add a vore flag, must be largest vore flag*2-1
#define isbelly(A) istype(A, /obj/belly) #define isbelly(A) istype(A, /obj/belly)
#define QDEL_NULL_LIST(x) if(x) { for(var/y in x) { qdel(y) } ; x = null } #define QDEL_NULL_LIST(x) if(x) { for(var/y in x) { qdel(y) } ; x = null }

View File

@@ -324,7 +324,7 @@
cleaning_cycles-- cleaning_cycles--
cleaning = TRUE cleaning = TRUE
for(var/mob/living/carbon/C in (touchable_items)) for(var/mob/living/carbon/C in (touchable_items))
if((C.status_flags & GODMODE) || !C.digestable) if((C.status_flags & GODMODE) || !CHECK_BITFIELD(C.vore_flags, DIGESTABLE))
items_preserved += C items_preserved += C
else else
C.adjustBruteLoss(2) C.adjustBruteLoss(2)
@@ -333,7 +333,7 @@
var/atom/target = pick(touchable_items) var/atom/target = pick(touchable_items)
if(iscarbon(target)) //Handle the target being a mob if(iscarbon(target)) //Handle the target being a mob
var/mob/living/carbon/T = target var/mob/living/carbon/T = target
if(T.stat == DEAD && T.digestable) //Mob is now dead if(T.stat == DEAD && CHECK_BITFIELD(T.vore_flags, DIGESTABLE)) //Mob is now dead
message_admins("[key_name(hound)] has digested [key_name(T)] as a dogborg. ([hound ? "<a href='?_src_=holder;adminplayerobservecoodjump=1;X=[hound.x];Y=[hound.y];Z=[hound.z]'>JMP</a>" : "null"])") message_admins("[key_name(hound)] has digested [key_name(T)] as a dogborg. ([hound ? "<a href='?_src_=holder;adminplayerobservecoodjump=1;X=[hound.x];Y=[hound.y];Z=[hound.z]'>JMP</a>" : "null"])")
to_chat(hound,"<span class='notice'>You feel your belly slowly churn around [T], breaking them down into a soft slurry to be used as power for your systems.</span>") to_chat(hound,"<span class='notice'>You feel your belly slowly churn around [T], breaking them down into a soft slurry to be used as power for your systems.</span>")
to_chat(T,"<span class='notice'>You feel [hound]'s belly slowly churn around your form, breaking you down into a soft slurry to be used as power for [hound]'s systems.</span>") to_chat(T,"<span class='notice'>You feel [hound]'s belly slowly churn around your form, breaking you down into a soft slurry to be used as power for [hound]'s systems.</span>")
@@ -445,7 +445,7 @@
var/mob/living/silicon/robot/hound = get_host() var/mob/living/silicon/robot/hound = get_host()
if(!hound || !istype(target) || !proximity || target.anchored) if(!hound || !istype(target) || !proximity || target.anchored)
return return
if (!target.devourable) if (!CHECK_BITFIELD(target.vore_flags,DEVOURABLE))
to_chat(user, "The target registers an error code. Unable to insert into [src].") to_chat(user, "The target registers an error code. Unable to insert into [src].")
return return
if(patient) if(patient)
@@ -509,7 +509,7 @@
if(iscarbon(target) || issilicon(target)) if(iscarbon(target) || issilicon(target))
var/mob/living/trashman = target var/mob/living/trashman = target
if(!trashman.devourable) if(!CHECK_BITFIELD(trashman.vore_flags,DEVOURABLE))
to_chat(user, "<span class='warning'>[target] registers an error code to your [src]</span>") to_chat(user, "<span class='warning'>[target] registers an error code to your [src]</span>")
return return
if(patient) if(patient)

View File

@@ -195,10 +195,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/action_buttons_screen_locs = list() var/action_buttons_screen_locs = list()
//bad stuff //bad stuff
var/digestable = FALSE var/vore_flags = 0
var/devourable = FALSE
var/feeding = FALSE
var/lickable = FALSE
var/list/belly_prefs = list() var/list/belly_prefs = list()
var/vore_taste = "nothing in particular" var/vore_taste = "nothing in particular"

View File

@@ -120,10 +120,14 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
if(fexists(vr_path)) if(fexists(vr_path))
var/list/json_from_file = json_decode(file2text(vr_path)) var/list/json_from_file = json_decode(file2text(vr_path))
if(json_from_file) if(json_from_file)
digestable = json_from_file["digestable"] if(json_from_file["digestable"])
devourable = json_from_file["devourable"] ENABLE_BITFIELD(vore_flags,DIGESTABLE)
feeding = json_from_file["feeding"] if(json_from_file["devourable"])
lickable = json_from_file["lickable"] ENABLE_BITFIELD(vore_flags,DEVOURABLE)
if(json_from_file["feeding"])
ENABLE_BITFIELD(vore_flags,FEEDING)
if(json_from_file["lickable"])
ENABLE_BITFIELD(vore_flags,LICKABLE)
belly_prefs = json_from_file["belly_prefs"] belly_prefs = json_from_file["belly_prefs"]
vore_taste = json_from_file["vore_taste"] vore_taste = json_from_file["vore_taste"]
@@ -159,6 +163,24 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
features["cock_shape"] = malformed_hockeys[hockey] features["cock_shape"] = malformed_hockeys[hockey]
features["cock_taur"] = TRUE features["cock_taur"] = TRUE
if(current_version < 29)
var/digestable
var/devourable
var/feeding
var/lickable
S["digestable"] >> digestable
S["devourable"] >> devourable
S["feeding"] >> feeding
S["lickable"] >> lickable
if(digestable)
ENABLE_BITFIELD(vore_flags,DIGESTABLE)
if(devourable)
ENABLE_BITFIELD(vore_flags,DEVOURABLE)
if(feeding)
ENABLE_BITFIELD(vore_flags,FEEDING)
if(lickable)
ENABLE_BITFIELD(vore_flags,LICKABLE)
/datum/preferences/proc/load_path(ckey,filename="preferences.sav") /datum/preferences/proc/load_path(ckey,filename="preferences.sav")
if(!ckey) if(!ckey)
return return
@@ -497,11 +519,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
else //We have no old flavortext, default to new else //We have no old flavortext, default to new
S["feature_flavor_text"] >> features["flavor_text"] S["feature_flavor_text"] >> features["flavor_text"]
S["digestable"] >> digestable S["vore_flags"] >> vore_flags
S["devourable"] >> devourable
S["feeding"] >> feeding
S["vore_taste"] >> vore_taste S["vore_taste"] >> vore_taste
S["lickable"] >> lickable
S["belly_prefs"] >> belly_prefs S["belly_prefs"] >> belly_prefs
//try to fix any outdated data if necessary //try to fix any outdated data if necessary
@@ -609,10 +628,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
all_quirks = SANITIZE_LIST(all_quirks) all_quirks = SANITIZE_LIST(all_quirks)
lickable = sanitize_integer(lickable, FALSE, TRUE, initial(lickable)) vore_flags = sanitize_integer(vore_flags, 0, MAX_VORE_FLAG, 0)
devourable = sanitize_integer(devourable, FALSE, TRUE, initial(devourable))
digestable = sanitize_integer(digestable, FALSE, TRUE, initial(digestable))
feeding = sanitize_integer(feeding, FALSE, TRUE, initial(feeding))
vore_taste = copytext(vore_taste, 1, MAX_TASTE_LEN) vore_taste = copytext(vore_taste, 1, MAX_TASTE_LEN)
belly_prefs = SANITIZE_LIST(belly_prefs) belly_prefs = SANITIZE_LIST(belly_prefs)
@@ -720,11 +736,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
//Quirks //Quirks
WRITE_FILE(S["all_quirks"] , all_quirks) WRITE_FILE(S["all_quirks"] , all_quirks)
WRITE_FILE(S["digestable"] , digestable) WRITE_FILE(S["vore_flags"] , vore_flags)
WRITE_FILE(S["devourable"] , devourable)
WRITE_FILE(S["feeding"] , feeding)
WRITE_FILE(S["vore_taste"] , vore_taste) WRITE_FILE(S["vore_taste"] , vore_taste)
WRITE_FILE(S["lickable"] , lickable)
WRITE_FILE(S["belly_prefs"] , belly_prefs) WRITE_FILE(S["belly_prefs"] , belly_prefs)
cit_character_pref_save(S) cit_character_pref_save(S)

View File

@@ -81,9 +81,7 @@
ENABLE_BITFIELD(mob.flags_1, HOLOGRAM_1) ENABLE_BITFIELD(mob.flags_1, HOLOGRAM_1)
if(isliving(mob)) if(isliving(mob))
var/mob/living/L = mob var/mob/living/L = mob
L.feeding = FALSE L.vore_flags = 0
L.devourable = FALSE
L.digestable = FALSE
return mob return mob
/obj/effect/holodeck_effect/mobspawner/deactivate(var/obj/machinery/computer/holodeck/HC) /obj/effect/holodeck_effect/mobspawner/deactivate(var/obj/machinery/computer/holodeck/HC)

View File

@@ -4,7 +4,6 @@
status_flags = GODMODE|CANPUSH status_flags = GODMODE|CANPUSH
mouse_drag_pointer = MOUSE_INACTIVE_POINTER mouse_drag_pointer = MOUSE_INACTIVE_POINTER
var/in_use = FALSE var/in_use = FALSE
no_vore = TRUE
INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy) INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy)

View File

@@ -74,9 +74,7 @@
//misc //misc
/mob/living/carbon/human/dummy /mob/living/carbon/human/dummy
no_vore = TRUE vore_flags = NO_VORE
/mob/living/carbon/human/vore /mob/living/carbon/human/vore
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE | FEEDING
digestable = TRUE
feeding = TRUE

View File

@@ -23,5 +23,5 @@
if(ranged_ability) if(ranged_ability)
ranged_ability.add_ranged_ability(src, "<span class='notice'>You currently have <b>[ranged_ability]</b> active!</span>") 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. if((vore_flags & VORE_INIT) && !(vore_flags & 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.
copy_from_prefs_vr() copy_from_prefs_vr()

View File

@@ -14,7 +14,7 @@
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
speech_span = SPAN_ROBOT speech_span = SPAN_ROBOT
flags_1 = PREVENT_CONTENTS_EXPLOSION_1 | HEAR_1 flags_1 = PREVENT_CONTENTS_EXPLOSION_1 | HEAR_1
no_vore = TRUE vore_flags = NO_VORE
/// Enable sprint system but not stamina /// Enable sprint system but not stamina
combat_flags = COMBAT_FLAGS_STAMEXEMPT_YESSPRINT combat_flags = COMBAT_FLAGS_STAMEXEMPT_YESSPRINT

View File

@@ -347,10 +347,11 @@
/mob/living/simple_animal/hostile/proc/AttackingTarget() /mob/living/simple_animal/hostile/proc/AttackingTarget()
SEND_SIGNAL(src, COMSIG_HOSTILE_ATTACKINGTARGET, target) SEND_SIGNAL(src, COMSIG_HOSTILE_ATTACKINGTARGET, target)
in_melee = TRUE in_melee = TRUE
/* sorry for the simplemob vore fans
if(vore_active) if(vore_active)
if(isliving(target)) if(isliving(target))
var/mob/living/L = target var/mob/living/L = target
if(!client && L.Adjacent(src) && L.devourable) // aggressive check to ensure vore attacks can be made if(!client && L.Adjacent(src) && CHECK_BITFIELD(L.vore_flags,DEVOURABLE)) // aggressive check to ensure vore attacks can be made
if(prob(voracious_chance)) if(prob(voracious_chance))
vore_attack(src,L,src) vore_attack(src,L,src)
else else
@@ -361,6 +362,8 @@
return target.attack_animal(src) return target.attack_animal(src)
else else
return target.attack_animal(src) return target.attack_animal(src)
*/
return target.attack_animal(src)
/mob/living/simple_animal/hostile/proc/Aggro() /mob/living/simple_animal/hostile/proc/Aggro()
vision_range = aggro_vision_range vision_range = aggro_vision_range

View File

@@ -1,6 +1,5 @@
/mob/living/simple_animal/hostile/megafauna/dragon /mob/living/simple_animal/hostile/megafauna/dragon
vore_active = TRUE vore_active = TRUE
no_vore = FALSE
isPredator = TRUE isPredator = TRUE
/mob/living/simple_animal/hostile/megafauna/dragon/Initialize() /mob/living/simple_animal/hostile/megafauna/dragon/Initialize()

View File

@@ -87,7 +87,7 @@
if(!client && ranged && ranged_cooldown <= world.time) if(!client && ranged && ranged_cooldown <= world.time)
OpenFire() OpenFire()
if(L.Adjacent(src) && (L.stat != CONSCIOUS)) if(L.Adjacent(src) && (L.stat != CONSCIOUS))
if(vore_active && L.devourable == TRUE) if(vore_active && CHECK_BITFIELD(L.vore_flags,DEVOURABLE))
vore_attack(src,L,src) vore_attack(src,L,src)
LoseTarget() LoseTarget()
else else

View File

@@ -49,10 +49,10 @@
// Simple animals have only one belly. This creates it (if it isn't already set up) // Simple animals have only one belly. This creates it (if it isn't already set up)
/mob/living/simple_animal/init_vore() /mob/living/simple_animal/init_vore()
vore_init = TRUE ENABLE_BITFIELD(vore_flags, VORE_INIT)
if(CHECK_BITFIELD(flags_1, HOLOGRAM_1)) if(CHECK_BITFIELD(flags_1, HOLOGRAM_1))
return return
if(!vore_active || no_vore) //If it can't vore, let's not give it a stomach. if(!vore_active || CHECK_BITFIELD(vore_flags, NO_VORE)) //If it can't vore, let's not give it a stomach.
return return
if(vore_active && !IsAdvancedToolUser()) //vore active, but doesn't have thumbs to grab people with. if(vore_active && !IsAdvancedToolUser()) //vore active, but doesn't have thumbs to grab people with.
verbs |= /mob/living/simple_animal/proc/animal_nom verbs |= /mob/living/simple_animal/proc/animal_nom
@@ -134,6 +134,6 @@
if (stat != CONSCIOUS) if (stat != CONSCIOUS)
return return
if(!T.devourable) if(!CHECK_BITFIELD(T.vore_flags,DEVOURABLE))
return return
return vore_attack(src,T,src) return vore_attack(src,T,src)

View File

@@ -1,13 +1,9 @@
//CARBON MOBS //CARBON MOBS
/mob/living/carbon/alien /mob/living/carbon/alien
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE | FEEDING
digestable = TRUE
feeding = TRUE
/mob/living/carbon/monkey /mob/living/carbon/monkey
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE | FEEDING
digestable = TRUE
feeding = TRUE
/* /*
@@ -17,121 +13,65 @@
//NUETRAL MOBS //NUETRAL MOBS
/mob/living/simple_animal/crab /mob/living/simple_animal/crab
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE | FEEDING
digestable = TRUE
feeding = TRUE
/mob/living/simple_animal/cow /mob/living/simple_animal/cow
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE | FEEDING
digestable = TRUE
feeding = TRUE
vore_active = TRUE
isPredator = TRUE
vore_default_mode = DM_HOLD
/mob/living/simple_animal/chick /mob/living/simple_animal/chick
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE
digestable = TRUE
/mob/living/simple_animal/chicken /mob/living/simple_animal/chicken
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE
digestable = TRUE
/mob/living/simple_animal/mouse /mob/living/simple_animal/mouse
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE
digestable = TRUE
/mob/living/simple_animal/kiwi /mob/living/simple_animal/kiwi
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE
digestable = TRUE
//STATION PETS //STATION PETS
/mob/living/simple_animal/pet /mob/living/simple_animal/pet
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE | FEEDING
digestable = TRUE
feeding = TRUE
/mob/living/simple_animal/pet/fox
vore_active = TRUE
isPredator = TRUE
vore_default_mode = DM_HOLD
/mob/living/simple_animal/pet/cat
vore_active = TRUE
isPredator = TRUE
vore_default_mode = DM_HOLD
/mob/living/simple_animal/pet/dog
vore_active = TRUE
isPredator = TRUE
vore_default_mode = DM_HOLD
/mob/living/simple_animal/sloth /mob/living/simple_animal/sloth
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE
digestable = TRUE
/mob/living/simple_animal/parrot /mob/living/simple_animal/parrot
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE
digestable = TRUE
//HOSTILE MOBS //HOSTILE MOBS
/mob/living/simple_animal/hostile/retaliate/goat /mob/living/simple_animal/hostile/retaliate/goat
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE | FEEDING
digestable = TRUE
feeding = TRUE
vore_active = TRUE
isPredator = TRUE
vore_stomach_flavor = "You find yourself squeezed into the hollow of the goat, the smell of oats and hay thick in the tight space, all of which grinds in on you. Harmless for now..."
vore_default_mode = DM_HOLD
/mob/living/simple_animal/hostile/lizard /mob/living/simple_animal/hostile/lizard
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE | FEEDING
digestable = TRUE
feeding = TRUE
vore_active = TRUE
isPredator = TRUE
vore_default_mode = DM_DIGEST
/mob/living/simple_animal/hostile/alien /mob/living/simple_animal/hostile/alien
feeding = TRUE vore_flags = FEEDING
vore_active = TRUE
isPredator = TRUE
vore_default_mode = DM_DIGEST vore_default_mode = DM_DIGEST
/mob/living/simple_animal/hostile/bear /mob/living/simple_animal/hostile/bear
feeding = TRUE vore_flags = FEEDING
vore_active = TRUE
isPredator = TRUE
vore_default_mode = DM_DIGEST vore_default_mode = DM_DIGEST
/mob/living/simple_animal/hostile/poison/giant_spider /mob/living/simple_animal/hostile/poison/giant_spider
feeding = TRUE vore_flags = FEEDING
vore_active = TRUE
isPredator = TRUE
vore_default_mode = DM_DIGEST vore_default_mode = DM_DIGEST
/mob/living/simple_animal/hostile/retaliate/poison/snake /mob/living/simple_animal/hostile/retaliate/poison/snake
feeding = TRUE vore_flags = FEEDING
vore_active = TRUE
isPredator = TRUE
vore_default_mode = DM_DIGEST vore_default_mode = DM_DIGEST
/mob/living/simple_animal/hostile/gorilla /mob/living/simple_animal/hostile/gorilla
feeding = TRUE vore_flags = FEEDING
vore_active = TRUE
isPredator = TRUE
vore_default_mode = DM_DIGEST vore_default_mode = DM_DIGEST
/mob/living/simple_animal/hostile/asteroid/goliath /mob/living/simple_animal/hostile/asteroid/goliath
feeding = TRUE //for pet Goliaths I guess or something. vore_flags = FEEDING
vore_active = TRUE
isPredator = TRUE
vore_default_mode = DM_DIGEST vore_default_mode = DM_DIGEST
/mob/living/simple_animal/hostile/carp /mob/living/simple_animal/hostile/carp
devourable = TRUE vore_flags = DEVOURABLE | DIGESTABLE | FEEDING
digestable = TRUE
feeding = TRUE
vore_active = TRUE
isPredator = TRUE
vore_default_mode = DM_DIGEST vore_default_mode = DM_DIGEST

View File

@@ -221,9 +221,9 @@
if(isliving(AM)) if(isliving(AM))
var/mob/living/L = AM var/mob/living/L = AM
var/mob/living/OW = owner var/mob/living/OW = owner
if(L.absorbed && !include_absorbed) if(L.vore_flags & ABSORBED && !include_absorbed)
continue continue
L.absorbed = FALSE L.vore_flags &= ~ABSORBED
L.stop_sound_channel(CHANNEL_PREYLOOP) L.stop_sound_channel(CHANNEL_PREYLOOP)
SEND_SIGNAL(OW, COMSIG_CLEAR_MOOD_EVENT, "fedpred", /datum/mood_event/fedpred) SEND_SIGNAL(OW, COMSIG_CLEAR_MOOD_EVENT, "fedpred", /datum/mood_event/fedpred)
SEND_SIGNAL(L, COMSIG_CLEAR_MOOD_EVENT, "fedprey", /datum/mood_event/fedprey) SEND_SIGNAL(L, COMSIG_CLEAR_MOOD_EVENT, "fedprey", /datum/mood_event/fedprey)
@@ -277,14 +277,14 @@
SEND_SIGNAL(OW, COMSIG_ADD_MOOD_EVENT, "emptypred", /datum/mood_event/emptypred) SEND_SIGNAL(OW, COMSIG_ADD_MOOD_EVENT, "emptypred", /datum/mood_event/emptypred)
SEND_SIGNAL(ML, COMSIG_ADD_MOOD_EVENT, "emptyprey", /datum/mood_event/emptyprey) SEND_SIGNAL(ML, COMSIG_ADD_MOOD_EVENT, "emptyprey", /datum/mood_event/emptyprey)
if(ML.absorbed) if(CHECK_BITFIELD(ML.vore_flags,ABSORBED))
ML.absorbed = FALSE DISABLE_BITFIELD(ML.vore_flags,ABSORBED)
if(ishuman(M) && ishuman(OW)) if(ishuman(M) && ishuman(OW))
var/mob/living/carbon/human/Prey = M var/mob/living/carbon/human/Prey = M
var/mob/living/carbon/human/Pred = OW var/mob/living/carbon/human/Pred = OW
var/absorbed_count = 2 //Prey that we were, plus the pred gets a portion var/absorbed_count = 2 //Prey that we were, plus the pred gets a portion
for(var/mob/living/P in contents) for(var/mob/living/P in contents)
if(P.absorbed) if(CHECK_BITFIELD(P.vore_flags,ABSORBED))
absorbed_count++ absorbed_count++
Pred.reagents.trans_to(Prey, Pred.reagents.total_volume / absorbed_count) Pred.reagents.trans_to(Prey, Pred.reagents.total_volume / absorbed_count)
@@ -389,7 +389,7 @@
formatted_message = replacetext(formatted_message,"%pred",owner) formatted_message = replacetext(formatted_message,"%pred",owner)
formatted_message = replacetext(formatted_message,"%prey",english_list(contents)) formatted_message = replacetext(formatted_message,"%prey",english_list(contents))
for(var/mob/living/P in contents) for(var/mob/living/P in contents)
if(!P.absorbed) //This is required first, in case there's a person absorbed and not absorbed in a stomach. if(!CHECK_BITFIELD(P.vore_flags, ABSORBED)) //This is required first, in case there's a person absorbed and not absorbed in a stomach.
total_bulge += P.mob_size total_bulge += P.mob_size
if(total_bulge >= bulge_size && bulge_size != 0) if(total_bulge >= bulge_size && bulge_size != 0)
return("<span class='warning'>[formatted_message]</span><BR>") return("<span class='warning'>[formatted_message]</span><BR>")
@@ -484,7 +484,7 @@
// Handle a mob being absorbed // Handle a mob being absorbed
/obj/belly/proc/absorb_living(var/mob/living/M) /obj/belly/proc/absorb_living(var/mob/living/M)
M.absorbed = TRUE ENABLE_BITFIELD(M.vore_flags, ABSORBED)
to_chat(M,"<span class='notice'>[owner]'s [lowertext(name)] absorbs your body, making you part of them.</span>") to_chat(M,"<span class='notice'>[owner]'s [lowertext(name)] absorbs your body, making you part of them.</span>")
to_chat(owner,"<span class='notice'>Your [lowertext(name)] absorbs [M]'s body, making them part of you.</span>") to_chat(owner,"<span class='notice'>Your [lowertext(name)] absorbs [M]'s body, making them part of you.</span>")
@@ -498,7 +498,7 @@
for(var/belly in M.vore_organs) for(var/belly in M.vore_organs)
var/obj/belly/B = belly var/obj/belly/B = belly
for(var/mob/living/Mm in B) for(var/mob/living/Mm in B)
if(Mm.absorbed) if(CHECK_BITFIELD(Mm.vore_flags, ABSORBED))
absorb_living(Mm) absorb_living(Mm)
//Update owner //Update owner

View File

@@ -27,7 +27,7 @@
var/list/EL = emote_lists[digest_mode] var/list/EL = emote_lists[digest_mode]
if(LAZYLEN(EL)) if(LAZYLEN(EL))
for(var/mob/living/M in contents) for(var/mob/living/M in contents)
if(M.digestable || !(digest_mode == DM_DIGEST)) // don't give digesty messages to indigestible people if((M.vore_flags & DIGESTABLE) || !(digest_mode == DM_DIGEST)) // don't give digesty messages to indigestible people
to_chat(M,"<span class='notice'>[pick(EL)]</span>") to_chat(M,"<span class='notice'>[pick(EL)]</span>")
///////////////////// Prey Loop Refresh/hack ////////////////////// ///////////////////// Prey Loop Refresh/hack //////////////////////
@@ -51,7 +51,7 @@
//////////////////////// Absorbed Handling //////////////////////// //////////////////////// Absorbed Handling ////////////////////////
for(var/mob/living/M in contents) for(var/mob/living/M in contents)
if(M.absorbed) if(M.vore_flags & ABSORBED)
M.Stun(5) M.Stun(5)
////////////////////////// Sound vars ///////////////////////////// ////////////////////////// Sound vars /////////////////////////////
@@ -76,7 +76,7 @@
play_sound = pick(pred_digest) play_sound = pick(pred_digest)
//Pref protection! //Pref protection!
if (!M.digestable || M.absorbed) if (!M.vore_flags & DIGESTABLE || M.vore_flags & ABSORBED)
continue continue
//Person just died in guts! //Person just died in guts!
@@ -150,7 +150,7 @@
SEND_SOUND(M,prey_digest) SEND_SOUND(M,prey_digest)
play_sound = pick(pred_digest) play_sound = pick(pred_digest)
if(M.absorbed) if(M.vore_flags & ABSORBED)
continue continue
if(M.nutrition >= 100) //Drain them until there's no nutrients left. Slowly "absorb" them. if(M.nutrition >= 100) //Drain them until there's no nutrients left. Slowly "absorb" them.
@@ -164,8 +164,8 @@
if(DM_UNABSORB) if(DM_UNABSORB)
for (var/mob/living/M in contents) for (var/mob/living/M in contents)
if(M.absorbed && owner.nutrition >= 100) if(M.vore_flags & ABSORBED && owner.nutrition >= 100)
M.absorbed = FALSE DISABLE_BITFIELD(M.vore_flags, ABSORBED)
to_chat(M,"<span class='notice'>You suddenly feel solid again </span>") to_chat(M,"<span class='notice'>You suddenly feel solid again </span>")
to_chat(owner,"<span class='notice'>You feel like a part of you is missing.</span>") to_chat(owner,"<span class='notice'>You feel like a part of you is missing.</span>")
owner.nutrition -= 100 owner.nutrition -= 100

View File

@@ -1,18 +1,11 @@
///////////////////// Mob Living ///////////////////// ///////////////////// Mob Living /////////////////////
/mob/living /mob/living
var/digestable = FALSE // Can the mob be digested inside a belly? var/vore_flags = 0
var/showvoreprefs = TRUE // Determines if the mechanical vore preferences button will be displayed on the mob or not. var/showvoreprefs = TRUE // 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/obj/belly/vore_selected // Default to no vore capability.
var/list/vore_organs = list() // List of vore containers inside a mob 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/vore_taste = null // What the character tastes like var/vore_taste = null // What the character tastes like
var/no_vore = FALSE // If the character/mob can vore.
var/openpanel = FALSE // Is the vore panel open?
var/absorbed = FALSE //are we absorbed?
var/next_preyloop var/next_preyloop
var/vore_init = FALSE //Has this mob's vore been initialized yet?
var/vorepref_init = FALSE //Has this mob's voreprefs been initialized?
// //
// Hook for generic creation of stuff on new creatures // Hook for generic creation of stuff on new creatures
@@ -22,7 +15,7 @@
M.verbs += /mob/living/proc/lick M.verbs += /mob/living/proc/lick
M.verbs += /mob/living/proc/escapeOOC M.verbs += /mob/living/proc/escapeOOC
if(M.no_vore) //If the mob isn't supposed to have a stomach, let's not give it an insidepanel so it can make one for itself, or a stomach. if(M.vore_flags & NO_VORE) //If the mob isn't supposed to have a stomach, let's not give it an insidepanel so it can make one for itself, or a stomach.
return TRUE return TRUE
M.verbs += /mob/living/proc/insidePanel M.verbs += /mob/living/proc/insidePanel
@@ -35,7 +28,7 @@
return TRUE return TRUE
/mob/living/proc/init_vore() /mob/living/proc/init_vore()
vore_init = TRUE ENABLE_BITFIELD(vore_flags, VORE_INIT)
//Something else made organs, meanwhile. //Something else made organs, meanwhile.
if(LAZYLEN(vore_organs)) if(LAZYLEN(vore_organs))
return TRUE return TRUE
@@ -75,7 +68,7 @@
return return
if(pred == prey) //you click your target if(pred == prey) //you click your target
if(!pred.feeding) if(!CHECK_BITFIELD(pred.vore_flags,FEEDING))
to_chat(user, "<span class='notice'>They aren't able to be fed.</span>") to_chat(user, "<span class='notice'>They aren't able to be fed.</span>")
to_chat(pred, "<span class='notice'>[user] tried to feed you themselves, but you aren't voracious enough to be fed.</span>") to_chat(pred, "<span class='notice'>[user] tried to feed you themselves, but you aren't voracious enough to be fed.</span>")
return return
@@ -91,11 +84,11 @@
feed_grabbed_to_self(user, prey) feed_grabbed_to_self(user, prey)
else // click someone other than you/prey else // click someone other than you/prey
if(!pred.feeding) if(!CHECK_BITFIELD(pred.vore_flags,FEEDING))
to_chat(user, "<span class='notice'>They aren't voracious enough to be fed.</span>") to_chat(user, "<span class='notice'>They aren't voracious enough to be fed.</span>")
to_chat(pred, "<span class='notice'>[user] tried to feed you [prey], but you aren't voracious enough to be fed.</span>") to_chat(pred, "<span class='notice'>[user] tried to feed you [prey], but you aren't voracious enough to be fed.</span>")
return return
if(!prey.feeding) if(!CHECK_BITFIELD(prey.vore_flags,FEEDING))
to_chat(user, "<span class='notice'>They aren't able to be fed to someone.</span>") 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 [pred], but you aren't able to be fed to them.</span>") to_chat(prey, "<span class='notice'>[user] tried to feed you to [pred], but you aren't able to be fed to them.</span>")
return return
@@ -128,7 +121,7 @@
testing("[user] attempted to feed [prey] to [pred], via [lowertext(belly.name)] but it went wrong.") testing("[user] attempted to feed [prey] to [pred], via [lowertext(belly.name)] but it went wrong.")
return return
if (!prey.devourable) if (!prey.vore_flags & DEVOURABLE)
to_chat(user, "This can't be eaten!") to_chat(user, "This can't be eaten!")
return FALSE return FALSE
@@ -267,9 +260,7 @@
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>") 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 return FALSE
client.prefs.digestable = digestable client.prefs.vore_flags = vore_flags // there's garbage data in here, but it doesn't matter
client.prefs.devourable = devourable
client.prefs.feeding = feeding
client.prefs.vore_taste = vore_taste client.prefs.vore_taste = vore_taste
var/list/serialized = list() var/list/serialized = list()
@@ -288,12 +279,17 @@
if(!client || !client.prefs) 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>") 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 return FALSE
vorepref_init = TRUE ENABLE_BITFIELD(vore_flags,VOREPREF_INIT)
// garbage data coming back the other way or breaking absorbed would be bad, so instead we do this
vore_flags |= CHECK_BITFIELD(client.prefs.vore_flags,DIGESTABLE) // set to 1 if prefs is 1
vore_flags |= CHECK_BITFIELD(client.prefs.vore_flags,DEVOURABLE)
vore_flags |= CHECK_BITFIELD(client.prefs.vore_flags,FEEDING)
vore_flags &= CHECK_BITFIELD(client.prefs.vore_flags,DIGESTABLE) // set to 0 if prefs is 0
vore_flags &= CHECK_BITFIELD(client.prefs.vore_flags,DEVOURABLE)
vore_flags &= CHECK_BITFIELD(client.prefs.vore_flags,FEEDING)
digestable = client.prefs.digestable
devourable = client.prefs.devourable
feeding = client.prefs.feeding
vore_taste = client.prefs.vore_taste vore_taste = client.prefs.vore_taste
release_vore_contents(silent = TRUE) release_vore_contents(silent = TRUE)
@@ -361,7 +357,7 @@
var/list/choices var/list/choices
for(var/mob/living/L in view(1)) for(var/mob/living/L in view(1))
if(L != src && (!L.ckey || L.client?.prefs.lickable) && Adjacent(L)) if(L != src && (!L.ckey || L.client?.prefs.vore_flags & LICKABLE) && Adjacent(L))
LAZYADD(choices, L) LAZYADD(choices, L)
if(!choices) if(!choices)
@@ -369,7 +365,7 @@
var/mob/living/tasted = input(src, "Who would you like to lick? (Excluding yourself and those with the preference disabled)", "Licking") as null|anything in choices var/mob/living/tasted = input(src, "Who would you like to lick? (Excluding yourself and those with the preference disabled)", "Licking") as null|anything in choices
if(QDELETED(tasted) || (tasted.ckey && !(tasted.client?.prefs.lickable)) || !Adjacent(tasted) || incapacitated(ignore_restraints = TRUE)) if(QDELETED(tasted) || (tasted.ckey && !(tasted.client?.prefs.vore_flags & LICKABLE)) || !Adjacent(tasted) || incapacitated(ignore_restraints = TRUE))
return return
setClickCooldown(100) setClickCooldown(100)

View File

@@ -20,10 +20,10 @@
picker_holder.popup = new(src, "insidePanel","Vore Panel", 450, 700, picker_holder) picker_holder.popup = new(src, "insidePanel","Vore Panel", 450, 700, picker_holder)
picker_holder.popup.set_content(dat) picker_holder.popup.set_content(dat)
picker_holder.popup.open() picker_holder.popup.open()
src.openpanel = TRUE vore_flags |= OPEN_PANEL
/mob/living/proc/updateVRPanel() //Panel popup update call from belly events. /mob/living/proc/updateVRPanel() //Panel popup update call from belly events.
if(src.openpanel == TRUE) if(vore_flags & OPEN_PANEL)
var/datum/vore_look/picker_holder = new() var/datum/vore_look/picker_holder = new()
picker_holder.loop = picker_holder picker_holder.loop = picker_holder
picker_holder.selected = vore_selected picker_holder.selected = vore_selected
@@ -65,7 +65,7 @@
//Don't display this part if we couldn't find the belly since could be held in hand. //Don't display this part if we couldn't find the belly since could be held in hand.
if(inside_belly) if(inside_belly)
dat += "<font color = 'green'>You are currently [user.absorbed ? "absorbed into " : "inside "]</font> <font color = 'yellow'>[eater]'s</font> <font color = 'red'>[inside_belly]</font>!<br><br>" dat += "<font color = 'green'>You are currently [(user.vore_flags & ABSORBED) ? "absorbed into " : "inside "]</font> <font color = 'yellow'>[eater]'s</font> <font color = 'red'>[inside_belly]</font>!<br><br>"
if(inside_belly.desc) if(inside_belly.desc)
dat += "[inside_belly.desc]<br><br>" dat += "[inside_belly.desc]<br><br>"
@@ -80,8 +80,8 @@
continue continue
//That's an absorbed person you're checking //That's an absorbed person you're checking
if(M.absorbed) if(M.vore_flags & ABSORBED)
if(user.absorbed) if(user.vore_flags & ABSORBED)
dat += "<a href='?src=\ref[src];outsidepick=\ref[O];outsidebelly=\ref[inside_belly]'><span style='color:purple;'>[O]</span></a>" dat += "<a href='?src=\ref[src];outsidepick=\ref[O];outsidebelly=\ref[inside_belly]'><span style='color:purple;'>[O]</span></a>"
continue continue
else else
@@ -139,7 +139,7 @@
var/mob/living/M = O var/mob/living/M = O
//Absorbed gets special color OOoOOOOoooo //Absorbed gets special color OOoOOOOoooo
if(M.absorbed) if(M.vore_flags & ABSORBED)
dat += "<a href='?src=\ref[src];insidepick=\ref[O]'><span style='color:purple;'>[O]</span></a>" dat += "<a href='?src=\ref[src];insidepick=\ref[O]'><span style='color:purple;'>[O]</span></a>"
continue continue
@@ -243,11 +243,11 @@
dat += "<HR>" dat += "<HR>"
var/pref_on = "#173d15" var/pref_on = "#173d15"
var/pref_off = "#990000" var/pref_off = "#990000"
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.vore_flags & DIGESTABLE) ? pref_on : pref_off];' href='?src=\ref[src];toggledg=1'>Toggle Digestable (Currently: [(user.vore_flags & 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.vore_flags & DEVOURABLE) ? pref_on : pref_off];' href='?src=\ref[src];toggledvor=1'>Toggle Devourable (Currently: [(user.vore_flags & 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>" dat += "<br><a style='background:[(user.vore_flags & FEEDING) ? pref_on : pref_off];' href='?src=\ref[src];toggledfeed=1'>Toggle Feeding (Currently: [(user.vore_flags & FEEDING) ? "ON" : "OFF"])</a>"
if(user.client.prefs) 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>" dat += "<br><a style='background:[(user.client.prefs.vore_flags & LICKABLE) ? pref_on : pref_off];' href='?src=\ref[src];toggledlickable=1'>Toggle Licking (Currently: [(user.client.prefs.vore_flags & LICKABLE) ? "ON" : "OFF"])</a>"
//Returns the dat html to the vore_look //Returns the dat html to the vore_look
return dat return dat
@@ -257,7 +257,7 @@
if(href_list["close"]) if(href_list["close"])
qdel(src) // Cleanup qdel(src) // Cleanup
user.openpanel = FALSE user.vore_flags &= ~OPEN_PANEL
return return
if(href_list["show_int"]) if(href_list["show_int"])
@@ -287,7 +287,7 @@
M.examine(user) M.examine(user)
if("Help Out") //Help the inside-mob out if("Help Out") //Help the inside-mob out
if(user.stat || user.absorbed || M.absorbed) if(user.stat || user.vore_flags & ABSORBED || M.vore_flags & ABSORBED)
to_chat(user,"<span class='warning'>You can't do that in your state!</span>") to_chat(user,"<span class='warning'>You can't do that in your state!</span>")
return TRUE return TRUE
@@ -306,7 +306,7 @@
to_chat(OB.owner,"<font color='green'>Your body efficiently shoves [M] back where they belong.</font>") to_chat(OB.owner,"<font color='green'>Your body efficiently shoves [M] back where they belong.</font>")
if("Devour") //Eat the inside mob if("Devour") //Eat the inside mob
if(user.absorbed || user.stat) if(user.vore_flags & ABSORBED || user.stat)
to_chat(user,"<span class='warning'>You can't do that in your state!</span>") to_chat(user,"<span class='warning'>You can't do that in your state!</span>")
return TRUE return TRUE
@@ -687,58 +687,58 @@
user.vore_taste = new_flavor user.vore_taste = new_flavor
if(href_list["toggledg"]) 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") 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.vore_flags & DIGESTABLE) ? "Allowed" : "Prevented"]", "", "Allow Digestion", "Cancel", "Prevent Digestion")
if(!user || !user.client) if(!user || !user.client)
return return
switch(choice) switch(choice)
if("Cancel") if("Cancel")
return FALSE return FALSE
if("Allow Digestion") if("Allow Digestion")
user.digestable = TRUE user.vore_flags |= DIGESTABLE
user.client.prefs.vore_flags |= DIGESTABLE
if("Prevent Digestion") if("Prevent Digestion")
user.digestable = FALSE user.vore_flags &= ~DIGESTABLE
user.client.prefs.vore_flags &= ~DIGESTABLE
user.client.prefs.digestable = user.digestable
if(href_list["toggledvor"]) 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") var/choice = alert(user, "This button is for those who don't like vore at all. Devouring you is currently: [(user.vore_flags & DEVOURABLE) ? "Allowed" : "Prevented"]", "", "Allow Devourment", "Cancel", "Prevent Devourment")
if(!user || !user.client) if(!user || !user.client)
return return
switch(choice) switch(choice)
if("Cancel") if("Cancel")
return FALSE return FALSE
if("Allow Devourment") if("Allow Devourment")
user.devourable = TRUE user.vore_flags |= DEVOURABLE
user.client.prefs.vore_flags |= DEVOURABLE
if("Prevent Devourment") if("Prevent Devourment")
user.devourable = FALSE user.vore_flags &= ~DEVOURABLE
user.client.prefs.vore_flags &= ~DEVOURABLE
user.client.prefs.devourable = user.devourable
if(href_list["toggledfeed"]) 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") var/choice = alert(user, "This button is to toggle your ability to be fed to others. Feeding predators is currently: [(user.vore_flags & FEEDING) ? "Allowed" : "Prevented"]", "", "Allow Feeding", "Cancel", "Prevent Feeding")
if(!user || !user.client) if(!user || !user.client)
return return
switch(choice) switch(choice)
if("Cancel") if("Cancel")
return FALSE return FALSE
if("Allow Feeding") if("Allow Feeding")
user.feeding = TRUE user.vore_flags |= FEEDING
user.client.prefs.vore_flags |= FEEDING
if("Prevent Feeding") if("Prevent Feeding")
user.feeding = FALSE user.vore_flags &= ~FEEDING
user.client.prefs.vore_flags &= ~FEEDING
user.client.prefs.feeding = user.feeding
if(href_list["toggledlickable"]) if(href_list["toggledlickable"])
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") var/choice = alert(user, "This button is to toggle your ability to be licked. Being licked is currently: [(user.client.prefs.vore_flags & LICKABLE) ? "Allowed" : "Prevented"]", "", "Allow Licking", "Cancel", "Prevent Licking")
if(!user || !user.client) if(!user || !user.client)
return return
switch(choice) switch(choice)
if("Cancel") if("Cancel")
return FALSE return FALSE
if("Allow Licking") if("Allow Licking")
user.client.prefs.lickable = TRUE user.client.prefs.vore_flags |= LICKABLE
if("Prevent Licking") if("Prevent Licking")
user.client.prefs.lickable = FALSE user.client.prefs.vore_flags &= ~LICKABLE
//Refresh when interacted with, returning 1 makes vore_look.Topic update //Refresh when interacted with, returning 1 makes vore_look.Topic update
return TRUE return TRUE