Skip to content

Commit

Permalink
Adds a new math function; TOUGHER_TIMES() (#1704)
Browse files Browse the repository at this point in the history
adds TOUGHER_TIMES()
  • Loading branch information
Kitsunemitsu authored Dec 6, 2023
1 parent 11b8ce3 commit a6ae770
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
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

0 comments on commit a6ae770

Please sign in to comment.