/datum/game_mode/waldo name = "waldo" config_tag = "waldo" var/list/datum/mind/waldos = list() var/const/waldos_possible = 3 var/finished = 0 var/const/waittime_l = 600 //lower bound on time before intercept arrives (in tenths of seconds) var/const/waittime_h = 1800 //upper bound on time before intercept arrives (in tenths of seconds) /datum/game_mode/waldo/announce() boutput(world, "The current game mode is - Waldo!") boutput(world, "A man named Waldo is likely to be somewhere on the station. You must find him (And beware of any of his compatriots!)") /datum/game_mode/waldo/pre_setup() var/list/possible_waldos = get_possible_waldos() if(possible_waldos.len < 1) return 0 var/num_players = 0 for(var/mob/new_player/player in mobs) if (player.client && player.ready) num_players++ var/num_waldos = max(1, min(round(num_players / 6), waldos_possible)) for(var/j = 0, j < num_waldos, j++) var/datum/mind/waldo = pick(possible_waldos) waldos += waldo possible_waldos.Remove(waldo) for(var/datum/mind/waldo_mind in waldos) waldo_mind.assigned_role = "MODE" //So they aren't chosen for other jobs. return 1 /datum/game_mode/waldo/post_setup() var/num_waldos = waldos.len for (var/obj/landmark/A in world) if (A.name == "Teleport-Scroll") var/scrollcount for (scrollcount = num_waldos, scrollcount > 0, scrollcount--) new /obj/item/teleportation_scroll(A.loc) qdel(A) continue var/k = 1 for(var/datum/mind/waldo in waldos) if(!waldo || !istype(waldo)) waldos.Remove(waldo) continue if(istype(waldo)) switch(k) if(1) waldo.special_role = "waldo" if(2) waldo.special_role = "odlaw" if(3) waldo.special_role = "wizard" waldo.current.resistances += list(/datum/ailment/disease/dnaspread, /datum/ailment/disease/clowning_around, /datum/ailment/disease/cluwneing_around, /datum/ailment/disease/enobola, /datum/ailment/disease/robotic_transformation) if(wizardstart.len == 0) boutput(waldo.current, "A starting location for you could not be found, please report this bug!") else var/starting_loc = pick(wizardstart) waldo.current.set_loc(starting_loc) if(waldo.special_role in list("odlaw", "wizard")) switch(rand(1,100)) if(1 to 30) var/datum/objective/assassinate/kill_objective = new kill_objective.owner = waldo kill_objective.find_target() waldo.objectives += kill_objective var/datum/objective/escape/escape_objective = new escape_objective.owner = waldo waldo.objectives += escape_objective if(31 to 60) var/datum/objective/force_evac_time/evac_objective = new evac_objective.owner = waldo waldo.objectives += evac_objective var/datum/objective/steal/steal_objective = new steal_objective.owner = waldo steal_objective.find_target() waldo.objectives += steal_objective var/datum/objective/escape/escape_objective = new escape_objective.owner = waldo waldo.objectives += escape_objective if(61 to 85) var/datum/objective/assassinate/kill_objective = new kill_objective.owner = waldo kill_objective.find_target() waldo.objectives += kill_objective var/datum/objective/steal/steal_objective = new steal_objective.owner = waldo steal_objective.find_target() waldo.objectives += steal_objective var/datum/objective/survive/survive_objective = new survive_objective.owner = waldo waldo.objectives += survive_objective else var/datum/objective/hijack_group/hijack_objective = new hijack_objective.owner = waldo hijack_objective.accomplices = waldos - waldo waldo.objectives += hijack_objective else var/datum/objective/stealth/stealth_objective = new stealth_objective.owner = waldo stealth_objective.get_score_count() stealth_objective.safe_minds = waldos - waldo waldo.objectives += stealth_objective var/datum/objective/escape/escape_objective = new escape_objective.owner = waldo waldo.objectives += escape_objective switch(waldo.special_role) if("waldo") boutput(waldo.current, "You are Waldo!") waldo.current.real_name = "Waldo" if("odlaw") boutput(waldo.current, "You are Odlaw!") waldo.current.real_name = "Odlaw" if("wizard") boutput(waldo.current, "You are Wizard Whitebeard!") waldo.current.real_name = "Wizard Whitebeard" equip_waldo(waldo.current) boutput(waldo.current, "You have come to [station_name()] to carry out the following tasks:") var/obj_count = 1 for(var/datum/objective/objective in waldo.objectives) boutput(waldo.current, "Objective #[obj_count]: [objective.explanation_text]") obj_count++ if(waldo.special_role == "waldo") boutput(waldo.current, "WARNING: Being away from the station (ie. in space) will decrement your stealth points! Stay alive on the station!") k++ // var/I = image(antag_wizard, loc = waldo.current) // waldo.current.client.images += I // waldo.current << browse('waldo.jpg',"window=some;titlebar=1;size=550x400;can_minimize=0;can_resize=0") spawn (rand(waittime_l, waittime_h)) send_intercept() /datum/game_mode/waldo/proc/get_possible_waldos() var/list/candidates = list() for(var/mob/new_player/player in mobs) if((player.client) && (player.ready)) if(player.client.preferences.be_syndicate) candidates += player.mind if(candidates.len < 1) for(var/mob/new_player/player in mobs) if((player.client) && (player.ready)) candidates += player.mind if(candidates.len < 1) return null else return candidates /datum/game_mode/waldo/proc/equip_waldo(mob/living/carbon/human/waldo_mob) if (!istype(waldo_mob)) return var/datum/mind/waldo_mind = waldo_mob.mind if(waldo_mind) switch(waldo_mind.special_role) if("waldo") waldo_mob.verbs += /client/proc/waldo_decoys waldo_mob.equip_if_possible(new /obj/item/clothing/shoes/brown(waldo_mob), waldo_mob.slot_shoes) waldo_mob.equip_if_possible(new /obj/item/clothing/under/waldo(waldo_mob), waldo_mob.slot_w_uniform) waldo_mob.equip_if_possible(new /obj/item/clothing/head/waldohat(waldo_mob), waldo_mob.slot_head) waldo_mob.equip_if_possible(new /obj/item/device/pda2/syndicate(waldo_mob), waldo_mob.slot_belt) waldo_mob.w_uniform.cant_self_remove = 1 waldo_mob.head.cant_self_remove = 1 waldo_mob.w_uniform.cant_other_remove = 1 waldo_mob.head.cant_other_remove = 1 if("odlaw") waldo_mob.equip_if_possible(new /obj/item/clothing/shoes/black(waldo_mob), waldo_mob.slot_shoes) waldo_mob.equip_if_possible(new /obj/item/clothing/under/odlaw(waldo_mob), waldo_mob.slot_w_uniform) waldo_mob.equip_if_possible(new /obj/item/clothing/head/odlawhat(waldo_mob), waldo_mob.slot_head) waldo_mob.equip_if_possible(new /obj/item/device/pda2/syndicate(waldo_mob), waldo_mob.slot_belt) waldo_mob.w_uniform.cant_self_remove = 1 waldo_mob.head.cant_self_remove = 1 waldo_mob.w_uniform.cant_other_remove = 1 waldo_mob.head.cant_other_remove = 1 equip_traitor(waldo_mob) if("wizard") waldo_mob.verbs += /client/proc/invisibility waldo_mob.verbs += /client/proc/mass_teleport var/freq = 1441 var/list/freqlist = list() while (freq <= 1489) if (freq < 1451 || freq > 1459) freqlist += freq freq += 2 if ((freq % 2) == 0) freq += 1 freq = freqlist[rand(1, freqlist.len)] // generate a passcode if the uplink is hidden in a PDA var/pda_pass = "[rand(100,999)] [pick("Morgan","Circe","Prospero","Merlin")]" waldo_mob.equip_if_possible(new /obj/item/clothing/under/color/white(waldo_mob), waldo_mob.slot_w_uniform) waldo_mob.equip_if_possible(new /obj/item/clothing/suit/wizrobe(waldo_mob), waldo_mob.slot_wear_suit) waldo_mob.equip_if_possible(new /obj/item/clothing/head/wizard(waldo_mob), waldo_mob.slot_head) waldo_mob.equip_if_possible(new /obj/item/clothing/shoes/sandal(waldo_mob), waldo_mob.slot_shoes) waldo_mob.equip_if_possible(new /obj/item/staff(waldo_mob), waldo_mob.slot_r_hand) waldo_mob.equip_if_possible(new /obj/item/device/pda2/syndicate(waldo_mob), waldo_mob.slot_belt) var/loc_text = "" var/obj/item/device/R = null //Hide the uplink in a PDA if available, otherwise radio if (!R && istype(waldo_mob.belt, /obj/item/device/pda2)) R = waldo_mob.belt loc_text = "on your belt" if (!R && istype(waldo_mob.l_hand, /obj/item/storage)) var/obj/item/storage/S = waldo_mob.l_hand var/list/L = S.return_inv() for (var/obj/item/device/radio/foo in L) R = foo loc_text = "in the [S.name] in your left hand" break if (!R && istype(waldo_mob.r_hand, /obj/item/storage)) var/obj/item/storage/S = waldo_mob.r_hand var/list/L = S.return_inv() for (var/obj/item/device/radio/foo in L) R = foo loc_text = "in the [S.name] in your right hand" break if (!R && istype(waldo_mob.back, /obj/item/storage)) var/obj/item/storage/S = waldo_mob.back var/list/L = S.return_inv() for (var/obj/item/device/radio/foo in L) R = foo loc_text = "in the [S.name] on your back" break if(!R) R = new /obj/item/device/radio/headset(waldo_mob) loc_text = "in the [S.name] on your back" waldo_mob.equip_if_possible(R, waldo_mob.slot_in_backpack) if (!R && waldo_mob.w_uniform && istype(waldo_mob.belt, /obj/item/device/radio)) R = waldo_mob.belt loc_text = "on your belt" if (!R && istype(waldo_mob.ears, /obj/item/device/radio)) R = waldo_mob.ears loc_text = "on your head" if (!R) boutput(waldo_mob, "Unfortunately, the Space Wizards Federation wasn't able to get you a radio.") else if (istype(R, /obj/item/device/radio)) var/obj/item/SWF_uplink/T = new /obj/item/SWF_uplink(R) R:traitorradio = T R:traitor_frequency = freq T.name = R.name T.icon_state = R.icon_state T.origradio = R boutput(waldo_mob, "The Space Waldos Federation have cunningly disguised a spell book as your [R.name] [loc_text]. Simply dial the frequency [format_frequency(freq)] to unlock it's hidden features.") waldo_mob.mind.store_memory("Radio Freq: [format_frequency(freq)] ([R.name] [loc_text]).") else if (istype(R, /obj/item/device/pda2)) var/obj/item/uplink/integrated/SWF/T = new /obj/item/uplink/integrated/SWF(R) R:uplink = T T.lock_code = pda_pass T.hostpda = R boutput(waldo_mob, "The Space Waldos Federation have cunningly enchanted a spellbook into your PDA [loc_text]. Simply enter the code \"[pda_pass]\" into the ringtone select to unlock its hidden features.") waldo_mob.mind.store_memory("Uplink Passcode: [pda_pass] ([R.name] [loc_text]).") waldo_mob.equip_if_possible(new /obj/item/device/radio/headset/syndicate(waldo_mob), waldo_mob.slot_ears) waldo_mob.equip_if_possible(new /obj/item/card/id/syndicate(waldo_mob), waldo_mob.slot_wear_id) waldo_mob.equip_if_possible(new /obj/item/storage/backpack(waldo_mob), waldo_mob.slot_back) waldo_mob.wear_id.registered = waldo_mob.real_name waldo_mob.wear_id.assignment = "None" waldo_mob.wear_id.name = "[waldo_mob.wear_id.registered]'s ID Card" waldo_mob.wear_id.access = get_access("Assistant") /datum/game_mode/waldo/send_intercept() var/intercepttext = "Cent. Com. Update Requested staus information: