mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-24 21:57:53 +01:00
Merge pull request #4631 from CHOMPStation2/upstream-merge-13406
[MIRROR] Selective bellymode now selectable and pref-adjustible
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// Normal digestion modes
|
||||
#define DM_DEFAULT "Default" // Not a real bellymode, used for handling on 'selective' bellymode prefs.
|
||||
#define DM_HOLD "Hold"
|
||||
#define DM_HOLD_ABSORBED "Hold Absorbed" // Not a real bellymode, used for handling different idle messages for absorbed prey.
|
||||
#define DM_DIGEST "Digest"
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
allowmobvore = client.prefs_vr.allowmobvore
|
||||
permit_healbelly = client.prefs_vr.permit_healbelly
|
||||
noisy = client.prefs_vr.noisy
|
||||
selective_preference = client.prefs_vr.selective_preference
|
||||
|
||||
drop_vore = client.prefs_vr.drop_vore
|
||||
stumble_vore = client.prefs_vr.stumble_vore
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
var/emote_time = 60 // How long between stomach emotes at prey (in seconds)
|
||||
var/emote_active = TRUE // Are we even giving emotes out at all or not?
|
||||
var/next_emote = 0 // When we're supposed to print our next emote, as a world.time
|
||||
var/selective_preference = DM_DIGEST // Which type of selective bellymode do we default to?
|
||||
|
||||
// Generally just used by AI
|
||||
var/autotransferchance = 0 // % Chance of prey being autotransferred to transfer location
|
||||
@@ -62,7 +63,7 @@
|
||||
|
||||
//I don't think we've ever altered these lists. making them static until someone actually overrides them somewhere.
|
||||
//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,DM_EGG)
|
||||
var/tmp/static/list/digest_modes = list(DM_HOLD,DM_DIGEST,DM_ABSORB,DM_DRAIN,DM_SELECT,DM_UNABSORB,DM_HEAL,DM_SHRINK,DM_GROW,DM_SIZE_STEAL,DM_EGG)
|
||||
//Digest mode addon flags
|
||||
var/tmp/static/list/mode_flag_list = list("Numbing" = DM_FLAG_NUMBING, "Stripping" = DM_FLAG_STRIPPING, "Leave Remains" = DM_FLAG_LEAVEREMAINS, "Muffles" = DM_FLAG_THICKBELLY, "Affect Worn Items" = DM_FLAG_AFFECTWORN, "Jams Sensors" = DM_FLAG_JAMSENSORS, "Complete Absorb" = DM_FLAG_FORCEPSAY)
|
||||
//Item related modes
|
||||
@@ -204,6 +205,7 @@
|
||||
"emote_lists",
|
||||
"emote_time",
|
||||
"emote_active",
|
||||
"selective_preference",
|
||||
"mode_flags",
|
||||
"item_digest_mode",
|
||||
"contaminates",
|
||||
@@ -1221,6 +1223,7 @@
|
||||
dupe.egg_type = egg_type
|
||||
dupe.emote_time = emote_time
|
||||
dupe.emote_active = emote_active
|
||||
dupe.selective_preference = selective_preference
|
||||
dupe.save_digest_mode = save_digest_mode
|
||||
|
||||
//// Object-holding variables
|
||||
|
||||
@@ -246,16 +246,37 @@ GLOBAL_LIST_INIT(digest_modes, list())
|
||||
/datum/digest_mode/selective //unselectable, "smart" digestion mode for mobs only
|
||||
id = DM_SELECT
|
||||
|
||||
|
||||
/datum/digest_mode/selective/process_mob(obj/belly/B, mob/living/L)
|
||||
var/datum/digest_mode/tempmode = GLOB.digest_modes["Hold"]
|
||||
var/datum/digest_mode/tempmode = GLOB.digest_modes[DM_HOLD] // Default to Hold in case of big oof fallback
|
||||
//if not absorbed, see if they're food
|
||||
if(L.digestable)
|
||||
tempmode = GLOB.digest_modes["Digest"]
|
||||
//if they're indigestible, then try to absorb them
|
||||
else if(L.absorbable)
|
||||
tempmode = GLOB.digest_modes["Absorb"]
|
||||
//if they're not absorbable, just drain
|
||||
else
|
||||
tempmode = GLOB.digest_modes["Drain"]
|
||||
//finally, process the mob as if they were subject to the chosen mode
|
||||
return tempmode.process_mob(B, L)
|
||||
switch(L.selective_preference) // First, we respect prey prefs
|
||||
if(DM_DIGEST)
|
||||
if(L.digestable)
|
||||
tempmode = GLOB.digest_modes[DM_DIGEST] // They want to be digested and can be, Digest
|
||||
else
|
||||
tempmode = GLOB.digest_modes[DM_DRAIN] // They want to be digested but can't be! Drain.
|
||||
if(DM_ABSORB)
|
||||
if(L.absorbable)
|
||||
tempmode = GLOB.digest_modes[DM_ABSORB] // They want to be absorbed and can be. Absorb.
|
||||
else
|
||||
tempmode = GLOB.digest_modes[DM_DRAIN] // They want to be absorbed but can't be! Drain.
|
||||
if(DM_DRAIN)
|
||||
tempmode = GLOB.digest_modes[DM_DRAIN] // They want to be drained. Drain.
|
||||
if(DM_DEFAULT)
|
||||
switch(B.selective_preference) // They don't actually care? Time for our own preference.
|
||||
if(DM_DIGEST)
|
||||
if(L.digestable)
|
||||
tempmode = GLOB.digest_modes[DM_DIGEST] // We prefer digestion and they're digestible? Digest
|
||||
else if(L.absorbable)
|
||||
tempmode = GLOB.digest_modes[DM_ABSORB] // If not digestible, are they absorbable? Then absorb.
|
||||
else
|
||||
tempmode = GLOB.digest_modes[DM_DRAIN] // Otherwise drain.
|
||||
if(DM_ABSORB)
|
||||
if(L.absorbable)
|
||||
tempmode = GLOB.digest_modes[DM_ABSORB] // We prefer absorption and they're absorbable? Absorb.
|
||||
else if(L.digestable)
|
||||
tempmode = GLOB.digest_modes[DM_DIGEST] // If not absorbable, are they digestible? Then digest.
|
||||
else
|
||||
tempmode = GLOB.digest_modes[DM_DRAIN] // Otherwise drain.
|
||||
return tempmode.process_mob(B, L)
|
||||
@@ -47,6 +47,7 @@
|
||||
var/latejoin_vore = FALSE //CHOMPedit: If enabled, latejoiners can spawn into this, assuming they have a client
|
||||
var/latejoin_prey = FALSE //CHOMPedit: If enabled, latejoiners can spawn ontop of and instantly eat the victim
|
||||
var/noisy_full = FALSE //CHOMPedit: Enables belching when a mob has overeaten
|
||||
var/selective_preference = DM_DEFAULT // Preference for selective bellymode
|
||||
var/regen_sounds = list(
|
||||
'sound/effects/mob_effects/xenochimera/regen_1.ogg',
|
||||
'sound/effects/mob_effects/xenochimera/regen_2.ogg',
|
||||
@@ -266,6 +267,7 @@
|
||||
P.vore_smell = src.vore_smell
|
||||
P.permit_healbelly = src.permit_healbelly
|
||||
P.noisy = src.noisy
|
||||
P.selective_preference = src.selective_preference
|
||||
P.show_vore_fx = src.show_vore_fx
|
||||
P.can_be_drop_prey = src.can_be_drop_prey
|
||||
P.can_be_drop_pred = src.can_be_drop_pred
|
||||
@@ -316,6 +318,7 @@
|
||||
vore_taste = P.vore_taste
|
||||
vore_smell = P.vore_smell
|
||||
permit_healbelly = P.permit_healbelly
|
||||
selective_preference = P.selective_preference
|
||||
noisy = P.noisy
|
||||
show_vore_fx = P.show_vore_fx
|
||||
can_be_drop_prey = P.can_be_drop_prey
|
||||
@@ -1039,6 +1042,7 @@
|
||||
dispvoreprefs += "<b>Leaves Remains:</b> [digest_leave_remains ? "Enabled" : "Disabled"]<br>"
|
||||
dispvoreprefs += "<b>Mob Vore:</b> [allowmobvore ? "Enabled" : "Disabled"]<br>"
|
||||
dispvoreprefs += "<b>Healbelly permission:</b> [permit_healbelly ? "Allowed" : "Disallowed"]<br>"
|
||||
dispvoreprefs += "<b>Selective Mode Pref:</b> [src.selective_preference]<br>"
|
||||
dispvoreprefs += "<b>Spontaneous vore prey:</b> [can_be_drop_prey ? "Enabled" : "Disabled"]<br>"
|
||||
dispvoreprefs += "<b>Spontaneous vore pred:</b> [can_be_drop_pred ? "Enabled" : "Disabled"]<br>"
|
||||
dispvoreprefs += "<b>Late join spawn point belly:</b> [latejoin_vore ? "Enabled" : "Disabled"]<br>" //CHOMPstation edit
|
||||
|
||||
@@ -77,6 +77,8 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE
|
||||
var/vore_taste = "nothing in particular"
|
||||
var/vore_smell = "nothing in particular"
|
||||
|
||||
var/selective_preference = DM_DEFAULT
|
||||
|
||||
|
||||
var/nutrition_message_visible = TRUE
|
||||
var/list/nutrition_messages = list(
|
||||
@@ -180,6 +182,7 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE
|
||||
vore_smell = json_from_file["vore_smell"]
|
||||
permit_healbelly = json_from_file["permit_healbelly"]
|
||||
noisy = json_from_file["noisy"]
|
||||
selective_preference = json_from_file["selective_preference"]
|
||||
show_vore_fx = json_from_file["show_vore_fx"]
|
||||
can_be_drop_prey = json_from_file["can_be_drop_prey"]
|
||||
can_be_drop_pred = json_from_file["can_be_drop_pred"]
|
||||
@@ -221,6 +224,8 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE
|
||||
allowmobvore = TRUE
|
||||
if(isnull(permit_healbelly))
|
||||
permit_healbelly = TRUE
|
||||
if(isnull(selective_preference))
|
||||
selective_preference = DM_DEFAULT
|
||||
if (isnull(noisy))
|
||||
noisy = FALSE
|
||||
if(isnull(show_vore_fx))
|
||||
@@ -304,6 +309,7 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE
|
||||
"vore_smell" = vore_smell,
|
||||
"permit_healbelly" = permit_healbelly,
|
||||
"noisy" = noisy,
|
||||
"selective_preference" = selective_preference,
|
||||
"show_vore_fx" = show_vore_fx,
|
||||
"can_be_drop_prey" = can_be_drop_prey,
|
||||
"can_be_drop_pred" = can_be_drop_pred,
|
||||
|
||||
@@ -191,6 +191,7 @@
|
||||
"shrink_grow_size" = selected.shrink_grow_size,
|
||||
"emote_time" = selected.emote_time,
|
||||
"emote_active" = selected.emote_active,
|
||||
"selective_preference" = selected.selective_preference,
|
||||
"nutrition_ex" = host.nutrition_message_visible,
|
||||
"weight_ex" = host.weight_message_visible,
|
||||
"belly_fullscreen" = selected.belly_fullscreen,
|
||||
@@ -586,6 +587,14 @@
|
||||
host.stumble_vore = !host.stumble_vore
|
||||
unsaved_changes = TRUE
|
||||
return TRUE
|
||||
if("switch_selective_mode_pref")
|
||||
host.selective_preference = tgui_input_list(usr, "What would you prefer happen to you with selective bellymode?","Selective Bellymode", list(DM_DEFAULT, DM_DIGEST, DM_ABSORB, DM_DRAIN))
|
||||
if(!(host.selective_preference))
|
||||
host.selective_preference = DM_DEFAULT
|
||||
if(host.client.prefs_vr)
|
||||
host.client.prefs_vr.selective_preference = host.selective_preference
|
||||
unsaved_changes = TRUE
|
||||
return TRUE
|
||||
if("toggle_nutrition_ex")
|
||||
host.nutrition_message_visible = !host.nutrition_message_visible
|
||||
unsaved_changes = TRUE
|
||||
@@ -1178,6 +1187,12 @@
|
||||
if("b_emoteactive")
|
||||
host.vore_selected.emote_active = !host.vore_selected.emote_active
|
||||
. = TRUE
|
||||
if("b_selective_mode_pref_toggle")
|
||||
if(host.vore_selected.selective_preference == DM_DIGEST)
|
||||
host.vore_selected.selective_preference = DM_ABSORB
|
||||
else
|
||||
host.vore_selected.selective_preference = DM_DIGEST
|
||||
. = TRUE
|
||||
if("b_emotetime")
|
||||
var/new_time = tgui_input_number(user, "Choose the period it takes for idle belly emotes to be shown to prey. Measured in seconds, Minimum 1 minute, Maximum 10 minutes.", "Set Belly Emote Delay.", host.vore_selected.digest_brute, 600, 60)
|
||||
if(new_time == null)
|
||||
|
||||
@@ -229,6 +229,7 @@
|
||||
new_mob.allowmobvore = allowmobvore
|
||||
new_mob.permit_healbelly = permit_healbelly
|
||||
new_mob.noisy = noisy
|
||||
new_mob.selective_preference = selective_preference
|
||||
new_mob.drop_vore = drop_vore
|
||||
new_mob.stumble_vore = stumble_vore
|
||||
new_mob.slip_vore = slip_vore
|
||||
|
||||
@@ -634,6 +634,7 @@ const VoreSelectedBellyOptions = (props, context) => {
|
||||
contaminate_flavor,
|
||||
contaminate_color,
|
||||
egg_type,
|
||||
selective_preference,
|
||||
save_digest_mode,
|
||||
vorespawn_blacklist,
|
||||
} = belly;
|
||||
@@ -754,6 +755,12 @@ const VoreSelectedBellyOptions = (props, context) => {
|
||||
content={capitalize(egg_type)}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Selective Mode Preference">
|
||||
<Button
|
||||
onClick={() => act('set_attribute', { attribute: 'b_selective_mode_pref_toggle' })}
|
||||
content={capitalize(selective_preference)}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Flex.Item>
|
||||
</Flex>
|
||||
@@ -1769,6 +1776,9 @@ const VoreUserPreferences = (props, context) => {
|
||||
<Flex.Item basis="32%">
|
||||
<VoreUserPreferenceItem spec={preferences.spontaneous_tf} />
|
||||
</Flex.Item>
|
||||
<Flex.Item basis="32%">
|
||||
<Button fluid content="Slective Mode Preference" onClick={() => act('switch_selective_mode_pref')} />
|
||||
</Flex.Item>
|
||||
<Flex.Item basis="32%">
|
||||
<VoreUserPreferenceItem spec={preferences.autotransferable} />
|
||||
</Flex.Item>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user