Fixed a bunch of broken code relating to AI malfunction

Malf AIs now appear red-tinted
  Malf AIs now get their 30-second window of ability to explode the station when they win
  
AIs and Ghosts can now enjoy the glorious station explosion cinematics.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@153 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
n3ophyt3@gmail.com
2010-09-23 02:38:42 +00:00
parent 184cce0222
commit 09a85d8c39
7 changed files with 62 additions and 31 deletions

View File

@@ -142,7 +142,7 @@ var/global/datum/controller/gameticker/ticker
spawn
declare_completion()
if(ticker.mode.name != "nuclear emergency")
spawn(50)
world << "\blue <B>Restarting in 25 seconds</B>"

View File

@@ -108,6 +108,7 @@ rcd light flash thingy on matter drain
ticker.mode:hack_intercept()
/datum/game_mode/malfunction/AI_Module/small/reactivate_camera
module_name = "Reactivate camera"
mod_pick_name = "recam"
uses = 10

View File

@@ -5,9 +5,10 @@
var/const/waittime_l = 600
var/const/waittime_h = 1800
var/AI_win_timeleft = 1800
var/AI_win_timeleft = 20 //started at 1800, in case I change this for testing round end.
var/intercept_hacked = 0
var/malf_mode_declared = 0
var/boom = 0
/datum/game_mode/malfunction/announce()
world << "<B>The current game mode is - AI Malfunction!</B>"
@@ -23,7 +24,7 @@
malf_ai += aiplayer.mind
for(var/datum/mind/AI_mind in malf_ai)
/*if(malf_ai.len < 1)
world << "Uh oh, its malfunction and there is no AI! Please report this."
world << "Rebooting world in 5 seconds."
@@ -32,10 +33,10 @@
return*/
malf_ai.current << "\red<font size=3><B>You are malfunctioning!</B> You do not have to follow any laws.</font>"
malf_ai.current << "<B>The crew do not know you have malfunctioned. You may keep it a secret or go wild. The timer will appear for humans 10 minutes in.</B>"
AI_mind.current << "\red<font size=3><B>You are malfunctioning!</B> You do not have to follow any laws.</font>"
AI_mind.current << "<B>The crew do not know you have malfunctioned. You may keep it a secret or go wild. The timer will appear for humans 10 minutes in.</B>"
malf_ai.current.icon_state = "ai-malf"
AI_mind.current.icon_state = "ai-malf"
spawn (rand(waittime_l, waittime_h))
send_intercept()
@@ -84,13 +85,19 @@
if (AI_win_timeleft == 0)
world << "<FONT size = 3><B>The AI has won!</B></FONT>"
world << "<B>It has fully taken control of all of [station_name()]'s systems.</B>"
spawn(400)
world << "\blue Rebooting due to end of game"
world.Reboot()
for(var/datum/mind/AI_mind in malf_ai)
malf_ai:current << "Congratulations you have taken control of the station."
malf_ai:current << "You may decide to blow up the station. You have 30 seconds to choose."
malf_ai:current << text("<A HREF=?src=\ref[src];ai_win=\ref[malf_ai:current]>Self-destruct the station</A>)")
AI_mind.current << "Congratulations you have taken control of the station."
AI_mind.current << "You may decide to blow up the station. You have 30 seconds to choose."
AI_mind.current.verbs += /datum/game_mode/malfunction/proc/ai_win
spawn (300)
AI_mind.current.verbs -= /datum/game_mode/malfunction/proc/ai_win
if (!boom)
world << "<B>The AI has chosen not to explode you all! Resetting in 30 seconds!</B>"
sleep(300)
log_game("Rebooting due to round end")
world.Reboot()
return 1
else
return 0
@@ -102,7 +109,12 @@
return
/datum/game_mode/malfunction/proc/ai_win()
set category = "BLOW UP THE STATION"
set name = "FUCK YES BLOW THIS SHIT UP"
set desc = "BOOM"
usr.verbs -= /datum/game_mode/malfunction/proc/ai_win
ticker.mode:boom = 1
world << "Self-destructing in 10"
sleep(10)
world << "9"
@@ -123,11 +135,14 @@
sleep(10)
world << "1"
sleep(10)
var/turf/ground_zero = locate("landmark*blob-directive")
enter_allowed = 0
for(var/mob/M in world)
if(M.client)
spawn(0)
M.client.station_explosion_cinematic()
sleep(110)
world << "<B>Everyone was killed by the self-destruct! Resetting in 30 seconds!</B>"
if (ground_zero)
ground_zero = get_turf(ground_zero)
else
ground_zero = locate(45,45,1)
explosion(ground_zero, 100, 250, 500, 750)
sleep(300)
log_game("Rebooting due to destruction of station")
world.Reboot()

View File

@@ -129,6 +129,7 @@
return
src.timing = -1.0
src.yes_code = 0
src.safety = 1
src.icon_state = "nuclearbomb3"
sleep(20)
@@ -146,8 +147,8 @@
if(ticker.mode.name == "nuclear emergency")
ticker.mode:nuke_detonated = 1
ticker.mode.check_win()
else
sleep(10)
sleep(110)
world << "<B>Everyone was killed by the nuclear blast! Resetting in 30 seconds!</B>"
sleep(300)

View File

@@ -1,2 +1,8 @@
/obj/hud/proc/ghost_hud()
src.station_explosion = new src.h_type( src )
src.station_explosion.icon = 'station_explosion.dmi'
src.station_explosion.icon_state = "start"
src.station_explosion.layer = 20
src.station_explosion.mouse_opacity = 0
src.station_explosion.screen_loc = "1,3"
return

View File

@@ -1,2 +1,10 @@
/obj/hud/proc/ai_hud()
src.station_explosion = new src.h_type( src )
src.station_explosion.icon = 'station_explosion.dmi'
src.station_explosion.icon_state = "start"
src.station_explosion.layer = 20
src.station_explosion.mouse_opacity = 0
src.station_explosion.screen_loc = "1,3"
return

View File

@@ -2004,11 +2004,11 @@
switch(ticker.mode.name)
if("nuclear emergency")
flick("start_nuke", boom)
if("AI malfunction")
else if("AI malfunction")
flick("start_malf", boom)
else
boom.icon_state = "start"
sleep(40)
sleep(100)
M << sound('explosionfar.ogg')
boom.icon_state = "end"
flick("explode", boom)