mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Allows admins to spawn a nuke with the DS (#19872)
* Lets DS spawn with a nuke * OOO * removes this unused code
This commit is contained in:
@@ -50,13 +50,21 @@ GLOBAL_VAR_INIT(deathsquad_sent, FALSE)
|
||||
|
||||
// Find the nuclear auth code
|
||||
var/nuke_code
|
||||
var/new_nuke = FALSE
|
||||
for(var/obj/machinery/nuclearbomb/N in GLOB.machines)
|
||||
if(istype(N, /obj/machinery/nuclearbomb/syndicate) || !N.core)
|
||||
continue
|
||||
var/temp_code = text2num(N.r_code)
|
||||
if(temp_code)//if it's actually a number. It won't convert any non-numericals.
|
||||
nuke_code = N.r_code
|
||||
break
|
||||
if(!nuke_code)
|
||||
message_admins("No nuclear warheads have been detected, the Deathsquad will not be provided detonation codes.")
|
||||
message_admins("No functional nuclear warheads have been detected, the Deathsquad will be issued a new warhead.")
|
||||
new_nuke = TRUE
|
||||
nuke_code = rand(10000, 99999)
|
||||
|
||||
if(alert("Do you want a new nuclear warhead to be spawned with this team?",, "Yes", "No") == "Yes")
|
||||
new_nuke = TRUE
|
||||
|
||||
// Find ghosts willing to be Deathsquad
|
||||
var/list/commando_ghosts = list()
|
||||
@@ -74,6 +82,12 @@ GLOBAL_VAR_INIT(deathsquad_sent, FALSE)
|
||||
to_chat(src, "<span class='userdanger'>Nobody volunteered to join the DeathSquad.</span>")
|
||||
return
|
||||
|
||||
// Spawns a nuclear warhead for the team
|
||||
if(new_nuke)
|
||||
for(var/obj/effect/landmark/spawner/nuclear_bomb/death_squad/nuke_spawn in GLOB.landmarks_list)
|
||||
var/obj/machinery/nuclearbomb/undeployed/the_bomb = new (get_turf(nuke_spawn))
|
||||
the_bomb.r_code = nuke_code
|
||||
|
||||
// Equips the Deathsquad
|
||||
for(var/mob/ghost_mob in commando_ghosts)
|
||||
if(!ghost_mob || !ghost_mob.key || !ghost_mob.client)
|
||||
|
||||
@@ -182,91 +182,6 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
|
||||
/datum/admins/proc/makeNukeTeam()
|
||||
|
||||
var/list/mob/candidates = list()
|
||||
var/mob/theghost = null
|
||||
var/time_passed = world.time
|
||||
|
||||
var/antnum = input(owner, "How many nuclear operative you want to create? Enter 0 to cancel.","Amount:", 0) as num
|
||||
if(!antnum || antnum <= 0)
|
||||
return
|
||||
log_admin("[key_name(owner)] tried making a [antnum] person Nuke Op Team with One-Click-Antag")
|
||||
message_admins("[key_name_admin(owner)] tried making a [antnum] person Nuke Op Team with One-Click-Antag")
|
||||
|
||||
for(var/mob/G in GLOB.respawnable_list)
|
||||
if(istype(G) && G.client && (ROLE_OPERATIVE in G.client.prefs.be_special))
|
||||
if(!jobban_isbanned(G, ROLE_OPERATIVE) && !jobban_isbanned(G, ROLE_SYNDICATE))
|
||||
if(player_old_enough_antag(G.client,ROLE_OPERATIVE))
|
||||
spawn(0)
|
||||
switch(alert(G,"Do you wish to be considered for a nuke team being sent in?","Please answer in 30 seconds!","Yes","No"))
|
||||
if("Yes")
|
||||
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
|
||||
return
|
||||
candidates += G
|
||||
if("No")
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
sleep(300)
|
||||
|
||||
if(candidates.len)
|
||||
var/agentcount = 0
|
||||
|
||||
for(var/i = 0, i<antnum,i++)
|
||||
shuffle(candidates) //More shuffles means more randoms
|
||||
for(var/mob/j in candidates)
|
||||
if(!j || !j.client)
|
||||
candidates.Remove(j)
|
||||
continue
|
||||
|
||||
theghost = candidates
|
||||
candidates.Remove(theghost)
|
||||
|
||||
var/mob/living/carbon/human/new_character=makeBody(theghost)
|
||||
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/closet_spawn = locate("landmark*Nuclear-Closet")
|
||||
|
||||
var/nuke_code = rand(10000, 99999)
|
||||
|
||||
if(nuke_spawn)
|
||||
var/obj/item/paper/P = new
|
||||
P.info = "Sadly, the Syndicate could not get you a nuclear bomb. We have, however, acquired the arming code for the station's onboard nuke. The nuclear authorization code is: <b>[nuke_code]</b>"
|
||||
P.name = "nuclear bomb code and instructions"
|
||||
P.loc = nuke_spawn.loc
|
||||
|
||||
if(closet_spawn)
|
||||
new /obj/structure/closet/syndicate/nuclear(closet_spawn.loc)
|
||||
|
||||
for(var/datum/mind/synd_mind in SSticker.mode.syndicates)
|
||||
if(synd_mind.current)
|
||||
if(synd_mind.current.client)
|
||||
for(var/image/I in synd_mind.current.client.images)
|
||||
if(I.icon_state == "synd")
|
||||
qdel(I)
|
||||
|
||||
for(var/datum/mind/synd_mind in SSticker.mode.syndicates)
|
||||
if(synd_mind.current)
|
||||
if(synd_mind.current.client)
|
||||
for(var/datum/mind/synd_mind_1 in SSticker.mode.syndicates)
|
||||
if(synd_mind_1.current)
|
||||
var/I = image('icons/mob/mob.dmi', loc = synd_mind_1.current, icon_state = "synd")
|
||||
synd_mind.current.client.images += I
|
||||
|
||||
for(var/obj/machinery/nuclearbomb/bomb in GLOB.machines)
|
||||
bomb.r_code = nuke_code // All the nukes are set to this code.
|
||||
return 1
|
||||
|
||||
//Abductors
|
||||
/datum/admins/proc/makeAbductorTeam()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user