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

Silverscale Aura now dims in darkness #661

Merged
merged 3 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions code/modules/mob/living/carbon/human/species_types/lizardpeople.dm
Original file line number Diff line number Diff line change
Expand Up @@ -221,36 +221,8 @@ Lizard subspecies: SILVER SCALED
mutanttongue = /obj/item/organ/internal/tongue/lizard/silver
changesource_flags = MIRROR_BADMIN | MIRROR_MAGIC | RACE_SWAP | ERT_SPAWN
examine_limb_id = SPECIES_LIZARD
///stored mutcolor for when we turn back off of a silverscale.
var/old_mutcolor
///stored horn color for when we turn back off of a silverscale.
var/old_horncolor
///stored eye color for when we turn back off of a silverscale.
var/old_eye_color_left
///See above
var/old_eye_color_right

/datum/species/lizard/silverscale/get_physical_attributes()
return "Silver Scales are to lizardpeople what angels are to humans. \
Mostly identical, they are holy, don't breathe, don't get viruses, their hide cannot be pierced, love the taste of wine, \
and their tongue allows them to turn into a statue, for some reason."

/datum/species/lizard/silverscale/on_species_gain(mob/living/carbon/human/new_silverscale, datum/species/old_species, pref_load)
old_mutcolor = new_silverscale.dna.features["mcolor"]
old_horncolor = new_silverscale.dna.features["lizard_horn_color"]
old_eye_color_left = new_silverscale.eye_color_left
old_eye_color_right = new_silverscale.eye_color_right
new_silverscale.dna.features["mcolor"] = "#eeeeee"
new_silverscale.dna.features["lizard_horn_color"] = "#eeeeee"
new_silverscale.eye_color_left = "#0000a0"
new_silverscale.eye_color_right = "#0000a0"
. = ..()
new_silverscale.add_filter("silver_glint", 2, list("type" = "outline", "color" = "#ffffff63", "size" = 2))

/datum/species/lizard/silverscale/on_species_loss(mob/living/carbon/human/was_silverscale, datum/species/new_species, pref_load)
was_silverscale.dna.features["mcolor"] = old_mutcolor
was_silverscale.dna.features["lizard_horn_color"] = old_horncolor
was_silverscale.eye_color_left = old_eye_color_left
was_silverscale.eye_color_right = old_eye_color_right
was_silverscale.remove_filter("silver_glint")
return ..()
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
color_source = ORGAN_COLOR_OVERRIDE

/datum/bodypart_overlay/mutant/horns/inherit_color(obj/item/bodypart/bodypart_owner, force)
draw_color = bodypart_owner?.owner?.dna?.features["lizard_horn_color"] || "#FFFFFF"
draw_color = bodypart_owner?.owner?.dna?.features["lizard_horn_color"] || "#dddddd"
return TRUE

// The actual preference
Expand All @@ -91,7 +91,7 @@
target.dna.features["lizard_horn_color"] = value

/datum/preference/color/horn_color/create_default_value()
return "#FFFFFF"
return "#dddddd"

// -- Lizard Horn Layer selection --
// Makes it actually work
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@
. += " This will be invaluable towards our research of silverscale biology - please send more samples if you have any!"

/obj/item/organ/internal/tongue/lizard/silver
visual = TRUE
/// Stored skin color for turning back off of a silverscale.
var/old_skincolor
VAR_PRIVATE/old_skincolor
///stored mutcolor for when we turn back off of a silverscale.
var/old_mutcolor
VAR_PRIVATE/old_mutcolor
///stored horn color for when we turn back off of a silverscale.
var/old_horncolor
VAR_PRIVATE/old_horncolor
///stored eye color for when we turn back off of a silverscale.
var/old_eye_color_left
VAR_PRIVATE/old_eye_color_left
///See above
var/old_eye_color_right
VAR_PRIVATE/old_eye_color_right
/// Tracks what color our glint is, to prevent unnecessary updates
VAR_PRIVATE/glint_color

/obj/item/organ/internal/tongue/lizard/silver/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -64,13 +67,8 @@
old_eye_color_right = he_who_was_blessed_with_silver.eye_color_right

if (istype(organ_owner.dna.species, /datum/species/lizard/silverscale))
var/datum/species/lizard/silverscale/silver_species = organ_owner.dna.species
old_mutcolor = silver_species.old_mutcolor
old_eye_color_left = silver_species.old_eye_color_left
old_eye_color_right = silver_species.old_eye_color_right

organ_owner.clear_mood_event(SILVERSCALE_LOST_TONGUE_MOOD_ID)
if (!special)
if(!special)
to_chat(organ_owner, span_blue("You feel a sense of security as you feel the familiar metallic taste of a silvery tongue... \
you are once again Silverscale."))

Expand All @@ -79,7 +77,7 @@
he_who_was_blessed_with_silver.dna.features["lizard_horn_color"] = "#eeeeee"
he_who_was_blessed_with_silver.eye_color_left = "#0000a0"
he_who_was_blessed_with_silver.eye_color_right = "#0000a0"
he_who_was_blessed_with_silver.add_filter("silver_glint", 2, list("type" = "outline", "color" = "#ffffff63", "size" = 2))
update_glint()

he_who_was_blessed_with_silver.physiology?.damage_resistance += 10
he_who_was_blessed_with_silver.dna.species.exotic_bloodtype = /datum/blood_type/silver/lizard
Expand All @@ -100,7 +98,7 @@

if (istype(organ_owner.dna.species, /datum/species/lizard/silverscale))
organ_owner.add_mood_event(SILVERSCALE_LOST_TONGUE_MOOD_ID, /datum/mood_event/silverscale_lost_tongue)
if (!special)
if(!special)
to_chat(organ_owner, span_userdanger("You can feel the arcane powers of the silver tongue slip away - \
you've lost your silver heritage! Without it, you are less than Silverscale... you MUST get it back!"))

Expand All @@ -120,7 +118,29 @@
for(var/datum/action/cooldown/turn_to_statue/statue in actions)
if(organ_owner.loc == statue.statue)
organ_owner.forceMove(statue.statue.loc)
organ_owner.Paralyze(12 SECONDS)
if(!special)
organ_owner.Paralyze(12 SECONDS)

/obj/item/organ/internal/tongue/lizard/silver/on_life(seconds_per_tick, times_fired)
update_glint()

/// Updates the alpha of the "glow" effect
/obj/item/organ/internal/tongue/lizard/silver/proc/update_glint()
var/turf/owner_turf = get_turf(owner)
var/lums = owner_turf?.get_lumcount() - LIGHTING_TILE_IS_DARK
if(lums <= 0)
if(owner.get_filter("silver_glint"))
owner.transition_filter("silver_glint", outline_filter(1.5, "#FFFFFF00"), 1 SECONDS)
addtimer(CALLBACK(owner, TYPE_PROC_REF(/datum, remove_filter), "silver_glint"), 1 SECONDS)
glint_color = null
return
var/new_glint_color = "#ffffff[num2text(0.5 * lums * 255, 2, 16)]"
if(glint_color == new_glint_color)
return
glint_color = new_glint_color
if(!owner.get_filter("silver_glint"))
owner.add_filter("silver_glint", 2, outline_filter(1.5, "#FFFFFF00"))
owner.transition_filter("silver_glint", outline_filter(1.5, glint_color), 1 SECONDS)

/datum/action/cooldown/turn_to_statue
/// Traits granted to the mob when in statue form
Expand Down
Loading