Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Antag xeno restrictions #312

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/game/gamemodes/blob/blob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var/list/blob_nodes = list()
votable = 0

restricted_jobs = list("Cyborg", "AI")
restricted_species = list(IPC)

var/declared = 0

Expand Down
1 change: 1 addition & 0 deletions code/game/gamemodes/changeling/changeling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
role_type = ROLE_CHANGELING
restricted_jobs = list("AI", "Cyborg")
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain")
restricted_species = list(IPC, DIONA)
required_players = 2
required_players_secret = 10
required_enemies = 1
Expand Down
1 change: 1 addition & 0 deletions code/game/gamemodes/cult/cult.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
role_type = ROLE_CULTIST
restricted_jobs = list("Chaplain","AI", "Cyborg", "Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Internal Affairs Agent")
protected_jobs = list()
restricted_species = list(IPC)
required_players = 5
required_players_secret = 15

Expand Down
10 changes: 9 additions & 1 deletion code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
var/list/datum/mind/modePlayer = new
var/list/restricted_jobs = list() // Jobs it doesn't make sense to be. I.E chaplain or AI cultist
var/list/protected_jobs = list() // Jobs that can't be traitors because
var/list/restricted_species = list() // This species will not be considered as a candidates for role
var/required_players = 0
var/required_players_secret = 0 //Minimum number of players for that game mode to be chose in Secret
var/required_enemies = 0
Expand Down Expand Up @@ -290,6 +291,12 @@ Implants;
if(security_level < SEC_LEVEL_BLUE)
set_security_level(SEC_LEVEL_BLUE)*/

/datum/game_mode/proc/check_species_restriction(var/mob/dead/new_player/player)
if(restricted_species)
Miracler112 marked this conversation as resolved.
Show resolved Hide resolved
for(var/species in restricted_species)
if(player.client.prefs.species == species)
return 0
return 1

/datum/game_mode/proc/get_players_for_role(role)
var/list/players = list()
Expand All @@ -300,7 +307,8 @@ Implants;
if(player.client && player.ready)
if(role in player.client.prefs.be_role)
if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, role) && !role_available_in_minutes(player, role))
players += player
if(check_species_restriction(player)) // Remove candidates with inappropriate species for role
players += player

// Shuffle the players list so that it becomes ping-independent.
players = shuffle(players)
Expand Down
2 changes: 2 additions & 0 deletions code/game/gamemodes/wizard/wizard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
required_enemies = 1
recommended_enemies = 1

restricted_species = list(IPC)

votable = 0

uplink_welcome = "Wizardly Uplink Console:"
Expand Down