From 09a85d8c3952e9b3e6dfcff7803a6ee5a3a3c2c5 Mon Sep 17 00:00:00 2001 From: "n3ophyt3@gmail.com" Date: Thu, 23 Sep 2010 02:38:42 +0000 Subject: [PATCH] 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 --- code/game/gamemodes/gameticker.dm | 10 ++-- .../gamemodes/malfunction/Malf_Modules.dm | 1 + .../game/gamemodes/malfunction/malfunction.dm | 51 ++++++++++++------- code/game/gamemodes/nuclear/nuclearbomb.dm | 13 ++--- code/modules/mob/dead/observer/hud.dm | 6 +++ code/modules/mob/living/silicon/ai/hud.dm | 8 +++ code/modules/mob/mob.dm | 4 +- 7 files changed, 62 insertions(+), 31 deletions(-) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 99d907561c7..56d525912d4 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -142,12 +142,12 @@ var/global/datum/controller/gameticker/ticker spawn declare_completion() + if(ticker.mode.name != "nuclear emergency") + spawn(50) + world << "\blue Restarting in 25 seconds" - spawn(50) - world << "\blue Restarting in 25 seconds" - - sleep(250) - world.Reboot() + sleep(250) + world.Reboot() return 1 diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 63bd9e7520a..7f1753a73a8 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -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 diff --git a/code/game/gamemodes/malfunction/malfunction.dm b/code/game/gamemodes/malfunction/malfunction.dm index 9f2fe29c9e4..85235960e4f 100644 --- a/code/game/gamemodes/malfunction/malfunction.dm +++ b/code/game/gamemodes/malfunction/malfunction.dm @@ -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 << "The current game mode is - AI Malfunction!" @@ -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 << "\redYou are malfunctioning! You do not have to follow any laws." - malf_ai.current << "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." + AI_mind.current << "\redYou are malfunctioning! You do not have to follow any laws." + AI_mind.current << "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." - 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 << "The AI has won!" world << "It has fully taken control of all of [station_name()]'s systems." - 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("Self-destruct the station)") + 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 << "The AI has chosen not to explode you all! Resetting in 30 seconds!" + + 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 << "Everyone was killed by the self-destruct! Resetting in 30 seconds!" - 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() diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 4296bd7fb78..731aeb0ff74 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -129,6 +129,7 @@ return src.timing = -1.0 src.yes_code = 0 + src.safety = 1 src.icon_state = "nuclearbomb3" sleep(20) @@ -146,13 +147,13 @@ if(ticker.mode.name == "nuclear emergency") ticker.mode:nuke_detonated = 1 ticker.mode.check_win() - else - sleep(10) - world << "Everyone was killed by the nuclear blast! Resetting in 30 seconds!" - sleep(300) - log_game("Rebooting due to nuclear destruction of station") - world.Reboot() + sleep(110) + world << "Everyone was killed by the nuclear blast! Resetting in 30 seconds!" + + sleep(300) + log_game("Rebooting due to nuclear destruction of station") + world.Reboot() return /obj/item/weapon/disk/nuclear/Del() diff --git a/code/modules/mob/dead/observer/hud.dm b/code/modules/mob/dead/observer/hud.dm index 13de279dfab..65834a4d50d 100644 --- a/code/modules/mob/dead/observer/hud.dm +++ b/code/modules/mob/dead/observer/hud.dm @@ -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 \ No newline at end of file diff --git a/code/modules/mob/living/silicon/ai/hud.dm b/code/modules/mob/living/silicon/ai/hud.dm index 2db6674a9a3..0e563e2cf44 100644 --- a/code/modules/mob/living/silicon/ai/hud.dm +++ b/code/modules/mob/living/silicon/ai/hud.dm @@ -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 \ No newline at end of file diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index afdaa72dfe7..61c6ca8fb5e 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -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)