Files
Paradise/code/datums/alarm_manager.dm
PollardTheDragon 65f5af735e 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>
2025-04-03 13:46:12 +00:00

46 lines
1.4 KiB
Plaintext

GLOBAL_DATUM_INIT(alarm_manager, /datum/alarm_manager, new())
/datum/alarm_manager
var/list/alarms = list(
"Motion" = list(),
"Fire" = list(),
"Atmosphere" = list(),
"Power" = list(),
"Burglar" = list(),
"Tracking" = list()
)
/datum/alarm_manager/proc/trigger_alarm(class, area/A, list/O, obj/alarmsource)
var/list/L = alarms[class]
for(var/I in L)
if(I == A.name)
var/list/alarm = L[I]
var/list/sources = alarm[3]
if(!(alarmsource.UID() in sources))
sources += alarmsource.UID()
return TRUE
L[A.name] = list(get_area_name(A, TRUE), O, list(alarmsource.UID()))
SEND_SIGNAL(GLOB.alarm_manager, COMSIG_TRIGGERED_ALARM, class, A, O, alarmsource)
return TRUE
/datum/alarm_manager/proc/cancel_alarm(class, area/A, obj/origin)
var/list/L = alarms[class]
var/cleared = FALSE
for(var/I in L)
if(I == A.name)
var/list/alarm = L[I]
var/list/srcs = alarm[3]
// Air alarm calls fire alarm and sets itself as origin
// If player manually reset fire alarm, it won't be deleted, so we check it by air alarm in area
if(class == "Fire" && !srcs.Find(origin.UID()))
for(var/obj/air_alarm in A.air_alarms)
if(srcs.Find(air_alarm.UID()))
srcs -= air_alarm.UID()
else
srcs -= origin.UID()
if(!length(srcs))
cleared = TRUE
L -= I
SEND_SIGNAL(GLOB.alarm_manager, COMSIG_CANCELLED_ALARM, class, A, origin, cleared)