/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 /datum/computer_file/program/raptordex/on_made_active_program(mob/user) RegisterSignal(computer, COMSIG_ITEM_REQUESTING_CONTEXT_FOR_TARGET, PROC_REF(add_item_context)) computer.item_flags |= ITEM_HAS_CONTEXTUAL_SCREENTIPS /datum/computer_file/program/raptordex/background_program(mob/user) . = ..() UnregisterSignal(computer, COMSIG_ITEM_REQUESTING_CONTEXT_FOR_TARGET) /datum/computer_file/program/raptordex/kill_program(mob/user) . = ..() UnregisterSignal(computer, COMSIG_ITEM_REQUESTING_CONTEXT_FOR_TARGET) /datum/computer_file/program/raptordex/proc/add_item_context(obj/item/source, list/context, atom/target, mob/living/user) SIGNAL_HANDLER if(!istype(target, /mob/living/basic/raptor)) return NONE context[SCREENTIP_CONTEXT_RMB] = "Scan Raptor" return CONTEXTUAL_SCREENTIP_SET