mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Adds more autotransfer filters, ore "recycling", and item digestability toggle. (#7102)
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
//For belly fullscreen shennanigans outside of bellies, due to Life() clearing belly fullscreens outside of bellies.
|
||||
#define ATOM_BELLY_FULLSCREEN "belly_atom_vfx"
|
||||
|
||||
//Auto-transfer flags
|
||||
//Auto-transfer mob flags
|
||||
#define AT_FLAG_CREATURES 0x1
|
||||
#define AT_FLAG_ABSORBED 0x2
|
||||
#define AT_FLAG_CARBON 0x4
|
||||
@@ -28,8 +28,15 @@
|
||||
#define AT_FLAG_DEAD 0x80
|
||||
#define AT_FLAG_CANDIGEST 0x100
|
||||
#define AT_FLAG_CANABSORB 0x200
|
||||
#define AT_FLAG_ITEMS 0x400
|
||||
#define AT_FLAG_TRASH 0x800
|
||||
#define AT_FLAG_EGGS 0x1000
|
||||
#define AT_FLAG_REMAINS 0x2000
|
||||
#define AT_FLAG_INDIGESTIBLE 0x4000
|
||||
#define AT_FLAG_HEALTHY 0x400
|
||||
|
||||
//Auto-transfer item flags
|
||||
#define AT_FLAG_ITEMS 0x1
|
||||
#define AT_FLAG_TRASH 0x2
|
||||
#define AT_FLAG_EGGS 0x4
|
||||
#define AT_FLAG_REMAINS 0x8
|
||||
#define AT_FLAG_INDIGESTIBLE 0x10
|
||||
#define AT_FLAG_RECYCLABLE 0x20
|
||||
#define AT_FLAG_ORES 0x40
|
||||
#define AT_FLAG_CLOTHES 0x80
|
||||
#define AT_FLAG_FOOD 0x100
|
||||
|
||||
@@ -174,10 +174,10 @@
|
||||
/obj/item/ore_chunk
|
||||
name = "ore chunk"
|
||||
desc = "A conglomerate of ore."
|
||||
icon = 'icons/obj/mining_ore_vr.dmi'
|
||||
icon = 'icons/obj/xenoarchaeology.dmi' //CHOMPEdit
|
||||
icon_state = "strange"
|
||||
randpixel = 8
|
||||
w_class = ITEMSIZE_SMALL
|
||||
w_class = ITEMSIZE_LARGE //CHOMPEdit
|
||||
var/list/stored_ore = list(
|
||||
"sand" = 0,
|
||||
"hematite" = 0,
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
if(stat == UNCONSCIOUS || sleeping > 0)
|
||||
to_chat(src, "<span class='filter_notice'><I>... You can almost hear someone talking ...</I></span>")
|
||||
else
|
||||
if(client.prefs.chat_timestamp)
|
||||
if(client && client.prefs.chat_timestamp) //CHOMPEdit
|
||||
msg = replacetext(msg, new/regex("^(<span(?: \[^>]*)?>)(.*</span>)", ""), "$1[time] $2")
|
||||
to_chat(src,msg)
|
||||
else if(teleop)
|
||||
|
||||
@@ -531,8 +531,18 @@
|
||||
w_class = ITEMSIZE_SMALL
|
||||
|
||||
/obj/belly/proc/recycle(var/obj/item/O)
|
||||
if(!recycling || !LAZYLEN(O.matter))
|
||||
if(!recycling || (!LAZYLEN(O.matter) && !istype(O, /obj/item/weapon/ore)))
|
||||
return FALSE
|
||||
if(istype(O, /obj/item/weapon/ore))
|
||||
var/obj/item/weapon/ore/ore = O
|
||||
for(var/obj/item/ore_chunk/C in contents)
|
||||
if(istype(C))
|
||||
C.stored_ore[ore.material]++
|
||||
return TRUE
|
||||
var/obj/item/ore_chunk/newchunk = new /obj/item/ore_chunk(src)
|
||||
newchunk.stored_ore[ore.material]++
|
||||
return TRUE
|
||||
else
|
||||
var/list/modified_mats = list()
|
||||
var/trash = 1
|
||||
if(istype(O,/obj/item/trash))
|
||||
|
||||
@@ -69,16 +69,21 @@
|
||||
var/autotransferlocation // Place to send them
|
||||
var/autotransfer_whitelist = 0 // Flags for what can be transferred to the primary location //CHOMPAdd
|
||||
var/autotransfer_blacklist = 2 // Flags for what can not be transferred to the primary location, defaults to Absorbed //CHOMPAdd
|
||||
var/autotransfer_whitelist_items = 0 // Flags for what can be transferred to the primary location //CHOMPAdd
|
||||
var/autotransfer_blacklist_items = 0 // Flags for what can not be transferred to the primary location //CHOMPAdd
|
||||
var/autotransferchance_secondary = 0 // % Chance of prey being autotransferred to secondary transfer location //CHOMPAdd
|
||||
var/autotransferlocation_secondary // Second place to send them //CHOMPAdd
|
||||
var/autotransfer_secondary_whitelist = 0// Flags for what can be transferred to the secondary location //CHOMPAdd
|
||||
var/autotransfer_secondary_blacklist = 2// Flags for what can not be transferred to the secondary location, defaults to Absorbed //CHOMPAdd
|
||||
var/autotransfer_secondary_whitelist_items = 0// Flags for what can be transferred to the secondary location //CHOMPAdd
|
||||
var/autotransfer_secondary_blacklist_items = 0// Flags for what can not be transferred to the secondary location //CHOMPAdd
|
||||
var/autotransfer_enabled = FALSE // Player toggle
|
||||
var/autotransfer_min_amount = 0 // Minimum amount of things to pass at once. //CHOMPAdd
|
||||
var/autotransfer_max_amount = 0 // Maximum amount of things to pass at once. //CHOMPAdd
|
||||
var/tmp/list/autotransfer_queue = list()// Reserve for above things. //CHOMPAdd
|
||||
//Auto-transfer flags for whitelist //CHOMPAdd
|
||||
var/tmp/static/list/autotransfer_flags_list = list("Creatures" = AT_FLAG_CREATURES, "Absorbed" = AT_FLAG_ABSORBED, "Carbon" = AT_FLAG_CARBON, "Silicon" = AT_FLAG_SILICON, "Mobs" = AT_FLAG_MOBS, "Animals" = AT_FLAG_ANIMALS, "Mice" = AT_FLAG_MICE, "Dead" = AT_FLAG_DEAD, "Digestable Creatures" = AT_FLAG_CANDIGEST, "Absorbable Creatures" = AT_FLAG_CANABSORB, "Items" = AT_FLAG_ITEMS, "Trash" = AT_FLAG_TRASH, "Eggs" = AT_FLAG_EGGS, "Remains" = AT_FLAG_REMAINS, "Indigestible Items" = AT_FLAG_INDIGESTIBLE)
|
||||
var/tmp/static/list/autotransfer_flags_list = list("Creatures" = AT_FLAG_CREATURES, "Absorbed" = AT_FLAG_ABSORBED, "Carbon" = AT_FLAG_CARBON, "Silicon" = AT_FLAG_SILICON, "Mobs" = AT_FLAG_MOBS, "Animals" = AT_FLAG_ANIMALS, "Mice" = AT_FLAG_MICE, "Dead" = AT_FLAG_DEAD, "Digestable Creatures" = AT_FLAG_CANDIGEST, "Absorbable Creatures" = AT_FLAG_CANABSORB, "Full Health" = AT_FLAG_HEALTHY)
|
||||
var/tmp/static/list/autotransfer_flags_list_items = list("Items" = AT_FLAG_ITEMS, "Trash" = AT_FLAG_TRASH, "Eggs" = AT_FLAG_EGGS, "Remains" = AT_FLAG_REMAINS, "Indigestible Items" = AT_FLAG_INDIGESTIBLE, "Recyclable Items" = AT_FLAG_RECYCLABLE, "Ores" = AT_FLAG_ORES, "Clothes and Bags" = AT_FLAG_CLOTHES, "Food" = AT_FLAG_FOOD)
|
||||
|
||||
//I don't think we've ever altered these lists. making them static until someone actually overrides them somewhere.
|
||||
//Actual full digest modes
|
||||
@@ -321,6 +326,10 @@
|
||||
"autotransfer_secondary_blacklist",
|
||||
"autotransfer_whitelist",
|
||||
"autotransfer_blacklist",
|
||||
"autotransfer_secondary_whitelist_items",
|
||||
"autotransfer_secondary_blacklist_items",
|
||||
"autotransfer_whitelist_items",
|
||||
"autotransfer_blacklist_items",
|
||||
"autotransfer_min_amount",
|
||||
"autotransfer_max_amount",
|
||||
"slow_digestion",
|
||||
@@ -1724,9 +1733,15 @@
|
||||
/obj/belly/proc/check_autotransfer(var/atom/movable/prey)
|
||||
if(!(prey in contents) || !prey.autotransferable) return
|
||||
var/dest_belly_name
|
||||
if(autotransferlocation_secondary && prob(autotransferchance_secondary) && autotransfer_filter(prey, autotransfer_secondary_whitelist, autotransfer_secondary_blacklist))
|
||||
if(autotransferlocation_secondary && prob(autotransferchance_secondary))
|
||||
if(ismob(prey) && autotransfer_filter(prey, autotransfer_secondary_whitelist, autotransfer_secondary_blacklist))
|
||||
dest_belly_name = autotransferlocation_secondary
|
||||
if(autotransferlocation && prob(autotransferchance) && autotransfer_filter(prey, autotransfer_whitelist, autotransfer_blacklist))
|
||||
if(isitem(prey) && autotransfer_filter(prey, autotransfer_secondary_whitelist_items, autotransfer_secondary_blacklist_items))
|
||||
dest_belly_name = autotransferlocation_secondary
|
||||
if(autotransferlocation && prob(autotransferchance))
|
||||
if(ismob(prey) && autotransfer_filter(prey, autotransfer_whitelist, autotransfer_blacklist))
|
||||
dest_belly_name = autotransferlocation
|
||||
if(isitem(prey) && autotransfer_filter(prey, autotransfer_whitelist_items, autotransfer_blacklist_items))
|
||||
dest_belly_name = autotransferlocation
|
||||
if(!dest_belly_name) // Didn't transfer, so wait before retrying
|
||||
prey.belly_cycles = 0
|
||||
@@ -1742,6 +1757,7 @@
|
||||
|
||||
//Autotransfer filter CHOMPEdit Start
|
||||
/obj/belly/proc/autotransfer_filter(var/atom/movable/prey, var/whitelist, var/blacklist)
|
||||
if(ismob(prey))
|
||||
if(blacklist & autotransfer_flags_list["Absorbed"])
|
||||
if(isliving(prey))
|
||||
var/mob/living/L = prey
|
||||
@@ -1771,17 +1787,10 @@
|
||||
if(isliving(prey))
|
||||
var/mob/living/L = prey
|
||||
if(L.absorbable) return FALSE
|
||||
if(blacklist & autotransfer_flags_list["Items"])
|
||||
if(isitem(prey)) return FALSE
|
||||
if(blacklist & autotransfer_flags_list["Trash"])
|
||||
if(istype(prey, /obj/item/trash)) return FALSE
|
||||
if(blacklist & autotransfer_flags_list["Eggs"])
|
||||
if(istype(prey, /obj/item/weapon/storage/vore_egg)) return FALSE
|
||||
if(blacklist & autotransfer_flags_list["Remains"])
|
||||
if(istype(prey, /obj/item/weapon/digestion_remains)) return FALSE
|
||||
if(blacklist & autotransfer_flags_list["Indigestible Items"])
|
||||
if(prey in items_preserved) return FALSE
|
||||
|
||||
if(blacklist & autotransfer_flags_list["Full Health"])
|
||||
if(isliving(prey))
|
||||
var/mob/living/L = prey
|
||||
if((L.getOxyLoss() + L.getToxLoss() + L.getFireLoss() + L.getBruteLoss() + L.getCloneLoss()) == 0) return FALSE
|
||||
if(whitelist == 0) return TRUE
|
||||
if(whitelist & autotransfer_flags_list["Creatures"])
|
||||
if(isliving(prey)) return TRUE
|
||||
@@ -1811,16 +1820,52 @@
|
||||
if(isliving(prey))
|
||||
var/mob/living/L = prey
|
||||
if(L.absorbable) return TRUE
|
||||
if(whitelist & autotransfer_flags_list["Items"])
|
||||
if(whitelist & autotransfer_flags_list["Full Health"])
|
||||
if(isliving(prey))
|
||||
var/mob/living/L = prey
|
||||
if((L.getOxyLoss() + L.getToxLoss() + L.getFireLoss() + L.getBruteLoss() + L.getCloneLoss()) == 0) return TRUE
|
||||
else
|
||||
if(blacklist & autotransfer_flags_list_items["Items"])
|
||||
if(isitem(prey)) return FALSE
|
||||
if(blacklist & autotransfer_flags_list_items["Trash"])
|
||||
if(istype(prey, /obj/item/trash)) return FALSE
|
||||
if(blacklist & autotransfer_flags_list_items["Eggs"])
|
||||
if(istype(prey, /obj/item/weapon/storage/vore_egg)) return FALSE
|
||||
if(blacklist & autotransfer_flags_list_items["Remains"])
|
||||
if(istype(prey, /obj/item/weapon/digestion_remains)) return FALSE
|
||||
if(blacklist & autotransfer_flags_list_items["Indigestible Items"])
|
||||
if(prey in items_preserved) return FALSE
|
||||
if(blacklist & autotransfer_flags_list_items["Recyclable Items"])
|
||||
if(isitem(prey))
|
||||
var/obj/item/I = prey
|
||||
if(I.matter) return FALSE
|
||||
if(blacklist & autotransfer_flags_list_items["Ores"])
|
||||
if(istype(prey, /obj/item/weapon/ore)) return FALSE
|
||||
if(blacklist & autotransfer_flags_list_items["Clothes and Bags"])
|
||||
if(istype(prey, /obj/item/clothing) || istype(prey, /obj/item/weapon/storage)) return FALSE
|
||||
if(blacklist & autotransfer_flags_list_items["Food"])
|
||||
if(istype(prey, /obj/item/weapon/reagent_containers/food)) return FALSE
|
||||
if(whitelist == 0) return TRUE
|
||||
if(whitelist & autotransfer_flags_list_items["Items"])
|
||||
if(isitem(prey)) return TRUE
|
||||
if(whitelist & autotransfer_flags_list["Trash"])
|
||||
if(whitelist & autotransfer_flags_list_items["Trash"])
|
||||
if(istype(prey, /obj/item/trash)) return TRUE
|
||||
if(whitelist & autotransfer_flags_list["Eggs"])
|
||||
if(whitelist & autotransfer_flags_list_items["Eggs"])
|
||||
if(istype(prey, /obj/item/weapon/storage/vore_egg)) return TRUE
|
||||
if(whitelist & autotransfer_flags_list["Remains"])
|
||||
if(whitelist & autotransfer_flags_list_items["Remains"])
|
||||
if(istype(prey, /obj/item/weapon/digestion_remains)) return TRUE
|
||||
if(whitelist & autotransfer_flags_list["Indigestible Items"])
|
||||
if(whitelist & autotransfer_flags_list_items["Indigestible Items"])
|
||||
if(prey in items_preserved) return TRUE
|
||||
if(whitelist & autotransfer_flags_list_items["Recyclable Items"])
|
||||
if(isitem(prey))
|
||||
var/obj/item/I = prey
|
||||
if(I.matter) return TRUE
|
||||
if(whitelist & autotransfer_flags_list_items["Ores"])
|
||||
if(istype(prey, /obj/item/weapon/ore)) return TRUE
|
||||
if(whitelist & autotransfer_flags_list_items["Clothes and Bags"])
|
||||
if(istype(prey, /obj/item/clothing) || istype(prey, /obj/item/weapon/storage)) return TRUE
|
||||
if(whitelist & autotransfer_flags_list_items["Food"])
|
||||
if(istype(prey, /obj/item/weapon/reagent_containers/food)) return TRUE
|
||||
return FALSE //CHOMPEdit end
|
||||
|
||||
// Belly copies and then returns the copy
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
for(var/atom/movable/M in contents)
|
||||
if(!M || !M.autotransferable) continue
|
||||
// If the prey can't pass the filter of at least one transfer location, skip it
|
||||
if(!(autotransfer_filter(M, autotransfer_secondary_whitelist, autotransfer_secondary_blacklist) || autotransfer_filter(M, autotransfer_whitelist, autotransfer_blacklist))) continue
|
||||
if(ismob(M) && !(autotransfer_filter(M, autotransfer_secondary_whitelist, autotransfer_secondary_blacklist) || autotransfer_filter(M, autotransfer_whitelist, autotransfer_blacklist))) continue
|
||||
if(isitem(M) && !(autotransfer_filter(M, autotransfer_secondary_whitelist_items, autotransfer_secondary_blacklist_items) || autotransfer_filter(M, autotransfer_whitelist_items, autotransfer_blacklist_items))) continue
|
||||
M.belly_cycles++
|
||||
if(M.belly_cycles < autotransferwait / 60) continue
|
||||
autotransferables += M
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
// Ye default implementation.
|
||||
/obj/item/proc/digest_act(atom/movable/item_storage = null, touchable_amount, splashing = 0) //CHOMPEdit
|
||||
if(!digestable) //CHOMPAdd
|
||||
return FALSE //CHOMPAdd
|
||||
if(istype(item_storage, /obj/item/device/dogborg/sleeper))
|
||||
if(istype(src, /obj/item/device/pda))
|
||||
var/obj/item/device/pda/P = src
|
||||
@@ -206,6 +208,13 @@
|
||||
return FALSE
|
||||
. = ..()
|
||||
|
||||
/obj/item/ore_chunk/digest_act(atom/movable/item_storage = null) //CHOMPAdd
|
||||
if(isbelly(item_storage))
|
||||
var/obj/belly/B = item_storage
|
||||
if(istype(B) && B.recycling)
|
||||
return FALSE
|
||||
. = ..()
|
||||
|
||||
/////////////
|
||||
// Some more complicated stuff
|
||||
/////////////
|
||||
|
||||
@@ -352,6 +352,16 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
|
||||
if(selected.autotransfer_blacklist & selected.autotransfer_flags_list[flag_name])
|
||||
at_blacklist.Add(flag_name)
|
||||
selected_list["autotransfer"]["autotransfer_blacklist"] = at_blacklist
|
||||
var/list/at_whitelist_items = list()
|
||||
for(var/flag_name in selected.autotransfer_flags_list_items)
|
||||
if(selected.autotransfer_whitelist_items & selected.autotransfer_flags_list_items[flag_name])
|
||||
at_whitelist_items.Add(flag_name)
|
||||
selected_list["autotransfer"]["autotransfer_whitelist_items"] = at_whitelist_items
|
||||
var/list/at_blacklist_items = list()
|
||||
for(var/flag_name in selected.autotransfer_flags_list_items)
|
||||
if(selected.autotransfer_blacklist_items & selected.autotransfer_flags_list_items[flag_name])
|
||||
at_blacklist_items.Add(flag_name)
|
||||
selected_list["autotransfer"]["autotransfer_blacklist_items"] = at_blacklist_items
|
||||
var/list/at_secondary_whitelist = list()
|
||||
for(var/flag_name in selected.autotransfer_flags_list)
|
||||
if(selected.autotransfer_secondary_whitelist & selected.autotransfer_flags_list[flag_name])
|
||||
@@ -362,6 +372,16 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
|
||||
if(selected.autotransfer_secondary_blacklist & selected.autotransfer_flags_list[flag_name])
|
||||
at_secondary_blacklist.Add(flag_name)
|
||||
selected_list["autotransfer"]["autotransfer_secondary_blacklist"] = at_secondary_blacklist
|
||||
var/list/at_secondary_whitelist_items = list()
|
||||
for(var/flag_name in selected.autotransfer_flags_list_items)
|
||||
if(selected.autotransfer_secondary_whitelist_items & selected.autotransfer_flags_list_items[flag_name])
|
||||
at_secondary_whitelist_items.Add(flag_name)
|
||||
selected_list["autotransfer"]["autotransfer_secondary_whitelist_items"] = at_secondary_whitelist_items
|
||||
var/list/at_secondary_blacklist_items = list()
|
||||
for(var/flag_name in selected.autotransfer_flags_list_items)
|
||||
if(selected.autotransfer_secondary_blacklist_items & selected.autotransfer_flags_list_items[flag_name])
|
||||
at_secondary_blacklist_items.Add(flag_name)
|
||||
selected_list["autotransfer"]["autotransfer_secondary_blacklist_items"] = at_secondary_blacklist_items
|
||||
//CHOMPAdd END
|
||||
|
||||
selected_list["disable_hud"] = selected.disable_hud
|
||||
@@ -2853,6 +2873,35 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
|
||||
return FALSE
|
||||
host.vore_selected.autotransfer_secondary_blacklist ^= host.vore_selected.autotransfer_flags_list[toggle_addon]
|
||||
. = TRUE
|
||||
. = TRUE
|
||||
if("b_autotransfer_whitelist_items")
|
||||
var/list/menu_list = host.vore_selected.autotransfer_flags_list_items.Copy()
|
||||
var/toggle_addon = tgui_input_list(usr, "Toggle Whitelist", "Whitelist Choice", menu_list)
|
||||
if(!toggle_addon)
|
||||
return FALSE
|
||||
host.vore_selected.autotransfer_whitelist_items ^= host.vore_selected.autotransfer_flags_list_items[toggle_addon]
|
||||
. = TRUE
|
||||
if("b_autotransfer_blacklist_items")
|
||||
var/list/menu_list = host.vore_selected.autotransfer_flags_list_items.Copy()
|
||||
var/toggle_addon = tgui_input_list(usr, "Toggle Blacklist", "Blacklist Choice", menu_list)
|
||||
if(!toggle_addon)
|
||||
return FALSE
|
||||
host.vore_selected.autotransfer_blacklist_items ^= host.vore_selected.autotransfer_flags_list_items[toggle_addon]
|
||||
. = TRUE
|
||||
if("b_autotransfer_secondary_whitelist_items")
|
||||
var/list/menu_list = host.vore_selected.autotransfer_flags_list_items.Copy()
|
||||
var/toggle_addon = tgui_input_list(usr, "Toggle Whitelist", "Whitelist Choice", menu_list)
|
||||
if(!toggle_addon)
|
||||
return FALSE
|
||||
host.vore_selected.autotransfer_secondary_whitelist_items ^= host.vore_selected.autotransfer_flags_list_items[toggle_addon]
|
||||
. = TRUE
|
||||
if("b_autotransfer_secondary_blacklist_items")
|
||||
var/list/menu_list = host.vore_selected.autotransfer_flags_list_items.Copy()
|
||||
var/toggle_addon = tgui_input_list(usr, "Toggle Blacklist", "Blacklist Choice", menu_list)
|
||||
if(!toggle_addon)
|
||||
return FALSE
|
||||
host.vore_selected.autotransfer_secondary_blacklist_items ^= host.vore_selected.autotransfer_flags_list_items[toggle_addon]
|
||||
. = TRUE
|
||||
if("b_autotransfer_min_amount")
|
||||
var/autotransfer_min_amount_input = input(user, "Set the minimum amount of items your belly can belly auto-transfer at once. Set to 0 for no limit.", "Auto-Transfer Min Amount") as num|null
|
||||
if(!isnull(autotransfer_min_amount_input))
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
var/list/ckeys_allowed_itemspawn = list()
|
||||
var/user_vars_to_edit //fun times :3 - pretty much just grabbed from tg immabehonest - list(variable_name = variable_value) eg list("name" = "Wizardly Wizard", "real_name" = "Wizardly Wizard")
|
||||
var/user_vars_remembered //not needed for manual editing, just stores the original vars from the above list to make sure they go back to normal later
|
||||
var/digestable = TRUE
|
||||
|
||||
/obj/item/proc/item_tf_spawnpoint_set()
|
||||
if(!item_tf_spawn_allowed)
|
||||
@@ -48,3 +49,11 @@
|
||||
if(user.vars[variable] == user_vars_to_edit[variable])
|
||||
user.vars[variable] = user_vars_remembered[variable]
|
||||
user_vars_remembered = initial(user_vars_remembered)
|
||||
|
||||
/obj/item/verb/toggle_digestable()
|
||||
set category = "Object"
|
||||
set name = "Toggle Digestable"
|
||||
set desc = "Toggle item's digestability."
|
||||
digestable = !digestable
|
||||
if(!digestable)
|
||||
to_chat(usr, "<span class='notice'>[src] is now protected from digestion.</span>")
|
||||
@@ -260,6 +260,16 @@
|
||||
if(B.autotransfer_blacklist & B.autotransfer_flags_list[flag_name])
|
||||
at_blacklist.Add(flag_name)
|
||||
belly_data["autotransfer_blacklist"] = at_blacklist
|
||||
var/list/at_whitelist_items = list()
|
||||
for(var/flag_name in B.autotransfer_flags_list_items)
|
||||
if(B.autotransfer_whitelist_items & B.autotransfer_flags_list_items[flag_name])
|
||||
at_whitelist_items.Add(flag_name)
|
||||
belly_data["autotransfer_whitelist_items"] = at_whitelist_items
|
||||
var/list/at_blacklist_items = list()
|
||||
for(var/flag_name in B.autotransfer_flags_list_items)
|
||||
if(B.autotransfer_blacklist_items & B.autotransfer_flags_list_items[flag_name])
|
||||
at_blacklist_items.Add(flag_name)
|
||||
belly_data["autotransfer_blacklist_items"] = at_blacklist_items
|
||||
var/list/at_secondary_whitelist = list()
|
||||
for(var/flag_name in B.autotransfer_flags_list)
|
||||
if(B.autotransfer_secondary_whitelist & B.autotransfer_flags_list[flag_name])
|
||||
@@ -270,6 +280,16 @@
|
||||
if(B.autotransfer_secondary_blacklist & B.autotransfer_flags_list[flag_name])
|
||||
at_secondary_blacklist.Add(flag_name)
|
||||
belly_data["autotransfer_secondary_blacklist"] = at_secondary_blacklist
|
||||
var/list/at_secondary_whitelist_items = list()
|
||||
for(var/flag_name in B.autotransfer_flags_list_items)
|
||||
if(B.autotransfer_secondary_whitelist_items & B.autotransfer_flags_list_items[flag_name])
|
||||
at_secondary_whitelist_items.Add(flag_name)
|
||||
belly_data["autotransfer_secondary_whitelist_items"] = at_secondary_whitelist_items
|
||||
var/list/at_secondary_blacklist_items = list()
|
||||
for(var/flag_name in B.autotransfer_flags_list_items)
|
||||
if(B.autotransfer_secondary_blacklist_items & B.autotransfer_flags_list_items[flag_name])
|
||||
at_secondary_blacklist_items.Add(flag_name)
|
||||
belly_data["autotransfer_secondary_blacklist_items"] = at_secondary_blacklist_items
|
||||
|
||||
// Liquid Options
|
||||
belly_data["show_liquids"] = B.show_liquids
|
||||
|
||||
@@ -1603,7 +1603,7 @@ const VoreSelectedBellyInteractions = (props, context) => {
|
||||
}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Auto-Transfer Primary Whitelist">
|
||||
<LabeledList.Item label="Auto-Transfer Primary Whitelist (Mobs)">
|
||||
{(autotransfer.autotransfer_whitelist.length &&
|
||||
autotransfer.autotransfer_whitelist.join(', ')) ||
|
||||
'Everything'}
|
||||
@@ -1617,7 +1617,21 @@ const VoreSelectedBellyInteractions = (props, context) => {
|
||||
icon="plus"
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Auto-Transfer Primary Blacklist">
|
||||
<LabeledList.Item label="Auto-Transfer Primary Whitelist (Items)">
|
||||
{(autotransfer.autotransfer_whitelist_items.length &&
|
||||
autotransfer.autotransfer_whitelist_items.join(', ')) ||
|
||||
'Everything'}
|
||||
<Button
|
||||
onClick={() =>
|
||||
act('set_attribute', {
|
||||
attribute: 'b_autotransfer_whitelist_items',
|
||||
})
|
||||
}
|
||||
ml={1}
|
||||
icon="plus"
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Auto-Transfer Primary Blacklist (Mobs)">
|
||||
{(autotransfer.autotransfer_blacklist.length &&
|
||||
autotransfer.autotransfer_blacklist.join(', ')) ||
|
||||
'Nothing'}
|
||||
@@ -1631,6 +1645,20 @@ const VoreSelectedBellyInteractions = (props, context) => {
|
||||
icon="plus"
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Auto-Transfer Primary Blacklist (Items)">
|
||||
{(autotransfer.autotransfer_blacklist_items.length &&
|
||||
autotransfer.autotransfer_blacklist_items.join(', ')) ||
|
||||
'Nothing'}
|
||||
<Button
|
||||
onClick={() =>
|
||||
act('set_attribute', {
|
||||
attribute: 'b_autotransfer_blacklist_items',
|
||||
})
|
||||
}
|
||||
ml={1}
|
||||
icon="plus"
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Divider />
|
||||
<LabeledList.Item label="Auto-Transfer Secondary Chance">
|
||||
<Button
|
||||
@@ -1656,7 +1684,7 @@ const VoreSelectedBellyInteractions = (props, context) => {
|
||||
}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Auto-Transfer Secondary Whitelist">
|
||||
<LabeledList.Item label="Auto-Transfer Secondary Whitelist (Mobs)">
|
||||
{(autotransfer.autotransfer_secondary_whitelist.length &&
|
||||
autotransfer.autotransfer_secondary_whitelist.join(', ')) ||
|
||||
'Everything'}
|
||||
@@ -1670,7 +1698,23 @@ const VoreSelectedBellyInteractions = (props, context) => {
|
||||
icon="plus"
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Auto-Transfer Secondary Blacklist">
|
||||
<LabeledList.Item label="Auto-Transfer Secondary Whitelist (Items)">
|
||||
{(autotransfer.autotransfer_secondary_whitelist_items.length &&
|
||||
autotransfer.autotransfer_secondary_whitelist_items.join(
|
||||
', '
|
||||
)) ||
|
||||
'Everything'}
|
||||
<Button
|
||||
onClick={() =>
|
||||
act('set_attribute', {
|
||||
attribute: 'b_autotransfer_secondary_whitelist_items',
|
||||
})
|
||||
}
|
||||
ml={1}
|
||||
icon="plus"
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Auto-Transfer Secondary Blacklist (Mobs)">
|
||||
{(autotransfer.autotransfer_secondary_blacklist.length &&
|
||||
autotransfer.autotransfer_secondary_blacklist.join(', ')) ||
|
||||
'Nothing'}
|
||||
@@ -1684,6 +1728,22 @@ const VoreSelectedBellyInteractions = (props, context) => {
|
||||
icon="plus"
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Auto-Transfer Secondary Blacklist (Items)">
|
||||
{(autotransfer.autotransfer_secondary_blacklist_items.length &&
|
||||
autotransfer.autotransfer_secondary_blacklist_items.join(
|
||||
', '
|
||||
)) ||
|
||||
'Nothing'}
|
||||
<Button
|
||||
onClick={() =>
|
||||
act('set_attribute', {
|
||||
attribute: 'b_autotransfer_secondary_blacklist_items',
|
||||
})
|
||||
}
|
||||
ml={1}
|
||||
icon="plus"
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
) : (
|
||||
'These options only display while Auto-Transfer is enabled.'
|
||||
|
||||
@@ -54,11 +54,16 @@ const AutotransferFlagIcon = {
|
||||
'Dead': '',
|
||||
'Digestable Creatures': '',
|
||||
'Absorbable Creatures': '',
|
||||
'Full Health': '',
|
||||
'Items': '',
|
||||
'Trash': '',
|
||||
'Eggs': '',
|
||||
'Remains': '',
|
||||
'Indigestible Items': '',
|
||||
'Recyclable Items': '',
|
||||
'Ores': '',
|
||||
'Clothes and Bags': '',
|
||||
'Food': '',
|
||||
};
|
||||
|
||||
const GetAddons = (addons: string[]) => {
|
||||
@@ -259,6 +264,10 @@ type Belly = {
|
||||
autotransfer_blacklist: string[];
|
||||
autotransfer_secondary_whitelist: string[];
|
||||
autotransfer_secondary_blacklist: string[];
|
||||
autotransfer_whitelist_items: string[];
|
||||
autotransfer_blacklist_items: string[];
|
||||
autotransfer_secondary_whitelist_items: string[];
|
||||
autotransfer_secondary_blacklist_items: string[];
|
||||
|
||||
// Liquid Options
|
||||
show_liquids: BooleanLike;
|
||||
@@ -423,6 +432,10 @@ const generateBellyString = (belly: Belly, index: number) => {
|
||||
autotransfer_blacklist,
|
||||
autotransfer_secondary_whitelist,
|
||||
autotransfer_secondary_blacklist,
|
||||
autotransfer_whitelist_items,
|
||||
autotransfer_blacklist_items,
|
||||
autotransfer_secondary_whitelist_items,
|
||||
autotransfer_secondary_blacklist_items,
|
||||
|
||||
// Liquid Options
|
||||
show_liquids,
|
||||
@@ -776,12 +789,16 @@ const generateBellyString = (belly: Belly, index: number) => {
|
||||
result += '<li class="list-group-item">Auto-Transfer Max Amount: ' + autotransfer_max_amount + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Primary Chance: ' + autotransferchance + '%</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Primary Location: ' + autotransferlocation + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Primary Whitelist: ' + GetAutotransferFlags(autotransfer_whitelist, true) + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Primary Blacklist: ' + GetAutotransferFlags(autotransfer_blacklist, false) + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Primary Whitelist (Mobs): ' + GetAutotransferFlags(autotransfer_whitelist, true) + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Primary Whitelist (Items): ' + GetAutotransferFlags(autotransfer_whitelist_items, true) + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Primary Blacklist (Mobs): ' + GetAutotransferFlags(autotransfer_blacklist, false) + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Primary Blacklist (Items): ' + GetAutotransferFlags(autotransfer_blacklist_items, false) + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Secondary Chance: ' + autotransferchance_secondary + '%</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Secondary Location: ' + autotransferlocation_secondary + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Secondary Whitelist: ' + GetAutotransferFlags(autotransfer_secondary_whitelist, true) + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Secondary Blacklist: ' + GetAutotransferFlags(autotransfer_secondary_blacklist, false) + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Secondary Whitelist (Mobs): ' + GetAutotransferFlags(autotransfer_secondary_whitelist, true) + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Secondary Whitelist (Items): ' + GetAutotransferFlags(autotransfer_secondary_whitelist_items, true) + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Secondary Blacklist (Mobs): ' + GetAutotransferFlags(autotransfer_secondary_blacklist, false) + '</li>';
|
||||
result += '<li class="list-group-item">Auto-Transfer Secondary Blacklist (Items): ' + GetAutotransferFlags(autotransfer_secondary_blacklist_items, false) + '</li>';
|
||||
result += '</ul>';
|
||||
result += '</div></div></div>';
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user