Monkey mode now can be ended by robusting all infected monkeys (including Pun-Pun) along with leaving on the shuttle.

Admins can switch mode to one from modes game actually can run, not from hardcoded list.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1401 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
rastaf.zero@gmail.com
2011-04-06 20:39:08 +00:00
parent 50d25c216c
commit 2c901c71bb
3 changed files with 54 additions and 84 deletions

View File

@@ -263,74 +263,18 @@ var/showadminmessages = 1
if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" )))
if (ticker && ticker.mode) if (ticker && ticker.mode)
return alert(usr, "The game has already started.", null, null, null, null) return alert(usr, "The game has already started.", null, null, null, null)
var/dat = text({"<B>What mode do you wish to play?</B><HR> var/dat = {"<B>What mode do you wish to play?</B><HR>"}
<A href='?src=\ref[src];c_mode2=secret'>Secret</A><br> for (var/mode in config.modes)
<A href='?src=\ref[src];c_mode2=wizard'>Wizard</A><br> dat += {"<A href='?src=\ref[src];c_mode2=[mode]'>[config.mode_names[mode]]</A><br>"}
<A href='?src=\ref[src];c_mode2=traitor'>Traitor</A><br> dat += {"Now: [master_mode]"}
<A href='?src=\ref[src];c_mode2=meteor'>Meteor</A><br>
<A href='?src=\ref[src];c_mode2=extended'>Extended</A><br>
<A href='?src=\ref[src];c_mode2=nuclear'>Nuclear Emergency</A><br>
<A href='?src=\ref[src];c_mode2=blob'>Blob</A><br>
<A href='?src=\ref[src];c_mode2=sandbox'>Sandbox</A><br>
<A href='?src=\ref[src];c_mode2=revolution'>Revolution</A><br>
<A href='?src=\ref[src];c_mode2=cult'>Cult</A><br>
<A href='?src=\ref[src];c_mode2=malfunction'>AI Malfunction</A><br>
<A href='?src=\ref[src];c_mode2=changeling'>Changeling</A><br><br>
Now: [master_mode]\n"})
usr << browse(dat, "window=c_mode") usr << browse(dat, "window=c_mode")
/*
<A href='?src=\ref[src];c_mode2=restructuring'>Corporate Restructuring</A><br>
<A href='?src=\ref[src];c_mode2=random'>Random</A><br>
<A href='?src=\ref[src];c_mode2=monkey'>Monkey</A><br>
<A href='?src=\ref[src];c_mode2=deathmatch'>Death Commando Deathmatch</A><br>
<A href='?src=\ref[src];c_mode2=confliction'>Confliction (TESTING)</A><br>
<A href='?src=\ref[src];c_mode2=ctf'>Capture The Flag (Beta)</A><br><br>
*/
if (href_list["c_mode2"]) if (href_list["c_mode2"])
if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" )))
if (ticker && ticker.mode) if (ticker && ticker.mode)
return alert(usr, "The game has already started.", null, null, null, null) return alert(usr, "The game has already started.", null, null, null, null)
switch(href_list["c_mode2"]) master_mode = href_list["c_mode2"]
if("secret")
master_mode = "secret"
if("random")
master_mode = "random"
if("traitor")
master_mode = "traitor"
if("meteor")
master_mode = "meteor"
if("extended")
master_mode = "extended"
if("monkey")
master_mode = "monkey"
if("nuclear")
master_mode = "nuclear"
if("blob")
master_mode = "blob"
if("sandbox")
master_mode = "sandbox"
if("restructuring")
master_mode = "restructuring"
if("wizard")
master_mode = "wizard"
if("revolution")
master_mode = "revolution"
if("cult")
master_mode = "cult"
if("malfunction")
master_mode = "malfunction"
if("deathmatch")
master_mode = "deathmatch"
if("confliction")
master_mode = "confliction"
if("ctf")
master_mode = "ctf"
if("changeling")
master_mode = "changeling"
else
log_admin("[key_name(usr)] set the mode as [master_mode].") log_admin("[key_name(usr)] set the mode as [master_mode].")
message_admins("\blue [key_name_admin(usr)] set the mode as [master_mode].", 1) message_admins("\blue [key_name_admin(usr)] set the mode as [master_mode].", 1)
world << "\blue <b>The mode is now: [master_mode]</b>" world << "\blue <b>The mode is now: [master_mode]</b>"

View File

@@ -24,6 +24,7 @@
//var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch //var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
//mind.store_memory("Time of death: [tod]", 0) //mind.store_memory("Time of death: [tod]", 0)
ticker.mode.check_win()
//src.icon_state = "dead" //src.icon_state = "dead"
for(var/mob/M in world) for(var/mob/M in world)
if ((M.client && !( M.stat ))) if ((M.client && !( M.stat )))
@@ -39,4 +40,5 @@
spawn(50) spawn(50)
if(src.client && src.stat == 2) if(src.client && src.stat == 2)
src.verbs += /mob/proc/ghostize src.verbs += /mob/proc/ghostize
return ..(gibbed) return ..(gibbed)

View File

@@ -1,6 +1,13 @@
#define MONKEY_MODE_RUNNING 0
#define MONKEY_MODE_NO_RABID_LEFT 1
#define MONKEY_MODE_SHUTTLE_CAPTURED 2
#define MONKEY_MODE_SHUTTLE_WITH_HUMANS 3
/datum/game_mode/monkey /datum/game_mode/monkey
name = "monkey" name = "monkey"
config_tag = "monkey" config_tag = "monkey"
var/state = MONKEY_MODE_RUNNING
/datum/game_mode/monkey/announce() /datum/game_mode/monkey/announce()
world << "<B>The current game mode is - Monkey!</B>" world << "<B>The current game mode is - Monkey!</B>"
@@ -20,38 +27,50 @@
while (amount > 0) while (amount > 0)
var/mob/living/carbon/human/player = pick(players) var/mob/living/carbon/human/player = pick(players)
player.monkeyize() var/mob/living/carbon/monkey/new_monkey = player.monkeyize()
new_monkey << "<B>Your goal is to capture the entire human civilization and your first target is Centcom. Hijack the shuttle without humans aboard.</B>"
players -= player players -= player
amount-- amount--
for (var/mob/living/carbon/monkey/rabid_monkey in world) for (var/mob/living/carbon/monkey/rabid_monkey in world)
if (!isturf(rabid_monkey.loc) || rabid_monkey.z!=1)
continue
rabid_monkey.contract_disease(new /datum/disease/jungle_fever,0,0) rabid_monkey.contract_disease(new /datum/disease/jungle_fever,0,0)
rabid_monkey << "<B>Your goal is to capture the entire human civilization and your first target is Centcom. Hijack the shuttle without humans aboard.</B>"
/datum/game_mode/monkey/proc/is_important_monkey(var/mob/living/carbon/monkey/M as mob)
var/turf/T = get_turf(M)
return M.stat!=2 && istype(M.virus, /datum/disease/jungle_fever) && ( T.z==1 || istype(T.loc, /area/shuttle/escape/centcom) || istype(T.loc, /area/centcom))
/datum/game_mode/monkey/check_win()
if (state==MONKEY_MODE_SHUTTLE_CAPTURED || state==MONKEY_MODE_SHUTTLE_WITH_HUMANS)
return
var/infected_count = 0
for (var/mob/living/carbon/monkey/rabid_monkey in world)
if (is_important_monkey(rabid_monkey))
infected_count++
if (infected_count==0)
state = MONKEY_MODE_NO_RABID_LEFT
/datum/game_mode/monkey/check_finished() /datum/game_mode/monkey/check_finished()
if(emergency_shuttle.location==2) return (emergency_shuttle.location==2) || (state>0)
return 1
return 0
/datum/game_mode/monkey/declare_completion() /datum/game_mode/monkey/declare_completion()
var/area/escape_zone = locate(/area/shuttle/escape/centcom)
var/monkeywin = 0 var/monkeywin = 0
for(var/mob/living/carbon/monkey/monkey_player in world) if (state != MONKEY_MODE_NO_RABID_LEFT)
if (monkey_player.stat != 2) for(var/mob/living/carbon/monkey/monkey_player in world)
var/turf/location = get_turf(monkey_player.loc) if (is_important_monkey(monkey_player))
if (location in escape_zone) var/turf/location = get_turf(monkey_player.loc)
monkeywin = 1 if (istype(location.loc, /area/shuttle/escape/centcom))
break monkeywin = 1
break
if(monkeywin) if(monkeywin)
for(var/mob/living/carbon/human/human_player in world) for(var/mob/living/carbon/human/human_player in world)
if (human_player.stat != 2) if (human_player.stat != 2)
var/turf/location = get_turf(human_player.loc) var/turf/location = get_turf(human_player.loc)
if (istype(human_player.loc, /turf)) if (istype(location.loc, /area/shuttle/escape/centcom))
if (location in escape_zone)
monkeywin = 0 monkeywin = 0
break break
@@ -63,12 +82,17 @@
player.monkeyize() player.monkeyize()
for(var/mob/living/carbon/monkey/monkey_player in world) for(var/mob/living/carbon/monkey/monkey_player in world)
if (monkey_player.client) if (monkey_player.client)
world << "<B>[monkey_player.key] was a monkey.</B>" world << "<B>[monkey_player.key] was a monkey. [monkey_player.stat == 2 ? "(DEAD)" : ""]</B>"
sleep(50) sleep(50)
else else
world << "<FONT size=3 color=red><B>The Research Staff has stopped the monkey invasion!</B></FONT>" world << "<FONT size=3 color=red><B>The Research Staff has stopped the monkey invasion!</B></FONT>"
for(var/mob/living/carbon/monkey/monkey_player in world) for(var/mob/living/carbon/monkey/monkey_player in world)
if (monkey_player.client) if (monkey_player.client)
world << "<B>[monkey_player.key] was a monkey.</B>" world << "<B>[monkey_player.key] was a monkey. [monkey_player.stat == 2 ? "(DEAD)" : ""]</B>"
return 1 return 1
#undef MONKEY_MODE_RUNNING
#undef MONKEY_MODE_NO_RABID_LEFT
#undef MONKEY_MODE_SHUTTLE_CAPTURED
#undef MONKEY_MODE_SHUTTLE_WITH_HUMANS