mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-08-25 04:56:29 +01:00
Dev-freeze into dev merge.
This commit is contained in:
@@ -202,13 +202,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
statpanel("Status")
|
||||
if (client.statpanel == "Status")
|
||||
stat(null, "Station Time: [worldtime2text()]")
|
||||
if(ticker)
|
||||
if(ticker.mode)
|
||||
//world << "DEBUG: ticker not null"
|
||||
if(ticker.mode.name == "AI malfunction")
|
||||
//world << "DEBUG: malf mode ticker test"
|
||||
if(malf.revealed)
|
||||
stat(null, "Time left: [max(malf.hack_time/(malf.hacked_apcs.len/3), 0)]")
|
||||
if(emergency_shuttle)
|
||||
var/eta_status = emergency_shuttle.get_status_panel_eta()
|
||||
if(eta_status)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
icon = 'icons/mob/eye.dmi'
|
||||
icon_state = "default-eye"
|
||||
alpha = 127
|
||||
density = 0
|
||||
|
||||
var/sprint = 10
|
||||
var/cooldown = 0
|
||||
|
||||
@@ -54,9 +54,6 @@
|
||||
|
||||
stat(null, "Intent: [a_intent]")
|
||||
stat(null, "Move Mode: [m_intent]")
|
||||
if(ticker && ticker.mode && ticker.mode.name == "AI malfunction")
|
||||
if(malf.revealed)
|
||||
stat(null, "Time left: [max(malf.hack_time/(malf.hacked_apcs/3), 0)]")
|
||||
if(emergency_shuttle)
|
||||
var/eta_status = emergency_shuttle.get_status_panel_eta()
|
||||
if(eta_status)
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
/mob/living/carbon/human/proc/get_damageable_organs()
|
||||
var/list/obj/item/organ/external/parts = list()
|
||||
for(var/obj/item/organ/external/O in organs)
|
||||
if(O.brute_dam + O.burn_dam < O.max_damage)
|
||||
if(O.is_damageable())
|
||||
parts += O
|
||||
return parts
|
||||
|
||||
|
||||
@@ -118,8 +118,12 @@
|
||||
else if(E.is_malfunctioning())
|
||||
|
||||
if(E.body_part == HAND_LEFT)
|
||||
if(!l_hand)
|
||||
continue
|
||||
drop_from_inventory(l_hand)
|
||||
else
|
||||
if(!r_hand)
|
||||
continue
|
||||
drop_from_inventory(r_hand)
|
||||
|
||||
emote("me", 1, "drops what they were holding, their [E.name] malfunctioning!")
|
||||
|
||||
@@ -56,26 +56,30 @@ var/list/ai_verbs_default = list(
|
||||
var/obj/item/device/multitool/aiMulti = null
|
||||
var/obj/item/device/radio/headset/heads/ai_integrated/aiRadio = null
|
||||
var/custom_sprite = 0 //For our custom sprites
|
||||
//Hud stuff
|
||||
|
||||
//MALFUNCTION
|
||||
var/datum/AI_Module/module_picker/malf_picker
|
||||
var/processing_time = 100
|
||||
var/list/datum/AI_Module/current_modules = list()
|
||||
var/fire_res_on_core = 0
|
||||
|
||||
var/control_disabled = 0 // Set to 1 to stop AI from interacting via Click() -- TLE
|
||||
var/malfhacking = 0 // More or less a copy of the above var, so that malf AIs can hack and still get new cyborgs -- NeoFite
|
||||
|
||||
var/obj/machinery/power/apc/malfhack = null
|
||||
var/explosive = 0 //does the AI explode when it dies?
|
||||
|
||||
var/mob/living/silicon/ai/parent = null
|
||||
|
||||
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 = ""
|
||||
var/control_disabled = 0
|
||||
var/datum/announcement/priority/announcement
|
||||
var/obj/machinery/ai_powersupply/psupply = null // Backwards reference to AI's powersupply object.
|
||||
|
||||
//NEWMALF VARIABLES
|
||||
var/malfunctioning = 0 // Master var that determines if AI is malfunctioning.
|
||||
var/datum/malf_hardware/hardware = null // Installed piece of hardware.
|
||||
var/datum/malf_research/research = null // Malfunction research datum.
|
||||
var/obj/machinery/power/apc/hack = null // APC that is currently being hacked.
|
||||
var/list/hacked_apcs = null // List of all hacked APCs
|
||||
var/APU_power = 0 // If set to 1 AI runs on APU power
|
||||
var/hacking = 0 // Set to 1 if AI is hacking APC, cyborg, other AI, or running system override.
|
||||
var/system_override = 0 // Set to 1 if system override is initiated, 2 if succeeded.
|
||||
var/hack_can_fail = 1 // If 0, all abilities have zero chance of failing.
|
||||
var/hack_fails = 0 // This increments with each failed hack, and determines the warning message text.
|
||||
var/errored = 0 // Set to 1 if runtime error occurs. Only way of this happening i can think of is admin fucking up with varedit.
|
||||
var/bombing_core = 0 // Set to 1 if core auto-destruct is activated
|
||||
var/bombing_station = 0 // Set to 1 if station nuke auto-destruct is activated
|
||||
var/override_CPUStorage = 0 // Bonus/Penalty CPU Storage. For use by admins/testers.
|
||||
var/override_CPURate = 0 // Bonus/Penalty CPU generation rate. For use by admins/testers.
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/add_ai_verbs()
|
||||
src.verbs |= ai_verbs_default
|
||||
@@ -203,17 +207,6 @@ var/list/ai_verbs_default = list(
|
||||
set src = usr.contents
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/ai/proc/system_integrity()
|
||||
return (health-config.health_threshold_dead)/2
|
||||
|
||||
// this function shows the health of the pAI in the Status panel
|
||||
/mob/living/silicon/ai/show_system_integrity()
|
||||
// An AI doesn't become inoperable until -100% (or whatever config.health_threshold_dead is set to)
|
||||
if(!src.stat)
|
||||
stat(null, text("System integrity: [system_integrity()]%"))
|
||||
else
|
||||
stat(null, text("Systems nonfunctional"))
|
||||
|
||||
/mob/living/silicon/ai/SetName(pickedName as text)
|
||||
..()
|
||||
announcement.announcer = pickedName
|
||||
@@ -240,6 +233,7 @@ var/list/ai_verbs_default = list(
|
||||
|
||||
/obj/machinery/ai_powersupply/New(var/mob/living/silicon/ai/ai=null)
|
||||
powered_ai = ai
|
||||
powered_ai.psupply = src
|
||||
if(isnull(powered_ai))
|
||||
qdel(src)
|
||||
|
||||
@@ -250,10 +244,17 @@ var/list/ai_verbs_default = list(
|
||||
|
||||
/obj/machinery/ai_powersupply/process()
|
||||
if(!powered_ai || powered_ai.stat & DEAD)
|
||||
qdel()
|
||||
return
|
||||
if(powered_ai.psupply != src) // For some reason, the AI has different powersupply object. Delete this one, it's no longer needed.
|
||||
qdel(src)
|
||||
if(powered_ai.APU_power)
|
||||
use_power = 0
|
||||
return
|
||||
if(!powered_ai.anchored)
|
||||
loc = powered_ai.loc
|
||||
use_power = 0
|
||||
use_power(50000) // Less optimalised but only called if AI is unwrenched. This prevents usage of wrenching as method to keep AI operational without power. Intellicard is for that.
|
||||
if(powered_ai.anchored)
|
||||
use_power = 2
|
||||
|
||||
@@ -312,14 +313,7 @@ var/list/ai_verbs_default = list(
|
||||
if("Lonestar") icon_state = "ai-lonestar"
|
||||
if("Nanotrasen") icon_state = "ai-nanotrasen"
|
||||
else icon_state = "ai"
|
||||
//else
|
||||
//usr <<"You can only change your display once!"
|
||||
//return
|
||||
|
||||
// displays the malf_ai information if the AI is the malf
|
||||
/mob/living/silicon/ai/show_malf_ai()
|
||||
if(malf && malf.hacked_apcs.len >= 3)
|
||||
stat(null, "Time until station control secured: [max(malf.hack_time/(malf.hacked_apcs/3), 0)] seconds")
|
||||
|
||||
// this verb lets the ai see the stations manifest
|
||||
/mob/living/silicon/ai/proc/ai_roster()
|
||||
@@ -420,11 +414,7 @@ var/list/ai_verbs_default = list(
|
||||
|
||||
/mob/living/silicon/ai/emp_act(severity)
|
||||
if (prob(30))
|
||||
switch(pick(1,2))
|
||||
if(1)
|
||||
view_core()
|
||||
if(2)
|
||||
ai_call_shuttle()
|
||||
view_core()
|
||||
..()
|
||||
|
||||
/mob/living/silicon/ai/Topic(href, href_list)
|
||||
@@ -545,13 +535,6 @@ var/list/ai_verbs_default = list(
|
||||
src << "\blue Switched to [network] camera network."
|
||||
//End of code by Mord_Sith
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/choose_modules()
|
||||
set category = "Malfunction"
|
||||
set name = "Choose Module"
|
||||
|
||||
malf_picker.use(src)
|
||||
|
||||
/mob/living/silicon/ai/proc/ai_statuschange()
|
||||
set category = "AI Commands"
|
||||
set name = "AI Status"
|
||||
@@ -711,5 +694,153 @@ var/list/ai_verbs_default = list(
|
||||
/mob/living/silicon/ai/proc/is_in_chassis()
|
||||
return istype(loc, /turf)
|
||||
|
||||
|
||||
/mob/living/silicon/ai/ex_act(var/severity)
|
||||
if(severity == 1.0)
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
|
||||
// NEWMALF FUNCTIONS/PROCEDURES
|
||||
|
||||
// Sets up malfunction-related variables, research system and such.
|
||||
/mob/living/silicon/ai/proc/setup_for_malf()
|
||||
var/mob/living/silicon/ai/user = src
|
||||
// Setup Variables
|
||||
malfunctioning = 1
|
||||
research = new/datum/malf_research()
|
||||
research.owner = src
|
||||
hacked_apcs = list()
|
||||
recalc_cpu()
|
||||
|
||||
verbs += new/datum/game_mode/malfunction/verb/ai_select_hardware()
|
||||
verbs += new/datum/game_mode/malfunction/verb/ai_select_research()
|
||||
verbs += new/datum/game_mode/malfunction/verb/ai_help()
|
||||
|
||||
// And greet user with some OOC info.
|
||||
user << "You are malfunctioning, you do not have to follow any laws."
|
||||
user << "Use ai-help command to view relevant information about your abilities"
|
||||
|
||||
// Safely remove malfunction status, fixing hacked APCs and resetting variables.
|
||||
/mob/living/silicon/ai/proc/stop_malf()
|
||||
var/mob/living/silicon/ai/user = src
|
||||
// Generic variables
|
||||
malfunctioning = 0
|
||||
sleep(10)
|
||||
research = null
|
||||
// Fix hacked APCs
|
||||
if(hacked_apcs)
|
||||
for(var/obj/machinery/power/apc/A in hacked_apcs)
|
||||
A.hacker = null
|
||||
hacked_apcs = null
|
||||
// Reset our verbs
|
||||
src.verbs = null
|
||||
add_ai_verbs()
|
||||
// Let them know.
|
||||
user << "You are no longer malfunctioning. Your abilities have been removed."
|
||||
|
||||
// Called every tick. Checks if AI is malfunctioning. If yes calls Process on research datum which handles all logic.
|
||||
/mob/living/silicon/ai/proc/malf_process()
|
||||
if(!malfunctioning)
|
||||
return
|
||||
if(!research)
|
||||
if(!errored)
|
||||
errored = 1
|
||||
error("malf_process() called on AI without research datum. Report this.")
|
||||
message_admins("ERROR: malf_process() called on AI without research datum. If admin modified one of the AI's vars revert the change and don't modify variables directly, instead use ProcCall or admin panels.")
|
||||
spawn(1200)
|
||||
errored = 0
|
||||
return
|
||||
recalc_cpu()
|
||||
if(APU_power || aiRestorePowerRoutine != 0)
|
||||
research.process(1)
|
||||
else
|
||||
research.process(0)
|
||||
|
||||
// Recalculates CPU time gain and storage capacities.
|
||||
/mob/living/silicon/ai/proc/recalc_cpu()
|
||||
// AI Starts with these values.
|
||||
var/cpu_gain = 0.01
|
||||
var/cpu_storage = 10
|
||||
|
||||
// Off-Station APCs should not count towards CPU generation.
|
||||
for(var/obj/machinery/power/apc/A in hacked_apcs)
|
||||
if(A.z in config.station_levels)
|
||||
cpu_gain += 0.002
|
||||
cpu_storage += 10
|
||||
|
||||
research.max_cpu = cpu_storage + override_CPUStorage
|
||||
if(hardware && istype(hardware, /datum/malf_hardware/dual_ram))
|
||||
research.max_cpu = research.max_cpu * 1.5
|
||||
research.stored_cpu = min(research.stored_cpu, research.max_cpu)
|
||||
|
||||
research.cpu_increase_per_tick = cpu_gain + override_CPURate
|
||||
if(hardware && istype(hardware, /datum/malf_hardware/dual_cpu))
|
||||
research.cpu_increase_per_tick = research.cpu_increase_per_tick * 2
|
||||
|
||||
// Starts AI's APU generator
|
||||
/mob/living/silicon/ai/proc/start_apu(var/shutup = 0)
|
||||
if(!hardware || !istype(hardware, /datum/malf_hardware/apu_gen))
|
||||
if(!shutup)
|
||||
src << "You do not have an APU generator and you shouldn't have this verb. Report this."
|
||||
return
|
||||
if(hardware_integrity() < 50)
|
||||
if(!shutup)
|
||||
src << "<span class='notice'>Starting APU... <b>FAULT</b>(System Damaged)</span>"
|
||||
return
|
||||
if(!shutup)
|
||||
src << "Starting APU... ONLINE"
|
||||
APU_power = 1
|
||||
|
||||
// Stops AI's APU generator
|
||||
/mob/living/silicon/ai/proc/stop_apu(var/shutup = 0)
|
||||
if(!hardware || !istype(hardware, /datum/malf_hardware/apu_gen))
|
||||
return
|
||||
|
||||
if(APU_power)
|
||||
APU_power = 0
|
||||
if(!shutup)
|
||||
src << "Shutting down APU... DONE"
|
||||
|
||||
// Returns percentage of AI's remaining backup capacitor charge (maxhealth - oxyloss).
|
||||
/mob/living/silicon/ai/proc/backup_capacitor()
|
||||
return ((200 - getOxyLoss()) / 2)
|
||||
|
||||
// Returns percentage of AI's remaining hardware integrity (maxhealth - (bruteloss + fireloss))
|
||||
/mob/living/silicon/ai/proc/hardware_integrity()
|
||||
return (health-config.health_threshold_dead)/2
|
||||
|
||||
// Shows capacitor charge and hardware integrity information to the AI in Status tab.
|
||||
/mob/living/silicon/ai/show_system_integrity()
|
||||
if(!src.stat)
|
||||
stat(null, text("Hardware integrity: [hardware_integrity()]%"))
|
||||
stat(null, text("Internal capacitor: [backup_capacitor()]%"))
|
||||
else
|
||||
stat(null, text("Systems nonfunctional"))
|
||||
|
||||
// Shows AI Malfunction related information to the AI.
|
||||
/mob/living/silicon/ai/show_malf_ai()
|
||||
if(src.is_malf())
|
||||
if(src.hacked_apcs)
|
||||
stat(null, "Hacked APCs: [src.hacked_apcs.len]")
|
||||
stat(null, "System Status: [src.hacking ? "Busy" : "Stand-By"]")
|
||||
if(src.research)
|
||||
stat(null, "Available CPU: [src.research.stored_cpu] TFlops")
|
||||
stat(null, "Maximal CPU: [src.research.max_cpu] TFlops")
|
||||
stat(null, "CPU generation rate: [src.research.cpu_increase_per_tick] TFlops/s")
|
||||
stat(null, "Current research focus: [src.research.focus ? src.research.focus.name : "None"]")
|
||||
if(src.research.focus)
|
||||
stat(null, "Research completed: [round(src.research.focus.invested, 0.1)]/[round(src.research.focus.price)]")
|
||||
if(system_override == 1)
|
||||
stat(null, "SYSTEM OVERRIDE INITIATED")
|
||||
else if(system_override == 2)
|
||||
stat(null, "SYSTEM OVERRIDE COMPLETED")
|
||||
|
||||
// Cleaner proc for creating powersupply for an AI.
|
||||
/mob/living/silicon/ai/proc/create_powersupply()
|
||||
if(psupply)
|
||||
del(psupply)
|
||||
psupply = new/obj/machinery/ai_powersupply(src)
|
||||
|
||||
#undef AI_CHECK_WIRELESS
|
||||
#undef AI_CHECK_RADIO
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
|
||||
remove_ai_verbs(src)
|
||||
|
||||
if(explosive)
|
||||
spawn(10)
|
||||
explosion(src.loc, 3, 6, 12, 15)
|
||||
|
||||
for(var/obj/machinery/ai_status_display/O in world)
|
||||
spawn( 0 )
|
||||
O.mode = 2
|
||||
|
||||
@@ -17,15 +17,23 @@
|
||||
msg += "It looks slightly charred.\n"
|
||||
else
|
||||
msg += "<B>Its casing is melted and heat-warped!</B>\n"
|
||||
if (src.getOxyLoss())
|
||||
if (src.getOxyLoss() > 175)
|
||||
msg += "<B>It seems to be running on backup power. Its display is blinking a \"BACKUP POWER CRITICAL\" warning.</B>\n"
|
||||
else if(src.getOxyLoss() > 100)
|
||||
msg += "<B>It seems to be running on backup power. Its display is blinking a \"BACKUP POWER LOW\" warning.</B>\n"
|
||||
else
|
||||
msg += "It seems to be running on backup power.\n"
|
||||
|
||||
if (src.stat == UNCONSCIOUS)
|
||||
msg += "It is non-responsive and displaying the text: \"RUNTIME: Sensory Overload, stack 26/3\".\n"
|
||||
msg += "</span>"
|
||||
msg += "*---------*</span>"
|
||||
|
||||
if(hardware && (hardware.owner == src))
|
||||
msg += "<br>"
|
||||
msg += hardware.get_examine_desc()
|
||||
user << msg
|
||||
user.showLaws(src)
|
||||
|
||||
return
|
||||
|
||||
/mob/proc/showLaws(var/mob/living/silicon/S)
|
||||
|
||||
@@ -12,90 +12,71 @@
|
||||
|
||||
src.updatehealth()
|
||||
|
||||
if (src.malfhack)
|
||||
if (src.malfhack.aidisabled)
|
||||
src << "\red ERROR: APC access disabled, hack attempt canceled."
|
||||
src.malfhacking = 0
|
||||
src.malfhack = null
|
||||
|
||||
|
||||
if (src.health <= config.health_threshold_dead)
|
||||
if (!hardware_integrity() || !backup_capacitor())
|
||||
death()
|
||||
return
|
||||
|
||||
// If our powersupply object was destroyed somehow, create new one.
|
||||
if(!psupply)
|
||||
create_powersupply()
|
||||
|
||||
if (src.machine)
|
||||
if (!( src.machine.check_eye(src) ))
|
||||
src.reset_view(null)
|
||||
|
||||
// Handle power damage (oxy)
|
||||
if(src:aiRestorePowerRoutine != 0)
|
||||
// Lost power
|
||||
if(aiRestorePowerRoutine != 0 && !APU_power)
|
||||
// Lose power
|
||||
adjustOxyLoss(1)
|
||||
else
|
||||
// Gain Power
|
||||
aiRestorePowerRoutine = 0 // Necessary if AI activated it's APU AFTER losing primary power.
|
||||
adjustOxyLoss(-1)
|
||||
|
||||
// Handle EMP-stun
|
||||
handle_stunned()
|
||||
|
||||
//stage = 1
|
||||
//if (istype(src, /mob/living/silicon/ai)) // Are we not sure what we are?
|
||||
malf_process()
|
||||
|
||||
if(APU_power && (hardware_integrity() < 50))
|
||||
src << "<span class='notice'><b>APU GENERATOR FAILURE! (System Damaged)</b></span>"
|
||||
stop_apu(1)
|
||||
|
||||
var/blind = 0
|
||||
//stage = 2
|
||||
var/area/loc = null
|
||||
if (istype(T, /turf))
|
||||
//stage = 3
|
||||
loc = T.loc
|
||||
if (istype(loc, /area))
|
||||
//stage = 4
|
||||
if (!loc.power_equip && !istype(src.loc,/obj/item))
|
||||
//stage = 5
|
||||
if (!loc.power_equip && !istype(src.loc,/obj/item) && !APU_power)
|
||||
blind = 1
|
||||
|
||||
if (!blind) //lol? if(!blind) #if(src.blind.layer) <--something here is clearly wrong :P
|
||||
//I'll get back to this when I find out how this is -supposed- to work ~Carn //removed this shit since it was confusing as all hell --39kk9t
|
||||
//stage = 4.5
|
||||
if (!blind)
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = SEE_INVISIBLE_LIVING
|
||||
|
||||
|
||||
//Congratulations! You've found a way for AI's to run without using power!
|
||||
//Todo: Without snowflaking up master_controller procs find a way to make AI use_power but only when APC's clear the area usage the tick prior
|
||||
// since mobs are in master_controller before machinery. We also have to do it in a manner where we don't reset the entire area's need to update
|
||||
// the power usage.
|
||||
//
|
||||
// We can probably create a new machine that resides inside of the AI contents that uses power using the idle_usage of 1000 and nothing else and
|
||||
// be fine.
|
||||
/*
|
||||
var/area/home = get_area(src)
|
||||
if(!home) return//something to do with malf fucking things up I guess. <-- aisat is gone. is this still necessary? ~Carn
|
||||
if(home.powered(EQUIP))
|
||||
home.use_power(1000, EQUIP)
|
||||
*/
|
||||
|
||||
if (src:aiRestorePowerRoutine==2)
|
||||
if (aiRestorePowerRoutine==2)
|
||||
src << "Alert cancelled. Power has been restored without our assistance."
|
||||
src:aiRestorePowerRoutine = 0
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0
|
||||
return
|
||||
else if (src:aiRestorePowerRoutine==3)
|
||||
else if (aiRestorePowerRoutine==3)
|
||||
src << "Alert cancelled. Power has been restored."
|
||||
src:aiRestorePowerRoutine = 0
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0
|
||||
return
|
||||
else if (APU_power)
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0
|
||||
return
|
||||
else
|
||||
|
||||
//stage = 6
|
||||
|
||||
var/area/current_area = get_area(src)
|
||||
|
||||
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
|
||||
if (aiRestorePowerRoutine==0)
|
||||
aiRestorePowerRoutine = 1
|
||||
|
||||
//Blind the AI
|
||||
|
||||
@@ -118,7 +99,7 @@
|
||||
if (loc.power_equip)
|
||||
if (!istype(T, /turf/space))
|
||||
src << "Alert cancelled. Power has been restored without our assistance."
|
||||
src:aiRestorePowerRoutine = 0
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0
|
||||
return
|
||||
src << "Fault confirmed: missing external power. Shutting down main control system to save power."
|
||||
@@ -127,7 +108,7 @@
|
||||
sleep(50)
|
||||
if (istype(T, /turf/space))
|
||||
src << "Unable to verify! No power connection detected!"
|
||||
src:aiRestorePowerRoutine = 2
|
||||
aiRestorePowerRoutine = 2
|
||||
return
|
||||
src << "Connection verified. Searching for APC in power network."
|
||||
sleep(50)
|
||||
@@ -148,7 +129,7 @@
|
||||
if (loc.power_equip)
|
||||
if (!istype(T, /turf/space))
|
||||
src << "Alert cancelled. Power has been restored without our assistance."
|
||||
src:aiRestorePowerRoutine = 0
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0 //This, too, is a fix to issue 603
|
||||
return
|
||||
switch(PRP)
|
||||
@@ -163,9 +144,9 @@
|
||||
theAPC.operating = 1
|
||||
theAPC.equipment = 3
|
||||
theAPC.update()
|
||||
src:aiRestorePowerRoutine = 3
|
||||
aiRestorePowerRoutine = 3
|
||||
src << "Here are your current laws:"
|
||||
src.show_laws()
|
||||
show_laws()
|
||||
sleep(50)
|
||||
theAPC = null
|
||||
|
||||
@@ -178,6 +159,8 @@
|
||||
process_med_hud(src,0,src.eyeobj)
|
||||
|
||||
/mob/living/silicon/ai/proc/lacks_power()
|
||||
if(APU_power)
|
||||
return 0
|
||||
var/turf/T = get_turf(src)
|
||||
var/area/A = get_area(src)
|
||||
return ((!A.power_equip) && A.requires_power == 1 || istype(T, /turf/space)) && !istype(src.loc,/obj/item)
|
||||
@@ -186,11 +169,9 @@
|
||||
if(status_flags & GODMODE)
|
||||
health = 100
|
||||
stat = CONSCIOUS
|
||||
setOxyLoss(0)
|
||||
else
|
||||
if(fire_res_on_core)
|
||||
health = 100 - getOxyLoss() - getToxLoss() - getBruteLoss()
|
||||
else
|
||||
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
|
||||
health = 100 - getFireLoss() - getBruteLoss() // Oxyloss is not part of health as it represents AIs backup power. AI is immune against ToxLoss as it is machine.
|
||||
|
||||
/mob/living/silicon/ai/rejuvenate()
|
||||
..()
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
/mob/living/silicon/ai/say(var/message)
|
||||
if(parent && istype(parent) && parent.stat != 2)
|
||||
return parent.say(message)
|
||||
//If there is a defined "parent" AI, it is actually an AI, and it is alive, anything the AI tries to say is said by the parent instead.
|
||||
return ..(message)
|
||||
@@ -409,19 +409,6 @@
|
||||
C.toggled = 1
|
||||
src << "\red You enable [C.name]."
|
||||
|
||||
// this function shows information about the malf_ai gameplay type in the status screen
|
||||
/mob/living/silicon/robot/show_malf_ai()
|
||||
..()
|
||||
for (var/datum/mind/malfai in malf.current_antagonists)
|
||||
if(connected_ai)
|
||||
if(connected_ai.mind == malfai)
|
||||
if(malf.hacked_apcs >= 3)
|
||||
stat(null, "Time until station control secured: [max(malf.hack_time/(malf.hacked_apcs/3), 0)] seconds")
|
||||
else if(malf.revealed)
|
||||
stat(null, "Time left: [max(malf.hack_time/(malf.hacked_apcs.len/3), 0)]")
|
||||
return 0
|
||||
|
||||
|
||||
// this function displays jetpack pressure in the stat panel
|
||||
/mob/living/silicon/robot/proc/show_jetpack_pressure()
|
||||
// if you have a jetpack, show the internal tank pressure
|
||||
|
||||
Reference in New Issue
Block a user