Skip to content

Commit

Permalink
strips away a lot of jobcode and ALL of revs
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkSuckerberg committed Jul 3, 2023
1 parent 1b0b31f commit 88df9fc
Show file tree
Hide file tree
Showing 73 changed files with 16 additions and 1,367 deletions.
1 change: 0 additions & 1 deletion code/__DEFINES/role_preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ GLOBAL_LIST_INIT(special_roles, list(
ROLE_CHANGELING = /datum/game_mode/changeling,
ROLE_WIZARD = /datum/game_mode/wizard,
ROLE_MALF,
ROLE_REV = /datum/game_mode/revolution,
ROLE_ALIEN,
ROLE_PAI,
ROLE_CULTIST = /datum/game_mode/cult,
Expand Down
43 changes: 5 additions & 38 deletions code/controllers/subsystem/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ SUBSYSTEM_DEF(job)
var/list/occupations = list() //List of all jobs
var/list/datum/job/name_occupations = list() //Dict of all jobs, keys are titles
var/list/type_occupations = list() //Dict of all jobs, keys are types
var/list/prioritized_jobs = list()

var/overflow_role = "Assistant"

/datum/controller/subsystem/job/Initialize(timeofday)
if(!occupations.len)
Expand Down Expand Up @@ -55,59 +52,29 @@ SUBSYSTEM_DEF(job)
SetupOccupations()
return

/datum/controller/subsystem/job/proc/handle_auto_deadmin_roles(client/C, rank)
if(!C?.holder)
return TRUE
var/datum/job/job = GetJob(rank)

var/timegate_expired = FALSE
// allow only forcing deadminning in the first X seconds of the round if auto_deadmin_timegate is set in config
var/timegate = CONFIG_GET(number/auto_deadmin_timegate)
if(timegate && (world.time - SSticker.round_start_time > timegate))
timegate_expired = TRUE

if(!job)
return
if((job.auto_deadmin_role_flags & DEADMIN_POSITION_HEAD) && ((CONFIG_GET(flag/auto_deadmin_heads) && !timegate_expired) || (C.prefs?.toggles & DEADMIN_POSITION_HEAD)))
return C.holder.auto_deadmin()
else if((job.auto_deadmin_role_flags & DEADMIN_POSITION_SECURITY) && ((CONFIG_GET(flag/auto_deadmin_security) && !timegate_expired) || (C.prefs?.toggles & DEADMIN_POSITION_SECURITY)))
return C.holder.auto_deadmin()
else if((job.auto_deadmin_role_flags & DEADMIN_POSITION_SILICON) && ((CONFIG_GET(flag/auto_deadmin_silicons) && !timegate_expired) || (C.prefs?.toggles & DEADMIN_POSITION_SILICON))) //in the event there's ever psuedo-silicon roles added, ie synths.
return C.holder.auto_deadmin()

/datum/controller/subsystem/job/Recover()
set waitfor = FALSE
var/oldjobs = SSjob.occupations
sleep(20)
for (var/datum/job/J in oldjobs)
INVOKE_ASYNC(src, .proc/RecoverJob, J)

/datum/controller/subsystem/job/proc/RecoverJob(datum/job/J)
var/datum/job/newjob = GetJob(J.name)
if (!istype(newjob))
return
newjob.total_positions = J.total_positions
newjob.spawn_positions = J.spawn_positions
newjob.current_positions = J.current_positions

/atom/proc/JoinPlayerHere(mob/M, buckle)
/atom/proc/join_player_here(mob/M)
// By default, just place the mob on the same turf as the marker or whatever.
M.forceMove(get_turf(src))

/obj/structure/chair/JoinPlayerHere(mob/M, buckle)
/obj/structure/chair/join_player_here(mob/M)
// Placing a mob in a chair will attempt to buckle it, or else fall back to default.
if (buckle && isliving(M) && buckle_mob(M, FALSE, FALSE))
if (isliving(M) && buckle_mob(M, FALSE, FALSE))
return
..()

/datum/controller/subsystem/job/proc/SendToLateJoin(mob/M, buckle = TRUE, atom/destination)
if(destination)
destination.JoinPlayerHere(M, buckle)
destination.join_player_here(M, buckle)
return TRUE

if(M.mind && M.mind.assigned_role && length(GLOB.jobspawn_overrides[M.mind.assigned_role])) //We're doing something special today.
destination = pick(GLOB.jobspawn_overrides[M.mind.assigned_role])
destination.JoinPlayerHere(M, FALSE)
destination.join_player_here(M, FALSE)
return TRUE

var/msg = "Unable to send mob [M] to late join!"
Expand Down
13 changes: 0 additions & 13 deletions code/datums/components/art.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,3 @@
if(!do_after(M, 20, target = parent))
return
on_obj_examine(source, M)

/datum/component/art/rev

/datum/component/art/rev/apply_moodlet(mob/M, impress)
M.visible_message(
"<span class='notice'>[M] stops to inspect [parent].</span>",
"<span class='notice'>You take in [parent], inspecting the fine craftsmanship of the proletariat.</span>"
)

if(M.mind && M.mind.has_antag_datum(/datum/antagonist/rev))
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "artgreat", /datum/mood_event/artgreat)
else
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "artbad", /datum/mood_event/artbad)
19 changes: 0 additions & 19 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,6 @@
special_role = null
remove_antag_equip()

