mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-28 22:48:38 +01:00
Gives AI a personal atmospherics control subsystem.
Includes further work on NanoUI interactions.
This commit is contained in:
@@ -72,7 +72,6 @@ var/list/ai_verbs_default = list(
|
||||
|
||||
var/mob/living/silicon/ai/parent = null
|
||||
|
||||
var/apc_override = 0 //hack for letting the AI use its APC even when visionless
|
||||
var/camera_light_on = 0 //Defines if the AI toggled the light on the camera it's looking through.
|
||||
var/datum/trackable/track = null
|
||||
var/last_announcement = ""
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
var/area/current_area = get_area(src)
|
||||
|
||||
if (((!loc.master.power_equip) && current_area.requires_power == 1 || istype(T, /turf/space)) && !istype(src.loc,/obj/item))
|
||||
if (lacks_power())
|
||||
//If our area lacks equipment power, and is not magically powered (i.e. centcom), or if we are in space and not carded, lose power.
|
||||
if (src:aiRestorePowerRoutine==0)
|
||||
src:aiRestorePowerRoutine = 1
|
||||
@@ -161,10 +161,9 @@
|
||||
sleep(50)
|
||||
src << "Receiving control information from APC."
|
||||
sleep(2)
|
||||
//bring up APC dialog
|
||||
apc_override = 1
|
||||
theAPC.attack_ai(src)
|
||||
apc_override = 0
|
||||
theAPC.operating = 1
|
||||
theAPC.equipment = 3
|
||||
theAPC.update()
|
||||
src:aiRestorePowerRoutine = 3
|
||||
src << "Here are your current laws:"
|
||||
src.show_laws()
|
||||
@@ -179,6 +178,11 @@
|
||||
if (MED_HUD)
|
||||
process_med_hud(src,0,src.eyeobj)
|
||||
|
||||
/mob/living/silicon/ai/proc/lacks_power()
|
||||
var/turf/T = get_turf(src)
|
||||
var/area/A = get_area(src)
|
||||
return ((!A.master.power_equip) && A.requires_power == 1 || istype(T, /turf/space)) && !istype(src.loc,/obj/item)
|
||||
|
||||
/mob/living/silicon/ai/updatehealth()
|
||||
if(status_flags & GODMODE)
|
||||
health = 100
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/mob/living/silicon/ai
|
||||
var/list/ai_verbs_subsystems = list(
|
||||
/mob/living/silicon/ai/proc/subsystem_atmos_control,
|
||||
/mob/living/silicon/ai/proc/subsystem_crew_monitor,
|
||||
/mob/living/silicon/ai/proc/subsystem_power_monitor,
|
||||
/mob/living/silicon/ai/proc/subsystem_rcon
|
||||
)
|
||||
|
||||
var/obj/nano_module/atmos_control/atmos_control
|
||||
var/obj/nano_module/crew_monitor/crew_monitor
|
||||
var/obj/nano_module/rcon/rcon
|
||||
var/obj/nano_module/power_monitor/power_monitor
|
||||
@@ -12,25 +14,32 @@
|
||||
/mob/living/silicon/ai/init_subsystems()
|
||||
..()
|
||||
del(alarm_monitor)
|
||||
atmos_control = new(src)
|
||||
alarm_monitor = new/obj/nano_module/alarm_monitor/ai(src)
|
||||
crew_monitor = new(src)
|
||||
rcon = new(src)
|
||||
power_monitor = new(src)
|
||||
|
||||
/mob/living/silicon/ai/proc/subsystem_atmos_control()
|
||||
set category = "Subystems"
|
||||
set name = "Atmospherics Control"
|
||||
|
||||
atmos_control.ui_interact(usr, state = self_state)
|
||||
|
||||
/mob/living/silicon/ai/proc/subsystem_crew_monitor()
|
||||
set category = "Subystems"
|
||||
set name = "Crew Monitor"
|
||||
|
||||
crew_monitor.ui_interact(usr)
|
||||
crew_monitor.ui_interact(usr, state = self_state)
|
||||
|
||||
/mob/living/silicon/ai/proc/subsystem_power_monitor()
|
||||
set category = "Subystems"
|
||||
set name = "Power Monitor"
|
||||
|
||||
power_monitor.ui_interact(usr)
|
||||
power_monitor.ui_interact(usr, state = self_state)
|
||||
|
||||
/mob/living/silicon/ai/proc/subsystem_rcon()
|
||||
set category = "Subystems"
|
||||
set name = "RCON"
|
||||
|
||||
rcon.ui_interact(usr)
|
||||
rcon.ui_interact(usr, state = self_state)
|
||||
|
||||
@@ -396,10 +396,10 @@
|
||||
var/changed_name = ""
|
||||
if(custom_name)
|
||||
changed_name = custom_name
|
||||
notify_ai(ROBOT_NOTIFICATION_NEW_NAME, real_name, changed_name)
|
||||
else
|
||||
changed_name = "[modtype] [braintype]-[num2text(ident)]"
|
||||
|
||||
notify_ai(ROBOT_NOTIFICATION_NEW_NAME, real_name, changed_name)
|
||||
real_name = changed_name
|
||||
name = real_name
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
set name = "Alarm Monitor"
|
||||
set category = "Subystems"
|
||||
|
||||
alarm_monitor.ui_interact(usr)
|
||||
alarm_monitor.ui_interact(usr, state = self_state)
|
||||
|
||||
/mob/living/silicon/proc/subsystem_law_manager()
|
||||
set name = "Law Manager"
|
||||
set category = "Subystems"
|
||||
|
||||
law_manager.ui_interact(usr)
|
||||
law_manager.ui_interact(usr, state = self_state)
|
||||
|
||||
Reference in New Issue
Block a user