[SEMI-MODULAR] Brings back custom Ash Walkers and Primal Podpeople, also fixes job banned species checks (#8665)

* initial commit

* whoops hahah you don't need that comment

* species check on the prefs menu

* species check actually works now, podpeople quirks

* goof was right
This commit is contained in:
Lyroy
2021-10-13 20:32:37 +01:00
committed by GitHub
parent b2ce1ac7c5
commit 99893bd8a8
12 changed files with 165 additions and 7 deletions
+11
View File
@@ -203,6 +203,8 @@ SUBSYSTEM_DEF(job)
return FALSE
if(job.veteran_only && !is_veteran_player(player.client))
return FALSE
if(job.has_banned_species(player.client.prefs))
return FALSE
//SKYRAT EDIT END
var/position_limit = job.total_positions
if(!latejoin)
@@ -242,6 +244,9 @@ SUBSYSTEM_DEF(job)
continue
if(job.veteran_only && !is_veteran_player(player.client))
JobDebug("FOC player is not veteran, Player: [player]")
if(job.has_banned_species(player.client.prefs))
JobDebug("FOC job not compatible with species, Player: [player]")
continue
//SKYRAT EDIT END
if(job.required_playtime_remaining(player.client))
JobDebug("FOC player not enough xp, Player: [player]")
@@ -295,6 +300,9 @@ SUBSYSTEM_DEF(job)
continue
if(job.veteran_only && !is_veteran_player(player.client))
JobDebug("GRJ player is not veteran, Player: [player]")
if(job.has_banned_species(player.client.prefs))
JobDebug("GRJ player has incompatible species, Player: [player]")
continue
//SKYRAT EDIT END
if(job.required_playtime_remaining(player.client))
@@ -481,6 +489,9 @@ SUBSYSTEM_DEF(job)
if(job.veteran_only && !is_veteran_player(player.client))
JobDebug("DO player is not veteran, Player: [player], Job:[job.title]")
continue
if(job.has_banned_species(player.client.prefs))
JobDebug("DO player has incompatible species, Player: [player], Job:[job.title]")
continue
//SKYRAT EDIT END
if(job.required_playtime_remaining(player.client))
@@ -45,6 +45,7 @@
data["job_preferences"] = preferences.job_preferences
// SKYRAT EDIT
data["job_alt_titles"] = preferences.alt_job_titles
data["species_restricted_jobs"] = get_unavailable_jobs_for_species()
// SKYRAT EDIT END
return data
@@ -99,3 +100,16 @@
data += job.title
return data
//SKYRAT EDIT ADDITION BEGIN - CHECKING FOR INCOMPATIBLE SPECIES
//This returns a list of jobs that are unavailable for the player's current species
/datum/preference_middleware/jobs/proc/get_unavailable_jobs_for_species()
var/list/data = list()
for (var/datum/job/job as anything in SSjob.all_occupations)
if (job.has_banned_species(preferences))
data += job.title
return data
//SKYRAT EDIT ADDITION END
+6 -1
View File
@@ -24,6 +24,11 @@
for (var/species_id in get_selectable_species())
values += GLOB.species_list[species_id]
//SKYRAT EDIT ADDITION
for (var/species_id in get_customizable_races())
values += GLOB.species_list[species_id]
//SKYRAT EDIT END
return values
/datum/preference/choiced/species/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/prefs)
@@ -49,7 +54,7 @@
var/list/food_flags = FOOD_FLAGS
for (var/species_id in get_selectable_species())
for (var/species_id in (get_selectable_species() + get_customizable_races())) //SKYRAT EDIT CHANGE - ORIGINAL: for (var/species_id in get_selectable_species())
var/species_type = GLOB.species_list[species_id]
var/datum/species/species = new species_type
@@ -156,6 +156,8 @@
return "[jobtitle] is restricted from your languages."
if(JOB_NOT_VETERAN)
return "You need to be veteran to join as [jobtitle]."
if(JOB_UNAVAILABLE_SPECIES)
return "[jobtitle] is restricted from your species."
//SKYRAT EDIT END
return "Error: Unknown job availability."
@@ -189,6 +191,8 @@
return JOB_UNAVAILABLE_QUIRK
if(job.veteran_only && !is_veteran_player(client))
return JOB_NOT_VETERAN
if(job.has_banned_species(client.prefs))
return JOB_UNAVAILABLE_SPECIES
//SKYRAT EDIT END
return JOB_AVAILABLE
@@ -71,20 +71,20 @@
var/list/data = list()
var/max_languages = preferences.all_quirks.Find(QUIRK_LINGUIST) ? 4 : 3
var/species_type = preferences.read_preference(/datum/preference/choiced/species)
var/datum/species/species = new species_type()
if(!preferences.languages || !preferences.languages.len || (preferences.languages && preferences.languages.len > max_languages)) // Too many languages, or no languages.
preferences.languages = list()
var/species_type = preferences.read_preference(/datum/preference/choiced/species)
var/datum/species/species = new species_type()
for(var/language in species.learnable_languages)
preferences.languages[language] = LANGUAGE_SPOKEN
qdel(species)
var/list/selected_languages = list()
var/list/unselected_languages = list()
for (var/language_name in GLOB.all_languages)
var/datum/language/language = GLOB.language_datum_instances[language_name]
if(language.secret)
continue
if(species.always_customizable && !(language.type in species.learnable_languages)) //For the ghostrole species. We don't want ashwalkers speaking beachtongue now.
continue
if(preferences.languages[language.type])
selected_languages += list(list(
"description" = language.desc,
@@ -97,6 +97,7 @@
"name" = language.name,
"icon" = sanitize_css_class_name(language.name)
))
qdel(species)
data["total_language_points"] = max_languages
data["selected_languages"] = selected_languages
@@ -33,7 +33,7 @@
var/my_id = species.id
if(species_whitelist && !species_whitelist[my_id])
return TRUE
else if(!GLOB.roundstart_races[my_id])
else if(!(my_id in get_selectable_species()))
return TRUE
if(species_blacklist && species_blacklist[my_id])
return TRUE
@@ -572,3 +572,28 @@ GLOBAL_LIST_EMPTY(customizable_races)
/datum/species/proc/spec_revival(mob/living/carbon/human/H)
return
/// Gets a list of all customizable races on roundstart.
/proc/get_customizable_races()
RETURN_TYPE(/list)
if (!GLOB.customizable_races.len)
GLOB.customizable_races = generate_customizable_races()
return GLOB.customizable_races
/**
* Generates races available to choose in character setup at roundstart, yet not playable on the station.
*
* This proc generates which species are available to pick from in character setup.
*/
/proc/generate_customizable_races()
var/list/customizable_races = list()
for(var/species_type in subtypesof(/datum/species))
var/datum/species/species = new species_type
if(species.always_customizable)
customizable_races += species.id
qdel(species)
return customizable_races
@@ -22,3 +22,4 @@
default_mutant_bodyparts = list()
learnable_languages = list(/datum/language/common, /datum/language/sylvan)
always_customizable = FALSE
@@ -268,6 +268,15 @@ const JobRow = (props: {
</Stack.Item>
</Stack>
);
} else if (data.species_restricted_jobs
&& data.species_restricted_jobs.indexOf(job.name) !== -1) {
rightSide = (
<Stack align="center" height="100%" pr={1}>
<Stack.Item grow textAlign="right">
<b>Bad species</b>
</Stack.Item>
</Stack>
);
// SKYRAT EDIT END
} else {
rightSide = (<PriorityButtons
@@ -184,9 +184,9 @@ export type PreferencesMenuData = {
selected_languages: Language[];
unselected_languages: Language[];
total_language_points: number;
quirks_balance: number;
positive_quirk_count: number;
species_restricted_jobs?: string[];
// SKYRAT EDIT END
keybindings: Record<string, string[]>;
overflow_role: string;
@@ -0,0 +1,57 @@
import { Species } from "./base";
const Ashwalker: Species = {
description: "The primitive natives of Indecipheres, this race, \
remotely related to other spacefaring reptiles, has formed a \
symbiotic relationship with one of the tendrils of the Necropolis. \
They live in a delicate balance with their surroundings, \
now threatened by invaders from the stars...",
features: {
good: [{
icon: "shield-alt",
name: "Tough Scales",
description: "Ash Walkers have been toughened by the heat of \
their homeland and constant hunting, making them more \
resilient to damage.",
}, {
icon: "biohazard",
name: "Virus Immunity",
description: "Either a blessing of the Tendril or unnaturally \
strong immune systems, Ash Walkers cannot contract illnesses.",
}, {
icon: "low-vision",
name: "Darksight",
description: "The eyes of Ash Walkers are able to see in \
the dark.",
}, {
icon: "wind",
name: "Blackened Lungs",
description: "The lungs of Ash Walkers are able to breathe \
the soot-filled atmosphere of Indecipheres.",
}],
neutral: [{
icon: "thermometer-empty",
name: "Cold-blooded",
description: "Higher tolerance for high temperatures, but lower \
tolerance for cold temperatures.",
}, {
icon: "egg",
name: "Tendril Rebirth",
description: "Ash Walkers may be brought back to life by \
the tendril they worship... as long as suitable \
sacrifices are made.",
}],
bad: [{
icon: "ban",
name: "Uncivilized",
description: "This species can't be used on the station.",
}, {
icon: "tint",
name: "Exotic Blood",
description: "Lizards have a unique \"L\" type blood, which can make \
receiving medical treatment more difficult.",
}],
},
};
export default Ashwalker;
@@ -0,0 +1,31 @@
import { Species } from "./base";
const Pod: Species = {
description: "An ancient, bio-engineered species of sentient plants, \
created by a Precursor Civilization.",
features: {
good: [{
icon: "sun",
name: "Photosynthetic Restoration",
description: "Podpeople slowly regenerate their wounds, \
clear out toxins, gather oxygen, and gain nutrition when in \
lit areas.",
}],
neutral: [],
bad: [{
icon: "ban",
name: "Uncivilized",
description: "This species can't be used on the station.",
}, {
icon: "seedling",
name: "Wilting",
description: "When hungry, podpeople start taking damage.",
}, {
icon: "heart-broken",
name: "Weak",
description: "Podpeople take increased brute and burn damage.",
}],
},
};
export default Pod;