Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Borg Multibelly, Glowing stomachs. #714

Merged
merged 6 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions code/game/Rogue Star/cyborgs/example/borg_example.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// This file contains an example of an engineering borg that contains multistomach capability.
//In this folder as well, you will find a .dmi that contains

// EXAMPLES are written next to each line

/*
/datum/robot_sprite/dogborg/engineering/EXAMPLE
name = "EXAMPLE"
sprite_icon_state = "engi"
sprite_hud_icon_state = "engi"
has_eye_sprites = TRUE //engi-eyes
has_eye_light_sprites = TRUE //engi-lights
has_sleeper_light_indicator = FALSE //We have multibelly! No sleeper lights!
has_vore_belly_resting_sprites = TRUE //engi-belly-1-bellyup & engi-belly-2-bellyup
sprite_icon = 'code/game/Rogue Star/cyborgs/example/example.dmi'
rest_sprite_options = list("Default", "Bellyup", "Sit") //engi-rest, engi-bellyup, engi-sit (in that order)

/////////////////////////////////////////////////////////////////
/// The "belly_capacity_list" is how many states you want each belly AND what bellies we have!
/// This also communicates what stomach sprites we have!
/// You can have AS MANY AS YOU WANT.
/// In order:
/// Belly: engi-belly-1 & engi-belly-2
/// Throat: engi-throat-1 & engi-throat-2
/// Tail: engi-tail-1 & engi-tail-2
/// Etc Etc
belly_capacity_list = list("belly" = 2, "throat" = 2, "tail" = 2)
/////////////////////////////////////////////////////////////////

/obj/item/weapon/robot_module/robot/engineering/EXAMPLE
name = "engineering EXAMPLE robot module"

/obj/item/weapon/robot_module/robot/engineering/EXAMPLE/create_equipment(var/mob/living/silicon/robot/robot)
..()
robot.vore_capacity = 1 //Leave this be. Unimportant.
robot.vore_capacity_ex = list("belly" = 2, "throat" = 2, "tail" = 2) //Copy & paste the list you have for the 'belly_capacity_list' here!
/*
Binary file not shown.
59 changes: 37 additions & 22 deletions code/modules/mob/living/carbon/human/human_rs.dm
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
/mob/living/carbon/human
var/vore_capacity = 3
var/vore_capacity_ex = list("stomach" = 3, "taur belly" = 3)
var/vore_fullness_ex = list("stomach" = 0, "taur belly" = 0)
var/vore_icon_bellies = list("stomach", "taur belly")
vore_capacity = 3
vore_capacity_ex = list("stomach" = 3, "taur belly" = 3)
vore_fullness_ex = list("stomach" = 0, "taur belly" = 0)
vore_icon_bellies = list("stomach", "taur belly")
var/struggle_anim_stomach = FALSE
var/struggle_anim_taur = FALSE
var/vore_sprite_color = list("stomach" = "#FFFFFF", "taur belly" = "#FFFFFF")
var/vore_sprite_multiply = list("stomach" = TRUE, "taur belly" = TRUE)
var/vore_fullness = 0
vore_sprite_color = list("stomach" = "#FFFFFF", "taur belly" = "#FFFFFF")
vore_sprite_multiply = list("stomach" = TRUE, "taur belly" = TRUE)
vore_fullness = 0
var/allow_contaminate = TRUE
var/allow_stripping = TRUE

/mob/living/carbon/human/proc/update_fullness()
var/list/new_fullness = list()
vore_fullness = 0
for(var/belly_class in vore_icon_bellies)
new_fullness[belly_class] = 0
for(var/obj/belly/B as anything in vore_organs)
new_fullness[B.belly_sprite_to_affect] += B.GetFullnessFromBelly()
for(var/belly_class in vore_icon_bellies)
new_fullness[belly_class] /= size_multiplier //Divided by pred's size so a macro mob won't get macro belly from a regular prey.
new_fullness[belly_class] = round(new_fullness[belly_class], 1) // Because intervals of 0.25 are going to make sprite artists cry.
vore_fullness_ex[belly_class] = min(vore_capacity_ex[belly_class], new_fullness[belly_class])
vore_fullness += new_fullness[belly_class]
vore_fullness = min(vore_capacity, vore_fullness)
update_vore_belly_sprite()
update_vore_tail_sprite()
/mob/living/carbon/human/update_fullness(var/returning = FALSE)
if(!returning)
if(updating_fullness)
return
var/previous_stomach_fullness = vore_fullness_ex["stomach"]
var/previous_taur_fullness = vore_fullness_ex["taur belly"]
//update_vore_tail_sprite()
//update_vore_belly_sprite()
var/list/new_fullness = ..(TRUE)
. = new_fullness
for(var/datum/category_group/underwear/undergarment_class in global_underwear.categories) //RS note: I'm not too 100% sure on what this does. Our TGUI has an 'undergarment addition' in it at the time of porting this from CS but this isn't able to be enabled. From the looks of it, it has to do with PR #6096 on Chomp to allow underwear bulging out when prey are eaten...Very clever way of implying a /certain/ thing! Perhaps worth looking into in the future to give people a 'stomach' for THOSE TWO vore types without being overt or getting into trouble.
if(!new_fullness[undergarment_class.name])
continue
new_fullness[undergarment_class.name] = -1 * round(-1 * new_fullness[undergarment_class.name]) // Doing a ceiling the only way BYOND knows how I guess
new_fullness[undergarment_class.name] = (min(2, new_fullness[undergarment_class.name]) - 2) * -1 //Complicated stuff to get it correctly aligned with the expected TRUE/FALSE
var/datum/category_item/underwear/UWI = all_underwear[undergarment_class.name]
if(!UWI || UWI.name == "None")
//Welllll okay then. If the former then something went wrong, if None was selected then...
if(istype(undergarment_class.items_by_name[new_fullness[undergarment_class.name + "-ifnone"]], /datum/category_item/underwear))
UWI = undergarment_class.items_by_name[new_fullness[undergarment_class.name + "-ifnone"]]
all_underwear[undergarment_class.name] = UWI
if(UWI && UWI.has_color && new_fullness[undergarment_class.name + "-color"])
all_underwear_metadata[undergarment_class.name]["[gear_tweak_free_color_choice]"] = new_fullness[undergarment_class.name + "-color"]
if(UWI && UWI.name != "None" && hide_underwear[undergarment_class.name] != new_fullness[undergarment_class.name])
hide_underwear[undergarment_class.name] = new_fullness[undergarment_class.name]
update_underwear(1)
if(vore_fullness_ex["stomach"] != previous_stomach_fullness)
update_vore_belly_sprite()
if(vore_fullness_ex["taur belly"] != previous_taur_fullness)
update_vore_tail_sprite()

/mob/living/carbon/human/proc/vs_animate(var/belly_to_animate)
if(belly_to_animate == "stomach")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@

choices += "Change amount"
choices += "Change verb"
choices += "Chemical refresher"
choices += "Chemical Refresher"

var/choice = tgui_alert(src, "Do you wish to inject somebody or adjust settings?", "Selection List", choices)

Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/human/update_icons_rs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
var/icon/vorebelly_s = new/icon(icon = 'icons/mob/vore/Bellies.dmi', icon_state = "[species.vore_belly_default_variant]Belly[vs_fullness][struggle_anim_stomach ? "" : " idle"]")
vorebelly_s.Blend(vore_sprite_color["stomach"], vore_sprite_multiply["stomach"] ? ICON_MULTIPLY : ICON_ADD)
var/image/working = image(vorebelly_s)
if(glowy_belly)
working.plane = PLANE_LIGHTING_ABOVE
working.overlays += em_block_image_generic(working)
return working
return null
Expand Down Expand Up @@ -58,6 +60,8 @@
working.pixel_x = -16
if(tail_style.em_block)
working.overlays += em_block_image_generic(working)
if(glowy_belly)
working.plane = PLANE_LIGHTING_ABOVE
return working
return null

Expand Down
163 changes: 138 additions & 25 deletions code/modules/mob/living/silicon/robot/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@
)

var/has_recoloured = FALSE //RS Add || Port Virgo PR 15836
//RS Edit Start CS Port
//Multibelly support. We do not want to apply it to any module not supporting it in it's sprites
var/list/vore_light_states = list() //Robot exclusive
vore_capacity_ex = list()
vore_fullness_ex = list()
vore_icon_bellies = list()
//RS Edit End

/mob/living/silicon/robot/New(loc, var/unfinished = 0)
spark_system = new /datum/effect/effect/system/spark_spread()
Expand Down Expand Up @@ -409,6 +416,27 @@
handle_light()
update_icon()

//RS Edit Start: Allows robots to also have a 'glow' if they have a naturally glowing belly or something of the sort.
//Instead of turning this ON / OFF EVERY SINGLE TICK like robot's update_icon does (it destroys the overlays and rebuilds them)
//We're going to just give them the verbs to toggle their natural glow.
/mob/living/silicon/robot/verb/toggle_glow()
set name = "Glow (Toggle)"
set category = "Abilities"
set desc = "Toggle your glowing on/off!"
glow_toggle = !glow_toggle

to_chat(src,"<span class='notice'>You <b>[glow_toggle ? "en" : "dis"]</b>able your body's glow.</span>")

/mob/living/silicon/robot/verb/change_glow_color()
set name = "Glow (Set Color)"
set category = "Abilities"
set desc = "Pick a color for your body's glow."

var/new_color = input(src,"Select a new color","Body Glow",glow_color) as color
if(new_color)
glow_color = new_color
//RS Edit End

/mob/living/silicon/robot/verb/self_diagnosis_verb()
set category = "Robot Commands"
set name = "Self Diagnosis"
Expand Down Expand Up @@ -757,6 +785,25 @@

return

//RS Edit Start CS Edit
/mob/living/silicon/robot/proc/reset_belly_lights(var/b_class)
if(sprite_datum.belly_light_list.len && sprite_datum.belly_light_list.Find(b_class))
vore_light_states[b_class] = 0

/mob/living/silicon/robot/proc/update_belly_lights(var/b_class)
if(sprite_datum.belly_light_list.len && sprite_datum.belly_light_list.Find(b_class))
vore_light_states[b_class] = 2
for (var/belly in vore_organs)
var/obj/belly/B = belly
if(b_class == "sleeper" && (B.silicon_belly_overlay_preference == "Vorebelly" || B.silicon_belly_overlay_preference == "Both") || b_class != "sleeper")
if(B.digest_mode != DM_DIGEST || B.belly_sprite_to_affect != b_class || !B.contents.len)
continue
for(var/contents in B.contents)
if(istype(contents, /mob/living))
vore_light_states[b_class] = 1
return
//RS Edit End

/mob/living/silicon/robot/proc/module_reset()
transform_with_anim() //VOREStation edit: sprite animation
uneq_all()
Expand All @@ -769,6 +816,13 @@
module = null
updatename("Default")
has_recoloured = FALSE //RS Add || Port Virgo PR 15836
//RS Edit Start CS Port
// We only use the chomp system when the sprite supports it. Else we go through the fallback
vore_capacity_ex = list()
vore_fullness_ex = list()
vore_light_states = list()
update_multibelly()
//RS Edit End

/mob/living/silicon/robot/proc/ColorMate() //RS Add Start|| Port Virgo PR 15836
set name = "Recolour Module"
Expand Down Expand Up @@ -887,6 +941,7 @@
return

cut_overlays()
handle_status_indicators() //CHOMPAdd, needed as we don't have priority overlays anymore

icon = sprite_datum.sprite_icon
icon_state = sprite_datum.sprite_icon_state
Expand All @@ -898,35 +953,41 @@
old_x = sprite_datum.pixel_x

if(stat == CONSCIOUS)
var/show_belly = FALSE
if(sprite_datum.has_vore_belly_sprites)
if(vore_selected.silicon_belly_overlay_preference == "Sleeper")
if(sleeper_state)
show_belly = TRUE
else if(vore_selected.silicon_belly_overlay_preference == "Vorebelly")
if(LAZYLEN(vore_selected.contents) >= vore_selected.visible_belly_minimum_prey)
if(vore_selected.overlay_min_prey_size == 0) //if min size is 0, we dont check for size
show_belly = TRUE
else
if(vore_selected.override_min_prey_size && (LAZYLEN(vore_selected.contents) > vore_selected.override_min_prey_num))
show_belly = TRUE //Override regardless of content size
else
for(var/content in vore_selected.contents) //If ANY in belly are big enough, we set to true
if(!istype(content, /mob/living)) continue
var/mob/living/prey = content
if(prey.size_multiplier >= vore_selected.overlay_min_prey_size)
show_belly = TRUE
break
if(show_belly)
add_overlay(sprite_datum.get_belly_overlay(src))
update_fullness()
for(var/belly_class in vore_fullness_ex)
reset_belly_lights(belly_class)
var/vs_fullness = vore_fullness_ex[belly_class]
if(belly_class == "sleeper" && sleeper_state == 0 && vore_selected.silicon_belly_overlay_preference == "Sleeper") continue
if(belly_class == "sleeper" && sleeper_state != 0 && !(vs_fullness + 1 > vore_capacity_ex[belly_class]))
if(vore_selected.silicon_belly_overlay_preference == "Sleeper")
vs_fullness = vore_capacity_ex[belly_class]
else if(vore_selected.silicon_belly_overlay_preference == "Both")
vs_fullness += 1
if(!vs_fullness > 0) continue
if(resting)
if(!sprite_datum.has_vore_belly_resting_sprites)
continue


if(glowy_belly)
var/image/belly_sprite = image(icon, sprite_datum.get_belly_resting_overlay(src, vs_fullness, belly_class))
belly_sprite.plane = PLANE_LIGHTING_ABOVE
add_overlay(belly_sprite)
else
add_overlay(sprite_datum.get_belly_resting_overlay(src, vs_fullness, belly_class))
else
update_belly_lights(belly_class)
if(glowy_belly)
var/image/belly_sprite = image(icon, sprite_datum.get_belly_overlay(src, vs_fullness, belly_class))
belly_sprite.plane = PLANE_LIGHTING_ABOVE
add_overlay(belly_sprite)
else
add_overlay(sprite_datum.get_belly_overlay(src, vs_fullness, belly_class))

sprite_datum.handle_extra_icon_updates(src) // Various equipment-based sprites go here.

if(resting && sprite_datum.has_rest_sprites)
cut_overlays() // Hide that gut for it has no ground sprite yo.
icon_state = sprite_datum.get_rest_sprite(src)
if(show_belly && sprite_datum.has_vore_belly_sprites && sprite_datum.has_vore_belly_resting_sprites) // Or DOES IT?
add_overlay(sprite_datum.get_belly_resting_overlay(src))

if(sprite_datum.has_eye_sprites)
if(!shell || deployed) // Shell borgs that are not deployed will have no eyes.
Expand Down Expand Up @@ -1135,9 +1196,15 @@
if(module_sprites.len == 1 || !client)
if(!(sprite_datum in module_sprites))
sprite_datum = module_sprites[1]
update_multibelly()
else
var/selection = tgui_input_list(src, "Select an icon! [triesleft ? "You have [triesleft] more chance\s." : "This is your last try."]", "Robot Icon", module_sprites)
sprite_datum = selection
if(selection)
sprite_datum = selection
else
sprite_datum = module_sprites[1]
update_multibelly()
if(!istype(src,/mob/living/silicon/robot/drone))
robot_species = sprite_datum.name
if(notransform)
Expand All @@ -1163,10 +1230,13 @@
choose_icon(icon_selection_tries)
return


icon_selected = 1
icon_selection_tries = 0
sprite_type = robot_species
to_chat(src, "<span class='filter_notice'>Your icon has been set. You now require a module reset to change it.</span>")
if(hands)
update_hud()
to_chat(src, "Your icon has been set. You now require a module reset to change it.")

/mob/living/silicon/robot/proc/set_default_module_icon()
if(!SSrobot_sprites)
Expand Down Expand Up @@ -1467,3 +1537,46 @@
if(issilicon(user))
return TRUE
return FALSE


/mob/living/silicon/robot/proc/update_multibelly()
vore_icon_bellies = list() //Clear any belly options that may not exist now
vore_capacity_ex = list()
vore_fullness_ex = list()
if(sprite_datum.belly_capacity_list.len)
for(var/belly in sprite_datum.belly_capacity_list) //vore icons list only contains a list of names with no associated data
vore_capacity_ex[belly] = sprite_datum.belly_capacity_list[belly] //I dont know why but this wasnt working when I just
vore_fullness_ex[belly] = 0 //set the lists equal to the old lists
vore_icon_bellies += belly
for(var/belly in sprite_datum.belly_light_list)
vore_light_states[belly] = 0
else if(sprite_datum.has_vore_belly_sprites)
vore_capacity_ex = list("sleeper" = 1)
vore_fullness_ex = list("sleeper" = 0)
vore_icon_bellies = list("sleeper")
if(sprite_datum.has_sleeper_light_indicator)
vore_light_states = list("sleeepr" = 0)
sprite_datum.belly_light_list = list("sleeper")
update_fullness() //Set how full the newly defined bellies are, if they're already full

// RS EDIT !! DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG
// Debug tool to swap the belly type and glowy belly
/*
/mob/living/silicon/robot/verb/belly_selection()
set name = "Switch selected belly sprite (Vore)"
set desc = "Select your belly sprite."
set category = "Abilities"

update_multibelly() //Clear it all and let's reselect.
var/list/belly_icons = vore_icon_bellies
var/belly_type = tgui_input_list(src, "Choose your belly TYPE:", "Belly Overlay", belly_icons)
if(!belly_type)
return
vore_selected.belly_sprite_to_affect = belly_type

var/belly_glow = tgui_alert(src, "Do you want your belly to glow?(show over darkness)?", "Belly glow", list("Yes", "No"))
if(!belly_glow || belly_glow == "No")
glowy_belly = FALSE
else
glowy_belly = TRUE
*/
Loading
Loading