Meteor turfs typecache (#78152)

## About The Pull Request

When looking why meteors randomly explode sometimes, the check has it
taking damage and exploding from turfs that it should just be flying
over. This creates a typecache of turfs the meteor shouldn't deplete
health from flying over. Most commonly openspace and asteroid baseturf.

## Why It's Good For The Game

Meteor is more likely to explode when it actually hits something vs
flying into an openspace tile.

## Changelog

🆑 LT3
fix: Meteors no longer take damage from crossing certain unoccupied
turfs
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
This commit is contained in:
lessthanthree
2023-09-07 16:33:31 +01:00
committed by GitHub
co-authored by san7890
parent d43ebdfdba
commit d9c8c67493
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -64,6 +64,15 @@ GLOBAL_LIST_INIT(turfs_openspace, typecacheof(list(
#define iscliffturf(A) (istype(A, /turf/open/cliff))
GLOBAL_LIST_INIT(turfs_pass_meteor, typecacheof(list(
/turf/closed/mineral,
/turf/open/misc/asteroid,
/turf/open/openspace,
/turf/open/space
)))
#define ispassmeteorturf(A) (is_type_in_typecache(A, GLOB.turfs_pass_meteor))
//Mobs
#define isliving(A) (istype(A, /mob/living))
+1 -1
View File
@@ -56,7 +56,7 @@
var/turf/T = get_turf(loc)
ram_turf(T)
if(prob(10) && !isspaceturf(T))//randomly takes a 'hit' from ramming
if(prob(10) && !ispassmeteorturf(T))//randomly takes a 'hit' from ramming
get_hit()
if(z != z_original || loc == get_turf(dest))