/datum/mind/proc/remove_rev()
var/datum/antagonist/rev/rev = has_antag_datum(/datum/antagonist/rev)
if(rev)
remove_antag_datum(rev.type)
special_role = null


/datum/mind/proc/remove_antag_equip()
var/list/Mob_Contents = current.get_contents()
for(var/obj/item/I in Mob_Contents)
Expand All @@ -365,7 +358,6 @@
remove_nukeop()
remove_wizard()
remove_cultist()
remove_rev()

/datum/mind/proc/equip_traitor(employer = "The Syndicate", silent = FALSE, datum/antagonist/uplink_owner)
if(!current)
Expand Down Expand Up @@ -441,10 +433,6 @@
if(iscultist(creator))
SSticker.mode.add_cultist(src)

else if(is_revolutionary(creator))
var/datum/antagonist/rev/converter = creator.mind.has_antag_datum(/datum/antagonist/rev,TRUE)
converter.add_revolutionary(src,FALSE)

else if(is_nuclear_operative(creator))
var/datum/antagonist/nukeop/converter = creator.mind.has_antag_datum(/datum/antagonist/nukeop,TRUE)
var/datum/antagonist/nukeop/N = new()
Expand Down Expand Up @@ -722,13 +710,6 @@
to_chat(current, "<font color=\"purple\"><b><i>You catch a glimpse of the Realm of Nar'Sie, The Geometer of Blood. You now see how flimsy your world is, you see that it should be open to the knowledge of Nar'Sie.</b></i></font>")
to_chat(current, "<font color=\"purple\"><b><i>Assist your new brethren in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.</b></i></font>")

/datum/mind/proc/make_Rev()
var/datum/antagonist/rev/head/head = new()
head.give_flash = TRUE
head.give_hud = TRUE
add_antag_datum(head)
special_role = ROLE_REV_HEAD

/datum/mind/proc/AddSpell(obj/effect/proc_holder/spell/S)
spell_list += S
S.action.Grant(current)
Expand Down
76 changes: 0 additions & 76 deletions code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,79 +68,3 @@
high_population_requirement = 10
repeatable = TRUE
flags = TRAITOR_RULESET

//////////////////////////////////////////////
// //
// REVOLUTIONARY PROVOCATEUR //
// //
//////////////////////////////////////////////

