mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Merge branch 'master' of https://github.com/Baystation12/Baystation12
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
max_stages = 4
|
||||
spread = "On contact"
|
||||
spread_type = CONTACT_GENERAL
|
||||
cure = "Ryetalin"
|
||||
cure = "ryetalyn"
|
||||
curable = 0
|
||||
cure = "Ryetalyn"
|
||||
cure_id = "ryetalyn"
|
||||
curable = 1
|
||||
agent = "S4E1 retrovirus"
|
||||
affected_species = list("Human")
|
||||
var/list/original_dna = list()
|
||||
|
||||
@@ -55,6 +55,9 @@ datum/mind
|
||||
|
||||
var/rev_cooldown = 0
|
||||
|
||||
// the world.time since the mob has been brigged, or -1 if not at all
|
||||
var/brigged_since = -1
|
||||
|
||||
New(var/key)
|
||||
src.key = key
|
||||
|
||||
@@ -1081,6 +1084,37 @@ datum/mind
|
||||
fail |= !ticker.mode.equip_revolutionary(current)
|
||||
|
||||
|
||||
// check whether this mind's mob has been brigged for the given duration
|
||||
// have to call this periodically for the duration to work properly
|
||||
proc/is_brigged(duration)
|
||||
var/turf/T = current.loc
|
||||
if(!istype(T))
|
||||
brigged_since = -1
|
||||
return 0
|
||||
|
||||
var/is_currently_brigged = 0
|
||||
|
||||
if(istype(T.loc,/area/security/brig))
|
||||
is_currently_brigged = 1
|
||||
for(var/obj/item/weapon/card/id/card in current)
|
||||
is_currently_brigged = 0
|
||||
break // if they still have ID they're not brigged
|
||||
for(var/obj/item/device/pda/P in current)
|
||||
if(P.id)
|
||||
is_currently_brigged = 0
|
||||
break // if they still have ID they're not brigged
|
||||
|
||||
if(!is_currently_brigged)
|
||||
brigged_since = -1
|
||||
return 0
|
||||
|
||||
if(brigged_since == -1)
|
||||
brigged_since = world.time
|
||||
|
||||
return (duration <= world.time - brigged_since)
|
||||
|
||||
|
||||
|
||||
|
||||
//Initialisation procs
|
||||
/mob/living/proc/mind_initialize()
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
// world << sound('sound/AI/outbreak7.ogg')
|
||||
var/virus_type
|
||||
if(!virus)
|
||||
virus_type = pick(/datum/disease/dnaspread,/datum/disease/flu,/datum/disease/cold,/datum/disease/brainrot,/datum/disease/magnitis,/datum/disease/pierrot_throat)
|
||||
virus_type = pick(/datum/disease/dnaspread,/datum/disease/flu,/datum/disease/cold,/datum/disease/brainrot,/datum/disease/magnitis)
|
||||
else
|
||||
switch(virus)
|
||||
if("fake gbs")
|
||||
|
||||
@@ -119,6 +119,95 @@ datum/objective/mutiny/rp
|
||||
return 0
|
||||
return 1
|
||||
|
||||
datum/objective/anti_revolution/execute
|
||||
find_target()
|
||||
..()
|
||||
if(target && target.current)
|
||||
explanation_text = "[target.current.real_name], the [target.assigned_role] has extracted confidential information above their clearance. Execute \him[target.current]."
|
||||
else
|
||||
explanation_text = "Free Objective"
|
||||
return target
|
||||
|
||||
|
||||
find_target_by_role(role, role_type=0)
|
||||
..(role, role_type)
|
||||
if(target && target.current)
|
||||
explanation_text = "[target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] has extracted confidential information above their clearance. Execute \him[target.current]."
|
||||
else
|
||||
explanation_text = "Free Objective"
|
||||
return target
|
||||
|
||||
check_completion()
|
||||
if(target && target.current)
|
||||
if(target.current.stat == DEAD || !ishuman(target.current))
|
||||
return 1
|
||||
return 0
|
||||
return 1
|
||||
|
||||
datum/objective/anti_revolution/brig
|
||||
var/already_completed = 0
|
||||
|
||||
find_target()
|
||||
..()
|
||||
if(target && target.current)
|
||||
explanation_text = "Brig [target.current.real_name], the [target.assigned_role] for 20 minutes to set an example."
|
||||
else
|
||||
explanation_text = "Free Objective"
|
||||
return target
|
||||
|
||||
|
||||
find_target_by_role(role, role_type=0)
|
||||
..(role, role_type)
|
||||
if(target && target.current)
|
||||
explanation_text = "Brig [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] for 20 minutes to set an example."
|
||||
else
|
||||
explanation_text = "Free Objective"
|
||||
return target
|
||||
|
||||
check_completion()
|
||||
if(already_completed)
|
||||
return 1
|
||||
|
||||
if(target && target.current)
|
||||
if(target.current.stat == DEAD)
|
||||
return 0
|
||||
if(target.is_brigged(10 * 60 * 10))
|
||||
already_completed = 1
|
||||
return 1
|
||||
return 0
|
||||
return 0
|
||||
|
||||
datum/objective/anti_revolution/demote
|
||||
find_target()
|
||||
..()
|
||||
if(target && target.current)
|
||||
explanation_text = "[target.current.real_name], the [target.assigned_role] has been classified as harmful to NanoTrasen's goals. Demote \him[target.current] to assistant."
|
||||
else
|
||||
explanation_text = "Free Objective"
|
||||
return target
|
||||
|
||||
find_target_by_role(role, role_type=0)
|
||||
..(role, role_type)
|
||||
if(target && target.current)
|
||||
explanation_text = "[target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] has been classified as harmful to NanoTrasen's goals. Demote \him[target.current] to assistant."
|
||||
else
|
||||
explanation_text = "Free Objective"
|
||||
return target
|
||||
|
||||
check_completion()
|
||||
if(target && target.current && istype(target,/mob/living/carbon/human))
|
||||
var/obj/item/weapon/card/id/I = target.current:wear_id
|
||||
if(istype(I, /obj/item/device/pda))
|
||||
var/obj/item/device/pda/P = I
|
||||
I = P.id
|
||||
|
||||
if(!istype(I)) return 1
|
||||
|
||||
if(I.assignment == "Assistant")
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
return 1
|
||||
|
||||
datum/objective/debrain//I want braaaainssss
|
||||
find_target()
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
// A sort of anti-revolution where the heads are given objectives to mess with the crew
|
||||
|
||||
/datum/game_mode/anti_revolution
|
||||
name = "anti-revolution"
|
||||
config_tag = "anti-revolution"
|
||||
required_players = 5
|
||||
|
||||
var/finished = 0
|
||||
var/checkwin_counter = 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)
|
||||
|
||||
var/required_execute_targets = 1
|
||||
var/required_brig_targets = 0
|
||||
|
||||
var/recommended_execute_targets = 1
|
||||
var/recommended_brig_targets = 3
|
||||
var/recommended_demote_targets = 3
|
||||
|
||||
var/list/datum/mind/heads = list()
|
||||
var/list/datum/mind/execute_targets = list()
|
||||
var/list/datum/mind/brig_targets = list()
|
||||
var/list/datum/mind/demote_targets = list()
|
||||
|
||||
///////////////////////////
|
||||
//Announces the game type//
|
||||
///////////////////////////
|
||||
/datum/game_mode/anti_revolution/announce()
|
||||
world << "<B>The current game mode is - Anti-Revolution!</B>"
|
||||
world << "<B>Looks like CentComm has given a few new orders..</B>"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//Gets the round setup, cancelling if there's not enough players at the start//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/datum/game_mode/anti_revolution/pre_setup()
|
||||
for(var/mob/new_player/player in world) if(player.mind)
|
||||
if(player.mind.assigned_role in command_positions)
|
||||
heads += player.mind
|
||||
else
|
||||
if(execute_targets.len < recommended_execute_targets)
|
||||
execute_targets += player.mind
|
||||
else if(brig_targets.len < recommended_brig_targets)
|
||||
brig_targets += player.mind
|
||||
else if(demote_targets.len < recommended_demote_targets)
|
||||
demote_targets += player.mind
|
||||
|
||||
|
||||
if(heads.len==0)
|
||||
return 0
|
||||
|
||||
if(execute_targets.len < required_execute_targets || brig_targets.len < required_brig_targets)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/datum/game_mode/anti_revolution/proc/add_head_objectives(datum/mind/head)
|
||||
for(var/datum/mind/target in execute_targets)
|
||||
var/datum/objective/anti_revolution/execute/obj = new
|
||||
obj.owner = head
|
||||
obj.target = target
|
||||
obj.explanation_text = "[target.current.real_name], the [target.assigned_role] has extracted confidential information above their clearance. Execute them."
|
||||
head.objectives += obj
|
||||
for(var/datum/mind/target in brig_targets)
|
||||
var/datum/objective/anti_revolution/brig/obj = new
|
||||
obj.owner = head
|
||||
obj.target = target
|
||||
obj.explanation_text = "Brig [target.current.real_name], the [target.assigned_role] for 20 minutes to set an example."
|
||||
head.objectives += obj
|
||||
for(var/datum/mind/target in demote_targets)
|
||||
var/datum/objective/anti_revolution/demote/obj = new
|
||||
obj.owner = head
|
||||
obj.target = target
|
||||
obj.explanation_text = "[target.current.real_name], the [target.assigned_role] has been classified as harmful to NanoTrasen's goals. Demote them to assistant."
|
||||
head.objectives += obj
|
||||
|
||||
|
||||
/datum/game_mode/anti_revolution/post_setup()
|
||||
|
||||
for(var/datum/mind/head_mind in heads)
|
||||
add_head_objectives(head_mind)
|
||||
for(var/datum/mind/head_mind in heads)
|
||||
greet_head(head_mind)
|
||||
modePlayer += heads
|
||||
spawn (rand(waittime_l, waittime_h))
|
||||
send_intercept()
|
||||
..()
|
||||
|
||||
|
||||
/datum/game_mode/anti_revolution/process()
|
||||
checkwin_counter++
|
||||
if(checkwin_counter >= 5)
|
||||
if(!finished)
|
||||
ticker.mode.check_win()
|
||||
checkwin_counter = 0
|
||||
return 0
|
||||
|
||||
|
||||
/datum/game_mode/proc/greet_head(var/datum/mind/head_mind, var/you_are=1)
|
||||
var/obj_count = 1
|
||||
if (you_are)
|
||||
head_mind.current << "\blue It looks like this shift CentComm has some special orders for you.. check your objectives."
|
||||
head_mind.current << "\blue Note that you can ignore these objectives, but resisting NT's orders probably means demotion or worse."
|
||||
for(var/datum/objective/objective in head_mind.objectives)
|
||||
head_mind.current << "<B>Objective #[obj_count]</B>: [objective.explanation_text]"
|
||||
head_mind.special_role = "Corrupt Head"
|
||||
obj_count++
|
||||
|
||||
head_mind.current.verbs += /mob/proc/ResignFromHeadPosition
|
||||
|
||||
//////////////////////////////////////
|
||||
//Checks if the revs have won or not//
|
||||
//////////////////////////////////////
|
||||
/datum/game_mode/anti_revolution/check_win()
|
||||
if(check_head_victory())
|
||||
finished = 1
|
||||
else if(check_crew_victory())
|
||||
finished = 2
|
||||
return
|
||||
|
||||
///////////////////////////////
|
||||
//Checks if the round is over//
|
||||
///////////////////////////////
|
||||
/datum/game_mode/anti_revolution/check_finished()
|
||||
if(finished != 0)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
//////////////////////////
|
||||
//Checks for crew victory//
|
||||
//////////////////////////
|
||||
/datum/game_mode/anti_revolution/proc/check_crew_victory()
|
||||
for(var/datum/mind/head_mind in heads)
|
||||
var/turf/T = get_turf(head_mind.current)
|
||||
if((head_mind) && (head_mind.current) && (head_mind.current.stat != 2) && T && (T.z == 1) && !head_mind.is_brigged(600))
|
||||
if(ishuman(head_mind.current))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/////////////////////////////
|
||||
//Checks for a head victory//
|
||||
/////////////////////////////
|
||||
/datum/game_mode/anti_revolution/proc/check_head_victory()
|
||||
for(var/datum/mind/head_mind in heads)
|
||||
for(var/datum/objective/objective in head_mind.objectives)
|
||||
if(!(objective.check_completion()))
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/datum/game_mode/anti_revolution/declare_completion()
|
||||
|
||||
var/text = ""
|
||||
if(finished == 2)
|
||||
world << "\red <FONT size = 3><B> The heads of staff were relieved of their posts! The crew wins!</B></FONT>"
|
||||
else if(finished == 1)
|
||||
world << "\red <FONT size = 3><B> The heads of staff managed to meet the goals set for them by CentComm!</B></FONT>"
|
||||
|
||||
|
||||
|
||||
world << "<FONT size = 2><B>The heads of staff were: </B></FONT>"
|
||||
var/list/heads = list()
|
||||
heads = get_all_heads()
|
||||
for(var/datum/mind/head_mind in heads)
|
||||
text = ""
|
||||
if(head_mind.current)
|
||||
text += "[head_mind.current.real_name]"
|
||||
if(head_mind.current.stat == 2)
|
||||
text += " (Dead)"
|
||||
else
|
||||
text += " (Survived!)"
|
||||
else
|
||||
text += "[head_mind.key] (character destroyed)"
|
||||
|
||||
world << text
|
||||
|
||||
|
||||
world << "<FONT size = 2><B>Their objectives were: </B></FONT>"
|
||||
for(var/datum/mind/head_mind in heads)
|
||||
if(head_mind.objectives.len)//If the traitor had no objectives, don't need to process this.
|
||||
var/count = 1
|
||||
for(var/datum/objective/objective in head_mind.objectives)
|
||||
if(objective.check_completion())
|
||||
text += "<br><B>Objective #[count]</B>: [objective.explanation_text] <font color='green'><B>Success!</B></font>"
|
||||
feedback_add_details("head_objective","[objective.type]|SUCCESS")
|
||||
else
|
||||
text += "<br><B>Objective #[count]</B>: [objective.explanation_text] <font color='red'>Fail.</font>"
|
||||
feedback_add_details("head_objective","[objective.type]|FAIL")
|
||||
count++
|
||||
break // just print once
|
||||
return 1
|
||||
|
||||
|
||||
/datum/game_mode/anti_revolution/latespawn(mob/living/carbon/human/character)
|
||||
..()
|
||||
if(emergency_shuttle.departed)
|
||||
return
|
||||
|
||||
if(character.mind.assigned_role in command_positions)
|
||||
heads += character.mind
|
||||
modePlayer += character.mind
|
||||
add_head_objectives(character.mind)
|
||||
greet_head(character.mind)
|
||||
|
||||
/mob/proc/ResignFromHeadPosition()
|
||||
set category = "IC"
|
||||
set name = "Resign From Head Position"
|
||||
|
||||
if(!istype(ticker.mode, /datum/game_mode/anti_revolution))
|
||||
return
|
||||
|
||||
ticker.mode:heads -= src.mind
|
||||
src.mind.objectives = list()
|
||||
ticker.mode.modePlayer -= src.mind
|
||||
src.mind.special_role = null
|
||||
|
||||
src.verbs -= /mob/proc/ResignFromHeadPosition
|
||||
|
||||
src << "\red You resigned from your position, now you have the consequences."
|
||||
@@ -67,7 +67,6 @@
|
||||
modePlayer += head_revolutionaries
|
||||
spawn (rand(waittime_l, waittime_h))
|
||||
send_intercept()
|
||||
..()
|
||||
|
||||
/datum/game_mode/revolution/rp_revolution/greet_revolutionary(var/datum/mind/rev_mind, var/you_are=1)
|
||||
var/obj_count = 1
|
||||
@@ -108,6 +107,14 @@
|
||||
return 0
|
||||
return 1
|
||||
|
||||
///////////////////////////
|
||||
//Announces the game type//
|
||||
///////////////////////////
|
||||
/datum/game_mode/revolution/rp_revolution/announce()
|
||||
world << "<B>The current game mode is - Revolution!</B>"
|
||||
world << "<B>Some crewmembers are attempting to start a revolution!</B>"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//Announces the end of the game with all relavent information stated//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -130,10 +137,11 @@
|
||||
|
||||
/mob/living/carbon/human/proc/RevConvert(mob/M as mob in oview(src))
|
||||
set name = "Rev-Convert"
|
||||
set category = "IC"
|
||||
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))
|
||||
src << "\red <b>[M] is already be a revolutionary!</b>"
|
||||
else if(ticker.mode:is_convertible(M))
|
||||
else if(!ticker.mode:is_convertible(M))
|
||||
src << "\red <b>[M] is implanted with a loyalty implant - Remove it first!</b>"
|
||||
else
|
||||
if(world.time < M.mind.rev_cooldown)
|
||||
@@ -156,37 +164,37 @@
|
||||
// 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)
|
||||
var/active_revs = 0
|
||||
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_admin("There are zero active head revolutionists, trying to add some..")
|
||||
message_admins("There are zero active head revolutionists, 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
|
||||
if(active_revs == 0)
|
||||
log_admin("There are zero active head revolutionists, trying to add some..")
|
||||
message_admins("There are zero active head revolutionists, 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
|
||||
update_rev_icons_added(H.mind)
|
||||
H.verbs += /mob/living/carbon/human/proc/RevConvert
|
||||
|
||||
H << "\red Congratulations, yer heads of revolution are all gone now, so yer earned yourself a promotion."
|
||||
added_heads = 1
|
||||
break
|
||||
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(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
|
||||
|
||||
return ..()
|
||||
@@ -478,6 +478,15 @@
|
||||
dat += "<td><A href='?src=\ref[usr];priv_msg=\ref[M]'>PM</A></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
if(istype(ticker.mode, /datum/game_mode/anti_revolution) && ticker.mode:heads.len)
|
||||
dat += "<br><table cellspacing=5><tr><td><B>Corrupt Heads</B></td><td></td></tr>"
|
||||
for(var/datum/mind/N in ticker.mode:heads)
|
||||
var/mob/M = N.current
|
||||
if(M)
|
||||
dat += "<tr><td><a href='?src=\ref[src];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='?src=\ref[usr];priv_msg=\ref[M]'>PM</A></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
if(ticker.mode.traitors.len > 0)
|
||||
dat += "<br><table cellspacing=5><tr><td><B>Traitors</B></td><td></td><td></td></tr>"
|
||||
for(var/datum/mind/traitor in ticker.mode.traitors)
|
||||
|
||||
Reference in New Issue
Block a user