EmergencyResponseTeam-AntagSelectionForAdmins

This commit is contained in:
Steelpoint
2015-01-05 20:20:11 +08:00
parent 44b09cea27
commit 49ea9b0543
7 changed files with 492 additions and 399 deletions
+5
View File
@@ -66,6 +66,11 @@
log_admin("[key_name(usr)] started a gang war.")
if(!src.makeGangsters())
usr << "<span class='danger'>Unfortunatly there were not enough candidates available.</span>"
if("13")
message_admins("[key_name(usr)] created a emergency response team.")
log_admin("[key_name(usr)] created a emergency response team.")
if(!src.makeEmergencyresponseteam())
usr << "<span class='danger'>Unfortunatly there were not enough candidates available.</span>"
else if(href_list["forceevent"])
+25
View File
@@ -818,6 +818,9 @@ var/global/list/g_fancy_list_of_types = null
if("death commando")
equip_deathsquad(M)
if("emergency response officer")
equip_emergencyresponsesquad(M)
if("centcom official")
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/sneakers/black(M), slot_shoes)
@@ -1100,3 +1103,25 @@ var/global/list/g_fancy_list_of_types = null
W.registered_name = M.real_name
W.update_label(M.real_name)
M.equip_to_slot_or_del(W, slot_wear_id)
/proc/equip_emergencyresponsesquad(var/mob/living/carbon/human/M, var/officer)
var/obj/item/device/radio/R = new /obj/item/device/radio/headset(M)
R.set_frequency(1441)
M.equip_to_slot_or_del(R, slot_ears)
if(officer)
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat/swat(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/weapon/card/id/ertsCommand(M), slot_wear_id)
else
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat/swat(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(M)
L.imp_in = M
L.implanted = 1
@@ -21,6 +21,7 @@ client/proc/one_click_antag()
<a href='?src=\ref[src];makeAntag=6'>Make Wizard (Requires Ghosts)</a><br>
<a href='?src=\ref[src];makeAntag=7'>Make Nuke Team (Requires Ghosts)</a><br>
<a href='?src=\ref[src];makeAntag=10'>Make Deathsquad (Requires Ghosts)</a><br>
<a href='?src=\ref[src];makeAntag=13'>Make Emergency Response Team (Requires Ghosts)</a><br>
"}
/* These dont work just yet
Ninja, aliens and deathsquad I have not looked into yet
@@ -427,6 +428,83 @@ client/proc/one_click_antag()
return 0
// DEATH SQUADS
/datum/admins/proc/makeEmergencyresponseteam()
var/list/mob/dead/observer/candidates = list()
var/time_passed = world.time
var/mission = input("Assign a mission to the Emergency Response Team", "Assign Mission", "Assist the station.")
//Generates a list of officers from active ghosts. Then the user picks which characters to respawn as the officers.
for(var/mob/dead/observer/G in player_list)
spawn(0)
switch(alert(G,"Do you wish to be considered for an elite Nanotrasen Emergency Response 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)
for(var/mob/dead/observer/G in candidates)
if(!G.key)
candidates.Remove(G)
if(candidates.len >= 1) //Minimum 5 to be considered a squad
//Pick the (un)lucky players
var/numagents = min(1,candidates.len) //How many officers to spawn
var/list/spawnpoints = emergencyresponseteamspawn
while(numagents && spawnpoints.len && candidates.len)
var/spawnloc = spawnpoints[1]
var/mob/dead/observer/chosen_candidate = pick(candidates)
candidates -= chosen_candidate
if(!chosen_candidate.key)
continue
//Spawn and equip the officer
var/mob/living/carbon/human/ERTOperative = new(spawnloc)
chosen_candidate.client.prefs.copy_to(ERTOperative)
ready_dna(ERTOperative)
if(numagents == 1) //If Squad Leader
ERTOperative.real_name = "Officer [pick(ERTOperative.real_name)]"
equip_emergencyresponsesquad(ERTOperative, 1)
else
ERTOperative.real_name = "Officer [pick(ERTOperative.real_name)]"
equip_emergencyresponsesquad(ERTOperative)
ERTOperative.key = chosen_candidate.key
ERTOperative.mind.assigned_role = "ERT"
//Assign antag status and the mission
ticker.mode.traitors += ERTOperative.mind
ERTOperative.mind.special_role = "ert"
var/datum/objective/missionobj = new
missionobj.owner = ERTOperative.mind
missionobj.explanation_text = mission
missionobj.completed = 1
ERTOperative.mind.objectives += missionobj
//Greet the commando
ERTOperative << "<B><font size=3 color=red>You are the [numagents==1?"Emergency Response Team Commander":"Emergency Response Officer"].</font></B>"
var/missiondesc = "Your squad is being sent on a mission to [station_name()] by Nanotrasen's Security Division."
if(numagents == 1) //If Squad Leader
missiondesc += " Lead your squad to ensure the completion of the mission. Avoid civilian casualites when possible. Board the shuttle when your team is ready."
else
missiondesc += " Follow orders given to you by your commander. Avoid civilian casualites when possible."
missiondesc += "<BR><B>Your Mission</B>: [mission]"
ERTOperative << missiondesc
//Logging and cleanup
if(numagents == 1)
message_admins("The emergency response team has spawned with the mission: [mission].")
log_game("[key_name(ERTOperative)] has been selected as a Emergency Response Officer")
spawnpoints -= spawnloc
numagents--
return 1
return
/datum/admins/proc/makeBody(var/mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character
if(!G_found || !G_found.key) return