Adds Abduction Mode

This commit is contained in:
AnturK
2015-04-13 18:40:15 +02:00
parent 77cd7476a1
commit 6fa8e5f02d
31 changed files with 1565 additions and 51 deletions
+12
View File
@@ -480,6 +480,18 @@
dat += "<td><A href='?priv_msg=[M.ckey]'>PM</A></td></tr>"
dat += "</table>"
if(ticker.mode.abductors.len)
dat += "<br><table cellspacing=5><tr><td><B>Abductors</B></td><td></td><td></td></tr>"
for(var/datum/mind/abductor in ticker.mode.abductors)
var/mob/M = abductor.current
if(M)
dat += "<tr><td><a href='?_src_=holder;adminplayeropts=\ref[M]'>[M.real_name]</a>[M.client ? "" : " <i>(logged out)</i>"][M.stat == 2 ? " <b><font color=red>(DEAD)</font></b>" : ""]</td>"
dat += "<td><A href='?priv_msg=[M.ckey]'>PM</A></td>"
dat += "<td><A HREF='?_src_=holder;traitor=\ref[M]'>Show Objective</A></td></tr>"
else
dat += "<tr><td><i>Abductor not found!</i></td></tr>"
dat += "</table>"
if(istype(ticker.mode, /datum/game_mode/blob))
var/datum/game_mode/blob/mode = ticker.mode
dat += "<br><table cellspacing=5><tr><td><B>Blob</B></td><td></td><td></td></tr>"
+5
View File
@@ -74,6 +74,11 @@
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>"
if("14")
message_admins("[key_name(usr)] created abductor team.")
log_admin("[key_name(usr)] created abductor team.")
if(!src.makeAbductorTeam())
usr << "<span class='danger'>Unfortunatly there were not enough candidates available.</span>"
else if(href_list["forceevent"])
var/datum/round_event_control/E = locate(href_list["forceevent"]) in SSevent.control
@@ -22,6 +22,7 @@ client/proc/one_click_antag()
<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>
<a href='?src=\ref[src];makeAntag=14'>Make Abductor Team (Requires Ghosts)</a><br>
"}
/* These dont work just yet
Ninja, aliens and deathsquad I have not looked into yet
@@ -541,6 +542,61 @@ client/proc/one_click_antag()
return
//Abductors
/datum/admins/proc/makeAbductorTeam()
var/list/mob/dead/observer/candidates = list()
var/time_passed = world.time
for(var/mob/dead/observer/G in player_list)
spawn(0)
switch(alert(G,"Do you wish to be considered for Abductor Team?","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 >= 2)
//Oh god why we can't have static functions
var/teams_finished = round(ticker.mode.abductors.len / 2)
var/number = teams_finished + 1
var/datum/game_mode/abduction/temp = new
var/agent_mind = pick(candidates)
candidates -= agent_mind
var/scientist_mind = pick(candidates)
var/mob/living/carbon/human/agent=makeBody(agent_mind)
var/mob/living/carbon/human/scientist=makeBody(scientist_mind)
agent_mind = agent.mind
scientist_mind = scientist.mind
temp.scientists.len = number
temp.agents.len = number
temp.abductors.len = 2*number
temp.team_objectives.len = number
temp.team_names.len = number
temp.scientists[number] = scientist_mind
temp.agents[number] = agent_mind
temp.abductors = list(agent_mind,scientist_mind)
temp.make_abductor_team(number)
temp.post_setup_team(number)
ticker.mode.abductors += temp.abductors
return 1
else
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