mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 01:23:41 +01:00
Mutiny fix prereqs for directives
Conflicts: code/game/gamemodes/mutiny/directives/alien_fraud_directive.dm code/game/gamemodes/mutiny/directives/bluespace_contagion_directive.dm code/game/gamemodes/mutiny/directives/financial_crisis_directive.dm code/game/gamemodes/mutiny/directives/ipc_virus_directive.dm code/game/gamemodes/mutiny/directives/research_to_ripleys_directive.dm code/game/gamemodes/mutiny/directives/tau_ceti_needs_women_directive.dm code/game/gamemodes/mutiny/directives/terminations_directive.dm code/game/gamemodes/mutiny/directives/test_directive.dm code/modules/mob/mob.dm code/modules/mob/new_player/new_player.dm
This commit is contained in:
@@ -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+=H
|
||||
for(var/mob/M in player_list)
|
||||
if (is_alien(M) && M.is_ready())
|
||||
aliens+=(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,7 +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+=(M)
|
||||
return candidates
|
||||
|
||||
datum/directive/bluespace_contagion/get_description()
|
||||
return {"
|
||||
<p>
|
||||
@@ -12,20 +20,13 @@ datum/directive/bluespace_contagion/get_description()
|
||||
"}
|
||||
|
||||
datum/directive/bluespace_contagion/initialize()
|
||||
var/list/candidates = list()
|
||||
|
||||
for (var/mob/living/M in player_list)
|
||||
if (is_valid_candidate(M))
|
||||
candidates += M
|
||||
|
||||
infection_count = min(infection_count, candidates.len)
|
||||
|
||||
var/list/candidates = get_infection_candidates()
|
||||
var/list/infected_names = list()
|
||||
for(var/i=0, i < infection_count, i++)
|
||||
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-=candidate
|
||||
infected+=candidate
|
||||
infected_names+="[candidate.mind.assigned_role] [candidate.mind.name]"
|
||||
@@ -35,19 +36,9 @@ datum/directive/bluespace_contagion/initialize()
|
||||
"Allow one hour for a cure to be manufactured.",
|
||||
"If no cure arrives after that time, execute the infected.")
|
||||
|
||||
datum/directive/bluespace_contagion/proc/is_valid_candidate(mob/M)
|
||||
//don't select observers, dead, or disconnected people
|
||||
if(istype(M, /mob/new_player) || !M.client || M.stat == DEAD)
|
||||
return 0
|
||||
|
||||
//don't allow AI, robots, simple_animals and the like
|
||||
if(!istype(M, /mob/living/carbon))
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
datum/directive/bluespace_contagion/meets_prerequisites()
|
||||
return player_list.len >= 7 //would be better to count the number of valid candidates but I don't know if that is possible here.
|
||||
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+=H
|
||||
for(var/mob/M in player_list)
|
||||
if (candidates.Find(M.mind.assigned_role) && M.is_ready())
|
||||
civilians+=(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+=H
|
||||
for(var/mob/M in player_list)
|
||||
if (M.get_species() == "Machine" && M.is_ready())
|
||||
machines+=(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+=H
|
||||
for(var/mob/M in player_list)
|
||||
if (roboticist_roles.Find(M.mind.assigned_role) && M.is_ready())
|
||||
roboticists+=(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+=H
|
||||
for(var/mob/M in player_list)
|
||||
if (is_researcher(M) && M.is_ready())
|
||||
researchers+=(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+=H
|
||||
for(var/mob/M in player_list)
|
||||
if(is_target_gender(M) && !M.is_mechanical() && M.is_ready())
|
||||
targets+=(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+=H
|
||||
for(var/mob/M in get_crew_of_target_gender())
|
||||
if(command_positions.Find(M.mind.assigned_role))
|
||||
heads+=(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+=H
|
||||
for(var/mob/M in get_crew_of_target_gender())
|
||||
var/species = M.get_species()
|
||||
if(species == "Tajaran" || species == "Unathi" || species == "Skrell")
|
||||
aliens+=(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+=A.wear_id
|
||||
ids_to_terminate+=(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+=H
|
||||
for(var/mob/M in player_list)
|
||||
uglies+=(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()
|
||||
|
||||
@@ -802,6 +802,17 @@ var/list/slot_equipment_priority = list( \
|
||||
/mob/proc/is_active()
|
||||
return (0 >= usr.stat)
|
||||
|
||||
/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
|
||||
|
||||
@@ -374,7 +374,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())
|
||||
switch(chosen_species.name)
|
||||
if("Slime People")
|
||||
new_character = new /mob/living/carbon/human/slime(loc)
|
||||
@@ -477,3 +478,31 @@
|
||||
src << browse(null, "window=preferences") //closes job selection
|
||||
src << browse(null, "window=mob_occupation")
|
||||
src << browse(null, "window=latechoices") //closes late job selection
|
||||
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user