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

Adds a new math function; TOUGHER_TIMES() #1704

Merged
merged 1 commit into from
Dec 6, 2023
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
8 changes: 8 additions & 0 deletions code/__DEFINES/maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))

6 changes: 3 additions & 3 deletions code/modules/mob/living/simple_animal/abnormality/he/eris.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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
Expand Down
Loading