From a6ae770069a06d712026601742f587a88fdf54e0 Mon Sep 17 00:00:00 2001 From: Kirie Saito <77302679+Kitsunemitsu@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:11:15 -0500 Subject: [PATCH] Adds a new math function; TOUGHER_TIMES() (#1704) adds TOUGHER_TIMES() --- code/__DEFINES/maths.dm | 8 ++++++++ .../mob/living/simple_animal/abnormality/he/eris.dm | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/maths.dm b/code/__DEFINES/maths.dm index 417caf28ca3d..5b55b6a518d2 100644 --- a/code/__DEFINES/maths.dm +++ b/code/__DEFINES/maths.dm @@ -221,3 +221,11 @@ // ) #define GET_TRUE_DIST(a, b) (a == null || b == null) ? -1 : max(abs(a.x -b.x), abs(a.y-b.y), abs(a.z-b.z)) + +//Named after the Risk of Rain 2 item, and uses the exact math of it. +//Allows for an easy decaying stacking off a variable. +#define TOUGHER_TIMES(x) ((0.15*x)/(0.15*x + 1)) + +//If you REALLY need to fine-tune the decaying alogrithm for some reason. +#define TOUGHER_TIMES_SPECIFIC(x,y) ((y*x)/(y*x + 1)) + diff --git a/code/modules/mob/living/simple_animal/abnormality/he/eris.dm b/code/modules/mob/living/simple_animal/abnormality/he/eris.dm index 15f38bbab8f5..10cdde93ba0f 100644 --- a/code/modules/mob/living/simple_animal/abnormality/he/eris.dm +++ b/code/modules/mob/living/simple_animal/abnormality/he/eris.dm @@ -157,7 +157,7 @@ if(H.stat >= SOFT_CRIT) continue //Shamelessly fucking stolen from risk of rain's teddy bear. Maxes out at 20. - var/healamount = 20 * ((0.15*girlboss_level)/(0.15*girlboss_level + 1)) + var/healamount = 20 * (TOUGHER_TIMES(girlboss_level)) H.adjustBruteLoss(-healamount) //Healing for those around. new /obj/effect/temp_visual/heal(get_turf(H), "#FF4444") @@ -167,14 +167,14 @@ if(!ishuman(Proj.firer)) return var/mob/living/carbon/human/H = Proj.firer - H.apply_damage(40*(0.15*girlboss_level/(0.15*girlboss_level + 1)), WHITE_DAMAGE, null, H.run_armor_check(null, WHITE_DAMAGE), spread_damage = TRUE) + H.apply_damage(40*(TOUGHER_TIMES(girlboss_level)), WHITE_DAMAGE, null, H.run_armor_check(null, WHITE_DAMAGE), spread_damage = TRUE) /mob/living/simple_animal/hostile/abnormality/eris/attacked_by(obj/item/I, mob/living/user) ..() if(!user) return - user.apply_damage(40*(0.15*girlboss_level/(0.15*girlboss_level + 1)), WHITE_DAMAGE, null, user.run_armor_check(null, WHITE_DAMAGE), spread_damage = TRUE) + user.apply_damage(40*(TOUGHER_TIMES(girlboss_level)), WHITE_DAMAGE, null, user.run_armor_check(null, WHITE_DAMAGE), spread_damage = TRUE) //Okay, but here's the work effects