From a2999b86a0d8e2b4a64f68e072c88316499e8813 Mon Sep 17 00:00:00 2001 From: d3athrow Date: Wed, 29 May 2013 16:26:25 -0500 Subject: [PATCH 1/2] Fixes the Create Antagonist: one click antag Nuke Team. Requires atleast 3 people to click yes with a maximum of 5 agents possible. --- code/modules/admin/verbs/one_click_antag.dm | 25 ++++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 295cdd877ea..552f21e0c00 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -17,12 +17,13 @@ client/proc/one_click_antag() Make Cult
Make Malf AI
Make Wizard (Requires Ghosts)
+ Make Nuke Team (Requires Ghosts)
"} /* These dont work just yet Ninja, aliens and deathsquad I have not looked into yet Nuke team is getting a null mob returned from makebody() (runtime error: null.mind. Line 272) - Make Nuke Team (Requires Ghosts)
+ Make Space Ninja (Requires Ghosts)
Make Aliens (Requires Ghosts)
Make Deathsquad (Syndicate) (Requires Ghosts)
@@ -216,6 +217,7 @@ client/proc/one_click_antag() /datum/admins/proc/makeNukeTeam() var/list/mob/dead/observer/candidates = list() + var/list/mob/dead/observer/chosen = list() var/mob/dead/observer/theghost = null var/time_passed = world.time @@ -245,18 +247,19 @@ client/proc/one_click_antag() candidates.Remove(j) continue - theghost = candidates + theghost = j candidates.Remove(theghost) - - var/mob/living/carbon/human/new_character=makeBody(theghost) + chosen += theghost + agentcount++ + //Making sure we have atleast 3 Nuke agents, because less than that is kinda bad + if(agentcount < 3) + return 0 + else + for(var/mob/c in chosen) + var/mob/living/carbon/human/new_character=makeBody(c) new_character.mind.make_Nuke() - agentcount++ - - if(agentcount < 1) - return 0 - - var/obj/effect/landmark/nuke_spawn = locate("landmark*Nuclear-Bomb") + var/obj/effect/landmark/nuke_spawn = locate("landmark*Syndicate-Uplink") var/obj/effect/landmark/closet_spawn = locate("landmark*Nuclear-Closet") var/nuke_code = "[rand(10000, 99999)]" @@ -396,4 +399,4 @@ client/proc/one_click_antag() ready_dna(new_character) new_character.key = G_found.key - return new_character + return new_character From 8f8ab8ebf0e3a365e8dfa37416f72c89b9117cbc Mon Sep 17 00:00:00 2001 From: d3athrow Date: Thu, 30 May 2013 23:32:05 -0500 Subject: [PATCH 2/2] Added a break to the nested loop after the candidate was chosen, without it every candidate would get chosen regardless. --- code/modules/admin/verbs/one_click_antag.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 552f21e0c00..e1285d865f9 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -251,6 +251,7 @@ client/proc/one_click_antag() candidates.Remove(theghost) chosen += theghost agentcount++ + break //Making sure we have atleast 3 Nuke agents, because less than that is kinda bad if(agentcount < 3) return 0