Files
Batrachophreno 5277251959 Tool behaviors port (#21663)
For a robust crafting system, I need a new materials framework.
For a new materials framework, I need to clean up reagents.
To clean up reagents, I need to pare down foods from reagent holders.
To pare down foods from reagent holders, I need to port edibility
components.
To port edibility components, I need to port processing components.
To port processing components, I need to port tool behaviors.

This is all back-end code, no new features or functionality from this.
2026-01-27 08:44:49 +00:00

43 lines
1.5 KiB
Plaintext

// A wrapper that allows the computer to contain an intellicard.
/obj/item/computer_hardware/ai_slot
name = "intellicard slot"
desc = "An IIS interlink with connection uplinks that allow the device to interface with most common intellicard models. Too large to fit into tablets. Uses a lot of power when active."
icon_state = "aislot"
hardware_size = 2
critical = 0
power_usage = 100
origin_tech = list(TECH_POWER = 2, TECH_DATA = 3)
var/obj/item/aicard/stored_card
var/power_usage_idle = 100
var/power_usage_occupied = 2 KILO WATTS
/obj/item/computer_hardware/ai_slot/proc/update_power_usage()
if(!stored_card?.carded_ai)
power_usage = power_usage_idle
return
power_usage = power_usage_occupied
/obj/item/computer_hardware/ai_slot/attackby(obj/item/attacking_item, mob/user)
if(..())
return TRUE
if(istype(attacking_item, /obj/item/aicard))
if(stored_card)
to_chat(user, SPAN_WARNING("\The [src] is already occupied."))
return
user.drop_from_inventory(attacking_item, src)
stored_card = attacking_item
update_power_usage()
if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, SPAN_NOTICE("You manually remove \the [stored_card] from \the [src]."))
stored_card.forceMove(get_turf(src))
stored_card = null
update_power_usage()
/obj/item/computer_hardware/ai_slot/Destroy()
if(parent_computer?.ai_slot == src)
parent_computer.ai_slot = null
if(stored_card)
stored_card.forceMove(get_turf(parent_computer))
parent_computer = null
return ..()