mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-10 07:30:36 +01:00
Merge pull request #709 from ArchieBeepBoop/blacklistfix1
Re-Porting the Trait Blacklist System (Fixes broken respawn traits)
This commit is contained in:
@@ -82,11 +82,14 @@ GLOBAL_VAR_INIT(cmp_field, "name")
|
||||
/proc/cmp_advdisease_resistance_asc(datum/disease/advance/A, datum/disease/advance/B)
|
||||
return A.totalResistance() - B.totalResistance()
|
||||
|
||||
/proc/cmp_numbered_displays_name_dsc(datum/numbered_display/A, datum/numbered_display/B)
|
||||
return sorttext(B.sample_object.name, A.sample_object.name)
|
||||
|
||||
/proc/cmp_quirk_asc(datum/quirk/A, datum/quirk/B)
|
||||
var/a_sign = num2sign(initial(A.value) * -1)
|
||||
var/b_sign = num2sign(initial(B.value) * -1)
|
||||
|
||||
// Neutral traits go last
|
||||
// Neutral traits go last.
|
||||
if(a_sign == 0)
|
||||
a_sign = 2
|
||||
if(b_sign == 0)
|
||||
|
||||
@@ -1565,6 +1565,10 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
|
||||
if(condition.Invoke(i))
|
||||
. |= i
|
||||
|
||||
/proc/CallAsync(datum/source, proctype, list/arguments)
|
||||
set waitfor = FALSE
|
||||
return call(source, proctype)(arglist(arguments))
|
||||
|
||||
/proc/num2sign(numeric)
|
||||
if(numeric > 0)
|
||||
return 1
|
||||
|
||||
@@ -17,8 +17,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
/datum/controller/subsystem/processing/quirks/Initialize(timeofday)
|
||||
if(!quirks.len)
|
||||
SetupQuirks()
|
||||
|
||||
quirk_blacklist = list(list("Blind","Nearsighted"),list("Jolly","Depression","Apathetic","Hypersensitive"),list("Ageusia","Vegetarian","Deviant Tastes"),list("Ananas Affinity","Ananas Aversion"),list("Alcohol Tolerance","Light Drinker"),list("Prosthetic Limb (Left Arm)","Prosthetic Limb (Right Arm)","Prosthetic Limb (Left Leg)","Prosthetic Limb (Right Leg)","Prosthetic Limb"),list("Social Anxiety","Mute"))
|
||||
quirk_blacklist = list(list("Blind","Nearsighted"),list("Jolly","Depression","Hypersensitive"),list("Ageusia","Vegetarian","Deviant Tastes"),list("Ananas Affinity","Ananas Aversion"),list("Alcohol Tolerance","Light Drinker"),list("Prosthetic Limb (Left Arm)","Prosthetic Limb (Right Arm)","Prosthetic Limb (Left Leg)","Prosthetic Limb (Right Leg)","Prosthetic Limb"),list("Social Anxiety","Mute"))
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/processing/quirks/proc/SetupQuirks()
|
||||
@@ -32,13 +31,21 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
quirk_names_by_path[T] = initial(T.name)
|
||||
|
||||
/datum/controller/subsystem/processing/quirks/proc/AssignQuirks(mob/living/user, client/cli, spawn_effects, roundstart = FALSE, datum/job/job, silent = FALSE, mob/to_chat_target)
|
||||
GenerateQuirks(cli)
|
||||
var/list/quirks = cli.prefs.character_quirks.Copy()
|
||||
var/badquirk = FALSE
|
||||
var/list/my_quirks = cli.prefs.all_quirks.Copy()
|
||||
var/list/cut
|
||||
if(job && job.blacklisted_quirks)
|
||||
if(job?.blacklisted_quirks)
|
||||
cut = filter_quirks(quirks, job)
|
||||
for(var/V in quirks)
|
||||
user.add_quirk(V, spawn_effects)
|
||||
for(var/V in my_quirks)
|
||||
if(V in quirks)
|
||||
var/datum/quirk/Q = quirks[V]
|
||||
user.add_quirk(Q, spawn_effects)
|
||||
else
|
||||
log_admin("Invalid quirk \"[V]\" in client [cli.ckey] preferences")
|
||||
cli.prefs.all_quirks -= V
|
||||
badquirk = TRUE
|
||||
if(badquirk)
|
||||
cli.prefs.save_character()
|
||||
if(!silent && LAZYLEN(cut))
|
||||
to_chat(to_chat_target || user, "<span class='boldwarning'>All of your non-neutral character quirks have been cut due to these quirks conflicting with your job assignment: [english_list(cut)].</span>")
|
||||
|
||||
@@ -91,8 +98,3 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
quirks -= i
|
||||
|
||||
return cut
|
||||
|
||||
/datum/controller/subsystem/processing/quirks/proc/GenerateQuirks(client/user)
|
||||
if(user.prefs.character_quirks.len)
|
||||
return
|
||||
user.prefs.character_quirks = user.prefs.all_quirks
|
||||
|
||||
@@ -383,8 +383,8 @@ SUBSYSTEM_DEF(ticker)
|
||||
captainless=0
|
||||
if(player.mind.assigned_role != player.mind.special_role)
|
||||
SSjob.EquipRank(N, player.mind.assigned_role, 0)
|
||||
if(CONFIG_GET(flag/roundstart_traits) && ishuman(N.new_character))
|
||||
SSquirks.AssignQuirks(N.new_character, N.client, TRUE, TRUE, SSjob.GetJob(player.mind.assigned_role), FALSE, N)
|
||||
if(CONFIG_GET(flag/roundstart_traits) && ishuman(N.new_character))
|
||||
SSquirks.AssignQuirks(N.new_character, N.client, TRUE, TRUE, SSjob.GetJob(player.mind.assigned_role), FALSE, N)
|
||||
CHECK_TICK
|
||||
if(captainless)
|
||||
for(var/mob/dead/new_player/N in GLOB.player_list)
|
||||
|
||||
@@ -158,15 +158,6 @@
|
||||
else
|
||||
owner.crit_threshold -= (holdmyinsanityeffect - insanity_effect)
|
||||
|
||||
if(HAS_TRAIT(owner, TRAIT_DEPRESSION))
|
||||
if(prob(0.05))
|
||||
add_event(null, "depression", /datum/mood_event/depression)
|
||||
clear_event(null, "jolly")
|
||||
if(HAS_TRAIT(owner, TRAIT_JOLLY))
|
||||
if(prob(0.05))
|
||||
add_event(null, "jolly", /datum/mood_event/jolly)
|
||||
clear_event(null, "depression")
|
||||
|
||||
holdmyinsanityeffect = insanity_effect
|
||||
|
||||
HandleNutrition(owner)
|
||||
|
||||
@@ -1397,4 +1397,30 @@
|
||||
return
|
||||
var/mob/living/carbon/human/H = locate(href_list["copyoutfit"]) in GLOB.carbon_list
|
||||
if(istype(H))
|
||||
H.copy_outfit()
|
||||
H.copy_outfit()
|
||||
else if(href_list["modquirks"])
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["modquirks"]) in GLOB.mob_list
|
||||
if(!istype(H))
|
||||
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
|
||||
return
|
||||
|
||||
var/list/options = list("Clear"="Clear")
|
||||
for(var/x in subtypesof(/datum/quirk))
|
||||
var/datum/quirk/T = x
|
||||
var/qname = initial(T.name)
|
||||
options[H.has_quirk(T) ? "[qname] (Remove)" : "[qname] (Add)"] = T
|
||||
|
||||
var/result = input(usr, "Choose quirk to add/remove","Quirk Mod") as null|anything in options
|
||||
if(result)
|
||||
if(result == "Clear")
|
||||
for(var/datum/quirk/q in H.roundstart_quirks)
|
||||
H.remove_quirk(q.type)
|
||||
else
|
||||
var/T = options[result]
|
||||
if(H.has_quirk(T))
|
||||
H.remove_quirk(T)
|
||||
else
|
||||
H.add_quirk(T,TRUE)
|
||||
|
||||
@@ -8,12 +8,14 @@
|
||||
mob_trait = TRAIT_ALCOHOL_TOLERANCE
|
||||
gain_text = "<span class='notice'>You feel like you could drink a whole keg!</span>"
|
||||
lose_text = "<span class='danger'>You don't feel as resistant to alcohol anymore. Somehow.</span>"
|
||||
medical_record_text = "Patient demonstrates a high tolerance for alcohol."
|
||||
|
||||
/datum/quirk/apathetic
|
||||
name = "Apathetic"
|
||||
desc = "You just don't care as much as other people. That's nice to have in a place like this, I guess."
|
||||
value = 1
|
||||
mood_quirk = TRUE
|
||||
medical_record_text = "Patient was administered the Apathy Evaluation Scale but did not bother to complete it."
|
||||
|
||||
/datum/quirk/apathetic/add()
|
||||
var/datum/component/mood/mood = quirk_holder.GetComponent(/datum/component/mood)
|
||||
@@ -42,6 +44,7 @@
|
||||
mob_trait = TRAIT_EMPATH
|
||||
gain_text = "<span class='notice'>You feel in tune with those around you.</span>"
|
||||
lose_text = "<span class='danger'>You feel isolated from others.</span>"
|
||||
medical_record_text = "Patient is highly perceptive of and sensitive to social cues, or may possibly have ESP. Further testing needed."
|
||||
|
||||
/datum/quirk/freerunning
|
||||
name = "Freerunning"
|
||||
@@ -50,6 +53,7 @@
|
||||
mob_trait = TRAIT_FREERUNNING
|
||||
gain_text = "<span class='notice'>You feel lithe on your feet!</span>"
|
||||
lose_text = "<span class='danger'>You feel clumsy again.</span>"
|
||||
medical_record_text = "Patient scored highly on cardio tests."
|
||||
|
||||
/datum/quirk/friendly
|
||||
name = "Friendly"
|
||||
@@ -59,6 +63,7 @@
|
||||
gain_text = "<span class='notice'>You want to hug someone.</span>"
|
||||
lose_text = "<span class='danger'>You no longer feel compelled to hug others.</span>"
|
||||
mood_quirk = TRUE
|
||||
medical_record_text = "Patient demonstrates low-inhibitions for physical contact and well-developed arms. Requesting another doctor take over this case."
|
||||
|
||||
/datum/quirk/jolly
|
||||
name = "Jolly"
|
||||
@@ -66,6 +71,11 @@
|
||||
value = 1
|
||||
mob_trait = TRAIT_JOLLY
|
||||
mood_quirk = TRUE
|
||||
medical_record_text = "Patient demonstrates constant euthymia irregular for environment. It's a bit much, to be honest."
|
||||
|
||||
/datum/quirk/jolly/on_process()
|
||||
if(prob(0.05))
|
||||
SEND_SIGNAL(quirk_holder, COMSIG_ADD_MOOD_EVENT, "jolly", /datum/mood_event/jolly)
|
||||
|
||||
/datum/quirk/light_step
|
||||
name = "Light Step"
|
||||
@@ -74,6 +84,7 @@
|
||||
mob_trait = TRAIT_LIGHT_STEP
|
||||
gain_text = "<span class='notice'>You walk with a little more litheness.</span>"
|
||||
lose_text = "<span class='danger'>You start tromping around like a barbarian.</span>"
|
||||
medical_record_text = "Patient's dexterity belies a strong capacity for stealth."
|
||||
|
||||
/datum/quirk/quick_step
|
||||
name = "Quick Step"
|
||||
@@ -82,6 +93,7 @@
|
||||
mob_trait = TRAIT_SPEEDY_STEP
|
||||
gain_text = "<span class='notice'>You feel determined. No time to lose.</span>"
|
||||
lose_text = "<span class='danger'>You feel less determined. What's the rush, man?</span>"
|
||||
medical_record_text = "Patient scored highly on racewalking tests."
|
||||
|
||||
/datum/quirk/musician
|
||||
name = "Musician"
|
||||
@@ -90,6 +102,7 @@
|
||||
mob_trait = TRAIT_MUSICIAN
|
||||
gain_text = "<span class='notice'>You know everything about musical instruments.</span>"
|
||||
lose_text = "<span class='danger'>You forget how musical instruments work.</span>"
|
||||
medical_record_text = "Patient brain scans show a highly-developed auditory pathway."
|
||||
|
||||
/datum/quirk/musician/on_spawn()
|
||||
var/mob/living/carbon/human/H = quirk_holder
|
||||
@@ -131,6 +144,7 @@
|
||||
mob_trait = TRAIT_PHOTOGRAPHER
|
||||
gain_text = "<span class='notice'>You know everything about photography.</span>"
|
||||
lose_text = "<span class='danger'>You forget how photo cameras work.</span>"
|
||||
medical_record_text = "Patient mentions photography as a stress-relieving hobby."
|
||||
|
||||
/datum/quirk/photographer/on_spawn()
|
||||
var/mob/living/carbon/human/H = quirk_holder
|
||||
@@ -150,6 +164,7 @@
|
||||
desc = "You know your body well, and can accurately assess the extent of your wounds."
|
||||
value = 2
|
||||
mob_trait = TRAIT_SELF_AWARE
|
||||
medical_record_text = "Patient demonstrates an uncanny knack for self-diagnosis."
|
||||
|
||||
/datum/quirk/skittish
|
||||
name = "Skittish"
|
||||
@@ -164,6 +179,7 @@
|
||||
mob_trait = TRAIT_SPIRITUAL
|
||||
gain_text = "<span class='notice'>You feel a little more faithful to the gods today.</span>"
|
||||
lose_text = "<span class='danger'>You feel less faithful in the gods.</span>"
|
||||
medical_record_text = "Patient reports a belief in a higher power."
|
||||
|
||||
/datum/quirk/tagger
|
||||
name = "Tagger"
|
||||
@@ -172,6 +188,7 @@
|
||||
mob_trait = TRAIT_TAGGER
|
||||
gain_text = "<span class='notice'>You know how to tag walls efficiently.</span>"
|
||||
lose_text = "<span class='danger'>You forget how to tag walls properly.</span>"
|
||||
medical_record_text = "Patient was recently seen for possible paint huffing incident."
|
||||
|
||||
/datum/quirk/tagger/on_spawn()
|
||||
var/mob/living/carbon/human/H = quirk_holder
|
||||
@@ -192,6 +209,7 @@
|
||||
mob_trait = TRAIT_VORACIOUS
|
||||
gain_text = "<span class='notice'>You feel HONGRY.</span>"
|
||||
lose_text = "<span class='danger'>You no longer feel HONGRY.</span>"
|
||||
medical_record_text = "Patient demonstrates a disturbing capacity for eating."
|
||||
|
||||
/datum/quirk/trandening
|
||||
name = "High Luminosity Eyes"
|
||||
@@ -219,6 +237,7 @@
|
||||
mob_trait = TRAIT_HIGH_BLOOD
|
||||
gain_text = "<span class='notice'>You feel full of blood!</span>"
|
||||
lose_text = "<span class='notice'>You feel like your blood pressure went down.</span>"
|
||||
medical_record_text = "Patient's blood tests report an abnormal concentration of red blood cells in their bloodstream."
|
||||
|
||||
/datum/quirk/bloodpressure/add()
|
||||
quirk_holder.blood_ratio = 1.2
|
||||
|
||||
@@ -22,14 +22,19 @@
|
||||
value = -1
|
||||
gain_text = "<span class='danger'>You start feeling depressed.</span>"
|
||||
lose_text = "<span class='notice'>You no longer feel depressed.</span>" //if only it were that easy!
|
||||
medical_record_text = "Patient has a severe mood disorder causing them to experience sudden moments of sadness."
|
||||
medical_record_text = "Patient has a severe mood disorder, causing them to experience acute episodes of depression."
|
||||
mood_quirk = TRUE
|
||||
|
||||
/datum/quirk/depression/on_process()
|
||||
if(prob(0.05))
|
||||
SEND_SIGNAL(quirk_holder, COMSIG_ADD_MOOD_EVENT, "depression", /datum/mood_event/depression)
|
||||
|
||||
/datum/quirk/family_heirloom
|
||||
name = "Family Heirloom"
|
||||
desc = "You are the current owner of an heirloom, passed down for generations. You have to keep it safe!"
|
||||
value = -1
|
||||
mood_quirk = TRUE
|
||||
medical_record_text = "Patient demonstrates an unnatural attachment to a family heirloom."
|
||||
var/obj/item/heirloom
|
||||
var/where
|
||||
|
||||
@@ -163,6 +168,7 @@
|
||||
name = "Nyctophobia"
|
||||
desc = "As far as you can remember, you've always been afraid of the dark. While in the dark without a light source, you instinctually act careful, and constantly feel a sense of dread."
|
||||
value = -1
|
||||
medical_record_text = "Patient demonstrates a fear of the dark. (Seriously?)"
|
||||
|
||||
/datum/quirk/nyctophobia/on_process()
|
||||
var/mob/living/carbon/human/H = quirk_holder
|
||||
@@ -183,7 +189,8 @@
|
||||
desc = "Bright lights irritate you. Your eyes start to water, your skin feels itchy against the photon radiation, and your hair gets dry and frizzy. Maybe it's a medical condition. If only Kinaris was more considerate of your needs..."
|
||||
value = -1
|
||||
gain_text = "<span class='danger'>The safety of light feels off...</span>"
|
||||
lose_text = "<span class='notice'>Enlighing.</span>"
|
||||
lose_text = "<span class='notice'>Enlightening.</span>"
|
||||
medical_record_text = "Despite my warnings, the patient refuses turn on the lights, only to end up rolling down a full flight of stairs and into the cellar."
|
||||
|
||||
/datum/quirk/lightless/on_process()
|
||||
var/turf/T = get_turf(quirk_holder)
|
||||
@@ -461,5 +468,5 @@
|
||||
H.maxHealth = H.maxHealth * 0.8
|
||||
|
||||
/datum/quirk/flimsy/remove() //how do admins even remove traits?
|
||||
var/mob/living/carbon/human/H = quirk_holder
|
||||
H.maxHealth += healthchange
|
||||
if(quirk_holder)
|
||||
quirk_holder.maxHealth += healthchange
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
value = 0
|
||||
gain_text = "<span class='notice'>You feel an intense craving for pineapple.</span>"
|
||||
lose_text = "<span class='notice'>Your feelings towards pineapples seem to return to a lukewarm state.</span>"
|
||||
medical_record_text = "Patient demonstrates a pathological love of pineapple."
|
||||
|
||||
/datum/quirk/pineapple_liker/add()
|
||||
var/mob/living/carbon/human/H = quirk_holder
|
||||
@@ -57,6 +58,7 @@
|
||||
value = 0
|
||||
gain_text = "<span class='notice'>You find yourself pondering what kind of idiot actually enjoys pineapples...</span>"
|
||||
lose_text = "<span class='notice'>Your feelings towards pineapples seem to return to a lukewarm state.</span>"
|
||||
medical_record_text = "Patient is correct to think that pineapple is disgusting."
|
||||
|
||||
/datum/quirk/pineapple_hater/add()
|
||||
var/mob/living/carbon/human/H = quirk_holder
|
||||
@@ -75,6 +77,7 @@
|
||||
value = 0
|
||||
gain_text = "<span class='notice'>You start craving something that tastes strange.</span>"
|
||||
lose_text = "<span class='notice'>You feel like eating normal food again.</span>"
|
||||
medical_record_text = "Patient demonstrates irregular nutrition preferences."
|
||||
|
||||
/datum/quirk/deviant_tastes/add()
|
||||
var/mob/living/carbon/human/H = quirk_holder
|
||||
|
||||
@@ -530,7 +530,7 @@ What a mess.*/
|
||||
M.fields["alg_d"] = "No allergies have been detected in this patient."
|
||||
M.fields["cdi"] = "None"
|
||||
M.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
|
||||
M.fields["notes"] = "No notes."
|
||||
M.fields["notes"] = "No Notes."
|
||||
GLOB.data_core.medical += M
|
||||
|
||||
|
||||
|
||||
@@ -190,12 +190,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
var/prefered_security_department = SEC_DEPT_RANDOM
|
||||
var/custom_species = null
|
||||
|
||||
//Quirk list
|
||||
var/list/positive_quirks = list()
|
||||
var/list/negative_quirks = list()
|
||||
var/list/neutral_quirks = list()
|
||||
var/list/all_quirks = list()
|
||||
var/list/character_quirks = list()
|
||||
|
||||
//Jobs, uses bitflags
|
||||
var/job_civilian_high = 0
|
||||
@@ -1395,7 +1390,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
dat += "<center><a href='?_src_=prefs;preference=trait;task=close'>Done</a></center>"
|
||||
dat += "<hr>"
|
||||
dat += "<center><b>Current quirks:</b> [all_quirks.len ? all_quirks.Join(", ") : "None"]</center>"
|
||||
dat += "<center>[positive_quirks.len] / [MAX_QUIRKS] max positive quirks<br>\
|
||||
dat += "<center>[GetPositiveQuirkCount()] / [MAX_QUIRKS] max positive quirks<br>\
|
||||
<b>Quirk balance remaining:</b> [GetQuirkBalance()]</center><br>"
|
||||
for(var/V in SSquirks.quirks)
|
||||
var/datum/quirk/T = SSquirks.quirks[V]
|
||||
@@ -1426,12 +1421,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
<font color='red'><b>LOCKED: [lock_reason]</b></font><br>"
|
||||
else
|
||||
if(has_quirk)
|
||||
dat += "<b><font color='[font_color]'>[quirk_name]</font></b> - [initial(T.desc)] \
|
||||
<a href='?_src_=prefs;preference=trait;task=update;trait=[quirk_name]'>[has_quirk ? "Lose" : "Take"] ([quirk_cost] pts.)</a><br>"
|
||||
dat += "<a href='?_src_=prefs;preference=trait;task=update;trait=[quirk_name]'>[has_quirk ? "Remove" : "Take"] ([quirk_cost] pts.)</a> \
|
||||
<b><font color='[font_color]'>[quirk_name]</font></b> - [initial(T.desc)]<br>"
|
||||
else
|
||||
dat += "<font color='[font_color]'>[quirk_name]</font> - [initial(T.desc)] \
|
||||
<a href='?_src_=prefs;preference=trait;task=update;trait=[quirk_name]'>[has_quirk ? "Lose" : "Take"] ([quirk_cost] pts.)</a><br>"
|
||||
dat += "<br><center><a href='?_src_=prefs;preference=trait;task=reset'>Reset Traits</a></center>"
|
||||
dat += "<a href='?_src_=prefs;preference=trait;task=update;trait=[quirk_name]'>[has_quirk ? "Remove" : "Take"] ([quirk_cost] pts.)</a> \
|
||||
<font color='[font_color]'>[quirk_name]</font> - [initial(T.desc)]<br>"
|
||||
dat += "<br><center><a href='?_src_=prefs;preference=trait;task=reset'>Reset Quirks</a></center>"
|
||||
|
||||
var/datum/browser/popup = new(user, "mob_occupation", "<div align='center'>Quirk Preferences</div>", 900, 600) //no reason not to reuse the occupation window, as it's cleaner that way
|
||||
popup.set_window_options("can_close=0")
|
||||
@@ -1445,6 +1440,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
bal -= initial(T.value)
|
||||
return bal
|
||||
|
||||
/datum/preferences/proc/GetPositiveQuirkCount()
|
||||
. = 0
|
||||
for(var/q in all_quirks)
|
||||
if(SSquirks.quirk_points[q] > 0)
|
||||
.++
|
||||
|
||||
/datum/preferences/Topic(href, href_list, hsrc) //yeah, gotta do this I guess..
|
||||
. = ..()
|
||||
if(href_list["close"])
|
||||
@@ -1532,42 +1533,23 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
to_chat(user, "<span class='danger'>[quirk] is incompatible with [Q].</span>")
|
||||
return
|
||||
var/value = SSquirks.quirk_points[quirk]
|
||||
if(value == 0)
|
||||
if(quirk in neutral_quirks)
|
||||
neutral_quirks -= quirk
|
||||
all_quirks -= quirk
|
||||
else
|
||||
neutral_quirks += quirk
|
||||
all_quirks += quirk
|
||||
var/balance = GetQuirkBalance()
|
||||
if(quirk in all_quirks)
|
||||
if(balance + value < 0)
|
||||
to_chat(user, "<span class='warning'>Refunding this would cause you to go below your balance!</span>")
|
||||
return
|
||||
all_quirks -= quirk
|
||||
else
|
||||
var/balance = GetQuirkBalance()
|
||||
if(quirk in positive_quirks)
|
||||
positive_quirks -= quirk
|
||||
all_quirks -= quirk
|
||||
else if(quirk in negative_quirks)
|
||||
if(balance + value < 0)
|
||||
to_chat(user, "<span class='warning'>Refunding this would cause you to go below your balance!</span>")
|
||||
return
|
||||
negative_quirks -= quirk
|
||||
all_quirks -= quirk
|
||||
else if(value > 0)
|
||||
if(positive_quirks.len >= MAX_QUIRKS)
|
||||
to_chat(user, "<span class='warning'>You can't have more than [MAX_QUIRKS] positive quirks!</span>")
|
||||
return
|
||||
if(balance - value < 0)
|
||||
to_chat(user, "<span class='warning'>You don't have enough balance to gain this quirk!</span>")
|
||||
return
|
||||
positive_quirks += quirk
|
||||
all_quirks += quirk
|
||||
else
|
||||
negative_quirks += quirk
|
||||
all_quirks += quirk
|
||||
if(GetPositiveQuirkCount() >= MAX_QUIRKS)
|
||||
to_chat(user, "<span class='warning'>You can't have more than [MAX_QUIRKS] positive quirks!</span>")
|
||||
return
|
||||
if(balance - value < 0)
|
||||
to_chat(user, "<span class='warning'>You don't have enough balance to gain this quirk!</span>")
|
||||
return
|
||||
all_quirks += quirk
|
||||
SetQuirks(user)
|
||||
if("reset")
|
||||
all_quirks = list()
|
||||
positive_quirks = list()
|
||||
negative_quirks = list()
|
||||
neutral_quirks = list()
|
||||
SetQuirks(user)
|
||||
else
|
||||
SetQuirks(user)
|
||||
|
||||
@@ -351,9 +351,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
|
||||
//Quirks
|
||||
S["all_quirks"] >> all_quirks
|
||||
S["positive_quirks"] >> positive_quirks
|
||||
S["negative_quirks"] >> negative_quirks
|
||||
S["neutral_quirks"] >> neutral_quirks
|
||||
|
||||
//Records
|
||||
S["security_records"] >> security_records
|
||||
@@ -496,9 +493,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
security_records = copytext(security_records, 1, MAX_FLAVOR_LEN)
|
||||
medical_records = copytext(medical_records, 1, MAX_FLAVOR_LEN)
|
||||
all_quirks = SANITIZE_LIST(all_quirks)
|
||||
positive_quirks = SANITIZE_LIST(positive_quirks)
|
||||
negative_quirks = SANITIZE_LIST(negative_quirks)
|
||||
neutral_quirks = SANITIZE_LIST(neutral_quirks)
|
||||
|
||||
cit_character_pref_load(S)
|
||||
|
||||
@@ -588,9 +582,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
WRITE_FILE(S["medical_records"] , medical_records)
|
||||
//Quirks
|
||||
WRITE_FILE(S["all_quirks"] , all_quirks)
|
||||
WRITE_FILE(S["positive_quirks"] , positive_quirks)
|
||||
WRITE_FILE(S["negative_quirks"] , negative_quirks)
|
||||
WRITE_FILE(S["neutral_quirks"] , neutral_quirks)
|
||||
|
||||
cit_character_pref_save(S)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
blood_type = B.data["blood_type"]
|
||||
features = B.data["features"]
|
||||
factions = B.data["factions"]
|
||||
factions = B.data["quirks"]
|
||||
quirks = B.data["quirks"]
|
||||
contains_sample = TRUE
|
||||
visible_message("<span class='notice'>The [src] is injected with a fresh blood sample.</span>")
|
||||
else
|
||||
|
||||
@@ -863,6 +863,7 @@
|
||||
.["Make slime"] = "?_src_=vars;[HrefToken()];makeslime=[REF(src)]"
|
||||
.["Toggle Purrbation"] = "?_src_=vars;[HrefToken()];purrbation=[REF(src)]"
|
||||
.["Copy outfit"] = "?_src_=vars;[HrefToken()];copyoutfit=[REF(src)]"
|
||||
.["Add/Remove Quirks"] = "?_src_=vars;[HrefToken()];modquirks=[REF(src)]"
|
||||
|
||||
/mob/living/carbon/human/MouseDrop_T(mob/living/target, mob/living/user)
|
||||
if(pulling == target && grab_state >= GRAB_AGGRESSIVE && stat == CONSCIOUS)
|
||||
|
||||
@@ -148,23 +148,28 @@
|
||||
|
||||
/////////////////////////////////// DISABILITIES ////////////////////////////////////
|
||||
|
||||
/mob/living/proc/add_quirk(quirk, spawn_effects) //separate proc due to the way these ones are handled
|
||||
if(HAS_TRAIT(src, quirk))
|
||||
/mob/living/proc/add_quirk(quirktype, spawn_effects) //separate proc due to the way these ones are handled
|
||||
if(has_quirk(quirktype))
|
||||
return
|
||||
if(!SSquirks || !SSquirks.quirks[quirk])
|
||||
var/datum/quirk/T = quirktype
|
||||
var/qname = initial(T.name)
|
||||
if(!SSquirks || !SSquirks.quirks[qname])
|
||||
return
|
||||
var/datum/quirk/T = SSquirks.quirks[quirk]
|
||||
new T (src, spawn_effects)
|
||||
new quirktype (src, spawn_effects)
|
||||
return TRUE
|
||||
|
||||
/mob/living/proc/remove_quirk(quirk)
|
||||
var/datum/quirk/T = roundstart_quirks[quirk]
|
||||
if(T)
|
||||
qdel(T)
|
||||
return TRUE
|
||||
/mob/living/proc/remove_quirk(quirktype)
|
||||
for(var/datum/quirk/Q in roundstart_quirks)
|
||||
if(Q.type == quirktype)
|
||||
qdel(Q)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/living/proc/has_quirk(quirk)
|
||||
return roundstart_quirks[quirk]
|
||||
/mob/living/proc/has_quirk(quirktype)
|
||||
for(var/datum/quirk/Q in roundstart_quirks)
|
||||
if(Q.type == quirktype)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/////////////////////////////////// TRAIT PROCS ////////////////////////////////////
|
||||
|
||||
@@ -225,4 +230,4 @@
|
||||
|
||||
/mob/living/proc/ignore_slowdown(source)
|
||||
ADD_TRAIT(src, TRAIT_IGNORESLOWDOWN, source)
|
||||
update_movespeed(FALSE)
|
||||
update_movespeed(FALSE)
|
||||
|
||||
@@ -452,12 +452,12 @@
|
||||
qdel(M)
|
||||
return
|
||||
|
||||
to_chat(usr, "<span class='boldnotice'>Please roleplay correctly, do not meta-game, and use information from a different character or characters, to influence your actions!</span>")
|
||||
usr.client.lastrespawn = world.time + 1800 SECONDS
|
||||
usr.client.respawn_observing = 0
|
||||
|
||||
message_admins("[client.ckey] respawned.")
|
||||
M.key = key
|
||||
M.ckey = ckey //shamelessly copied to
|
||||
to_chat(M, "<span class='danger'>Please roleplay correctly, do not meta-game, and use information from a different character or characters, to influence your actions!</span>")
|
||||
qdel(usr)
|
||||
// M.Login() //wat
|
||||
return
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/datum/reagent/blood
|
||||
data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_HUMAN, "blood_type"= null,"resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null)
|
||||
data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_HUMAN, "blood_type"= null,"resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null,"quirks"=null)
|
||||
name = "Blood"
|
||||
id = "blood"
|
||||
value = 1
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
M.grant_language(/datum/language/narsie)
|
||||
|
||||
/datum/quirk/narsianspeaker/remove()
|
||||
var/mob/living/M = quirk_holder
|
||||
M.remove_language(/datum/language/narsie)
|
||||
if(quirk_holder)
|
||||
quirk_holder.remove_language(/datum/language/ratvar)
|
||||
|
||||
/datum/quirk/ratvarianspeaker
|
||||
name = "Ratvarian speaker"
|
||||
@@ -25,8 +25,8 @@
|
||||
M.grant_language(/datum/language/ratvar)
|
||||
|
||||
/datum/quirk/ratvarianspeaker/remove()
|
||||
var/mob/living/M = quirk_holder
|
||||
M.remove_language(/datum/language/ratvar)
|
||||
if(quirk_holder)
|
||||
quirk_holder.remove_language(/datum/language/ratvar)
|
||||
|
||||
/datum/quirk/encodedspeaker
|
||||
name = "Encoded Audio speaker"
|
||||
@@ -40,8 +40,8 @@
|
||||
M.grant_language(/datum/language/machine)
|
||||
|
||||
/datum/quirk/encodedspeaker/remove()
|
||||
var/mob/living/M = quirk_holder
|
||||
M.remove_language(/datum/language/machine)
|
||||
if(quirk_holder)
|
||||
quirk_holder.remove_language(/datum/language/ratvar)
|
||||
|
||||
/datum/quirk/xenospeaker
|
||||
name = "Xenocommon speaker"
|
||||
@@ -55,5 +55,5 @@
|
||||
M.grant_language(/datum/language/xenocommon)
|
||||
|
||||
/datum/quirk/xenospeaker/remove()
|
||||
var/mob/living/M = quirk_holder
|
||||
M.remove_language(/datum/language/xenocommon)
|
||||
if(quirk_holder)
|
||||
quirk_holder.remove_language(/datum/language/ratvar)
|
||||
|
||||
Reference in New Issue
Block a user