custom egg size (#8090)

This commit is contained in:
Kashargul
2024-03-28 23:00:18 +01:00
committed by GitHub
parent 5a26e4455f
commit d62700cfa5
5 changed files with 45 additions and 4 deletions
+3
View File
@@ -49,6 +49,7 @@
var/egg_type = "Egg" // Default egg type and path.
var/egg_path = /obj/item/weapon/storage/vore_egg
var/egg_name = null // CHOMPAdd. Custom egg name
var/egg_size = 0 // CHOMPAdd. Custom egg size
var/list/list/emote_lists = list() // Idle emotes that happen on their own, depending on the bellymode. Contains lists of strings indexed by bellymode
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?
@@ -439,6 +440,7 @@
"sound_volume",
"speedy_mob_processing",
"egg_name",
"egg_size",
"recycling",
"storing_nutrition",
"is_feedable",
@@ -2489,6 +2491,7 @@
dupe.slow_brutal = slow_brutal
dupe.sound_volume = sound_volume
dupe.egg_name = egg_name
dupe.egg_size = egg_size
dupe.recycling = recycling
dupe.storing_nutrition = storing_nutrition
dupe.is_feedable = is_feedable
@@ -276,8 +276,12 @@ GLOBAL_LIST_INIT(digest_modes, list())
B.ownegg.w_class = I.w_class
B.ownegg.max_storage_space = B.ownegg.w_class
I.forceMove(B.ownegg)
B.ownegg.icon_scale_x = 0.2 * B.ownegg.w_class
B.ownegg.icon_scale_y = 0.2 * B.ownegg.w_class
if(B.egg_size)
B.ownegg.icon_scale_x = B.egg_size
B.ownegg.icon_scale_y = B.egg_size
else
B.ownegg.icon_scale_x = 0.2 * B.ownegg.w_class
B.ownegg.icon_scale_y = 0.2 * B.ownegg.w_class
B.ownegg.update_transform()
egg_contents -= I
B.ownegg = null
@@ -305,8 +309,12 @@ GLOBAL_LIST_INIT(digest_modes, list())
B.ownegg.calibrate_size()
B.ownegg.orient2hud()
B.ownegg.w_class = clamp(B.ownegg.w_class * 0.25, 1, 8) //A total w_class of 16 will result in a backpack sized egg.
B.ownegg.icon_scale_x = clamp(0.25 * B.ownegg.w_class, 0.25, scale_clamp)
B.ownegg.icon_scale_y = clamp(0.25 * B.ownegg.w_class, 0.25, scale_clamp)
if(B.egg_size)
B.ownegg.icon_scale_x = B.egg_size
B.ownegg.icon_scale_y = B.egg_size
else
B.ownegg.icon_scale_x = clamp(0.25 * B.ownegg.w_class, 0.25, scale_clamp)
B.ownegg.icon_scale_y = clamp(0.25 * B.ownegg.w_class, 0.25, scale_clamp)
B.ownegg.update_transform()
if(B.ownegg.w_class > 4)
B.ownegg.slowdown = 4 //CHOMPEdit End
+22
View File
@@ -226,6 +226,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
"is_feedable" = selected.is_feedable, //CHOMPAdd
"egg_type" = selected.egg_type,
"egg_name" = selected.egg_name, //CHOMPAdd
"egg_size" = selected.egg_size, //CHOMPAdd
"recycling" = selected.recycling, //CHOMPAdd
"storing_nutrition" = selected.storing_nutrition, //CHOMPAdd
"entrance_logs" = selected.entrance_logs, //CHOMPAdd
@@ -321,6 +322,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
selected_list["egg_type"] = selected.egg_type
selected_list["egg_name"] = selected.egg_name //CHOMPAdd
selected_list["egg_size"] = selected.egg_size //CHOMPAdd
selected_list["recycling"] = selected.recycling //CHOMPAdd
selected_list["storing_nutrition"] = selected.storing_nutrition //CHOMPAdd
selected_list["item_digest_logs"] = selected.item_digest_logs //CHOMPAdd
@@ -1080,6 +1082,13 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
if(length(new_egg_name) >= BELLIES_NAME_MIN && length(new_egg_name) <= BELLIES_NAME_MAX)
new_belly.egg_name = new_egg_name
if(istext(belly_data["egg_size"]))
var/new_egg_size = belly_data["egg_size"]
if(new_egg_size == 0)
new_belly.egg_size = 0
else
new_belly.egg_size = CLAMP(new_egg_size,0.25,2)
if(isnum(belly_data["recycling"]))
var/new_recycling = belly_data["recycling"]
if(new_recycling == 0)
@@ -2623,6 +2632,19 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
return FALSE
host.vore_selected.egg_name = new_egg_name
. = TRUE
if("b_egg_size")
var/new_egg_size = tgui_input_number(usr,"Custom Egg Size 25% to 200% (0 for automatic item depending egg size from 25% to 100%)","New Egg Size", 0, 200)
if(new_egg_size == null)
return FALSE
if(new_egg_size == 0) //Disable.
host.vore_selected.egg_size = 0
to_chat(user,"<span class='notice'>Eggs will automatically calculate size depending on contents.</span>")
else if (!ISINRANGE(new_egg_size,25,200))
host.vore_selected.egg_size = 0.25 //Set it to the default.
to_chat(user,"<span class='notice'>Invalid size.</span>")
else if(new_egg_size)
host.vore_selected.egg_size = (new_egg_size/100)
. = TRUE
if("b_recycling")
host.vore_selected.recycling = !host.vore_selected.recycling
. = TRUE
@@ -275,6 +275,7 @@
belly_data["vorespawn_blacklist"] = B.vorespawn_blacklist
belly_data["egg_type"] = B.egg_type
belly_data["egg_name"] = B.egg_name
belly_data["egg_size"] = B.egg_size
belly_data["selective_preference"] = B.selective_preference
belly_data["recycling"] = B.recycling
belly_data["storing_nutrition"] = B.storing_nutrition
@@ -27,6 +27,7 @@ export const VoreSelectedBellyOptions = (props) => {
contaminate_color,
egg_type,
egg_name,
egg_size,
recycling,
storing_nutrition,
entrance_logs,
@@ -233,6 +234,12 @@ export const VoreSelectedBellyOptions = (props) => {
content={egg_name ? egg_name : 'Default'}
/>
</LabeledList.Item>
<LabeledList.Item label="Custom Egg Size">
<Button
onClick={() => act('set_attribute', { attribute: 'b_egg_size' })}
content={egg_size ? egg_size * 100 + '%' : 'Automatic'}
/>
</LabeledList.Item>
<LabeledList.Item label="Recycling">
<Button
onClick={() => act('set_attribute', { attribute: 'b_recycling' })}