diff --git a/code/game/gamemodes/events/ninja_equipment.dm b/code/game/gamemodes/events/ninja_equipment.dm index 0a2c8b7aa9c..5a621af4028 100644 --- a/code/game/gamemodes/events/ninja_equipment.dm +++ b/code/game/gamemodes/events/ninja_equipment.dm @@ -420,7 +420,7 @@ ________________________________________________________________________________ // AUTOFIXED BY fix_string_idiocy.py // C:\Users\Rob\Documents\Projects\vgstation13\code\game\gamemodes\events\ninja_equipment.dm:416: dat += "Stored AI: [A.name]
" dat += {"Stored AI: [A.name]
- System integrity: [(A.health+100)/2]%
"} + System integrity: [A.system_integrity()]%
"} // END AUTOFIX //I personally think this makes things a little more fun. Ninjas can override all but law 0. //if (A.laws.zeroth) diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index d06732cc5a3..d9771d0f987 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -43,7 +43,7 @@ if (src.occupant) var/laws - dat += "Stored AI: [src.occupant.name]
System integrity: [(src.occupant.health+100)/2]%
" + dat += "Stored AI: [src.occupant.name]
System integrity: [src.occupant.system_integrity()]%
" if (src.occupant.laws.zeroth) laws += "0: [src.occupant.laws.zeroth]
" diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index 345a4259d43..bf56c4bf359 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -38,7 +38,7 @@ var/dat = "Intelicard
" var/laws for(var/mob/living/silicon/ai/A in src) - dat += "Stored AI: [A.name]
System integrity: [(A.health+100)/2]%
" + dat += "Stored AI: [A.name]
System integrity: [A.system_integrity()]%
" //AI DIDN'T KILL SOMEONE FOR ME, CARD HER TO CHECK HER LAWS diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index eba92dd1e5a..f2eb490bbc1 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -770,4 +770,8 @@ var/list/ai_list = list() /mob/living/silicon/ai/get_multitool(var/active_only=0) - return aiMulti \ No newline at end of file + return aiMulti + +// An AI doesn't become inoperable until -100% (or whatever config.health_threshold_dead is set to) +/mob/living/silicon/ai/system_integrity() + return (health - config.health_threshold_dead) / 2 diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index b301fc52a2b..fd5dbdce395 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -156,20 +156,20 @@ return 1 return 0 +/mob/living/silicon/proc/system_integrity() + return round((health / maxHealth) * 100) -// this function shows the health of the pAI in the Status panel +// this function shows the health of a silicon in the Status panel /mob/living/silicon/proc/show_system_integrity() - if(!src.stat) - stat(null, text("System integrity: [round((health / maxHealth) * 100)]%")) + if(stat == CONSCIOUS) + stat(null, text("System integrity: [system_integrity()]%")) else stat(null, text("Systems nonfunctional")) - // This is a pure virtual function, it should be overwritten by all subclasses /mob/living/silicon/proc/show_malf_ai() return 0 - // this function displays the station time in the status panel /mob/living/silicon/proc/show_station_time() stat(null, "Station Time: [worldtime2text()]")