From dbe43db59a75084792565731e5b17501a901524c Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sun, 1 Jun 2014 14:50:57 -0400 Subject: [PATCH 1/3] Round no longer ends suddenly Instead, a crew transfer vote is called. Also adds cleanup proc to game_mode. --- code/game/gamemodes/game_mode.dm | 2 ++ code/game/gamemodes/gameticker.dm | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index e97c915c0ba..32f5e9110b5 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -129,6 +129,8 @@ Implants; return 1 return 0 +/datum/game_mode/proc/cleanup() //the end conditions specified by check_finished() have been met, let's clean up. + return /datum/game_mode/proc/declare_completion() var/clients = 0 diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index d42f88e8913..596156344f4 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -12,6 +12,7 @@ var/global/datum/controller/gameticker/ticker var/hide_mode = 0 var/datum/game_mode/mode = null + var/post_game = 0 var/event_time = null var/event = 0 @@ -309,8 +310,10 @@ var/global/datum/controller/gameticker/ticker emergency_shuttle.process() - var/mode_finished = mode.check_finished() || (emergency_shuttle.location == 2 && emergency_shuttle.alert == 1) - if(!mode.explosion_in_progress && mode_finished) + var/mode_finished = (!post_game && mode.check_finished()) + var/game_finished = (emergency_shuttle.location == 2 || mode.station_was_nuked) + + if(!mode.explosion_in_progress && game_finished && (mode_finished || post_game)) current_state = GAME_STATE_FINISHED spawn @@ -340,7 +343,17 @@ var/global/datum/controller/gameticker/ticker world << "\blue An admin has delayed the round end" else world << "\blue An admin has delayed the round end" - + + else if (mode_finished) + post_game = 1 + + mode.cleanup() + + //call a transfer shuttle vote + spawn(50) + world << "\red The round has ended!" + vote.autotransfer() + return 1 proc/getfactionbyname(var/name) From cc4a6e0f2641b471c00ccd1f0a3ca3fe6973ac10 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sun, 1 Jun 2014 15:49:13 -0400 Subject: [PATCH 2/3] Fixes config.continous_rounds and adds check --- code/controllers/configuration.dm | 2 +- code/game/gamemodes/game_mode.dm | 2 +- code/game/gamemodes/gameticker.dm | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 366ac7aff96..f9d825d8963 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -40,7 +40,7 @@ var/traitor_scaling = 0 //if amount of traitors scales based on amount of players var/objectives_disabled = 0 //if objectives are disabled or not var/protect_roles_from_antagonist = 0// If security and such can be traitor/cult/other - var/continous_rounds = 1 // Gamemodes which end instantly will instead keep on going until the round ends by escape shuttle or nuke. + var/continous_rounds = 0 // Gamemodes which end instantly will instead keep on going until the round ends by escape shuttle or nuke. var/allow_Metadata = 0 // Metadata is supported. var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1. var/Ticklag = 0.9 diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 32f5e9110b5..f027246efa4 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -129,7 +129,7 @@ Implants; return 1 return 0 -/datum/game_mode/proc/cleanup() //the end conditions specified by check_finished() have been met, let's clean up. +/datum/game_mode/proc/cleanup() //This is called when the round has ended but not the game, if any cleanup would be necessary in that case. return /datum/game_mode/proc/declare_completion() diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 596156344f4..abab43ede72 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -310,8 +310,14 @@ var/global/datum/controller/gameticker/ticker emergency_shuttle.process() - var/mode_finished = (!post_game && mode.check_finished()) - var/game_finished = (emergency_shuttle.location == 2 || mode.station_was_nuked) + var/game_finished = 0 + var/mode_finished = 0 + if (config.continous_rounds) + game_finished = (emergency_shuttle.location == 2 || mode.station_was_nuked) + mode_finished = (!post_game && mode.check_finished()) + else + game_finished = (mode.check_finished() || (emergency_shuttle.location == 2 && emergency_shuttle.alert == 1)) + mode_finished = game_finished if(!mode.explosion_in_progress && game_finished && (mode_finished || post_game)) current_state = GAME_STATE_FINISHED From e91f285ce92180bf29ff0236ed35922f180836bb Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sun, 1 Jun 2014 17:01:35 -0400 Subject: [PATCH 3/3] Adds cleanup for heist mode --- code/game/gamemodes/heist/heist.dm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/game/gamemodes/heist/heist.dm b/code/game/gamemodes/heist/heist.dm index 6f0da9100d3..ba093e3c381 100644 --- a/code/game/gamemodes/heist/heist.dm +++ b/code/game/gamemodes/heist/heist.dm @@ -274,4 +274,13 @@ datum/game_mode/proc/auto_declare_completion_heist() /datum/game_mode/heist/check_finished() if (!(is_raider_crew_alive()) || (vox_shuttle_location && (vox_shuttle_location == "start"))) return 1 - return ..() \ No newline at end of file + return ..() + +/datum/game_mode/heist/cleanup() + //the skipjack and everything in it have left and aren't coming back, so get rid of them. + var/area/skipjack = locate(/area/shuttle/vox/station) + for (var/mob/living/M in skipjack.contents) + //maybe send the player a message that they've gone home/been kidnapped? Someone responsible for vox lore should write that. + Del(M) + for (var/obj/O in skipjack.contents) + Del(O) //no hiding in lockers or anything \ No newline at end of file