mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Merge pull request #4255 from Fox-McCloud/how-revolutionary
Updates Revolution
This commit is contained in:
@@ -297,37 +297,38 @@
|
||||
//Keeps track of all living heads//
|
||||
///////////////////////////////////
|
||||
/datum/game_mode/proc/get_living_heads()
|
||||
var/list/heads = list()
|
||||
. = list()
|
||||
for(var/mob/living/carbon/human/player in mob_list)
|
||||
if(player.stat!=2 && player.mind && (player.mind.assigned_role in command_positions))
|
||||
heads += player.mind
|
||||
return heads
|
||||
if(player.stat != DEAD && player.mind && (player.mind.assigned_role in command_positions))
|
||||
. |= player.mind
|
||||
|
||||
/datum/game_mode/proc/get_extra_living_heads()
|
||||
var/list/heads = list()
|
||||
var/list/alt_positions = list("Warden", "Magistrate", "Blueshield", "Nanotrasen Representative")
|
||||
for(var/mob/living/carbon/human/player in mob_list)
|
||||
if(player.stat!=2 && player.mind && (player.mind.assigned_role in alt_positions))
|
||||
heads += player.mind
|
||||
return heads
|
||||
|
||||
////////////////////////////
|
||||
//Keeps track of all heads//
|
||||
////////////////////////////
|
||||
/datum/game_mode/proc/get_all_heads()
|
||||
var/list/heads = list()
|
||||
. = list()
|
||||
for(var/mob/player in mob_list)
|
||||
if(player.mind && (player.mind.assigned_role in command_positions))
|
||||
heads += player.mind
|
||||
return heads
|
||||
. |= player.mind
|
||||
|
||||
/datum/game_mode/proc/get_extra_heads()
|
||||
var/list/heads = list()
|
||||
var/list/alt_positions = list("Warden", "Magistrate", "Blueshield", "Nanotrasen Representative")
|
||||
for(var/mob/player in mob_list)
|
||||
if(player.mind && (player.mind.assigned_role in alt_positions))
|
||||
heads += player.mind
|
||||
return heads
|
||||
//////////////////////////////////////////////
|
||||
//Keeps track of all living security members//
|
||||
//////////////////////////////////////////////
|
||||
/datum/game_mode/proc/get_living_sec()
|
||||
. = list()
|
||||
for(var/mob/living/carbon/human/player in mob_list)
|
||||
if(player.stat != DEAD && player.mind && (player.mind.assigned_role in security_positions))
|
||||
. |= player.mind
|
||||
|
||||
////////////////////////////////////////
|
||||
//Keeps track of all security members//
|
||||
////////////////////////////////////////
|
||||
/datum/game_mode/proc/get_all_sec()
|
||||
. = list()
|
||||
for(var/mob/living/carbon/human/player in mob_list)
|
||||
if(player.mind && (player.mind.assigned_role in security_positions))
|
||||
. |= player.mind
|
||||
|
||||
/datum/game_mode/proc/check_antagonists_topic(href, href_list[])
|
||||
return 0
|
||||
|
||||
@@ -4,31 +4,27 @@
|
||||
// Just make sure the converter is a head before you call it!
|
||||
// To remove a rev (from brainwashing or w/e), call ticker.mode:remove_revolutionary(_THE_PLAYERS_MIND_),
|
||||
// this will also check they're not a head, so it can just be called freely
|
||||
// If the rev icons start going wrong for some reason, ticker.mode:update_all_rev_icons() can be called to correct them.
|
||||
// If the game somtimes isn't registering a win properly, then ticker.mode.check_win() isn't being called somewhere.
|
||||
|
||||
/datum/game_mode
|
||||
var/list/datum/mind/head_revolutionaries = list()
|
||||
var/list/datum/mind/revolutionaries = list()
|
||||
var/extra_heads = 0
|
||||
|
||||
/datum/game_mode/revolution
|
||||
name = "revolution"
|
||||
config_tag = "revolution"
|
||||
restricted_jobs = list("Security Officer", "Warden", "Detective", "Internal Affairs Agent", "AI", "Cyborg","Captain", "Head of Personnel", "Head of Security", "Chief Engineer", "Research Director", "Chief Medical Officer", "Blueshield", "Nanotrasen Representative", "Security Pod Pilot", "Magistrate", "Brig Physician")
|
||||
protected_jobs = list()
|
||||
required_players = 4
|
||||
required_players_secret = 15
|
||||
required_enemies = 3
|
||||
required_players = 20
|
||||
required_players_secret = 20
|
||||
required_enemies = 1
|
||||
recommended_enemies = 3
|
||||
|
||||
|
||||
uplink_welcome = "Revolutionary Uplink Console:"
|
||||
uplink_uses = 20
|
||||
|
||||
var/finished = 0
|
||||
var/checkwin_counter = 0
|
||||
var/check_counter = 0
|
||||
var/max_headrevs = 3
|
||||
var/list/datum/mind/heads_to_kill = list()
|
||||
var/list/possible_revolutionaries = list()
|
||||
|
||||
///////////////////////////
|
||||
//Announces the game type//
|
||||
///////////////////////////
|
||||
@@ -41,17 +37,17 @@
|
||||
//Gets the round setup, cancelling if there's not enough players at the start//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/datum/game_mode/revolution/pre_setup()
|
||||
possible_revolutionaries = get_players_for_role(ROLE_REV)
|
||||
|
||||
if(config.protect_roles_from_antagonist)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/datum/mind/possible_headrevs = get_players_for_role(ROLE_REV)
|
||||
|
||||
for (var/i=1 to max_headrevs)
|
||||
if(possible_headrevs.len==0)
|
||||
if(possible_revolutionaries.len==0)
|
||||
break
|
||||
var/datum/mind/lenin = pick(possible_headrevs)
|
||||
possible_headrevs -= lenin
|
||||
var/datum/mind/lenin = pick(possible_revolutionaries)
|
||||
possible_revolutionaries -= lenin
|
||||
head_revolutionaries += lenin
|
||||
lenin.restricted_roles = restricted_jobs
|
||||
|
||||
@@ -63,22 +59,24 @@
|
||||
|
||||
/datum/game_mode/revolution/post_setup()
|
||||
var/list/heads = get_living_heads()
|
||||
if(num_players_started() >= 30)
|
||||
heads += get_extra_living_heads()
|
||||
extra_heads = 1
|
||||
var/list/sec = get_living_sec()
|
||||
var/weighted_score = min(max(round(heads.len - ((8 - sec.len) / 3)),1),max_headrevs)
|
||||
|
||||
while(weighted_score < head_revolutionaries.len) //das vi danya
|
||||
var/datum/mind/trotsky = pick(head_revolutionaries)
|
||||
possible_revolutionaries += trotsky
|
||||
head_revolutionaries -= trotsky
|
||||
update_rev_icons_removed(trotsky)
|
||||
|
||||
for(var/datum/mind/rev_mind in head_revolutionaries)
|
||||
log_game("[rev_mind.key] (ckey) has been selected as a head rev")
|
||||
for(var/datum/mind/head_mind in heads)
|
||||
var/datum/objective/mutiny/rev_obj = new
|
||||
rev_obj.owner = rev_mind
|
||||
rev_obj.target = head_mind
|
||||
rev_obj.explanation_text = "Assassinate [head_mind.name], the [head_mind.assigned_role]."
|
||||
rev_mind.objectives += rev_obj
|
||||
mark_for_death(rev_mind, head_mind)
|
||||
|
||||
// equip_traitor(rev_mind.current, 1) //changing how revs get assigned their uplink so they can get PDA uplinks. --NEO
|
||||
// Removing revolutionary uplinks. -Pete
|
||||
equip_revolutionary(rev_mind.current)
|
||||
update_rev_icons_added(rev_mind)
|
||||
spawn(rand(10,100))
|
||||
// equip_traitor(rev_mind.current, 1) //changing how revs get assigned their uplink so they can get PDA uplinks. --NEO
|
||||
// Removing revolutionary uplinks. -Pete
|
||||
equip_revolutionary(rev_mind.current)
|
||||
|
||||
for(var/datum/mind/rev_mind in head_revolutionaries)
|
||||
greet_revolutionary(rev_mind)
|
||||
@@ -89,71 +87,29 @@
|
||||
|
||||
|
||||
/datum/game_mode/revolution/process()
|
||||
checkwin_counter++
|
||||
if(checkwin_counter >= 5)
|
||||
check_counter++
|
||||
if(check_counter >= 5)
|
||||
if(!finished)
|
||||
check_heads()
|
||||
ticker.mode.check_win()
|
||||
checkwin_counter = 0
|
||||
check_counter = 0
|
||||
return 0
|
||||
|
||||
/proc/get_rev_mode()
|
||||
if(!ticker || !istype(ticker.mode, /datum/game_mode/revolution))
|
||||
return null
|
||||
|
||||
/**
|
||||
* LateSpawn hook.
|
||||
* Called in newplayer.dm when a humanoid character joins the round after it started.
|
||||
* Parameters: var/mob/living/carbon/human, var/rank
|
||||
*/
|
||||
/hook/latespawn/proc/add_latejoiner_heads(var/mob/living/carbon/human/H)
|
||||
var/datum/game_mode/revolution/mode = get_rev_mode()
|
||||
if (!mode) return 1
|
||||
|
||||
var/list/heads = list()
|
||||
var/list/alt_positions = list("Warden", "Magistrate", "Blueshield", "Nanotrasen Representative")
|
||||
|
||||
if(H.stat!=2 && H.mind && (H.mind.assigned_role in command_positions))
|
||||
heads += H
|
||||
|
||||
if(mode.extra_heads)
|
||||
if(H.stat!=2 && H.mind && (H.mind.assigned_role in alt_positions))
|
||||
heads += H
|
||||
|
||||
for(var/datum/mind/rev_mind in mode.head_revolutionaries)
|
||||
for(var/datum/mind/head_mind in heads)
|
||||
var/datum/objective/mutiny/rev_obj = new
|
||||
rev_obj.owner = rev_mind
|
||||
rev_obj.target = head_mind
|
||||
rev_obj.explanation_text = "Assassinate [head_mind.name], the [head_mind.assigned_role]."
|
||||
rev_mind.objectives += rev_obj
|
||||
to_chat(rev_mind.current, "Additional Objective: Assassinate [head_mind.name], the [head_mind.assigned_role].")
|
||||
|
||||
for(var/datum/mind/rev_mind in mode.revolutionaries)
|
||||
for(var/datum/mind/head_mind in heads)
|
||||
var/datum/objective/mutiny/rev_obj = new
|
||||
rev_obj.owner = rev_mind
|
||||
rev_obj.target = head_mind
|
||||
rev_obj.explanation_text = "Assassinate [head_mind.name], the [head_mind.assigned_role]."
|
||||
rev_mind.objectives += rev_obj
|
||||
to_chat(rev_mind.current, "Additional Objective: Assassinate [head_mind.name], the [head_mind.assigned_role].")
|
||||
|
||||
|
||||
/datum/game_mode/proc/forge_revolutionary_objectives(var/datum/mind/rev_mind)
|
||||
/datum/game_mode/proc/forge_revolutionary_objectives(datum/mind/rev_mind)
|
||||
var/list/heads = get_living_heads()
|
||||
if(num_players_started() >= 30)
|
||||
heads += get_extra_living_heads()
|
||||
extra_heads = 1
|
||||
for(var/datum/mind/head_mind in heads)
|
||||
var/datum/objective/mutiny/rev_obj = new
|
||||
rev_obj.owner = rev_mind
|
||||
rev_obj.target = head_mind
|
||||
rev_obj.explanation_text = "Assassinate [head_mind.name], the [head_mind.assigned_role]."
|
||||
rev_obj.explanation_text = "Assassinate or exile [head_mind.name], the [head_mind.assigned_role]."
|
||||
rev_mind.objectives += rev_obj
|
||||
|
||||
/datum/game_mode/proc/greet_revolutionary(var/datum/mind/rev_mind, var/you_are=1)
|
||||
/datum/game_mode/proc/greet_revolutionary(datum/mind/rev_mind, you_are=1)
|
||||
var/obj_count = 1
|
||||
update_rev_icons_added(rev_mind)
|
||||
if (you_are)
|
||||
to_chat(rev_mind.current, "\blue You are a member of the revolutionaries' leadership!")
|
||||
to_chat(rev_mind.current, "<span class='userdanger'>You are a member of the revolutionaries' leadership!</span>")
|
||||
for(var/datum/objective/objective in rev_mind.objectives)
|
||||
to_chat(rev_mind.current, "<B>Objective #[obj_count]</B>: [objective.explanation_text]")
|
||||
rev_mind.special_role = "Head Revolutionary"
|
||||
@@ -173,6 +129,8 @@
|
||||
|
||||
|
||||
var/obj/item/device/flash/T = new(mob)
|
||||
var/obj/item/toy/crayon/spraycan/R = new(mob)
|
||||
var/obj/item/clothing/glasses/hud/security/chameleon/C = new(mob)
|
||||
|
||||
var/list/slots = list (
|
||||
"backpack" = slot_in_backpack,
|
||||
@@ -182,13 +140,67 @@
|
||||
"right hand" = slot_r_hand,
|
||||
)
|
||||
var/where = mob.equip_in_one_of_slots(T, slots)
|
||||
var/where2 = mob.equip_in_one_of_slots(C, slots)
|
||||
mob.equip_in_one_of_slots(R,slots)
|
||||
|
||||
mob.update_icons()
|
||||
|
||||
if (!where2)
|
||||
to_chat(mob, "The Syndicate were unfortunately unable to get you a chameleon security HUD.")
|
||||
else
|
||||
to_chat(mob, "The chameleon security HUD in your [where2] will help you keep track of who is loyalty-implanted, and unable to be recruited.")
|
||||
|
||||
if (!where)
|
||||
to_chat(mob, "The Syndicate were unfortunately unable to get you a flash.")
|
||||
else
|
||||
to_chat(mob, "The flash in your [where] will help you to persuade the crew to join your cause.")
|
||||
mob.update_icons()
|
||||
return 1
|
||||
|
||||
/////////////////////////////////
|
||||
//Gives head revs their targets//
|
||||
/////////////////////////////////
|
||||
/datum/game_mode/revolution/proc/mark_for_death(datum/mind/rev_mind, datum/mind/head_mind)
|
||||
var/datum/objective/mutiny/rev_obj = new
|
||||
rev_obj.owner = rev_mind
|
||||
rev_obj.target = head_mind
|
||||
rev_obj.explanation_text = "Assassinate [head_mind.name], the [head_mind.assigned_role]."
|
||||
rev_mind.objectives += rev_obj
|
||||
heads_to_kill += head_mind
|
||||
|
||||
////////////////////////////////////////////
|
||||
//Checks if new heads have joined midround//
|
||||
////////////////////////////////////////////
|
||||
/datum/game_mode/revolution/proc/check_heads()
|
||||
var/list/heads = get_all_heads()
|
||||
var/list/sec = get_all_sec()
|
||||
if(heads_to_kill.len < heads.len)
|
||||
var/list/new_heads = heads - heads_to_kill
|
||||
for(var/datum/mind/head_mind in new_heads)
|
||||
for(var/datum/mind/rev_mind in head_revolutionaries)
|
||||
mark_for_death(rev_mind, head_mind)
|
||||
|
||||
if(head_revolutionaries.len < max_headrevs && head_revolutionaries.len < round(heads.len - ((8 - sec.len) / 3)))
|
||||
latejoin_headrev()
|
||||
|
||||
///////////////////////////////
|
||||
//Adds a new headrev midround//
|
||||
///////////////////////////////
|
||||
/datum/game_mode/revolution/proc/latejoin_headrev()
|
||||
if(revolutionaries) //Head Revs are not in this list
|
||||
var/list/promotable_revs = list()
|
||||
for(var/datum/mind/khrushchev in revolutionaries)
|
||||
if(khrushchev.current && khrushchev.current.client && khrushchev.current.stat != DEAD)
|
||||
if(ROLE_REV in khrushchev.current.client.prefs.be_special)
|
||||
promotable_revs += khrushchev
|
||||
if(promotable_revs.len)
|
||||
var/datum/mind/stalin = pick(promotable_revs)
|
||||
revolutionaries -= stalin
|
||||
head_revolutionaries += stalin
|
||||
log_game("[stalin.key] (ckey) has been promoted to a head rev")
|
||||
equip_revolutionary(stalin.current)
|
||||
forge_revolutionary_objectives(stalin)
|
||||
greet_revolutionary(stalin)
|
||||
|
||||
//////////////////////////////////////
|
||||
//Checks if the revs have won or not//
|
||||
//////////////////////////////////////
|
||||
@@ -205,9 +217,16 @@
|
||||
/datum/game_mode/revolution/check_finished()
|
||||
if(config.continuous_rounds)
|
||||
if(finished != 0)
|
||||
if(shuttle_master && shuttle_master.emergencyNoEscape)
|
||||
shuttle_master.emergencyNoEscape = 0
|
||||
return finished != 0
|
||||
shuttle_master.emergencyNoEscape = 0
|
||||
if(shuttle_master.emergency.mode == SHUTTLE_STRANDED)
|
||||
shuttle_master.emergency.mode = SHUTTLE_DOCKED
|
||||
shuttle_master.emergency.timer = world.time
|
||||
command_announcement.Announce("Hostile enviroment resolved. You have 3 minutes to board the Emergency Shuttle.", null, 'sound/AI/shuttledock.ogg')
|
||||
return ..()
|
||||
if(finished != 0)
|
||||
return 1
|
||||
else
|
||||
return ..()
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
//Deals with converting players to the revolution//
|
||||
@@ -216,13 +235,18 @@
|
||||
if(rev_mind.assigned_role in command_positions)
|
||||
return 0
|
||||
var/mob/living/carbon/human/H = rev_mind.current//Check to see if the potential rev is implanted
|
||||
for(var/obj/item/weapon/implant/loyalty/L in H)//Checking that there is a loyalty implant in the contents
|
||||
if(L.imp_in == H)//Checking that it's actually implanted
|
||||
return 0
|
||||
if(isloyal(H))
|
||||
return 0
|
||||
if((rev_mind in revolutionaries) || (rev_mind in head_revolutionaries))
|
||||
return 0
|
||||
revolutionaries += rev_mind
|
||||
to_chat(rev_mind.current, "\red <FONT size = 3> You are now a revolutionary! Help your cause. Do not harm your fellow freedom fighters. You can identify your comrades by the red \"R\" icons, and your leaders by the blue \"R\" icons. Help them kill the heads to win the revolution!</FONT>")
|
||||
if(iscarbon(rev_mind.current))
|
||||
var/mob/living/carbon/carbon_mob = rev_mind.current
|
||||
carbon_mob.silent = max(carbon_mob.silent, 5)
|
||||
carbon_mob.flash_eyes(1, 1)
|
||||
rev_mind.current.Stun(5)
|
||||
to_chat(rev_mind.current, "<span class='danger'><FONT size = 3> You are now a revolutionary! Help your cause. Do not harm your fellow freedom fighters. You can identify your comrades by the red \"R\" icons, and your leaders by the blue \"R\" icons. Help them kill the heads to win the revolution!</FONT></span>")
|
||||
rev_mind.current.attack_log += "\[[time_stamp()]\] <font color='red'>Has been converted to the revolution!</font>"
|
||||
rev_mind.special_role = "Revolutionary"
|
||||
update_rev_icons_added(rev_mind)
|
||||
if(jobban_isbanned(rev_mind.current, ROLE_REV))
|
||||
@@ -232,15 +256,23 @@
|
||||
//Deals with players being converted from the revolution (Not a rev anymore)// // Modified to handle borged MMIs. Accepts another var if the target is being borged at the time -- Polymorph.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/datum/game_mode/proc/remove_revolutionary(datum/mind/rev_mind , beingborged)
|
||||
if(rev_mind in revolutionaries)
|
||||
var/remove_head = 0
|
||||
if(beingborged && (rev_mind in head_revolutionaries))
|
||||
head_revolutionaries -= rev_mind
|
||||
remove_head = 1
|
||||
|
||||
if((rev_mind in revolutionaries) || remove_head)
|
||||
revolutionaries -= rev_mind
|
||||
rev_mind.special_role = null
|
||||
rev_mind.current.attack_log += "\[[time_stamp()]\] <font color='red'>Has renounced the revolution!</font>"
|
||||
|
||||
if(beingborged)
|
||||
to_chat(rev_mind.current, "\red <FONT size = 3><B>The frame's firmware detects and deletes your neural reprogramming! You remember nothing from the moment you were flashed until now.</B></FONT>")
|
||||
message_admins("[key_name_admin(rev_mind.current)] has been borged while being a member of the revolution.")
|
||||
to_chat(rev_mind.current, "<span class='danger'><FONT size = 3>The frame's firmware detects and deletes your neural reprogramming! You remember nothing[remove_head ? "." : " but the name of the one who flashed you."]</FONT></span>")
|
||||
message_admins("[key_name_admin(rev_mind.current)] <A HREF='?_src_=holder;adminmoreinfo=\ref[rev_mind.current]'>?</A> (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[rev_mind.current]'>FLW</A>) has been borged while being a [remove_head ? "leader" : " member"] of the revolution.")
|
||||
|
||||
else
|
||||
to_chat(rev_mind.current, "\red <FONT size = 3><B>You have been brainwashed! You are no longer a revolutionary! Your memory is hazy from the time you were a rebel...the only thing you remember is the name of the one who brainwashed you...</B></FONT>")
|
||||
rev_mind.current.Paralyse(5)
|
||||
to_chat(rev_mind.current, "<span class='danger'><FONT size = 3>You have been brainwashed! You are no longer a revolutionary! Your memory is hazy from the time you were a rebel...the only thing you remember is the name of the one who brainwashed you...</FONT></span>")
|
||||
|
||||
update_rev_icons_removed(rev_mind)
|
||||
for(var/mob/living/M in view(rev_mind.current))
|
||||
@@ -250,7 +282,6 @@
|
||||
else
|
||||
to_chat(M, "[rev_mind.current] looks like they just remembered their real allegiance!")
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
//Adds the rev hud to a new convert//
|
||||
/////////////////////////////////////
|
||||
@@ -266,6 +297,7 @@
|
||||
var/datum/atom_hud/antag/revhud = huds[ANTAG_HUD_REV]
|
||||
revhud.leave_hud(rev_mind.current)
|
||||
set_antag_hud(rev_mind.current, null)
|
||||
|
||||
//////////////////////////
|
||||
//Checks for rev victory//
|
||||
//////////////////////////
|
||||
@@ -283,7 +315,7 @@
|
||||
/datum/game_mode/revolution/proc/check_heads_victory()
|
||||
for(var/datum/mind/rev_mind in head_revolutionaries)
|
||||
var/turf/T = get_turf(rev_mind.current)
|
||||
if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != 2) && rev_mind.current.client && T && (T.z in config.station_levels))
|
||||
if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != 2) && rev_mind.current.client && T && (T.z == ZLEVEL_STATION))
|
||||
if(ishuman(rev_mind.current))
|
||||
return 0
|
||||
return 1
|
||||
@@ -294,96 +326,50 @@
|
||||
/datum/game_mode/revolution/declare_completion()
|
||||
if(finished == 1)
|
||||
feedback_set_details("round_end_result","win - heads killed")
|
||||
to_chat(world, "\red <FONT size = 3><B> The heads of staff were killed or abandoned the station! The revolutionaries win!</B></FONT>")
|
||||
to_chat(world, "<span class='redtext'>The heads of staff were killed or exiled! The revolutionaries win!</span>")
|
||||
else if(finished == 2)
|
||||
feedback_set_details("round_end_result","loss - rev heads killed")
|
||||
to_chat(world, "\red <FONT size = 3><B> The heads of staff managed to stop the revolution!</B></FONT>")
|
||||
to_chat(world, "<span class='redtext'>The heads of staff managed to stop the revolution!</span>")
|
||||
..()
|
||||
return 1
|
||||
|
||||
/datum/game_mode/proc/auto_declare_completion_revolution()
|
||||
var/list/targets = list()
|
||||
|
||||
if(head_revolutionaries.len || istype(ticker.mode,/datum/game_mode/revolution))
|
||||
var/text = "<FONT size = 2><B>The head revolutionaries were:</B></FONT>"
|
||||
|
||||
var/num_revs = 0
|
||||
var/num_survivors = 0
|
||||
for(var/mob/living/carbon/survivor in living_mob_list)
|
||||
if(survivor.ckey)
|
||||
num_survivors++
|
||||
if(survivor.mind)
|
||||
if((survivor.mind in head_revolutionaries) || (survivor.mind in revolutionaries))
|
||||
num_revs++
|
||||
if(num_survivors)
|
||||
to_chat(world, "[TAB]Command's Approval Rating: <B>[100 - round((num_revs/num_survivors)*100, 0.1)]%</B>") // % of loyal crew
|
||||
var/text = "<br><font size=3><b>The head revolutionaries were:</b></font>"
|
||||
for(var/datum/mind/headrev in head_revolutionaries)
|
||||
text += "<br>[headrev.key] was [headrev.name] ("
|
||||
if(headrev.current)
|
||||
if(headrev.current.stat == DEAD)
|
||||
text += "died"
|
||||
else if(!(headrev.current.z in config.station_levels))
|
||||
text += "fled the station"
|
||||
else
|
||||
text += "survived the revolution"
|
||||
if(headrev.current.real_name != headrev.name)
|
||||
text += " as [headrev.current.real_name]"
|
||||
else
|
||||
text += "body destroyed"
|
||||
text += ")"
|
||||
|
||||
for(var/datum/objective/mutiny/objective in headrev.objectives)
|
||||
targets |= objective.target
|
||||
|
||||
text += printplayer(headrev, 1)
|
||||
text += "<br>"
|
||||
to_chat(world, text)
|
||||
|
||||
if(revolutionaries.len || istype(ticker.mode,/datum/game_mode/revolution))
|
||||
var/text = "<FONT size = 2><B>The revolutionaries were:</B></FONT>"
|
||||
|
||||
var/text = "<br><font size=3><b>The revolutionaries were:</b></font>"
|
||||
for(var/datum/mind/rev in revolutionaries)
|
||||
text += "<br>[rev.key] was [rev.name] ("
|
||||
if(rev.current)
|
||||
if(rev.current.stat == DEAD)
|
||||
text += "died"
|
||||
else if(!(rev.current.z in config.station_levels))
|
||||
text += "fled the station"
|
||||
else
|
||||
text += "survived the revolution"
|
||||
if(rev.current.real_name != rev.name)
|
||||
text += " as [rev.current.real_name]"
|
||||
else
|
||||
text += "body destroyed"
|
||||
text += ")"
|
||||
|
||||
text += printplayer(rev, 1)
|
||||
text += "<br>"
|
||||
to_chat(world, text)
|
||||
|
||||
|
||||
if( head_revolutionaries.len || revolutionaries.len || istype(ticker.mode,/datum/game_mode/revolution) )
|
||||
var/text = "<FONT size = 2><B>The heads of staff were:</B></FONT>"
|
||||
|
||||
var/text = "<br><font size=3><b>The heads of staff were:</b></font>"
|
||||
var/list/heads = get_all_heads()
|
||||
if(extra_heads)
|
||||
heads += get_extra_heads()
|
||||
for(var/datum/mind/head in heads)
|
||||
var/target = (head in targets)
|
||||
if(target)
|
||||
text += "<font color='red'>"
|
||||
text += "<br>[head.key] was [head.name] ("
|
||||
if(head.current)
|
||||
if(head.current.stat == DEAD)
|
||||
text += "died"
|
||||
else if(!(head.current.z in config.station_levels))
|
||||
text += "fled the station"
|
||||
else
|
||||
text += "survived the revolution"
|
||||
if(head.current.real_name != head.name)
|
||||
text += " as [head.current.real_name]"
|
||||
else
|
||||
text += "body destroyed"
|
||||
text += ")"
|
||||
if(target)
|
||||
text += "</font>"
|
||||
|
||||
text += "<span class='boldannounce'>Target</span>"
|
||||
text += printplayer(head, 1)
|
||||
text += "<br>"
|
||||
to_chat(world, text)
|
||||
|
||||
/proc/is_convertable_to_rev(datum/mind/mind)
|
||||
return istype(mind) && \
|
||||
istype(mind.current, /mob/living/carbon/human) && \
|
||||
!(mind.assigned_role in command_positions) && \
|
||||
!(mind.assigned_role in list("Security Officer", "Detective", "Warden", "Nanotrasen Representative"))
|
||||
|
||||
|
||||
|
||||
/datum/game_mode/revolution/set_scoreboard_gvars()
|
||||
var/foecount = 0
|
||||
for(var/datum/mind/M in ticker.mode.head_revolutionaries)
|
||||
|
||||
@@ -1,257 +0,0 @@
|
||||
// BS12's less violent revolution mode
|
||||
// Isn't this basically mutiny but without any real reason
|
||||
|
||||
/datum/game_mode/revolution/rp_revolution
|
||||
name = "rp-revolution"
|
||||
config_tag = "rp-revolution"
|
||||
required_players = 4
|
||||
required_players_secret = 12
|
||||
required_enemies = 3
|
||||
recommended_enemies = 3
|
||||
|
||||
uplink_welcome = "Revolutionary Uplink Console:"
|
||||
uplink_uses = 10
|
||||
|
||||
newscaster_announcements = /datum/news_announcement/revolution_inciting_event
|
||||
|
||||
var/last_command_report = 0
|
||||
var/list/heads = list()
|
||||
var/tried_to_add_revheads = 0
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//Gets the round setup, cancelling if there's not enough players at the start//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/datum/game_mode/revolution/rp_revolution/pre_setup()
|
||||
|
||||
if(config.protect_roles_from_antagonist)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/num_players = num_players()
|
||||
max_headrevs = max(num_players / 4, 3)
|
||||
recommended_enemies = max_headrevs
|
||||
|
||||
var/list/datum/mind/possible_headrevs = get_players_for_role(ROLE_REV)
|
||||
|
||||
var/head_check = 0
|
||||
for(var/mob/new_player/player in player_list)
|
||||
if(player.mind.assigned_role in command_positions)
|
||||
head_check = 1
|
||||
break
|
||||
|
||||
for (var/i=1 to max_headrevs)
|
||||
if (possible_headrevs.len==0)
|
||||
break
|
||||
var/datum/mind/lenin = pick(possible_headrevs)
|
||||
possible_headrevs -= lenin
|
||||
head_revolutionaries += lenin
|
||||
lenin.restricted_roles = restricted_jobs
|
||||
|
||||
if((head_revolutionaries.len==0)||(!head_check))
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/datum/game_mode/revolution/rp_revolution/post_setup()
|
||||
heads = get_living_heads()
|
||||
|
||||
for(var/datum/mind/rev_mind in head_revolutionaries)
|
||||
for(var/datum/mind/head_mind in heads)
|
||||
var/datum/objective/mutiny/rp/rev_obj = new
|
||||
rev_obj.owner = rev_mind
|
||||
rev_obj.target = head_mind
|
||||
rev_obj.explanation_text = "Assassinate, convert or capture [head_mind.name], the [head_mind.assigned_role]."
|
||||
rev_mind.objectives += rev_obj
|
||||
|
||||
update_rev_icons_added(rev_mind)
|
||||
|
||||
for(var/datum/mind/rev_mind in head_revolutionaries)
|
||||
greet_revolutionary(rev_mind)
|
||||
rev_mind.current.verbs += /mob/living/carbon/human/proc/RevConvert
|
||||
|
||||
modePlayer += head_revolutionaries
|
||||
|
||||
|
||||
/datum/game_mode/revolution/rp_revolution/greet_revolutionary(var/datum/mind/rev_mind, var/you_are=1)
|
||||
var/obj_count = 1
|
||||
if (you_are)
|
||||
to_chat(rev_mind.current, "\blue You are a member of the revolutionaries' leadership!")
|
||||
for(var/datum/objective/objective in rev_mind.objectives)
|
||||
to_chat(rev_mind.current, "<B>Objective #[obj_count]</B>: [objective.explanation_text]")
|
||||
rev_mind.special_role = "Head Revolutionary"
|
||||
obj_count++
|
||||
|
||||
// Show each head revolutionary up to 3 candidates
|
||||
var/list/already_considered = list()
|
||||
for(var/i = 0, i < 2, i++)
|
||||
var/mob/rev_mob = rev_mind.current
|
||||
already_considered += rev_mob
|
||||
// Tell them about people they might want to contact.
|
||||
var/mob/living/carbon/human/M = get_nt_opposed()
|
||||
if(M && !(M.mind in head_revolutionaries) && !(M in already_considered))
|
||||
to_chat(rev_mob, "We have received credible reports that [M.real_name] might be willing to help our cause. If you need assistance, consider contacting them.")
|
||||
rev_mob.mind.store_memory("<b>Potential Collaborator</b>: [M.real_name]")
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
//Deals with converting players to the revolution//
|
||||
///////////////////////////////////////////////////
|
||||
/datum/game_mode/revolution/rp_revolution/add_revolutionary(datum/mind/rev_mind)
|
||||
// overwrite this func to make it so even heads can be converted
|
||||
var/mob/living/carbon/human/H = rev_mind.current//Check to see if the potential rev is implanted
|
||||
if(!is_convertible(H))
|
||||
return 0
|
||||
if((rev_mind in revolutionaries) || (rev_mind in head_revolutionaries))
|
||||
return 0
|
||||
revolutionaries += rev_mind
|
||||
to_chat(rev_mind.current, "\red <FONT size = 3> You are now a revolutionary! Help your cause. Do not harm your fellow freedom fighters. You can identify your comrades by the red \"R\" icons, and your leaders by the blue \"R\" icons. Help them kill, capture or convert the heads to win the revolution!</FONT>")
|
||||
rev_mind.special_role = "Revolutionary"
|
||||
update_rev_icons_added(rev_mind)
|
||||
return 1
|
||||
|
||||
/////////////////////////////
|
||||
//Checks for a head victory//
|
||||
/////////////////////////////
|
||||
/datum/game_mode/revolution/rp_revolution/check_heads_victory()
|
||||
for(var/datum/mind/rev_mind in head_revolutionaries)
|
||||
var/turf/T = get_turf(rev_mind.current)
|
||||
if(rev_mind.current.stat != 2)
|
||||
// TODO: add a similar check that also checks whether they're without ID in the brig..
|
||||
// probably wanna export this stuff into a separate function for use by both
|
||||
// revs and heads
|
||||
//assume that only carbon mobs can become rev heads for now
|
||||
if(!rev_mind.current:handcuffed && T && (T.z in config.station_levels))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
///////////////////////////
|
||||
//Announces the game type//
|
||||
///////////////////////////
|
||||
/datum/game_mode/revolution/rp_revolution/announce()
|
||||
to_chat(world, "<B>The current game mode is - Revolution!</B>")
|
||||
to_chat(world, "<B>Some crewmembers are attempting to start a revolution!</B>")
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//Announces the end of the game with all relavent information stated//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
/datum/game_mode/revolution/rp_revolution/declare_completion()
|
||||
if(finished == 1)
|
||||
feedback_set_details("round_end_result","win - heads overthrown")
|
||||
to_chat(world, "\red <FONT size = 3><B> The heads of staff were overthrown! The revolutionaries win!</B></FONT>")
|
||||
else if(finished == 2)
|
||||
feedback_set_details("round_end_result","loss - revolution stopped")
|
||||
to_chat(world, "\red <FONT size = 3><B> The heads of staff managed to stop the revolution!</B></FONT>")
|
||||
..()
|
||||
return 1
|
||||
|
||||
/datum/game_mode/revolution/proc/is_convertible(mob/M)
|
||||
for(var/obj/item/weapon/implant/loyalty/L in M)//Checking that there is a loyalty implant in the contents
|
||||
if(L.imp_in == M)//Checking that it's actually implanted
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/RevConvert()
|
||||
set name = "Rev-Convert"
|
||||
set category = "IC"
|
||||
var/list/Possible = list()
|
||||
for (var/mob/living/carbon/human/P in oview(src))
|
||||
if(!stat && P.client && P.mind && !P.mind.special_role)
|
||||
Possible += P
|
||||
if(!Possible.len)
|
||||
to_chat(src, "\red There doesn't appear to be anyone available for you to convert here.")
|
||||
return
|
||||
var/mob/living/carbon/human/M = input("Select a person to convert", "Viva la revolution!", null) as mob in Possible
|
||||
if(((src.mind in ticker.mode:head_revolutionaries) || (src.mind in ticker.mode:revolutionaries)))
|
||||
if((M.mind in ticker.mode:head_revolutionaries) || (M.mind in ticker.mode:revolutionaries))
|
||||
to_chat(src, "\red <b>[M] is already be a revolutionary!</b>")
|
||||
else if(!ticker.mode:is_convertible(M))
|
||||
to_chat(src, "\red <b>[M] is implanted with a loyalty implant - Remove it first!</b>")
|
||||
else
|
||||
if(world.time < M.mind.rev_cooldown)
|
||||
to_chat(src, "\red Wait five seconds before reconversion attempt.")
|
||||
return
|
||||
to_chat(src, "\red Attempting to convert [M]...")
|
||||
log_admin("[src]([src.ckey]) attempted to convert [M].")
|
||||
message_admins("\red [src]([src.ckey]) attempted to convert [M].")
|
||||
var/choice = alert(M,"Asked by [src]: Do you want to join the revolution?","Align Thyself with the Revolution!","No!","Yes!")
|
||||
if(choice == "Yes!")
|
||||
ticker.mode:add_revolutionary(M.mind)
|
||||
to_chat(M, "\blue You join the revolution!")
|
||||
to_chat(src, "\blue <b>[M] joins the revolution!</b>")
|
||||
else if(choice == "No!")
|
||||
to_chat(M, "\red You reject this traitorous cause!")
|
||||
to_chat(src, "\red <b>[M] does not support the revolution!</b>")
|
||||
M.mind.rev_cooldown = world.time+50
|
||||
|
||||
/datum/game_mode/revolution/rp_revolution/process()
|
||||
// only perform rev checks once in a while
|
||||
if(tried_to_add_revheads < world.time)
|
||||
tried_to_add_revheads = world.time+50
|
||||
var/active_revs = 0
|
||||
for(var/datum/mind/rev_mind in head_revolutionaries)
|
||||
if(rev_mind.current.client && rev_mind.current.client.inactivity <= 10*60*20) // 20 minutes inactivity are OK
|
||||
active_revs++
|
||||
|
||||
if(active_revs == 0)
|
||||
log_debug("There are zero active heads of revolution, trying to add some..")
|
||||
var/added_heads = 0
|
||||
for(var/mob/living/carbon/human/H in world) if(H.client && H.mind && H.client.inactivity <= 10*60*20 && H.mind in revolutionaries)
|
||||
head_revolutionaries += H.mind
|
||||
for(var/datum/mind/head_mind in heads)
|
||||
var/datum/objective/mutiny/rp/rev_obj = new
|
||||
rev_obj.owner = H.mind
|
||||
rev_obj.target = head_mind
|
||||
rev_obj.explanation_text = "Assassinate or capture [head_mind.name], the [head_mind.assigned_role]."
|
||||
H.mind.objectives += rev_obj
|
||||
|
||||
update_rev_icons_added(H.mind)
|
||||
H.verbs += /mob/living/carbon/human/proc/RevConvert
|
||||
|
||||
to_chat(H, "\red Congratulations, yer heads of revolution are all gone now, so yer earned yourself a promotion.")
|
||||
added_heads = 1
|
||||
break
|
||||
|
||||
if(added_heads)
|
||||
log_admin("Managed to add new heads of revolution.")
|
||||
message_admins("Managed to add new heads of revolution.")
|
||||
else
|
||||
log_admin("Unable to add new heads of revolution.")
|
||||
message_admins("Unable to add new heads of revolution.")
|
||||
tried_to_add_revheads = world.time + 6000 // wait 10 minutes
|
||||
|
||||
if(last_command_report == 0 && world.time >= 10 * 60 * 10)
|
||||
src.command_report("We are regrettably announcing that your performance has been disappointing, and we are thus forced to cut down on financial support to your station. To achieve this, the pay of all personnal, except the Heads of Staff, has been halved.")
|
||||
last_command_report = 1
|
||||
else if(last_command_report == 1 && world.time >= 10 * 60 * 30)
|
||||
src.command_report("Statistics hint that a high amount of leisure time, and associated activities, are responsible for the poor performance of many of our stations. You are to bolt and close down any leisure facilities, such as the holodeck, the theatre and the bar. Food can be distributed through vendors and the kitchen.")
|
||||
last_command_report = 2
|
||||
else if(last_command_report == 2 && world.time >= 10 * 60 * 60)
|
||||
src.command_report("It is reported that merely closing down leisure facilities has not been successful. You and your Heads of Staff are to ensure that all crew are working hard, and not wasting time or energy. Any crew caught off duty without leave from their Head of Staff are to be warned, and on repeated offence, to be brigged until the next transfer shuttle arrives, which will take them to facilities where they can be of more use.")
|
||||
last_command_report = 3
|
||||
|
||||
return ..()
|
||||
|
||||
/datum/game_mode/revolution/rp_revolution/proc/command_report(message)
|
||||
for (var/obj/machinery/computer/communications/comm in world)
|
||||
if (!(comm.stat & (BROKEN | NOPOWER)) && comm.prints_intercept)
|
||||
var/obj/item/weapon/paper/intercept = new /obj/item/weapon/paper( comm.loc )
|
||||
intercept.name = "paper- 'Cent. Com. Announcement'"
|
||||
intercept.info = message
|
||||
|
||||
comm.messagetitle.Add("Cent. Com. Announcement")
|
||||
comm.messagetext.Add(message)
|
||||
to_chat(world, sound('sound/AI/commandreport.ogg'))
|
||||
|
||||
/datum/game_mode/revolution/rp_revolution/latespawn(mob/M)
|
||||
if(M.mind.assigned_role in command_positions)
|
||||
log_debug("Adding head kill/capture/convert objective for [M.name]")
|
||||
heads += M
|
||||
|
||||
for(var/datum/mind/rev_mind in head_revolutionaries)
|
||||
var/datum/objective/mutiny/rp/rev_obj = new
|
||||
rev_obj.owner = rev_mind
|
||||
rev_obj.target = M.mind
|
||||
rev_obj.explanation_text = "Assassinate, convert or capture [M.real_name], the [M.mind.assigned_role]."
|
||||
rev_mind.objectives += rev_obj
|
||||
to_chat(rev_mind.current, "\red A new Head of Staff, [M.real_name], the [M.mind.assigned_role] has appeared. Your objectives have been updated.")
|
||||
@@ -466,15 +466,6 @@
|
||||
dat += "<td>[mob_loc.loc]</td></tr>"
|
||||
else
|
||||
dat += "<tr><td><i>Head not found!</i></td></tr>"
|
||||
if(ticker.mode.num_players_started() >= 30)
|
||||
for(var/datum/mind/N in ticker.mode.get_extra_living_heads())
|
||||
var/mob/M = N.current
|
||||
if(M)
|
||||
dat += check_antagonists_line(M)
|
||||
var/turf/mob_loc = get_turf(M)
|
||||
dat += "<td>[mob_loc.loc]</td></tr>"
|
||||
else
|
||||
dat += "<tr><td><i>Head not found!</i></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
if(istype(ticker.mode, /datum/game_mode/blob))
|
||||
|
||||
@@ -439,3 +439,54 @@
|
||||
icon_state = "cybereye-red"
|
||||
item_state = "eyepatch"
|
||||
flags = NODROP
|
||||
|
||||
/obj/item/clothing/glasses/proc/chameleon(var/mob/user)
|
||||
var/input_glasses = input(user, "Choose a piece of eyewear to disguise as.", "Choose glasses style.") as null|anything in list("Sunglasses", "Medical HUD", "Mesons", "Science Goggles", "Glasses", "Security Sunglasses","Eyepatch","Welding","Gar")
|
||||
|
||||
if(user && src in user.contents)
|
||||
switch(input_glasses)
|
||||
if("Sunglasses")
|
||||
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Enhanced shielding blocks many flashes."
|
||||
name = "sunglasses"
|
||||
icon_state = "sun"
|
||||
item_state = "sunglasses"
|
||||
if("Medical HUD")
|
||||
name = "Health Scanner HUD"
|
||||
desc = "A heads-up display that scans the humans in view and provides accurate data about their health status."
|
||||
icon_state = "healthhud"
|
||||
item_state = "healthhud"
|
||||
if("Mesons")
|
||||
name = "Optical Meson Scanner"
|
||||
desc = "Used by engineering and mining staff to see basic structural and terrain layouts through walls, regardless of lighting condition."
|
||||
icon_state = "meson"
|
||||
item_state = "meson"
|
||||
if("Science Goggles")
|
||||
name = "Science Goggles"
|
||||
desc = "A pair of snazzy goggles used to protect against chemical spills."
|
||||
icon_state = "purple"
|
||||
item_state = "glasses"
|
||||
if("Glasses")
|
||||
name = "Prescription Glasses"
|
||||
desc = "Made by Nerd. Co."
|
||||
icon_state = "glasses"
|
||||
item_state = "glasses"
|
||||
if("Security Sunglasses")
|
||||
name = "HUDSunglasses"
|
||||
desc = "Sunglasses with a HUD."
|
||||
icon_state = "sunhud"
|
||||
item_state = "sunglasses"
|
||||
if("Eyepatch")
|
||||
name = "eyepatch"
|
||||
desc = "Yarr."
|
||||
icon_state = "eyepatch"
|
||||
item_state = "eyepatch"
|
||||
if("Welding")
|
||||
name = "welding goggles"
|
||||
desc = "Protects the eyes from welders; approved by the mad scientist association."
|
||||
icon_state = "welding-g"
|
||||
item_state = "welding-g"
|
||||
if("Gar")
|
||||
desc = "Just who the hell do you think I am?!"
|
||||
name = "gar glasses"
|
||||
icon_state = "gar"
|
||||
item_state = "gar"
|
||||
@@ -68,6 +68,14 @@
|
||||
flash_protect = 1
|
||||
HUDType = DATA_HUD_SECURITY_ADVANCED
|
||||
|
||||
/obj/item/clothing/glasses/hud/security/chameleon
|
||||
name = "Chamleon Security HUD"
|
||||
desc = "A stolen security HUD integrated with Syndicate chameleon technology. Toggle to disguise the HUD. Provides flash protection."
|
||||
flash_protect = 1
|
||||
|
||||
/obj/item/clothing/glasses/hud/security/chameleon/attack_self(mob/user)
|
||||
chameleon(user)
|
||||
|
||||
/obj/item/clothing/glasses/hud/security/jensenshades
|
||||
name = "augmented shades"
|
||||
desc = "Polarized bioneural eyewear, designed to augment your vision."
|
||||
|
||||
Reference in New Issue
Block a user