From 2c901c71bbdc266a72eb52da61c2e569dbb466a0 Mon Sep 17 00:00:00 2001 From: "rastaf.zero@gmail.com" Date: Wed, 6 Apr 2011 20:39:08 +0000 Subject: [PATCH] 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 --- code/modules/admin/admin.dm | 66 ++--------------- .../modules/mob/living/carbon/monkey/death.dm | 2 + code/unused/gamemodes/monkey.dm | 70 +++++++++++++------ 3 files changed, 54 insertions(+), 84 deletions(-) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index e7d1bf2d60c..dd54e28b65c 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -263,74 +263,18 @@ var/showadminmessages = 1 if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) if (ticker && ticker.mode) return alert(usr, "The game has already started.", null, null, null, null) - var/dat = text({"What mode do you wish to play?
- Secret
- Wizard
- Traitor
- Meteor
- Extended
- Nuclear Emergency
- Blob
- Sandbox
- Revolution
- Cult
- AI Malfunction
- Changeling

- Now: [master_mode]\n"}) + var/dat = {"What mode do you wish to play?
"} + for (var/mode in config.modes) + dat += {"[config.mode_names[mode]]
"} + dat += {"Now: [master_mode]"} usr << browse(dat, "window=c_mode") -/* - Corporate Restructuring
- Random
- Monkey
- Death Commando Deathmatch
- Confliction (TESTING)
- Capture The Flag (Beta)

- -*/ if (href_list["c_mode2"]) if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) if (ticker && ticker.mode) return alert(usr, "The game has already started.", null, null, null, null) - switch(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 + master_mode = href_list["c_mode2"] 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) world << "\blue The mode is now: [master_mode]" diff --git a/code/modules/mob/living/carbon/monkey/death.dm b/code/modules/mob/living/carbon/monkey/death.dm index 4047e8590e3..c37ec6c31ad 100644 --- a/code/modules/mob/living/carbon/monkey/death.dm +++ b/code/modules/mob/living/carbon/monkey/death.dm @@ -24,6 +24,7 @@ //var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch //mind.store_memory("Time of death: [tod]", 0) + ticker.mode.check_win() //src.icon_state = "dead" for(var/mob/M in world) if ((M.client && !( M.stat ))) @@ -39,4 +40,5 @@ spawn(50) if(src.client && src.stat == 2) src.verbs += /mob/proc/ghostize + return ..(gibbed) \ No newline at end of file diff --git a/code/unused/gamemodes/monkey.dm b/code/unused/gamemodes/monkey.dm index 49228c25ead..2efc0cd13c2 100644 --- a/code/unused/gamemodes/monkey.dm +++ b/code/unused/gamemodes/monkey.dm @@ -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 name = "monkey" config_tag = "monkey" + var/state = MONKEY_MODE_RUNNING /datum/game_mode/monkey/announce() world << "The current game mode is - Monkey!" @@ -20,38 +27,50 @@ while (amount > 0) var/mob/living/carbon/human/player = pick(players) - player.monkeyize() + var/mob/living/carbon/monkey/new_monkey = player.monkeyize() + new_monkey << "Your goal is to capture the entire human civilization and your first target is Centcom. Hijack the shuttle without humans aboard." players -= player amount-- 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 << "Your goal is to capture the entire human civilization and your first target is Centcom. Hijack the shuttle without humans aboard." + + +/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() - if(emergency_shuttle.location==2) - return 1 - - return 0 + return (emergency_shuttle.location==2) || (state>0) /datum/game_mode/monkey/declare_completion() - var/area/escape_zone = locate(/area/shuttle/escape/centcom) - var/monkeywin = 0 - for(var/mob/living/carbon/monkey/monkey_player in world) - if (monkey_player.stat != 2) - var/turf/location = get_turf(monkey_player.loc) - if (location in escape_zone) - monkeywin = 1 - break + if (state != MONKEY_MODE_NO_RABID_LEFT) + for(var/mob/living/carbon/monkey/monkey_player in world) + if (is_important_monkey(monkey_player)) + var/turf/location = get_turf(monkey_player.loc) + if (istype(location.loc, /area/shuttle/escape/centcom)) + monkeywin = 1 + break - if(monkeywin) - for(var/mob/living/carbon/human/human_player in world) - if (human_player.stat != 2) - var/turf/location = get_turf(human_player.loc) - if (istype(human_player.loc, /turf)) - if (location in escape_zone) + if(monkeywin) + for(var/mob/living/carbon/human/human_player in world) + if (human_player.stat != 2) + var/turf/location = get_turf(human_player.loc) + if (istype(location.loc, /area/shuttle/escape/centcom)) monkeywin = 0 break @@ -63,12 +82,17 @@ player.monkeyize() for(var/mob/living/carbon/monkey/monkey_player in world) if (monkey_player.client) - world << "[monkey_player.key] was a monkey." + world << "[monkey_player.key] was a monkey. [monkey_player.stat == 2 ? "(DEAD)" : ""]" sleep(50) else world << "The Research Staff has stopped the monkey invasion!" for(var/mob/living/carbon/monkey/monkey_player in world) if (monkey_player.client) - world << "[monkey_player.key] was a monkey." + world << "[monkey_player.key] was a monkey. [monkey_player.stat == 2 ? "(DEAD)" : ""]" - return 1 \ No newline at end of file + return 1 + +#undef MONKEY_MODE_RUNNING +#undef MONKEY_MODE_NO_RABID_LEFT +#undef MONKEY_MODE_SHUTTLE_CAPTURED +#undef MONKEY_MODE_SHUTTLE_WITH_HUMANS