mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Mutiny fix prereqs for directives
This commit is contained in:
@@ -59,7 +59,7 @@ datum/shuttle_controller/proc/recall()
|
||||
if(direction == 1)
|
||||
var/timeleft = timeleft()
|
||||
if(alert == 0)
|
||||
if(timeleft >= 600)
|
||||
if(timeleft >= get_shuttle_arrive_time())
|
||||
return
|
||||
captain_announce("The emergency shuttle has been recalled.")
|
||||
world << sound('sound/AI/shuttlerecalled.ogg')
|
||||
|
||||
@@ -4,11 +4,15 @@ datum/directive/terminations/alien_fraud
|
||||
"Transfer their payrolls to the station account.",
|
||||
"Terminate their employment.")
|
||||
|
||||
proc/is_alien(mob/M)
|
||||
var/species = M.get_species()
|
||||
return species == "Tajaran" || species == "Unathi"
|
||||
|
||||
datum/directive/terminations/alien_fraud/get_crew_to_terminate()
|
||||
var/list/aliens[0]
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
if (H.species.name == "Tajaran" || H.species.name == "Unathi")
|
||||
aliens.Add(H)
|
||||
for(var/mob/M in player_list)
|
||||
if (is_alien(M) && M.is_ready())
|
||||
aliens.Add(M)
|
||||
return aliens
|
||||
|
||||
datum/directive/terminations/alien_fraud/get_description()
|
||||
@@ -24,10 +28,11 @@ datum/directive/terminations/alien_fraud/meets_prerequisites()
|
||||
// of the Tajarans and Unathi combined can't be more than 1/3rd of the crew.
|
||||
var/tajarans = 0
|
||||
var/unathi = 0
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
if (H.species.name == "Tajaran")
|
||||
for(var/mob/M in player_list)
|
||||
var/species = M.get_species()
|
||||
if(species == "Tajaran")
|
||||
tajarans++
|
||||
if (H.species.name == "Unathi")
|
||||
if(species == "Unathi")
|
||||
unathi++
|
||||
|
||||
if (!tajarans || !unathi)
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
#define INFECTION_COUNT 5
|
||||
|
||||
datum/directive/bluespace_contagion
|
||||
var/infection_count = 5
|
||||
var/list/infected = list()
|
||||
|
||||
proc/get_infection_candidates()
|
||||
var/list/candidates[0]
|
||||
for(var/mob/M in player_list)
|
||||
if (!M.is_mechanical() && M.is_ready())
|
||||
candidates.Add(M)
|
||||
return candidates
|
||||
|
||||
datum/directive/bluespace_contagion/get_description()
|
||||
return {"
|
||||
<p>
|
||||
@@ -14,13 +20,13 @@ datum/directive/bluespace_contagion/get_description()
|
||||
"}
|
||||
|
||||
datum/directive/bluespace_contagion/initialize()
|
||||
var/list/candidates = player_list.Copy()
|
||||
var/list/candidates = get_infection_candidates()
|
||||
var/list/infected_names = list()
|
||||
for(var/i=0, i < INFECTION_COUNT, i++)
|
||||
if(!candidates.len)
|
||||
break
|
||||
|
||||
var/mob/living/carbon/human/candidate = pick(candidates)
|
||||
var/mob/candidate = pick(candidates)
|
||||
candidates.Remove(candidate)
|
||||
infected.Add(candidate)
|
||||
infected_names.Add("[candidate.mind.assigned_role] [candidate.mind.name]")
|
||||
@@ -31,7 +37,8 @@ datum/directive/bluespace_contagion/initialize()
|
||||
"If no cure arrives after that time, execute the infected.")
|
||||
|
||||
datum/directive/bluespace_contagion/meets_prerequisites()
|
||||
return player_list.len >= 7
|
||||
var/list/candidates = get_infection_candidates()
|
||||
return candidates.len >= 7
|
||||
|
||||
datum/directive/bluespace_contagion/directives_complete()
|
||||
return infected.len == 0
|
||||
|
||||
@@ -7,9 +7,9 @@ datum/directive/terminations/financial_crisis
|
||||
datum/directive/terminations/financial_crisis/get_crew_to_terminate()
|
||||
var/list/civilians[0]
|
||||
var/list/candidates = civilian_positions - "Head of Personnel"
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
if (candidates.Find(H.mind.assigned_role))
|
||||
civilians.Add(H)
|
||||
for(var/mob/M in player_list)
|
||||
if (candidates.Find(M.mind.assigned_role) && M.is_ready())
|
||||
civilians.Add(M)
|
||||
return civilians
|
||||
|
||||
datum/directive/terminations/financial_crisis/get_description()
|
||||
|
||||
@@ -15,16 +15,16 @@ datum/directive/ipc_virus
|
||||
|
||||
proc/get_ipcs()
|
||||
var/list/machines[0]
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
if (H.species.name == "Machine")
|
||||
machines.Add(H)
|
||||
for(var/mob/M in player_list)
|
||||
if (M.get_species() == "Machine" && M.is_ready())
|
||||
machines.Add(M)
|
||||
return machines
|
||||
|
||||
proc/get_roboticists()
|
||||
var/list/roboticists[0]
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
if (roboticist_roles.Find(H.mind.assigned_role))
|
||||
roboticists.Add(H)
|
||||
for(var/mob/M in player_list)
|
||||
if (roboticist_roles.Find(M.mind.assigned_role) && M.is_ready())
|
||||
roboticists.Add(M)
|
||||
return roboticists
|
||||
|
||||
datum/directive/ipc_virus/initialize()
|
||||
@@ -37,7 +37,7 @@ datum/directive/ipc_virus/get_description()
|
||||
return {"
|
||||
<p>
|
||||
IPC units have been found to be infected with a violent and undesired virus in Virgus Ferrorus system.
|
||||
Risk to NSS Exodus IPC units has not been assessed. Further information is classified.
|
||||
Risk to [station_name()] IPC units has not been assessed. Further information is classified.
|
||||
</p>
|
||||
"}
|
||||
|
||||
|
||||
@@ -4,11 +4,14 @@ datum/directive/research_to_ripleys
|
||||
var/list/ids_to_reassign = list()
|
||||
var/materials_shipped = 0
|
||||
|
||||
proc/is_researcher(mob/M)
|
||||
return M.mind.assigned_role in science_positions - "Research Director"
|
||||
|
||||
proc/get_researchers()
|
||||
var/list/researchers[0]
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
if (H.mind.assigned_role in science_positions - "Research Director")
|
||||
researchers.Add(H)
|
||||
for(var/mob/M in player_list)
|
||||
if (is_researcher(M) && M.is_ready())
|
||||
researchers.Add(M)
|
||||
return researchers
|
||||
|
||||
proc/count_researchers_reassigned()
|
||||
|
||||
@@ -4,27 +4,32 @@ datum/directive/tau_ceti_needs_women
|
||||
|
||||
proc/get_target_gender()
|
||||
if(!mode.head_loyalist) return FEMALE
|
||||
return mode.head_loyalist.current.gender == FEMALE ? MALE : FEMALE
|
||||
return mode.head_loyalist.current.get_gender() == FEMALE ? MALE : FEMALE
|
||||
|
||||
proc/is_target_gender(mob/M)
|
||||
var/species = M.get_species()
|
||||
return species != "Diona" && M.get_gender() == get_target_gender()
|
||||
|
||||
proc/get_crew_of_target_gender()
|
||||
var/list/targets[0]
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
if(H.species.name != "Machine" && H.gender == get_target_gender())
|
||||
targets.Add(H)
|
||||
for(var/mob/M in player_list)
|
||||
if(is_target_gender(M) && !M.is_mechanical() && M.is_ready())
|
||||
targets.Add(M)
|
||||
return targets
|
||||
|
||||
proc/get_target_heads()
|
||||
var/list/heads[0]
|
||||
for(var/mob/living/carbon/human/H in get_crew_of_target_gender())
|
||||
if(command_positions.Find(H.mind.assigned_role))
|
||||
heads.Add(H)
|
||||
for(var/mob/M in get_crew_of_target_gender())
|
||||
if(command_positions.Find(M.mind.assigned_role))
|
||||
heads.Add(M)
|
||||
return heads
|
||||
|
||||
proc/get_target_aliens()
|
||||
var/list/aliens[0]
|
||||
for(var/mob/living/carbon/human/H in get_crew_of_target_gender())
|
||||
if (H.species.name == "Tajaran" || H.species.name == "Unathi" || H.species.name == "Skrell")
|
||||
aliens.Add(H)
|
||||
for(var/mob/M in get_crew_of_target_gender())
|
||||
var/species = M.get_species()
|
||||
if(species == "Tajaran" || species == "Unathi" || species == "Skrell")
|
||||
aliens.Add(M)
|
||||
return aliens
|
||||
|
||||
proc/count_heads_reassigned()
|
||||
@@ -55,8 +60,17 @@ datum/directive/tau_ceti_needs_women/initialize()
|
||||
"Terminate employment of all [get_target_gender()] Skrell, Tajara, and Unathi.")
|
||||
|
||||
datum/directive/tau_ceti_needs_women/meets_prerequisites()
|
||||
var/list/targets = get_crew_of_target_gender()
|
||||
return targets.len >= 3
|
||||
var/females = 0
|
||||
var/males = 0
|
||||
for(var/mob/M in player_list)
|
||||
if(!M.is_mechanical() && M.get_species() != "Diona" && M.is_ready())
|
||||
var/gender = M.get_gender()
|
||||
if(gender == MALE)
|
||||
males++
|
||||
else if(gender == FEMALE)
|
||||
females++
|
||||
|
||||
return males >= 2 && females >= 2
|
||||
|
||||
datum/directive/tau_ceti_needs_women/directives_complete()
|
||||
return command_targets.len == count_heads_reassigned() && alien_targets.len == 0
|
||||
|
||||
@@ -22,11 +22,11 @@ datum/directive/terminations/directives_complete()
|
||||
return ids_to_terminate.len == 0
|
||||
|
||||
datum/directive/terminations/initialize()
|
||||
for(var/mob/living/carbon/human/A in get_crew_to_terminate())
|
||||
var/datum/money_account/account = A.mind.initial_account
|
||||
for(var/mob/living/carbon/human/H in get_crew_to_terminate())
|
||||
var/datum/money_account/account = H.mind.initial_account
|
||||
accounts_to_revoke["[account.account_number]"] = 0
|
||||
accounts_to_suspend["[account.account_number]"] = account.suspended
|
||||
ids_to_terminate.Add(A.wear_id)
|
||||
ids_to_terminate.Add(H.wear_id)
|
||||
|
||||
/hook/revoke_payroll/proc/payroll_directive(datum/money_account/account)
|
||||
var/datum/directive/terminations/D = get_directive("terminations")
|
||||
|
||||
@@ -7,8 +7,8 @@ datum/directive/terminations/test
|
||||
|
||||
datum/directive/terminations/test/get_crew_to_terminate()
|
||||
var/list/uglies[0]
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
uglies.Add(H)
|
||||
for(var/mob/M in player_list)
|
||||
uglies.Add(M)
|
||||
return uglies
|
||||
|
||||
datum/directive/terminations/test/get_description()
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
return
|
||||
|
||||
if(!mode.current_directive.directives_complete())
|
||||
state("Command aborted. Communication with CentComm is prohibited until Directive X has been completed.")
|
||||
state("Command aborted. Communication with CentCom is prohibited until Directive X has been completed.")
|
||||
return
|
||||
|
||||
check_key_existence()
|
||||
|
||||
@@ -256,17 +256,17 @@ datum/game_mode/mutiny
|
||||
/datum/game_mode/mutiny/pre_setup()
|
||||
var/list/loyalist_candidates = get_head_loyalist_candidates()
|
||||
if(!loyalist_candidates || loyalist_candidates.len == 0)
|
||||
world << "Mutiny mode aborted: no valid candidates for head loyalist."
|
||||
world << "\red Mutiny mode aborted: no valid candidates for head loyalist."
|
||||
return 0
|
||||
|
||||
var/list/mutineer_candidates = get_head_mutineer_candidates()
|
||||
if(!mutineer_candidates || mutineer_candidates.len == 0)
|
||||
world << "Mutiny mode aborted: no valid candidates for head mutineer."
|
||||
world << "\red Mutiny mode aborted: no valid candidates for head mutineer."
|
||||
return 0
|
||||
|
||||
var/list/directive_candidates = get_directive_candidates()
|
||||
if(!directive_candidates || directive_candidates.len == 0)
|
||||
world << "Mutiny mode aborted: no valid candidates for Directive X."
|
||||
world << "\red Mutiny mode aborted: no valid candidates for Directive X."
|
||||
return 0
|
||||
|
||||
head_loyalist = pick(loyalist_candidates)
|
||||
|
||||
@@ -604,6 +604,17 @@ var/list/slot_equipment_priority = list( \
|
||||
/mob/proc/is_dead()
|
||||
return stat == DEAD
|
||||
|
||||
/mob/proc/is_mechanical()
|
||||
if(mind && (mind.assigned_role == "Cyborg" || mind.assigned_role == "AI"))
|
||||
return 1
|
||||
return istype(src, /mob/living/silicon) || get_species() == "Machine"
|
||||
|
||||
/mob/proc/is_ready()
|
||||
return !!client
|
||||
|
||||
/mob/proc/get_gender()
|
||||
return gender
|
||||
|
||||
/mob/proc/see(message)
|
||||
if(!is_active())
|
||||
return 0
|
||||
|
||||
@@ -355,7 +355,8 @@
|
||||
if(client.prefs.species)
|
||||
chosen_species = all_species[client.prefs.species]
|
||||
if(chosen_species)
|
||||
if(is_alien_whitelisted(src, client.prefs.species) || !config.usealienwhitelist || !(chosen_species.flags & IS_WHITELISTED) || (client.holder.rights & R_ADMIN) )// Have to recheck admin due to no usr at roundstart. Latejoins are fine though.
|
||||
// Have to recheck admin due to no usr at roundstart. Latejoins are fine though.
|
||||
if(is_species_whitelisted(chosen_species) || has_admin_rights())
|
||||
new_character = new(loc, client.prefs.species)
|
||||
|
||||
if(!new_character)
|
||||
@@ -413,11 +414,36 @@
|
||||
Move()
|
||||
return 0
|
||||
|
||||
|
||||
proc/close_spawn_windows()
|
||||
src << browse(null, "window=latechoices") //closes late choices window
|
||||
src << browse(null, "window=playersetup") //closes the player setup window
|
||||
|
||||
proc/has_admin_rights()
|
||||
return client.holder.rights & R_ADMIN
|
||||
|
||||
proc/is_species_whitelisted(datum/species/S)
|
||||
if(!S) return 1
|
||||
return is_alien_whitelisted(src, S.name) || !config.usealienwhitelist || !(S.flags & IS_WHITELISTED)
|
||||
|
||||
/mob/new_player/get_species()
|
||||
var/datum/species/chosen_species
|
||||
if(client.prefs.species)
|
||||
chosen_species = all_species[client.prefs.species]
|
||||
|
||||
if(!chosen_species)
|
||||
return "Human"
|
||||
|
||||
if(is_species_whitelisted(chosen_species) || has_admin_rights())
|
||||
return chosen_species.name
|
||||
|
||||
return "Human"
|
||||
|
||||
/mob/new_player/get_gender()
|
||||
if(!client || !client.prefs) ..()
|
||||
return client.prefs.gender
|
||||
|
||||
/mob/new_player/is_ready()
|
||||
return ready && !!client
|
||||
|
||||
/mob/new_player/hear_say(var/message, var/verb = "says", var/datum/language/language = null, var/alt_name = "",var/italics = 0, var/mob/speaker = null)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user