AI Programs: More than a Door (#27988)

* AI Powers initial commit - Base datums for picker and program

* Small fixes in base datums

* RGB Lighting Power

* Nearest camera detection, beam effect for RGB_Lighting

* Fixed learning AI Porgrams, Power Shunt Program

* Program install fixes, WebUI Program Install Menu Fixes

* Repair nanites

* Universal Adapter

* Door Override

* Nanofrost, Program Icons, Door Override Bug Fixes

* Sprites for AI machines

* Bluespace Miner, Multimarket Analyzer, Light Replacer

* Fixes economy thing with bluespace miner

* Enhanced Door Controls, Nanosurgeons

* Experimental Research Subsystem

* Removed excess from RND subsystem

* Adds Processing Node

* Processing node changes and fixes

* Processing nodes power states

* Minor cleanup

* I've got a network node! And it makes heat!

* Adds proc to nodes to change the assigned AI

* Removed extra vars

* Icon fixes

* Adds overheat counter to delay overheat to prevent random atmos hotspots from instantly turning it off

* They changed my isAI check. Woe.

* Sealant, Holosigns, HONK, bugfixes, and stock part multipliers

* Enhanced Tracking Software

* Refunds for active programs

* Remaining uninstall functionality

* AI RMC

* Forgot a circuitboard

* Fixes a small path issue

* Global nodes list + node data for AI RMC TGUI

* TGUI Foundations

* Better check

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>

* Better null check

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>

* Spacing

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>

* Better chat notification

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>

* A shitload of fixes

* Camera beam helper proc

* AI remote sound helper

* Timer on nanofrost

* ui.user

* Fixed examine grammar

* tgui first pass

* TGUI Bundle Rebuild

* Fixed bug in AI node stock parts, began implementation of reassign code

* resource management tgui update

* Initial changes for ai programs ui

* Fixes UI opening

* ui improvement and ui_act reimplementation (draft)

* UI act works now yay

* Fixed space indentation and  proc args

* Fix merge

* Machine deconstruction fix

* Fixes charging bandwidth on install, fixes programs being removed from the menu when uninstalled

* Fixes honk subsystem targeting

* Better examines on nodes

* Light synthesizer fix

* Fixes passive resources, fixes messages about not affording upgrades

* Increases base memory from 1 to 3

* Increases overheat threshhold with stock parts.

* Buffs cooldown for Repair and Nanosurgeon to be on par with Power Shunt

* Reduces mineral costs of AI network machines

* Nulls tracked mob on destroy, fixes overheat counter

* Makes RGB lighting immediately update light color

* Refunds cooldowns on failed cast

* More robust camera vision checking

* Fixed cooldown scaling on some programs, added target zone hologram to sealant

* merge master and rebuild bundle

* begone

* revert change to gitattributes

* Apply suggestions from code review

Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>

* Whole lot of suggestions and fixes

* Renames Door Override to Airlock Restoration, Fixes minor spelling issue

* Adds message when AI tries to access the resource console

* Divides up proc for AI nodes to be more itemized between procs, handles shut off when out of power, handles when AI cryos

* removes broken tgui hooks

* Removes excess comment

* Reduces cooldowns, increases delay on sealant

* Reduces cost of AI machines

* UI adjustment for Progam Picker

* Servers require more power, buffs surgeon at higher upgrade tiers, adds messages for servers and losses, and adds a pointer program

* Trailing newline for the linter gods

* No more screaming servers

* Fixes holograms that AI deploys in Sealant and Holopointer

---------

Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
Co-authored-by: XFirebirdX <142694283+XFirebirdX@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
This commit is contained in:
PollardTheDragon
2025-04-03 13:46:12 +00:00
committed by GitHub
co-authored by Luc warriorstar-orion XFirebirdX Burzah
parent e38ab5c4d9
commit 65f5af735e
25 changed files with 2010 additions and 176 deletions
@@ -26,6 +26,15 @@
if(istype(machine, /obj/machinery/hologram))
check_holopad_eye()
// Enhanced Tracking
if(enhanced_tracking && tracked_mob)
if(can_see(tracked_mob))
var/area/A = get_area(tracked_mob)
if(A)
addtimer(CALLBACK(src, PROC_REF(raise_tracking_alert), A, tracked_mob), enhanced_tracking_delay)
// To prevent spam, immediately unset tracking.
tracked_mob = null
if(malfhack && malfhack.aidisabled)
to_chat(src, "<span class='danger'>ERROR: APC access disabled, hack attempt canceled.</span>")
deltimer(malfhacking)
+59 -4
View File
@@ -57,7 +57,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
var/list/connected_robots = list()
var/aiRestorePowerRoutine = 0
//var/list/laws = list()
alarms_listend_for = list("Motion", "Fire", "Atmosphere", "Power", "Burglar")
alarms_listened_for = list("Motion", "Fire", "Atmosphere", "Power", "Burglar")
var/viewalerts = FALSE
var/icon/holo_icon //Default is assigned when AI is created.
var/obj/mecha/controlled_mech //For controlled_mech a mech, to determine whether to relaymove or use the AI eye.
@@ -68,6 +68,26 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
var/obj/item/radio/headset/heads/ai_integrated/aiRadio = null
// AI Powers
var/datum/program_picker/program_picker
var/datum/spell/ai_spell/choose_program/program_action
/// Whether or not the AI has unlocked universal adapter
var/universal_adapter = FALSE
/// How effective is the adapter?
var/adapter_efficiency = 0.5
/// Has the AI unlocked a bluespace miner?
var/bluespace_miner = FALSE
/// Credit payout rate
var/bluespace_miner_rate = 100
/// Time until next payout
var/next_payout = 10 MINUTES
/// Do we have the enhanced tracker?
var/enhanced_tracking = FALSE
/// Who are we tracking with the enhanced tracker?
var/mob/tracked_mob
/// The current delay on enhanced tracking
var/enhanced_tracking_delay = 10 SECONDS
//MALFUNCTION
var/datum/module_picker/malf_picker
var/datum/spell/ai_spell/choose_modules/modules_action
@@ -136,8 +156,13 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
/// The cached AI annoucement help menu.
var/ai_announcement_string_menu
/// Is the AI in storage?
var/in_storage = FALSE
var/hologram_color = rgb(125, 180, 225)
/mob/living/silicon/ai/proc/add_ai_verbs()
add_verb(src, GLOB.ai_verbs_default)
add_verb(src, silicon_subsystems)
@@ -239,6 +264,8 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
GLOB.ai_list += src
GLOB.shuttle_caller_list += src
add_program_picker()
for(var/I in 1 to 4)
stored_locations += "unset" //This is checked in ai_keybinds.dm.
@@ -260,6 +287,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
QDEL_NULL(aiMulti)
QDEL_NULL(aiRadio)
QDEL_NULL(builtInCamera)
tracked_mob = null
return ..()
/mob/living/silicon/ai/get_radio()
@@ -301,7 +329,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
dat += "<a href='byond://?src=[UID()];mach_close=aialerts'>Close</a><br><br>"
var/list/list/temp_alarm_list = GLOB.alarm_manager.alarms.Copy()
for(var/cat in temp_alarm_list)
if(!(cat in alarms_listend_for))
if(!(cat in alarms_listened_for))
continue
dat += "<b>[cat]</b><br>\n"
var/list/list/L = temp_alarm_list[cat].Copy()
@@ -378,6 +406,8 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
power_state = ACTIVE_POWER_USE
var/mob/living/silicon/ai/powered_ai = null
invisibility = 100
/// Power draw for the bluespace miner module
var/bluespace_miner_power = 0
/obj/machinery/ai_powersupply/New(mob/living/silicon/ai/ai=null)
powered_ai = ai
@@ -394,11 +424,26 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
if(!powered_ai || powered_ai.stat & DEAD)
qdel(src)
return
// Regenerate nanites for abilities only when powered.
powered_ai.program_picker.nanites = min(100, powered_ai.program_picker.nanites + (1 + 0.5 * powered_ai.program_picker.bandwidth))
if(!powered_ai.anchored)
loc = powered_ai.loc
change_power_mode(NO_POWER_USE)
if(powered_ai.anchored)
change_power_mode(ACTIVE_POWER_USE)
if(powered_ai.bluespace_miner)
// Money money money
if(powered_ai.next_payout <= world.time)
powered_ai.next_payout = 10 MINUTES + world.time
var/account = GLOB.station_money_database.get_account_by_department(DEPARTMENT_SCIENCE)
var/datum/money_account_database/main_station/station_db = GLOB.station_money_database
station_db.credit_account(account, powered_ai.bluespace_miner_rate, "Bluespace Miner Production", "AI Bluespace Miner Subsystem", FALSE)
// Update power consumption if powering a bluespace miner
if(bluespace_miner_power == powered_ai.bluespace_miner_rate * 2.5)
return
bluespace_miner_power = powered_ai.bluespace_miner_rate * 2.5
update_active_power_consumption(power_channel, active_power_consumption + bluespace_miner_power)
/mob/living/silicon/ai/update_icons()
. = ..()
@@ -844,7 +889,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
Bot.call_bot(src, waypoint)
/mob/living/silicon/ai/alarm_triggered(src, class, area/A, list/O, obj/alarmsource)
if(!(class in alarms_listend_for))
if(!(class in alarms_listened_for))
return
if(alarmsource.z != z)
return
@@ -872,7 +917,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
/mob/living/silicon/ai/alarm_cancelled(src, class, area/A, obj/origin, cleared)
if(cleared)
if(!(class in alarms_listend_for))
if(!(class in alarms_listened_for))
return
if(origin.z != z)
return
@@ -1368,6 +1413,12 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
create_chat_message(locateUID(M.runechat_msg_location), message_clean)
show_message(rendered, 2)
/mob/living/silicon/ai/proc/add_program_picker()
view_core() // A BYOND bug requires you to be viewing your core before your verbs update
program_picker = new /datum/program_picker(src)
program_action = new(program_picker)
AddSpell(program_action)
/mob/living/silicon/ai/proc/malfhacked(obj/machinery/power/apc/apc)
malfhack = null
malfhacking = null
@@ -1485,6 +1536,10 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
eyeobj.acceleration = !eyeobj.acceleration
to_chat(usr, "Camera acceleration has been toggled [eyeobj.acceleration ? "on" : "off"].")
/mob/living/silicon/ai/proc/play_sound_remote(target, sound, volume)
playsound_local(src, sound, volume, FALSE, use_reverb = FALSE)
playsound(target, sound, volume, FALSE, use_reverb = FALSE)
/mob/living/silicon/ai/handle_fire()
return
File diff suppressed because it is too large Load Diff
@@ -38,6 +38,15 @@ GLOBAL_LIST_EMPTY(empty_playable_ai_cores)
ghostize(FALSE)
else
ghostize(TRUE)
in_storage = TRUE
// Clean up AI programs, reassign nodes
for(var/obj/machinery/ai_node/node as anything in GLOB.ai_nodes)
if(!istype(node))
continue
if(node.assigned_ai != src)
continue
node.refresh_ai()
// Delete the old AI shell
qdel(src)
@@ -797,7 +797,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
var/list/dat = list()
var/list/list/temp_alarm_list = GLOB.alarm_manager.alarms.Copy()
for(var/cat in temp_alarm_list)
if(!(cat in alarms_listend_for))
if(!(cat in alarms_listened_for))
continue
dat += "<B>[cat]</B><BR>\n"
var/list/list/L = temp_alarm_list[cat].Copy()
@@ -884,7 +884,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
return low_power_mode
/mob/living/silicon/robot/alarm_triggered(src, class, area/A, list/O, obj/alarmsource)
if(!(class in alarms_listend_for))
if(!(class in alarms_listened_for))
return
if(alarmsource.z != z)
return
@@ -894,7 +894,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
/mob/living/silicon/robot/alarm_cancelled(src, class, area/A, obj/origin, cleared)
if(cleared)
if(!(class in alarms_listend_for))
if(!(class in alarms_listened_for))
return
if(origin.z != z)
return
@@ -20,7 +20,7 @@
var/list/alarms_to_clear = list()
var/list/alarm_types_show = list("Motion" = 0, "Fire" = 0, "Atmosphere" = 0, "Power" = 0)
var/list/alarm_types_clear = list("Motion" = 0, "Fire" = 0, "Atmosphere" = 0, "Power" = 0)
var/list/alarms_listend_for = list("Motion", "Fire", "Atmosphere", "Power")
var/list/alarms_listened_for = list("Motion", "Fire", "Atmosphere", "Power")
//var/list/hud_list[10]
var/list/speech_synthesizer_langs = list() //which languages can be vocalized by the speech synthesizer
var/designation = ""
@@ -80,6 +80,9 @@
var/datum/ai_laws/laws = null
var/list/additional_law_channels = list("State" = "")
/// The delay used when toggling door bolts or electrification
var/door_bolt_delay = 3 SECONDS
/mob/living/silicon/New()
GLOB.silicon_mob_list |= src
..()
@@ -154,6 +157,9 @@
var/list/msg = list("--- ")
if(alarm_types_show["Tracking"])
msg += "TRACKING: [alarm_types_show["Tracking"]] alarms detected. - "
if(alarm_types_show["Burglar"])
msg += "BURGLAR: [alarm_types_show["Burglar"]] alarms detected. - "
@@ -662,6 +662,35 @@
build_path = /obj/item/circuitboard/merch
category = list("Misc. Machinery")
/datum/design/processing_node
name = "Machine Design (Processing Node)"
desc = "The circuit board for a processing node."
id = "processing_node"
req_tech = list("programming" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, MAT_GOLD = 250)
build_path = /obj/item/circuitboard/processing_node
category = list("Misc. Machinery")
/datum/design/network_node
name = "Machine Design (Network Node)"
desc = "The circuit board for a network node."
id = "network_node"
req_tech = list("programming" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, MAT_GOLD = 250)
build_path = /obj/item/circuitboard/network_node
category = list("Misc. Machinery")
/datum/design/ai_resource_console
name = "Computer Design (AI Resource Console)"
desc = "The circuit board for an AI Resource Console."
id = "ai_resource_console"
req_tech = list("programming" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/ai_resource_console
/datum/design/autochef
name = "Machine Design (Autochef)"
desc = "The circuit board for an autochef."