Files
Bubberstation/code/datums/elements/cliff_walker.dm
Time-Green ec9434ea6b Adds cliffs to icebox (#77062)
## About The Pull Request

Adds cliffs to the game! They're tiles usable for mapping to make
mountainy area's and cliffs! I don't have any sprites for them yet, so
just imagine it's a cliff really hard


![image](https://github.com/tgstation/tgstation/assets/7501474/ab0f31b6-93d7-4964-8b9c-4fb3c774647a)

THESE DO NOT REPLACE MULTI-Z AND NEVER WILL! They're just a neat way to
add more depth to the game. You can’t really add 10 different z’s for
one mountain, so this can be used to help map area’s with depth without
overusing z-levels

They've been mapped into the top part of the icebox outside. There's not
a good way to do sides of cliffs yet (will need some thinking), so
they're mapped in such a fashion where it doesn't matter much. Later,
this area above icebox can be expanded with properly done side-cliffs,
something like in stardew-valley would work for our grid-system:


![image](https://github.com/tgstation/tgstation/assets/7501474/007964cc-49d5-489c-9a43-2140f29239ce)

Longer demonstration: https://www.youtube.com/watch?v=Eig4jXNZZRQ

Eventually, I'll redo mapgen and add 3x3 icebox (definitely not coping)

## Why It's Good For The Game

The incredible flatness of icebox drives me insane. While multi-z is
great at giving it more depth, the actual terrain itself is still
completely flat. Adding cliffs let's us add 'soft-mountains', which does
wonders for making an area feel more alive

(And I absolutely adore snowy mountains)

## Changelog
🆑
add: Adds cliffs to the north of icebox. Try not to fall of of them!
/🆑
<details>
  <summary>Additional images (now outdated)</summary>


https://github.com/tgstation/tgstation/assets/7501474/572dc749-596c-4cab-9693-43c2270aca96
 

![image](https://github.com/tgstation/tgstation/assets/7501474/e12236d1-fda8-406a-858b-84a9fe5b4dc7)

![image](https://github.com/tgstation/tgstation/assets/7501474/264ae9d8-2f84-4133-8eb3-29e8df6c976e)

![image](https://github.com/tgstation/tgstation/assets/7501474/15a7f378-b595-4d7b-b948-d405916cb431)

![image](https://github.com/tgstation/tgstation/assets/7501474/b058a184-9fd5-4fa9-b0de-9f687bdf4e43)
  
</details>

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-07-28 14:13:43 +00:00

35 lines
1.0 KiB
Plaintext

/// Lets a mob walk cliffs and keeps track of if they're alive or not to add/remove the trait
/datum/element/cliff_walking
/datum/element/cliff_walking/Attach(datum/target, climb_time, climb_stun)
. = ..()
if(!isliving(target))
return ELEMENT_INCOMPATIBLE
// Feel free to add more bespoke signals here if this gets implemented for more than just a few funny mobs
RegisterSignals(target, list(COMSIG_LIVING_DEATH, COMSIG_LIVING_REVIVE), PROC_REF(update_cliff_walking))
update_cliff_walking(target)
/datum/element/cliff_walking/Detach(datum/source, ...)
. = ..()
UnregisterSignal(source, list(COMSIG_LIVING_DEATH, COMSIG_LIVING_REVIVE))
/// Do some checks to see if we should walk the cliffs
/datum/element/cliff_walking/proc/update_cliff_walking(mob/living/climber)
SIGNAL_HANDLER
if(climber.stat != DEAD)
ADD_TRAIT(climber, TRAIT_CLIFF_WALKER, type)
return
REMOVE_TRAIT(climber, TRAIT_CLIFF_WALKER, type)
var/turf/open/cliff/cliff_tile = get_turf(climber)
if(!iscliffturf(cliff_tile))
return
cliff_tile.try_fall(climber)