Files
CHOMPStation2/code/modules/mob/living/silicon/ai/death.dm
Ravensdale 9aedfa8b23 Bugfix: Fixes mining borg's radio to the supply frequency since mining frequency no longer exists.
Feature: Introduces and adjusts code for cyborg and AI custom sprites

Cleanup: Streamlined the AI core selection code. Could probably be even cleaner but it's good for now.
2013-07-03 21:24:25 -07:00

62 lines
2.0 KiB
Plaintext

/mob/living/silicon/ai/death(gibbed)
if(stat == DEAD) return
stat = DEAD
if (src.custom_sprite == 1)//check for custom AI sprite, defaulting to blue screen if no.
icon_state = "[ckey]-ai-crash"
else icon_state = "ai-crash"
update_canmove()
if(src.eyeobj)
src.eyeobj.setLoc(get_turf(src))
if(blind) blind.layer = 0
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
var/callshuttle = 0
for(var/obj/machinery/computer/communications/commconsole in world)
if(commconsole.z == 2)
continue
if(istype(commconsole.loc,/turf))
break
callshuttle++
for(var/obj/item/weapon/circuitboard/communications/commboard in world)
if(commboard.z == 2)
continue
if(istype(commboard.loc,/turf) || istype(commboard.loc,/obj/item/weapon/storage))
break
callshuttle++
for(var/mob/living/silicon/ai/shuttlecaller in player_list)
if(shuttlecaller.z == 2)
continue
if(!shuttlecaller.stat && shuttlecaller.client && istype(shuttlecaller.loc,/turf))
break
callshuttle++
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || sent_strike_team)
callshuttle = 0
if(callshuttle == 3) //if all three conditions are met
emergency_shuttle.incall(2)
log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.")
message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1)
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
world << sound('sound/AI/shuttlecalled.ogg')
if(explosive)
spawn(10)
explosion(src.loc, 3, 6, 12, 15)
for(var/obj/machinery/ai_status_display/O in world) //change status
spawn( 0 )
O.mode = 2
if (istype(loc, /obj/item/device/aicard))
loc.icon_state = "aicard-404"
tod = worldtime2text() //weasellos time of death patch
if(mind) mind.store_memory("Time of death: [tod]", 0)
return ..(gibbed)