Skip to content

Commit

Permalink
Megafauna are no longer chronically afraid of chasms (#22782)
Browse files Browse the repository at this point in the history
* megafauna are no longer chronically afraid of chasms

* drop that

* Update code/game/turfs/simulated/floor/chasm.dm

Co-authored-by: Contrabang <[email protected]>

* )

---------

Co-authored-by: Contrabang <[email protected]>
  • Loading branch information
Qwertytoforty and Contrabang authored Oct 9, 2023
1 parent f1a4a9e commit 3b618d4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
9 changes: 8 additions & 1 deletion code/game/turfs/simulated/floor/chasm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
/obj/effect/ebeam,
/obj/effect/spawner,
/obj/structure/railing,
/obj/machinery/atmospherics/pipe/simple
/obj/machinery/atmospherics/pipe/simple,
/mob/living/simple_animal/hostile/megafauna //failsafe
))
var/drop_x = 1
var/drop_y = 1
Expand All @@ -44,6 +45,12 @@
if(!drop_stuff())
STOP_PROCESSING(SSprocessing, src)

/turf/simulated/floor/chasm/CanPathfindPass(obj/item/card/id/ID, to_dir, caller, no_id = FALSE)
if(!isliving(caller))
return TRUE
var/mob/living/L = caller
return (L.flying || ismegafauna(caller))

/turf/simulated/floor/chasm/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
underlay_appearance.icon = 'icons/turf/floors.dmi'
underlay_appearance.icon_state = "basalt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ Difficulty: Hard

/mob/living/simple_animal/hostile/megafauna/ancient_robot/Bump(atom/A, yes)
if(charging)
DestroySurroundings()
if(isliving(A) && yes)
var/mob/living/L = A
if(!istype(A, /mob/living/simple_animal/hostile/ancient_robot_leg))
Expand Down Expand Up @@ -511,8 +510,6 @@ Difficulty: Hard
return

/mob/living/simple_animal/hostile/megafauna/ancient_robot/Moved(atom/OldLoc, Dir, Forced = FALSE)
if(charging)
DestroySurroundings()
if(Dir)
leg_walking_controler(Dir)
if(charging)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,16 +463,13 @@ Difficulty: Hard
/mob/living/simple_animal/hostile/megafauna/bubblegum/Moved(atom/OldLoc, Dir, Forced = FALSE)
if(Dir)
new /obj/effect/decal/cleanable/blood/bubblegum(loc)
if(charging)
DestroySurroundings()
playsound(src, 'sound/effects/meteorimpact.ogg', 200, TRUE, 2, TRUE)
return ..()

/mob/living/simple_animal/hostile/megafauna/bubblegum/Bump(atom/A, yes)
if(charging && yes)
if(isturf(A) || isobj(A) && A.density)
A.ex_act(EXPLODE_HEAVY)
DestroySurroundings()
if(isliving(A))
var/mob/living/L = A
L.visible_message("<span class='danger'>[src] slams into [L]!</span>", "<span class='userdanger'>[src] tramples you into the ground!</span>")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
return ..()

/mob/living/simple_animal/hostile/megafauna/Moved()
if(target)
DestroySurroundings() //So they can path through chasms.
if(nest && nest.parent && get_dist(nest.parent, src) > nest_range)
var/turf/closest = get_turf(nest.parent)
for(var/i = 1 to nest_range)
Expand Down Expand Up @@ -128,6 +130,12 @@
recovery_time = world.time + buffer_time
ranged_cooldown = world.time + buffer_time

/mob/living/simple_animal/hostile/megafauna/DestroySurroundings()
. = ..()
for(var/turf/simulated/floor/chasm/C in circlerangeturfs(src, 1))
C.density = FALSE //I hate it.
addtimer(VARSET_CALLBACK(C, density, TRUE), 2 SECONDS) // Needed to make them path. I hate it.

/datum/action/innate/megafauna_attack
name = "Megafauna Attack"
icon_icon = 'icons/mob/actions/actions_animal.dmi'
Expand Down

0 comments on commit 3b618d4

Please sign in to comment.