From 433cc6c05a66e855f1499945681bf269278ea8b7 Mon Sep 17 00:00:00 2001 From: Seris02 Date: Tue, 17 Dec 2019 19:59:01 +0800 Subject: [PATCH 1/3] makes trait blacklisting remove random positives instead of NULLING EVERY SINGLE FUCKING QUIRK --- .../subsystem/processing/quirks.dm | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/code/controllers/subsystem/processing/quirks.dm b/code/controllers/subsystem/processing/quirks.dm index 4af54b8c70..704fa3763a 100644 --- a/code/controllers/subsystem/processing/quirks.dm +++ b/code/controllers/subsystem/processing/quirks.dm @@ -33,9 +33,8 @@ PROCESSING_SUBSYSTEM_DEF(quirks) cut = filter_quirks(quirks, job) for(var/V in quirks) user.add_quirk(V, spawn_effects) - if(!silent && LAZYLEN(cut)) - to_chat(to_chat_target || user, "All of your non-neutral character quirks have been cut due to these quirks conflicting with your job assignment: [english_list(cut)].") - + if (!silent && LAZYLEN(cut)) + to_chat(to_chat_target || user, "Some quirks have been cut from your character because of these quirks conflicting with your job assignment: [english_list(cut)].") /datum/controller/subsystem/processing/quirks/proc/quirk_path_by_name(name) return quirks[name] @@ -53,6 +52,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks) /datum/controller/subsystem/processing/quirks/proc/filter_quirks(list/quirks, datum/job/job) var/list/cut = list() var/list/banned_names = list() + var/pointscut = 0 for(var/i in job.blacklisted_quirks) var/name = quirk_name_by_path(i) if(name) @@ -62,7 +62,30 @@ PROCESSING_SUBSYSTEM_DEF(quirks) for(var/i in blacklisted) quirks -= i cut += i - + pointscut += quirk_points_by_name(i) + if (pointscut != 0) + var/list/pickquirks = list() + var/k = 0 + while (k < 50) //chances and randoms + k++ + if (!(pick(quirks) in pickquirks)) + pickquirks += pick(quirks) + if (LAZYLEN(pickquirks) == LAZYLEN(quirks)) + break + for (var/l in quirks) //make sure we get them all with no repeats + if (LAZYLEN(pickquirks) == LAZYLEN(quirks)) + break + if (!(l in pickquirks)) + pickquirks += l + for (var/i in pickquirks) + if (quirk_points_by_name(i) < pointscut || (pointscut < 0) ? quirk_points_by_name(i) <= 0 : quirk_points_by_name(i) >= 0) + continue + else + quirks -= i + cut += i + pointscut += quirk_points_by_name(i) + if (pointscut == 0) + break /* //Code to automatically reduce positive quirks until balance is even. var/points_used = total_points(quirks) if(points_used > 0) @@ -78,11 +101,12 @@ PROCESSING_SUBSYSTEM_DEF(quirks) */ //Nah, let's null all non-neutrals out. - if(cut.len) - for(var/i in quirks) - if(quirk_points_by_name(i) != 0) - //cut += i -- Commented out: Only show the ones that triggered the quirk purge. - quirks -= i + if (pointscut != 0)// only if the pointscutting didn't work. + if(cut.len) + for(var/i in quirks) + if(quirk_points_by_name(i) != 0) + //cut += i -- Commented out: Only show the ones that triggered the quirk purge. + quirks -= i return cut From 551e9f540d20d6e3e02400243592943abafc1544 Mon Sep 17 00:00:00 2001 From: Seris02 <49109742+Seris02@users.noreply.github.com> Date: Wed, 1 Jan 2020 10:54:56 +0800 Subject: [PATCH 2/3] yee --- code/controllers/subsystem/processing/quirks.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/subsystem/processing/quirks.dm b/code/controllers/subsystem/processing/quirks.dm index 88637a3881..47eebc4bda 100644 --- a/code/controllers/subsystem/processing/quirks.dm +++ b/code/controllers/subsystem/processing/quirks.dm @@ -85,7 +85,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks) our_quirks -= i cut += i pointscut += quirk_points_by_name(i) - if (pointscut == 0) + if (pointscut <= 0) break /* //Code to automatically reduce positive quirks until balance is even. var/points_used = total_points(our_quirks) From a6a110bca383051ebd70773f7eff699bf15e1dbf Mon Sep 17 00:00:00 2001 From: Seris02 <49109742+Seris02@users.noreply.github.com> Date: Thu, 2 Jan 2020 19:29:11 +0800 Subject: [PATCH 3/3] nopenopenope --- code/controllers/subsystem/processing/quirks.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/subsystem/processing/quirks.dm b/code/controllers/subsystem/processing/quirks.dm index 47eebc4bda..6de9ed7ccd 100644 --- a/code/controllers/subsystem/processing/quirks.dm +++ b/code/controllers/subsystem/processing/quirks.dm @@ -85,7 +85,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks) our_quirks -= i cut += i pointscut += quirk_points_by_name(i) - if (pointscut <= 0) + if (pointscut >= 0) //with how it works, it needs to be above zero, not below, as points for positive is positive, and negative is negative, we only want it to break if it's above zero, ie. we cut more positive than negative break /* //Code to automatically reduce positive quirks until balance is even. var/points_used = total_points(our_quirks)