diff --git a/code/__DEFINES/maths.dm b/code/__DEFINES/maths.dm index 367e8436864..db69b263cdf 100644 --- a/code/__DEFINES/maths.dm +++ b/code/__DEFINES/maths.dm @@ -219,3 +219,5 @@ /// Like DT_PROB_RATE but easier to use, simply put `if(DT_PROB(10, 5))` #define DT_PROB(prob_per_second_percent, delta_time) (prob(100*DT_PROB_RATE(prob_per_second_percent/100, delta_time))) // ) + +#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)) diff --git a/code/modules/events/crystal_event.dm b/code/modules/events/crystal_event.dm index 6cbd4262304..5965893fe15 100644 --- a/code/modules/events/crystal_event.dm +++ b/code/modules/events/crystal_event.dm @@ -78,7 +78,7 @@ This section is for the event controller for(var/t in RANGE_TURFS(8, dest_crystal.loc)) var/turf/turf_loc = t - var/distance_from_center = get_dist(turf_loc, dest_crystal.loc) + var/distance_from_center = get_dist(turf_loc, dest_crystal) switch(distance_from_center) if(0) distance_from_center = 1 //Same tile, let's avoid a division by zero. @@ -127,13 +127,13 @@ This section is for the event controller for(var/t in RANGE_TURFS(5, center_turf)) var/turf/turf_loc = t - var/distance_from_center = get_dist(turf_loc, center_turf) + var/distance_from_center = GET_TRUE_DIST(turf_loc, center_turf) switch(distance_from_center) if(0) distance_from_center = 1 //Same tile, let's avoid a division by zero. if(-1) kill() - CRASH("Negative distance error here") + CRASH("Negative distance measurement from the center turf detected, this should never happen") if(prob(250 / distance_from_center)) if(isopenturf(turf_loc) || isspaceturf(turf_loc)) turf_loc.ChangeTurf(/turf/open/indestructible/crystal_floor, flags = CHANGETURF_INHERIT_AIR) @@ -619,12 +619,10 @@ This section is for the crystal portals variations name = "Huge Portal" desc = "A huge portal to an unkown dimension!" color = COLOR_BLACK - max_mobs = 5 - spawn_time = 20 SECONDS + max_mobs = 2 + spawn_time = 40 SECONDS mob_types = list( - /mob/living/simple_animal/hostile/crystal_monster/recruit, - /mob/living/simple_animal/hostile/crystal_monster/killer, - /mob/living/simple_animal/hostile/crystal_monster/boss, + /mob/living/simple_animal/hostile/crystal_monster/boss ) /obj/structure/crystal_portal/huge/Initialize() @@ -686,8 +684,8 @@ This section is for the crystal monsters variations health = 20 speed = 0.8 harm_intent_damage = 7 - melee_damage_lower = 10 - melee_damage_upper = 15 + melee_damage_lower = 7 + melee_damage_upper = 10 move_force = MOVE_FORCE_WEAK move_resist = MOVE_FORCE_WEAK pull_force = MOVE_FORCE_WEAK @@ -713,9 +711,9 @@ This section is for the crystal monsters variations maxHealth = 20 health = 20 speed = 0.9 - harm_intent_damage = 11 - melee_damage_lower = 10 - melee_damage_upper = 15 + harm_intent_damage = 8 + melee_damage_lower = 8 + melee_damage_upper = 11 move_force = MOVE_FORCE_NORMAL move_resist = MOVE_FORCE_NORMAL pull_force = MOVE_FORCE_NORMAL @@ -745,9 +743,9 @@ This section is for the crystal monsters variations maxHealth = 20 health = 20 speed = 1.2 - harm_intent_damage = 11 - melee_damage_lower = 15 - melee_damage_upper = 20 + harm_intent_damage = 9 + melee_damage_lower = 10 + melee_damage_upper = 15 move_force = MOVE_FORCE_STRONG move_resist = MOVE_FORCE_STRONG pull_force = MOVE_FORCE_STRONG @@ -771,9 +769,9 @@ This section is for the crystal monsters variations maxHealth = 35 health = 35 speed = 0.75 - harm_intent_damage = 15 - melee_damage_lower = 30 - melee_damage_upper = 35 + harm_intent_damage = 10 + melee_damage_lower = 15 + melee_damage_upper = 20 move_force = MOVE_FORCE_VERY_STRONG move_resist = MOVE_FORCE_VERY_STRONG pull_force = MOVE_FORCE_VERY_STRONG @@ -810,12 +808,12 @@ This section is for the crystal monsters variations icon_state = "crystal_boss" icon_living = "crystal_boss" icon_dead = "crystal_boss" - maxHealth = 300 - health = 30 + maxHealth = 150 + health = 100 speed = 1.3 - harm_intent_damage = 11 - melee_damage_lower = 20 - melee_damage_upper = 35 + harm_intent_damage = 15 + melee_damage_lower = 25 + melee_damage_upper = 40 move_force = MOVE_FORCE_EXTREMELY_STRONG move_resist = MOVE_FORCE_EXTREMELY_STRONG pull_force = MOVE_FORCE_EXTREMELY_STRONG @@ -832,7 +830,8 @@ This section is for the crystal monsters variations var/mob/living/mob = clong if(mob.stat >= HARD_CRIT) mob.dust() - health += 35 + if(health < maxHealth) + health = min(health+30,maxHealth) else if(isturf(clong)) var/turf/turf_bump = clong turf_bump.Melt() @@ -844,7 +843,8 @@ This section is for the crystal monsters variations var/mob/living/mob = target if(mob.stat >= HARD_CRIT) mob.dust() - health += 35 + if(health < maxHealth) + health = min(health+30,maxHealth) else var/obj/item/bodypart/body_part = mob.get_bodypart(pick(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)) if(body_part)