Ability to ban subsplats - #116
Conversation
…into banning-splats-and-clans-and-shit
FalloutFalcon
left a comment
There was a problem hiding this comment.
There is an arugment to be made that with the fact we will get more fera and other splats, you could save yourself alot of work by genercising code to check for "subsplats" instead of individual types (clan, tribe, auspice) and just pool them all into one big list.
The ideal code for sub-splats already is reworking them to share more behavoir and procs anyway.
Will make it simplier to fit new splats/subsplats into this code and require less copypasta to add a new one.
| // CRIMSON EDIT ADD START - SUBSPLAT_BANS | ||
| if(is_banned_from(player.ckey, player_splat_id)) | ||
| job_debug("[debug_prefix] Error: [get_job_unavailable_error_message(JOB_UNAVAILABLE_BANNED, player_splat_id)], Player: [player][add_job_to_log ? ", Job: [possible_job]" : ""]") | ||
| return JOB_UNAVAILABLE_BANNED_SPLAT | ||
| // CRIMSON EDIT ADD END |
There was a problem hiding this comment.
I belive this runs ban checks for EVERY job it tries to assign? Likely should be moved up before job selection?
There was a problem hiding this comment.
doesn't matter where it's moved up, itll hit it eventually because this is all a bunch of checks to see if it should decline. but im assuming you want it earlier in the chain so its the first to show, even though in tg code, bans checks do not come first.
| // NO, THIS IS BAD DO NOT DO THIS, i cant think of another way though because `splat_id` is defined SEPERATELY on 3 subtypes, except for one | ||
| // so i have no other choice but to check if the splat_id exists. | ||
| // by checking for splat_id this does exclude checking for a splat ban | ||
| if(preference.vars["splat_id"] && is_banned_from(usr.ckey, preference_value)) |
There was a problem hiding this comment.
why does preference.vars["splat_id"] even exist here. you dont use it and it just means clans arent checked for being banned??
| @@ -0,0 +1,25 @@ | |||
| /datum/preference_middleware/feature_bans/get_ui_static_data(mob/user) | |||
There was a problem hiding this comment.
Seemingly no similar feature for splats (not subsplats)
There was a problem hiding this comment.
cause species is a different kind of preference, not a feature. i hate the naming for all the preferences stuff cause like, everything is technically a feature and preference but they make it complicated to comprehend.
| "vampire_clan" = GLOB.vampire_clan_list, | ||
| ) | ||
| for(var/feature in features) | ||
| for(var/creature in features[feature]) |
| auspice = get_fera_auspice(player.client.prefs.read_preference(/datum/preference/choiced/subsplat/fera_auspice/garou)) | ||
| tribe = get_fera_tribe(player.client.prefs.read_preference(/datum/preference/choiced/subsplat/fera_tribe/garou)) |
There was a problem hiding this comment.
hardcoding to the garou choices will become an issue when other changing breeds get tribes you will want to ban.
There was a problem hiding this comment.
how should i go about it then? I still can't fully wrap my head around this subsplat concept.
Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com>
| job_debug("[debug_prefix] Error: [get_job_unavailable_error_message(JOB_UNAVAILABLE_FERA_AUSPICE, possible_job.title)], Player: [player][add_job_to_log ? ", Job: [possible_job]" : ""]") | ||
| return JOB_UNAVAILABLE_FERA_AUSPICE | ||
| // CRIMSON EDIT ADD START - SUBSPLAT_BANS | ||
| if(possible_job.allowed_auspice && (auspice.name in possible_job.allowed_auspice) && is_banned_from(player.ckey, auspice.name)) |
There was a problem hiding this comment.
Need to change line to check if they're banned regardless.
| // CRIMSON EDIT ADD START - SUBSPLAT_BANS | ||
| if(is_banned_from(player.ckey, player_splat_id)) | ||
| job_debug("[debug_prefix] Error: [get_job_unavailable_error_message(JOB_UNAVAILABLE_BANNED, player_splat_id)], Player: [player][add_job_to_log ? ", Job: [possible_job]" : ""]") | ||
| return JOB_UNAVAILABLE_BANNED_SPLAT | ||
| // CRIMSON EDIT ADD END |
There was a problem hiding this comment.
doesn't matter where it's moved up, itll hit it eventually because this is all a bunch of checks to see if it should decline. but im assuming you want it earlier in the chain so its the first to show, even though in tg code, bans checks do not come first.
| "vampire_clan" = GLOB.vampire_clan_list, | ||
| ) | ||
| for(var/feature in features) | ||
| for(var/creature in features[feature]) |
| auspice = get_fera_auspice(player.client.prefs.read_preference(/datum/preference/choiced/subsplat/fera_auspice/garou)) | ||
| tribe = get_fera_tribe(player.client.prefs.read_preference(/datum/preference/choiced/subsplat/fera_tribe/garou)) |
There was a problem hiding this comment.
how should i go about it then? I still can't fully wrap my head around this subsplat concept.
…into banning-splats-and-clans-and-shit
|
Warning: field access requires static type: "name" |
|
This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~7 days. Please address any outstanding review items and ensure your PR is finished - if both are true, and you have auto-staled anyway, you need to actively ask maintainers (by pinging them in the /tg/station Discord) to (re)review or merge your PR. If no maintainer responds to your request, you may wish to close this PR yourself while you seek maintainer comment, as you will later be able to reopen the PR yourself. |
About The Pull Request
For the admins. This PR was for a code bounty
In addition, adds a "View notes & bans" button to the bottom of the UI since it's not something most players would know they could do. This is the same as the "View Admin remarks" verb. Does not show secret notes. obviously.
Why It's Good For The Game
yeh
Changelog
🆑
admin: You can now ban players from subsplats
/:cl: