mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Vorespawn Whitelist and Absorb (#8731)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -40,3 +40,7 @@
|
||||
#define AT_FLAG_ORES 0x40
|
||||
#define AT_FLAG_CLOTHES 0x80
|
||||
#define AT_FLAG_FOOD 0x100
|
||||
|
||||
//Vorespawn flags
|
||||
#define VS_FLAG_ABSORB_YES 0x1
|
||||
#define VS_FLAG_ABSORB_PREY 0x2
|
||||
|
||||
@@ -673,6 +673,7 @@ var/global/datum/controller/occupations/job_master
|
||||
var/datum/spawnpoint/spawnpos
|
||||
var/fail_deadly = FALSE
|
||||
var/obj/belly/vore_spawn_gut
|
||||
var/absorb_choice = FALSE //CHOMPAdd - Ability to start absorbed with vorespawn
|
||||
var/mob/living/prey_to_nomph
|
||||
var/obj/item/item_to_be //CHOMPEdit - Item TF spawning
|
||||
var/mob/living/item_carrier //CHOMPEdit - Capture crystal spawning
|
||||
@@ -708,6 +709,10 @@ var/global/datum/controller/occupations/job_master
|
||||
for(var/obj/belly/Y in pred.vore_organs)
|
||||
if(Y.vorespawn_blacklist)
|
||||
continue
|
||||
//CHOMPAdd Start
|
||||
if(LAZYLEN(Y.vorespawn_whitelist) && !(C.ckey in Y.vorespawn_whitelist))
|
||||
continue
|
||||
//CHOMPAdd End
|
||||
available_bellies += Y
|
||||
var/backup = alert(C, "Do you want a mind backup?", "Confirm", "Yes", "No")
|
||||
if(backup == "Yes")
|
||||
@@ -715,6 +720,15 @@ var/global/datum/controller/occupations/job_master
|
||||
vore_spawn_gut = input(C, "Choose a Belly.", "Belly Spawnpoint") as null|anything in available_bellies
|
||||
if(!vore_spawn_gut)
|
||||
return
|
||||
//CHOMPAdd Start
|
||||
if(vore_spawn_gut.vorespawn_absorbed & VS_FLAG_ABSORB_YES)
|
||||
absorb_choice = TRUE
|
||||
if(vore_spawn_gut.vorespawn_absorbed & VS_FLAG_ABSORB_PREY)
|
||||
if(alert(C, "Do you want to start absorbed into [pred]'s [vore_spawn_gut]?", "Confirm", "Yes", "No") != "Yes")
|
||||
absorb_choice = FALSE
|
||||
else if(alert(C, "[pred]'s [vore_spawn_gut] will start with you absorbed. Continue?", "Confirm", "Yes", "No") != "Yes")
|
||||
return
|
||||
//CHOMPAdd End
|
||||
to_chat(C, "<b><span class='warning'>[pred] has received your spawn request. Please wait.</span></b>")
|
||||
log_admin("[key_name(C)] has requested to vore spawn into [key_name(pred)]")
|
||||
message_admins("[key_name(C)] has requested to vore spawn into [key_name(pred)]")
|
||||
@@ -722,11 +736,21 @@ var/global/datum/controller/occupations/job_master
|
||||
var/confirm
|
||||
if(pred.no_latejoin_vore_warning)
|
||||
if(pred.no_latejoin_vore_warning_time > 0)
|
||||
confirm = tgui_alert(pred, "[C.prefs.real_name] is attempting to spawn into your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), pred.no_latejoin_vore_warning_time SECONDS)
|
||||
//CHOMPEdit Start
|
||||
if(absorb_choice)
|
||||
confirm = tgui_alert(pred, "[C.prefs.real_name] is attempting to spawn absorbed as your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), pred.no_latejoin_vore_warning_time SECONDS)
|
||||
else
|
||||
confirm = tgui_alert(pred, "[C.prefs.real_name] is attempting to spawn into your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), pred.no_latejoin_vore_warning_time SECONDS)
|
||||
//CHOMPEdit End
|
||||
if(!confirm)
|
||||
confirm = "Yes"
|
||||
else
|
||||
confirm = alert(pred, "[C.prefs.real_name] is attempting to spawn into your [vore_spawn_gut]. Let them?", "Confirm", "No", "Yes")
|
||||
//CHOMPEdit Start
|
||||
if(absorb_choice)
|
||||
confirm = alert(pred, "[C.prefs.real_name] is attempting to spawn absorbed as your [vore_spawn_gut]. Let them?", "Confirm", "No", "Yes")
|
||||
else
|
||||
confirm = alert(pred, "[C.prefs.real_name] is attempting to spawn into your [vore_spawn_gut]. Let them?", "Confirm", "No", "Yes")
|
||||
//CHOMPEdit End
|
||||
if(confirm != "Yes")
|
||||
to_chat(C, "<span class='warning'>[pred] has declined your spawn request.</span>")
|
||||
var/message = sanitizeSafe(input(pred,"Do you want to leave them a message?")as text|null)
|
||||
@@ -784,6 +808,10 @@ var/global/datum/controller/occupations/job_master
|
||||
vore_spawn_gut = input(C, "Choose your Belly.", "Belly Spawnpoint") as null|anything in available_bellies
|
||||
if(!vore_spawn_gut)
|
||||
return
|
||||
//CHOMPAdd Start
|
||||
if(alert(C, "Do you want to instantly absorb them?", "Confirm", "Yes", "No") == "Yes")
|
||||
absorb_choice = TRUE
|
||||
//CHOMPAdd End
|
||||
to_chat(C, "<b><span class='warning'>[prey] has received your spawn request. Please wait.</span></b>")
|
||||
log_admin("[key_name(C)] has requested to pred spawn onto [key_name(prey)]")
|
||||
message_admins("[key_name(C)] has requested to pred spawn onto [key_name(prey)]")
|
||||
@@ -791,11 +819,21 @@ var/global/datum/controller/occupations/job_master
|
||||
var/confirm
|
||||
if(prey.no_latejoin_prey_warning)
|
||||
if(prey.no_latejoin_prey_warning_time > 0)
|
||||
confirm = tgui_alert(prey, "[C.prefs.real_name] is attempting to televore you into their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), prey.no_latejoin_prey_warning_time SECONDS)
|
||||
//CHOMPEdit Start
|
||||
if(absorb_choice)
|
||||
confirm = tgui_alert(prey, "[C.prefs.real_name] is attempting to televore and instantly absorb you with their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), prey.no_latejoin_prey_warning_time SECONDS)
|
||||
else
|
||||
confirm = tgui_alert(prey, "[C.prefs.real_name] is attempting to televore you into their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), prey.no_latejoin_prey_warning_time SECONDS)
|
||||
//CHOMPEdit End
|
||||
if(!confirm)
|
||||
confirm = "Yes"
|
||||
else
|
||||
confirm = alert(prey, "[C.prefs.real_name] is attempting to televore you into their [vore_spawn_gut]. Let them?", "Confirm", "No", "Yes")
|
||||
//CHOMPEdit Start
|
||||
if(absorb_choice)
|
||||
confirm = alert(prey, "[C.prefs.real_name] is attempting to televore and instantly absorb you with their [vore_spawn_gut]. Let them?", "Confirm", "No", "Yes")
|
||||
else
|
||||
confirm = alert(prey, "[C.prefs.real_name] is attempting to televore you into their [vore_spawn_gut]. Let them?", "Confirm", "No", "Yes")
|
||||
//CHOMPEdit End
|
||||
if(confirm != "Yes")
|
||||
to_chat(C, "<span class='warning'>[prey] has declined your spawn request.</span>")
|
||||
var/message = sanitizeSafe(input(prey,"Do you want to leave them a message?")as text|null)
|
||||
@@ -932,6 +970,7 @@ var/global/datum/controller/occupations/job_master
|
||||
. = list("turf","msg", "voreny", "prey", "itemtf", "vorgans", "carrier") //CHOMPEdit - Item TF spawnpoints, spawn as mob
|
||||
if(vore_spawn_gut)
|
||||
.["voreny"] = vore_spawn_gut
|
||||
.["absorb"] = absorb_choice //CHOMPAdd
|
||||
if(prey_to_nomph)
|
||||
.["prey"] = prey_to_nomph //We pass this on later to reverse the vorespawn in new_player.dm
|
||||
//CHOMPEdit Start - Item TF spawnpoints
|
||||
|
||||
@@ -587,6 +587,7 @@
|
||||
if(imp.handle_implant(character,character.zone_sel.selecting))
|
||||
imp.post_implant(character)
|
||||
var/gut = join_props["voreny"]
|
||||
var/start_absorbed = join_props["absorb"] //CHOMPAdd
|
||||
var/mob/living/prey = join_props["prey"]
|
||||
//CHOMPEdit Start - Item TF
|
||||
if(itemtf && istype(itemtf, /obj/item/capture_crystal))
|
||||
@@ -613,9 +614,17 @@
|
||||
tele.set_up("#00FFFF", get_turf(prey))
|
||||
tele.start()
|
||||
character.forceMove(get_turf(prey))
|
||||
//CHOMPAdd Start
|
||||
if(start_absorbed)
|
||||
prey.absorbed = 1
|
||||
//CHOMPAdd End
|
||||
prey.forceMove(gut_to_enter)
|
||||
else
|
||||
if(gut)
|
||||
//CHOMPAdd Start
|
||||
if(start_absorbed)
|
||||
character.absorbed = 1
|
||||
//CHOMPAdd End
|
||||
character.forceMove(gut)
|
||||
|
||||
character.client.init_verbs() // init verbs for the late join
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
var/liquid_fullness4_messages = FALSE
|
||||
var/liquid_fullness5_messages = FALSE
|
||||
var/vorespawn_blacklist = FALSE
|
||||
var/vorespawn_whitelist = list()
|
||||
var/vorespawn_absorbed = 0
|
||||
|
||||
var/list/fullness1_messages = list(
|
||||
"%pred's %belly looks empty"
|
||||
|
||||
@@ -430,6 +430,8 @@
|
||||
"fullness4_messages",
|
||||
"fullness5_messages",
|
||||
"vorespawn_blacklist",
|
||||
"vorespawn_whitelist",
|
||||
"vorespawn_absorbed",
|
||||
"vore_sprite_flags",
|
||||
"affects_vore_sprites",
|
||||
"count_absorbed_prey_for_sprite",
|
||||
@@ -2586,6 +2588,8 @@
|
||||
dupe.reagent_transfer_verb = reagent_transfer_verb
|
||||
dupe.custom_max_volume = custom_max_volume
|
||||
dupe.vorespawn_blacklist = vorespawn_blacklist
|
||||
dupe.vorespawn_whitelist = vorespawn_whitelist
|
||||
dupe.vorespawn_absorbed = vorespawn_absorbed
|
||||
dupe.vore_sprite_flags = vore_sprite_flags
|
||||
dupe.affects_vore_sprites = affects_vore_sprites
|
||||
dupe.count_absorbed_prey_for_sprite = count_absorbed_prey_for_sprite
|
||||
|
||||
@@ -282,6 +282,8 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
|
||||
"custom_ingested_color" = selected.custom_ingested_color,
|
||||
"custom_ingested_alpha" = selected.custom_ingested_alpha,
|
||||
"vorespawn_blacklist" = selected.vorespawn_blacklist,
|
||||
"vorespawn_whitelist" = selected.vorespawn_whitelist,
|
||||
"vorespawn_absorbed" = (global_flag_check(selected.vorespawn_absorbed, VS_FLAG_ABSORB_YES) + global_flag_check(selected.vorespawn_absorbed, VS_FLAG_ABSORB_PREY)),
|
||||
"sound_volume" = selected.sound_volume,
|
||||
"affects_voresprite" = selected.affects_vore_sprites,
|
||||
"absorbed_voresprite" = selected.count_absorbed_prey_for_sprite,
|
||||
@@ -1148,6 +1150,20 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
|
||||
if(new_vorespawn_blacklist == 1)
|
||||
new_belly.vorespawn_blacklist = TRUE
|
||||
|
||||
if(islist(belly_data["vorespawn_whitelist"]))
|
||||
var/new_vorespawn_whitelist = splittext(sanitize(lowertext(jointext(belly_data["vorespawn_whitelist"],"\n")),MAX_MESSAGE_LEN,0,0,0),"\n")
|
||||
new_belly.vorespawn_whitelist = new_vorespawn_whitelist
|
||||
|
||||
if(isnum(belly_data["vorespawn_absorbed"]))
|
||||
var/new_vorespawn_absorbed = 0
|
||||
var/updated_vorespawn_absorbed = belly_data["vorespawn_absorbed"]
|
||||
if(updated_vorespawn_absorbed & VS_FLAG_ABSORB_YES)
|
||||
new_vorespawn_absorbed |= VS_FLAG_ABSORB_YES
|
||||
if(updated_vorespawn_absorbed & VS_FLAG_ABSORB_PREY)
|
||||
new_vorespawn_absorbed |= VS_FLAG_ABSORB_YES
|
||||
new_vorespawn_absorbed |= VS_FLAG_ABSORB_PREY
|
||||
new_belly.vorespawn_absorbed = new_vorespawn_absorbed
|
||||
|
||||
if(istext(belly_data["egg_type"]))
|
||||
var/new_egg_type = sanitize(belly_data["egg_type"],MAX_MESSAGE_LEN,0,0,0)
|
||||
if(new_egg_type)
|
||||
@@ -2198,10 +2214,8 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
|
||||
if(1)
|
||||
host.soulcatcher_pref_flags ^= SOULCATCHER_ALLOW_DELETION_INSTANT
|
||||
if(2)
|
||||
if(host.soulcatcher_pref_flags & SOULCATCHER_ALLOW_DELETION)
|
||||
host.soulcatcher_pref_flags ^= SOULCATCHER_ALLOW_DELETION
|
||||
if(host.soulcatcher_pref_flags & SOULCATCHER_ALLOW_DELETION_INSTANT)
|
||||
host.soulcatcher_pref_flags ^= SOULCATCHER_ALLOW_DELETION_INSTANT
|
||||
host.soulcatcher_pref_flags &= ~(SOULCATCHER_ALLOW_DELETION)
|
||||
host.soulcatcher_pref_flags &= ~(SOULCATCHER_ALLOW_DELETION_INSTANT)
|
||||
if(host.client.prefs_vr)
|
||||
host.client.prefs_vr.soulcatcher_pref_flags = host.soulcatcher_pref_flags
|
||||
unsaved_changes = TRUE
|
||||
@@ -3848,6 +3862,25 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
|
||||
if("b_vorespawn_blacklist") //CHOMP Addition
|
||||
host.vore_selected.vorespawn_blacklist = !host.vore_selected.vorespawn_blacklist
|
||||
. = TRUE
|
||||
if("b_vorespawn_whitelist") //CHOMP Addition
|
||||
var/new_vorespawn_whitelist = sanitize(tgui_input_text(user,"Input ckeys allowed to vorespawn on separate lines. Cancel will clear the list.","Allowed Players",jointext(host.vore_selected.vorespawn_whitelist,"\n"), multiline = TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN,0,0,0)
|
||||
if(new_vorespawn_whitelist)
|
||||
host.vore_selected.vorespawn_whitelist = splittext(lowertext(new_vorespawn_whitelist),"\n")
|
||||
else
|
||||
host.vore_selected.vorespawn_whitelist = list()
|
||||
. = TRUE
|
||||
if("b_vorespawn_absorbed") //CHOMP Addition
|
||||
var/current_number = global_flag_check(host.vore_selected.vorespawn_absorbed, VS_FLAG_ABSORB_YES) + global_flag_check(host.vore_selected.vorespawn_absorbed, VS_FLAG_ABSORB_PREY)
|
||||
switch(current_number)
|
||||
if(0)
|
||||
host.vore_selected.vorespawn_absorbed |= VS_FLAG_ABSORB_YES
|
||||
if(1)
|
||||
host.vore_selected.vorespawn_absorbed |= VS_FLAG_ABSORB_PREY
|
||||
if(2)
|
||||
host.vore_selected.vorespawn_absorbed &= ~(VS_FLAG_ABSORB_YES)
|
||||
host.vore_selected.vorespawn_absorbed &= ~(VS_FLAG_ABSORB_PREY)
|
||||
unsaved_changes = TRUE
|
||||
return TRUE
|
||||
if("b_belly_sprite_to_affect") //CHOMP Addition
|
||||
var/belly_choice = tgui_input_list(user, "Which belly sprite do you want your [lowertext(host.vore_selected.name)] to affect?","Select Region", host.vore_icon_bellies) //ChompEDIT - user, not usr
|
||||
if(!belly_choice) //They cancelled, no changes
|
||||
|
||||
@@ -290,6 +290,8 @@
|
||||
belly_data["emote_time"] = B.emote_time
|
||||
belly_data["shrink_grow_size"] = B.shrink_grow_size
|
||||
belly_data["vorespawn_blacklist"] = B.vorespawn_blacklist
|
||||
belly_data["vorespawn_whitelist"] = B.vorespawn_whitelist
|
||||
belly_data["vorespawn_absorbed"] = B.vorespawn_absorbed
|
||||
belly_data["egg_type"] = B.egg_type
|
||||
belly_data["egg_name"] = B.egg_name
|
||||
belly_data["egg_size"] = B.egg_size
|
||||
|
||||
@@ -2,6 +2,7 @@ import { capitalize } from 'common/string';
|
||||
|
||||
import { useBackend } from '../../../../backend';
|
||||
import { Button, Flex, LabeledList } from '../../../../components';
|
||||
import { vorespawnAbsorbedColor, vorespawnAbsorbedText } from '../constants';
|
||||
import { hostMob, selectedData } from '../types';
|
||||
import { VoreSelectedMobTypeBellyButtons } from './VoreSelectedMobTypeBellyButtons';
|
||||
|
||||
@@ -40,6 +41,8 @@ export const VoreSelectedBellyOptions = (props: {
|
||||
save_digest_mode,
|
||||
eating_privacy_local,
|
||||
vorespawn_blacklist,
|
||||
vorespawn_whitelist,
|
||||
vorespawn_absorbed,
|
||||
private_struggle,
|
||||
drainmode,
|
||||
} = belly;
|
||||
@@ -256,6 +259,35 @@ export const VoreSelectedBellyOptions = (props: {
|
||||
{vorespawn_blacklist ? 'Yes' : 'No'}
|
||||
</Button>
|
||||
</LabeledList.Item>
|
||||
{vorespawn_blacklist ? (
|
||||
''
|
||||
) : (
|
||||
<>
|
||||
<LabeledList.Item label="Vore Spawn Whitelist">
|
||||
<Button
|
||||
onClick={() =>
|
||||
act('set_attribute', { attribute: 'b_vorespawn_whitelist' })
|
||||
}
|
||||
icon="pen"
|
||||
>
|
||||
{vorespawn_whitelist.length
|
||||
? vorespawn_whitelist.join(', ')
|
||||
: 'Anyone!'}
|
||||
</Button>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Vore Spawn Absorbed">
|
||||
<Button
|
||||
color={vorespawnAbsorbedColor[vorespawn_absorbed]}
|
||||
tooltip="Click to toggle between No, Yes and Prey's Choice."
|
||||
onClick={() =>
|
||||
act('set_attribute', { attribute: 'b_vorespawn_absorbed' })
|
||||
}
|
||||
>
|
||||
{vorespawnAbsorbedText[vorespawn_absorbed]}
|
||||
</Button>
|
||||
</LabeledList.Item>
|
||||
</>
|
||||
)}
|
||||
<LabeledList.Item label="Egg Type">
|
||||
<Button
|
||||
onClick={() => act('set_attribute', { attribute: 'b_egg_type' })}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
export const stats: (string | undefined)[] = [undefined, 'average', 'bad'];
|
||||
export const vorespawnAbsorbedText: string[] = ['No', 'Yes', 'Prey Choice'];
|
||||
export const vorespawnAbsorbedColor: (string | undefined)[] = [
|
||||
undefined,
|
||||
'green',
|
||||
'orange',
|
||||
];
|
||||
|
||||
export const digestModeToColor = {
|
||||
Default: undefined,
|
||||
|
||||
@@ -123,6 +123,8 @@ export type selectedData = {
|
||||
custom_ingested_color: string;
|
||||
custom_ingested_alpha: number;
|
||||
vorespawn_blacklist: BooleanLike;
|
||||
vorespawn_whitelist: string[];
|
||||
vorespawn_absorbed: number;
|
||||
sound_volume: number;
|
||||
affects_voresprite: BooleanLike;
|
||||
absorbed_voresprite: BooleanLike;
|
||||
|
||||
@@ -40,6 +40,8 @@ export const generateBellyString = (belly: Belly, index: number) => {
|
||||
emote_time,
|
||||
shrink_grow_size,
|
||||
vorespawn_blacklist,
|
||||
vorespawn_whitelist,
|
||||
vorespawn_absorbed,
|
||||
egg_type,
|
||||
egg_name,
|
||||
selective_preference,
|
||||
@@ -633,6 +635,8 @@ export const generateBellyString = (belly: Belly, index: number) => {
|
||||
result += '<li class="list-group-item">Idle Emote Delay: ' + emote_time + ' seconds</li>';
|
||||
result += '<li class="list-group-item">Shrink/Grow Size: ' + shrink_grow_size * 100 + '%</li>';
|
||||
result += '<li class="list-group-item">Vore Spawn Blacklist: ' + (vorespawn_blacklist ? '<span style="color: green;">Yes' : '<span style="color: red;">No') + '</li>';
|
||||
result += '<li class="list-group-item">Vore Spawn Whitelist: ' + (vorespawn_whitelist.length ? vorespawn_whitelist.join(', ') : 'Anyone!') + '</li>';
|
||||
result += '<li class="list-group-item">Vore Spawn Absorbed: ' + (vorespawn_absorbed === 0 ? '<span style="color: red;">No' : vorespawn_absorbed === 1 ? '<span style="color: green;">Yes' : '<span style="color: orange;">Prey Choice') + '</li>';
|
||||
result += '<li class="list-group-item">Egg Type: ' + egg_type + '</li>';
|
||||
result += '<li class="list-group-item">Selective Mode Preference: ' + selective_preference + '</li>';
|
||||
result += '</ul>';
|
||||
|
||||
@@ -39,6 +39,8 @@ export type Belly = {
|
||||
emote_time: number;
|
||||
shrink_grow_size: number;
|
||||
vorespawn_blacklist: BooleanLike;
|
||||
vorespawn_whitelist: string[];
|
||||
vorespawn_absorbed: number;
|
||||
egg_type: string;
|
||||
egg_name: string;
|
||||
selective_preference: string;
|
||||
|
||||
Reference in New Issue
Block a user