Files
SmArtKarandGitHub 0f2a1dd6a3 Adds raptor growth progress bar to RaptorDex (#94659)
## About The Pull Request
Players can now check their chick's/youngling's growth progress via the
RaptorDex item or app

## Why It's Good For The Game

Currently there's no way to know how much food you need to feed to your
raptor to advance their growth, which can cause confusion among newer
players.

## Changelog
🆑
qol: Added raptor growth progress bar to RaptorDex
/🆑
2026-01-04 11:44:51 -07:00

64 lines
2.7 KiB
Plaintext

/datum/computer_file/program/raptordex
filename = "raptordex"
filedesc = "RaptorDex"
downloader_category = PROGRAM_CATEGORY_DEVICE
program_open_overlay = "bountyboard"
extended_desc = "Scan and analyze raptor genes."
size = 2
tgui_id = "NtosRaptorDex"
program_icon = "crow"
can_run_on_flags = PROGRAM_PDA
/// Raptor scan data we have stored
var/list/scan_data = list("raptor_scan" = FALSE)
/datum/computer_file/program/raptordex/tap(atom/tapped_atom, mob/living/user, list/modifiers)
if(!istype(tapped_atom, /mob/living/basic/raptor))
return FALSE
var/mob/living/basic/raptor/my_raptor = tapped_atom
var/datum/movespeed_modifier/intent_mod = my_raptor.get_move_intent_slowdown()
scan_data = list()
scan_data["raptor_scan"] = TRUE
scan_data["raptor_image"] = icon2base64(icon(icon = my_raptor.icon, icon_state = my_raptor.icon_state, dir = SOUTH, frame = 1))
scan_data["raptor_attack"] = my_raptor.melee_damage_lower
scan_data["raptor_health"] = my_raptor.health
scan_data["raptor_max_health"] = my_raptor.maxHealth
scan_data["raptor_speed"] = my_raptor.speed + intent_mod?.multiplicative_slowdown
scan_data["raptor_color"] = my_raptor.name
scan_data["raptor_gender"] = my_raptor.gender
scan_data["raptor_growth"] = my_raptor.growth_progress
scan_data["can_grow"] = my_raptor.growth_stage != RAPTOR_ADULT
scan_data["raptor_description"] = my_raptor.raptor_color.description
var/happiness_percentage = my_raptor.ai_controller?.blackboard[BB_BASIC_HAPPINESS]
var/obj/effect/overlay/happiness_overlay/display = new()
display.set_hearts(happiness_percentage)
display.pixel_y = ICON_SIZE_Y * 0.5
scan_data["raptor_happiness"] = icon2base64(getFlatIcon(display, no_anim = TRUE))
qdel(display)
var/datum/raptor_inheritance/inherit = my_raptor.inherited_stats
if(!isnull(inherit))
scan_data["inherited_attack"] = inherit.attack_modifier
scan_data["inherited_attack_max"] = RAPTOR_INHERIT_MAX_ATTACK
scan_data["inherited_health"] = inherit.health_modifier
scan_data["inherited_health_max"] = RAPTOR_INHERIT_MAX_HEALTH
scan_data["inherited_speed"] = inherit.speed_modifier
scan_data["inherited_speed_max"] = RAPTOR_INHERIT_MAX_SPEED
scan_data["inherited_ability"] = inherit.ability_modifier
scan_data["inherited_ability_max"] = RAPTOR_INHERIT_MAX_MODIFIER
scan_data["inherited_growth"] = inherit.growth_modifier
scan_data["inherited_growth_max"] = RAPTOR_INHERIT_MAX_MODIFIER
scan_data["inherited_traits"] = list()
for(var/index in inherit.personality_traits)
scan_data["inherited_traits"] += GLOB.raptor_inherit_traits[index]
playsound(computer, 'sound/mobs/non-humanoids/orbie/orbie_send_out.ogg', 20)
my_raptor.balloon_alert(user, "scanned")
return TRUE
/datum/computer_file/program/raptordex/ui_data(mob/user)
return scan_data