mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 04:26:03 +01:00
[MIRROR] Add: 2 Quirks Configs (#26206)
* Add: 2 Quirks Configs (#81033) This PR adds two new config options for quirks: - *Flag* `DISABLE_QUIRK_POINTS` - When enabled, disables quirk points balancing. - When enabled, players can select positive quirks without first selecting negative ones. - When enabled, the quirk points balance visually hides itself on the Quirks page. - *Number* `MAX_POSITIVE_QUIRKS` - Limits the maximum quantity of positive quirks which players can select using the Character Preferences page. - I ported this from the old `MAX_QUIRKS` define. - When set to `0`, players won't be able to select any positive quirks, and they won't appear on the Quirks page. - When set to `-1`, players will be able to select any quantity of positive quirks. - When commented-out or undefined, the default is `6`. - When set to `0` or `-1`, the positive quirk balance visually hides itself on the Quirks page. There is some downstream repositories asking for the quirks system to be configurable. Additionally, I always find myself tweaking these values on my own private servers and I thought it would be nice to share my edits. Usually I was simply commenting-out sections of this code in order to get the same result, so it helps to have an official way to disable quirk points. 🆑 A.C.M.O. config: Added two new config flags for quirks, DISABLE_QUIRK_POINTS and MAX_POSITIVE_QUIRKS. /🆑 * Oh come on --------- Co-authored-by: Dani Glore <fantasticdragons@gmail.com> Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com>
This commit is contained in:
@@ -540,6 +540,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
.++
|
||||
|
||||
/datum/preferences/proc/validate_quirks()
|
||||
if(CONFIG_GET(flag/disable_quirk_points))
|
||||
return
|
||||
if(GetQuirkBalance() < 0)
|
||||
all_quirks = list()
|
||||
|
||||
|
||||
@@ -31,8 +31,13 @@
|
||||
|
||||
var/list/quirks = SSquirks.get_quirks()
|
||||
|
||||
var/max_positive_quirks = CONFIG_GET(number/max_positive_quirks)
|
||||
var/positive_quirks_disabled = max_positive_quirks == 0
|
||||
for (var/quirk_name in quirks)
|
||||
var/datum/quirk/quirk = quirks[quirk_name]
|
||||
if(positive_quirks_disabled && initial(quirk.value) > 0)
|
||||
continue
|
||||
|
||||
var/datum/quirk_constant_data/constant_data = GLOB.all_quirk_constant_data[quirk]
|
||||
var/list/datum/preference/customization_options = constant_data?.get_customization_data()
|
||||
|
||||
@@ -47,9 +52,10 @@
|
||||
)
|
||||
|
||||
return list(
|
||||
"max_positive_quirks" = MAX_QUIRKS,
|
||||
"max_positive_quirks" = max_positive_quirks,
|
||||
"quirk_info" = quirk_info,
|
||||
"quirk_blacklist" = GLOB.quirk_string_blacklist,
|
||||
"points_enabled" = !CONFIG_GET(flag/disable_quirk_points),
|
||||
)
|
||||
|
||||
/datum/preference_middleware/quirks/on_new_character(mob/user)
|
||||
|
||||
Reference in New Issue
Block a user