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

moon smile effect durations fix #81794

Merged
merged 1 commit into from
Mar 4, 2024
Merged
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
6 changes: 4 additions & 2 deletions code/modules/antagonists/heretic/magic/moon_smile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
/datum/action/cooldown/spell/pointed/moon_smile/cast(mob/living/carbon/human/cast_on)
. = ..()
/// The duration of these effects are based on sanity, mainly for flavor but also to make it a weaker alpha strike
var/moon_smile_duration = (150 - cast_on.mob_mood.sanity) / 10
var/maximum_duration = 15 SECONDS
var/moon_smile_duration = ((SANITY_MAXIMUM - cast_on.mob_mood.sanity) / (SANITY_MAXIMUM - SANITY_INSANE)) * maximum_duration
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var/moon_smile_duration = ((SANITY_MAXIMUM - cast_on.mob_mood.sanity) / (SANITY_MAXIMUM - SANITY_INSANE)) * maximum_duration
var/moon_smile_duration = ((SANITY_MAXIMUM - cast_on.mob_mood.sanity) / SANITY_MAXIMUM) * maximum_duration

the SANITY_INSANE value is 0 anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know, but just in case it ever changes, I use the define so that the scaling stays accurate.

if(cast_on.can_block_magic(antimagic_flags))
to_chat(cast_on, span_notice("The moon turns, its smile no longer set on you."))
to_chat(owner, span_warning("The moon does not smile upon them."))
Expand All @@ -40,7 +41,8 @@
cast_on.set_eye_blur_if_lower(moon_smile_duration + 7 SECONDS)

var/obj/item/organ/internal/ears/ears = cast_on.get_organ_slot(ORGAN_SLOT_EARS)
ears?.adjustEarDamage(0, moon_smile_duration + 2 SECONDS)
//adjustEarDamage takes deafness duration parameter in one unit per two seconds, instead of the normal time, so we divide by two seconds
ears?.adjustEarDamage(0, (moon_smile_duration + 2 SECONDS) / (2 SECONDS))

cast_on.adjust_silence(moon_smile_duration + 5 SECONDS)
cast_on.AdjustKnockdown(2 SECONDS)
Expand Down
Loading