/datum/dynamic_ruleset/latejoin/provocateur
name = "Provocateur"
persistent = TRUE
antag_datum = /datum/antagonist/rev/head
antag_flag = ROLE_REV_HEAD
antag_flag_override = ROLE_REV
restricted_roles = list("AI", "Cyborg", "Prisoner", "Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "SolGov Representative")
enemy_roles = list("AI", "Cyborg", "Security Officer","Detective","Head of Security", "Captain", "Warden")
required_enemies = list(2,2,1,1,1,1,1,0,0,0)
required_candidates = 1
weight = 2
delay = 1 MINUTES // Prevents rule start while head is offstation.
cost = 20
requirements = list(101,101,70,40,30,20,20,20,20,20)
high_population_requirement = 50
flags = HIGHLANDER_RULESET
blocking_rules = list(/datum/dynamic_ruleset/roundstart/revs)
var/required_heads_of_staff = 3
var/finished = FALSE
/// How much threat should be injected when the revolution wins?
var/revs_win_threat_injection = 20
var/datum/team/revolution/revolution

/datum/dynamic_ruleset/latejoin/provocateur/ready(forced=FALSE)
if (forced)
required_heads_of_staff = 1
if(!..())
return FALSE
var/head_check = 0
for(var/mob/player in mode.current_players[CURRENT_LIVING_PLAYERS])
if (player.mind.assigned_role in GLOB.command_positions)
head_check++
return (head_check >= required_heads_of_staff)

/datum/dynamic_ruleset/latejoin/provocateur/execute()
var/mob/M = pick(candidates) // This should contain a single player, but in case.
if(check_eligible(M.mind)) // Didnt die/run off z-level/get implanted since leaving shuttle.
assigned += M.mind
M.mind.special_role = antag_flag
revolution = new()
var/datum/antagonist/rev/head/new_head = new()
new_head.give_flash = TRUE
new_head.give_hud = TRUE
new_head.remove_clumsy = TRUE
new_head = M.mind.add_antag_datum(new_head, revolution)
revolution.update_objectives()
revolution.update_heads()
return TRUE
else
log_game("DYNAMIC: [ruletype] [name] discarded [M.name] from head revolutionary due to ineligibility.")
log_game("DYNAMIC: [ruletype] [name] failed to get any eligible headrevs. Refunding [cost] threat.")
return FALSE

/datum/dynamic_ruleset/latejoin/provocateur/rule_process()
var/winner = revolution.process_victory(revs_win_threat_injection)
if (isnull(winner))
return

finished = winner
return RULESET_STOP_PROCESSING

/// Checks for revhead loss conditions and other antag datums.
/datum/dynamic_ruleset/latejoin/provocateur/proc/check_eligible(datum/mind/M)
if(!considered_afk(M) && considered_alive(M) && !M.antag_datums?.len && !HAS_TRAIT(M, TRAIT_MINDSHIELD))
return TRUE
return FALSE

/datum/dynamic_ruleset/latejoin/provocateur/round_result()
revolution.round_result(finished)
84 changes: 0 additions & 84 deletions code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -330,90 +330,6 @@
SSticker.mode_result = "halfwin - interrupted"
SSticker.news_report = OPERATIVE_SKIRMISH

//////////////////////////////////////////////
// //
// REVS //
// //
//////////////////////////////////////////////

/datum/dynamic_ruleset/roundstart/revs
name = "Revolution"
persistent = TRUE
antag_flag = ROLE_REV_HEAD
antag_flag_override = ROLE_REV
antag_datum = /datum/antagonist/rev/head
minimum_required_age = 14
restricted_roles = list("AI", "Cyborg", "Prisoner", "Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "SolGov Representative")
required_candidates = 3
weight = 2
delay = 7 MINUTES
cost = 35
requirements = list(101,101,70,40,30,20,10,10,10,10)
high_population_requirement = 10
antag_cap = list(3,3,3,3,3,3,3,3,3,3)
flags = HIGHLANDER_RULESET
blocking_rules = list(/datum/dynamic_ruleset/latejoin/provocateur)
// I give up, just there should be enough heads with 35 players...
minimum_players = 35
/// How much threat should be injected when the revolution wins?
var/revs_win_threat_injection = 20
var/datum/team/revolution/revolution
var/finished = FALSE

/datum/dynamic_ruleset/roundstart/revs/pre_execute()
. = ..()
var/max_candidates = antag_cap[indice_pop]
mode.antags_rolled += max_candidates
for(var/i = 1 to max_candidates)
if(candidates.len <= 0)
break
var/mob/M = pick_n_take(candidates)
assigned += M.mind
M.mind.restricted_roles = restricted_roles
M.mind.special_role = antag_flag
GLOB.pre_setup_antags += M.mind
return TRUE

/datum/dynamic_ruleset/roundstart/revs/execute()
revolution = new()
for(var/datum/mind/M in assigned)
GLOB.pre_setup_antags -= M
if(check_eligible(M))
var/datum/antagonist/rev/head/new_head = new antag_datum()
new_head.give_flash = TRUE
new_head.give_hud = TRUE
new_head.remove_clumsy = TRUE
M.add_antag_datum(new_head,revolution)
else
assigned -= M
log_game("DYNAMIC: [ruletype] [name] discarded [M.name] from head revolutionary due to ineligibility.")
if(revolution.members.len)
revolution.update_objectives()
revolution.update_heads()
return TRUE
log_game("DYNAMIC: [ruletype] [name] failed to get any eligible headrevs. Refunding [cost] threat.")
return FALSE

/datum/dynamic_ruleset/roundstart/revs/clean_up()
qdel(revolution)
..()

/datum/dynamic_ruleset/roundstart/revs/rule_process()
var/winner = revolution.process_victory(revs_win_threat_injection)
if (isnull(winner))
return

finished = winner
return RULESET_STOP_PROCESSING

/// Checks for revhead loss conditions and other antag datums.
/datum/dynamic_ruleset/roundstart/revs/proc/check_eligible(datum/mind/M)
if(!considered_afk(M) && considered_alive(M) && !M.antag_datums?.len && !HAS_TRAIT(M, TRAIT_MINDSHIELD))
return TRUE
return FALSE

/datum/dynamic_ruleset/roundstart/revs/round_result()
revolution.round_result(finished)

// Admin only rulesets. The threat requirement is 101 so it is not possible to roll them.

Expand Down
3 changes: 0 additions & 3 deletions code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,6 @@

/datum/game_mode/proc/remove_antag_for_borging(datum/mind/newborgie)
SSticker.mode.remove_cultist(newborgie, 0, 0)
var/datum/antagonist/rev/rev = newborgie.has_antag_datum(/datum/antagonist/rev)
if(rev)
rev.remove_revolutionary(TRUE)

/datum/game_mode/proc/generate_station_goals()
var/list/possible = list()
Expand Down
Loading

0 comments on commit 88df9fc

Please sign in to comment.