diff --git a/code/__DEFINES/quirks.dm b/code/__DEFINES/quirks.dm index 17b39898969..290fed93c95 100644 --- a/code/__DEFINES/quirks.dm +++ b/code/__DEFINES/quirks.dm @@ -12,7 +12,3 @@ #define QUIRK_CHANGES_APPEARANCE (1<<2) /// The only thing this quirk effects is mood so it should be disabled if mood is #define QUIRK_MOODLET_BASED (1<<3) - -//BUBBER EDIT ADDITION - Slime specific traits -/// This quirk can only be applied to roundstartslimes -#define QUIRK_SLIMEPERSON_ONLY (1<<4) diff --git a/code/controllers/subsystem/processing/quirks.dm b/code/controllers/subsystem/processing/quirks.dm index d5bb0effa59..4f669ed3084 100644 --- a/code/controllers/subsystem/processing/quirks.dm +++ b/code/controllers/subsystem/processing/quirks.dm @@ -37,6 +37,13 @@ PROCESSING_SUBSYSTEM_DEF(quirks) //SKYRAT EDIT ADDITION END ) + //BUBBER EDIT ADDITION START - Species quirks + /// A list of quirks that can only be used by a certain species. Format: list(quirk, species define) + var/static/list/quirk_species_whitelist = list( + list("Hydrophilic", "[SPECIES_SLIMESTART]") + ) + //BUBBER EDIT ADDITION END + /datum/controller/subsystem/processing/quirks/Initialize() get_quirks() return SS_INIT_SUCCESS diff --git a/code/datums/quirks/_quirk.dm b/code/datums/quirks/_quirk.dm index 21ad4d51501..85885e62127 100644 --- a/code/datums/quirks/_quirk.dm +++ b/code/datums/quirks/_quirk.dm @@ -61,11 +61,6 @@ if((quirk_flags & QUIRK_HUMAN_ONLY) && !ishuman(new_holder)) CRASH("Human only quirk attempted to be added to non-human mob.") - //BUBBER EDIT ADDITION - Slime-specific quirk check - if(quirk_flags & QUIRK_SLIMEPERSON_ONLY && !isroundstartslime(new_holder)) //I don't think we want this quirk on non-slimes. - CRASH("Slime-only quirk attempted to be added to a non-slimeperson.") - //BUBBER EDIT END - if(new_holder.has_quirk(type)) CRASH("Quirk attempted to be added to mob which already had this quirk.") diff --git a/code/modules/client/preferences/middleware/quirks.dm b/code/modules/client/preferences/middleware/quirks.dm index 343aff49144..2b4ded6ce49 100644 --- a/code/modules/client/preferences/middleware/quirks.dm +++ b/code/modules/client/preferences/middleware/quirks.dm @@ -45,6 +45,7 @@ "max_positive_quirks" = MAX_QUIRKS, "quirk_info" = quirk_info, "quirk_blacklist" = SSquirks.quirk_blacklist, + "quirk_species_whitelist" = SSquirks.quirk_species_whitelist, ) /datum/preference_middleware/quirks/on_new_character(mob/user) diff --git a/modular_zubbers/code/datums/bubber_quirks/hydrophilic.dm b/modular_zubbers/code/datums/bubber_quirks/hydrophilic.dm index 054f46a5c92..fa5cf8459c9 100644 --- a/modular_zubbers/code/datums/bubber_quirks/hydrophilic.dm +++ b/modular_zubbers/code/datums/bubber_quirks/hydrophilic.dm @@ -2,8 +2,8 @@ name = "Hydrophilic" desc = "(Slimeperson only) Your molecules are highly hydrophilic - or, in layman's terms, dissolve very well in water." icon = "bug" // I can't be asked to make an icon for this, my spritework sucks. - value = 0 //Neutral quirk for RP stuff. I don't know TGUI so I can't make it whitelisted. - quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_MOODLET_BASED|QUIRK_SLIMEPERSON_ONLY + value = 0 + quirk_flags = QUIRK_HUMAN_ONLY gain_text = "You have a feeling you should stay away from water..." lose_text = "Somehow, you feel as if water is no longer dangerous." medical_record_text = "Patient scans indicate extreme hydrophilicity." diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/QuirksPage.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/QuirksPage.tsx index 16b5f20bf61..6e90c8fa89f 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/QuirksPage.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/QuirksPage.tsx @@ -148,6 +148,7 @@ export const QuirksPage = (props, context) => { const { max_positive_quirks: maxPositiveQuirks, quirk_blacklist: quirkBlacklist, + quirk_species_whitelist: quirkSpeciesWhitelist, quirk_info: quirkInfo, } = quirks_data.quirks; // SKYRAT EDIT - Quirks balance refactor @@ -201,6 +202,29 @@ export const QuirksPage = (props, context) => { } } + // BUBBER EDIT ADDITION START - Species quirks + + // Iterate through all whitelists + + for (const whitelist of quirkSpeciesWhitelist) { + const currentSpeciesName = data.character_preferences.misc.species; + + // Format: Quirk ([0]), Species define ([1]) + const whitelistSpeciesName = whitelist[1]; + // Quirk is not in the whitelisted ones, continue to next list + if (whitelist.indexOf(quirk.name) === -1) { + continue; + } + + // If the selected species is NOT in the list, do not give the quirk + // Otherwise, give the quirk + if (whitelist.indexOf(currentSpeciesName) === -1) { + return `This quirk is whitelisted to ${whitelistSpeciesName}!`; + } + } + + // BUBBER EDIT ADDITION END + return undefined; }; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/data.ts b/tgui/packages/tgui/interfaces/PreferencesMenu/data.ts index f428c6612bb..4a08734e063 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/data.ts +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/data.ts @@ -132,6 +132,7 @@ export type QuirkInfo = { max_positive_quirks: number; quirk_info: Record; quirk_blacklist: string[][]; + quirk_species_whitelist: string[][]; }; export enum RandomSetting {