Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gives werewolves a dog accent and colorblindness #1831

Merged
merged 11 commits into from Aug 25, 2020
3 changes: 3 additions & 0 deletions _std/_setup.dm
Expand Up @@ -1166,6 +1166,9 @@ var/ZLOG_START_TIME
//Logged whenever you try to View Variables a thing
#define AUDIT_VIEW_VARIABLES (1 << 1)

//Color matrices // vv Values modified from those obtained from https://gist.github.com/Lokno/df7c3bfdc9ad32558bb7
#define MATRIX_PROTANOPIA 0.55,0.45,0.000,0.55,0.45,0.000,0.000,0.25,1.0,0.0,0.0,0.0

//PATHOLOGY REMOVAL
//#define CREATE_PATHOGENS 1

Expand Down
2 changes: 2 additions & 0 deletions _std/mob_properties.dm
Expand Up @@ -178,6 +178,8 @@ To remove:
#define PROP_DIGESTION_EFFICIENCY(x) x("digestion_efficiency", APPLY_MOB_PROPERTY_PRODUCT, REMOVE_MOB_PROPERTY_PRODUCT)
#define PROP_CHEM_PURGE(x) x("chem_purging", APPLY_MOB_PROPERTY_SUM, REMOVE_MOB_PROPERTY_SUM)
#define PROP_REBREATHING(x) x("rebreathing", APPLY_MOB_PROPERTY_SIMPLE, REMOVE_MOB_PROPERTY_SIMPLE)
//visual effect properties
#define PROP_PROTANOPIA(x) x("protanopia", APPLY_MOB_PROPERTY_SIMPLE, REMOVE_MOB_PROPERTY_SIMPLE)


// In lieu of comments, these are the indexes used for list access in the macros below.
Expand Down
7 changes: 7 additions & 0 deletions code/datums/mutantraces.dm
Expand Up @@ -812,6 +812,7 @@
r_limb_arm_type_mutantrace = /obj/item/parts/human_parts/arm/right/werewolf
l_limb_arm_type_mutantrace = /obj/item/parts/human_parts/arm/left/werewolf
ignore_missing_limbs = 0
var/old_client_color = null

New()
..()
Expand All @@ -825,6 +826,10 @@

var/duration = 3000
var/datum/ailment_data/disease/D = mob.find_ailment_by_type(/datum/ailment/disease/lycanthropy/)

mob.bioHolder.AddEffect("protanopia", null, null, 0, 1)
mob.bioHolder.AddEffect("accent_scoob", null, null, 0, 1)

if(D)
D.cycles++
duration = rand(2000, 4000) * D.cycles
Expand All @@ -839,6 +844,8 @@
mob.remove_stam_mod_regen("werewolf")
mob.remove_stun_resist_mod("werewolf")
mob.max_health -= 30
mob.bioHolder.RemoveEffect("protanopia")
mob.bioHolder.RemoveEffect("accent_scoob")

if (!isnull(src.original_name))
mob.real_name = src.original_name
Expand Down
3 changes: 3 additions & 0 deletions code/mob.dm
Expand Up @@ -485,6 +485,9 @@
if (illumplane) //Wire: Fix for Cannot modify null.alpha
illumplane.alpha = 255

if(HAS_MOB_PROPERTY(src, PROP_PROTANOPIA))
src.client?.color = list(MATRIX_PROTANOPIA)

return

/mob/Logout()
Expand Down
24 changes: 24 additions & 0 deletions code/modules/medical/genetics/bioEffects/harmful.dm
Expand Up @@ -588,6 +588,30 @@
if (prob(emote_prob))
L.emote(emote_type)

/datum/bioEffect/colorblindness
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't checked but I'm pretty sure as its written this whole thing might go away if you reconnect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to do it properly there should be something (check out mob_properties, I think priority based system would work the best unless someone wants to write color matrix compositions) that holds the intended client color and it is also set in mob/Login.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a mob_property and a check on login to add the effect.

I didn't set it to be a priority property since there was only this effect to check for, and changing how the effect is applied through priorities doesn't seem within the scope of this PR. I'll probably end up doing that, though, if I hopefully get around to adding other color matrix effects. And maybe fixing the flockvision thing.

I also defined the matrix values in _setup. I tried defining the whole list there, and also plugging the define as it is now into something like mob.client.color = list(MATRIX_PROTANOPIA), but it just set client.color to "#0000FF" and made everything blue. I'm probably not understanding how lists work, but as it is now, it appears to work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks decent enough now

name = "Protanopia"
desc = "Selectively inhibits the L-cones in the subject's eyes, causing red-green colorblindness."
id = "protanopia"
effectType = effectTypeDisability
isBad = 1
msgGain = "Everything starts looking a lot more yellow."
msgLose = "You notice a few extra colors."
probability = 99
icon_state = "bad"
var/list/protanopia_matrix = list(MATRIX_PROTANOPIA)

OnAdd()
src.removed = 0
APPLY_MOB_PROPERTY(owner, PROP_PROTANOPIA, src)
owner.client?.color = protanopia_matrix
return

OnRemove()
src.removed = 1
REMOVE_MOB_PROPERTY(owner, PROP_PROTANOPIA, src)
owner.client?.color = null
return

/datum/bioEffect/emoter/screamer
name = "Paranoia"
desc = "Causes the subject to become easily startled."
Expand Down
20 changes: 20 additions & 0 deletions code/modules/medical/genetics/bioEffects/speech.dm
Expand Up @@ -673,3 +673,23 @@
message = yorkify(message)
return message

/datum/bioEffect/speech/scoob
name = "Frontal Gyrus Alteration Type-SD"
desc = "Forces the language center of the subject's brain to bark out sentences like a dog."
id = "accent_scoob"
effectType = effectTypeDisability
isBad = 1
msgGain = "You feel like you've got some work to do now."
msgLose = "You feel like you've found yourself."
reclaim_fail = 10
lockProb = 25
lockedGaps = 2
lockedDiff = 2
lockedChars = list("G","C")
lockedTries = 3

OnSpeak(var/message)
if (!istext(message))
return ""
message = scoobify(message)
return message