[MIRROR] Adds collapsing stone tiles (#1933)
* Adds collapsing stone tiles * Update necropolis_gate.dm * Update necropolis_gate.dm.rej * Delete necropolis_gate.dm.rej
This commit is contained in:
committed by
kevinz000
parent
f893863397
commit
2892a3710d
@@ -226,6 +226,10 @@ GLOBAL_DATUM(necropolis_gate, /obj/structure/necropolis_gate/legion_gate)
|
||||
else
|
||||
return QDEL_HINT_LETMELIVE
|
||||
|
||||
#define STABLE 0 //The tile is stable and won't collapse/sink when crossed.
|
||||
#define COLLAPSE_ON_CROSS 1 //The tile is unstable and will temporary become unusable when crossed.
|
||||
#define DESTROY_ON_CROSS 2 //The tile is nearly broken and will permanently become unusable when crossed.
|
||||
#define UNIQUE_EFFECT 3 //The tile has some sort of unique effect when crossed.
|
||||
//stone tiles for boss arenas
|
||||
/obj/structure/stone_tile
|
||||
name = "stone tile"
|
||||
@@ -236,17 +240,67 @@ GLOBAL_DATUM(necropolis_gate, /obj/structure/necropolis_gate/legion_gate)
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
var/tile_key = "pristine_tile"
|
||||
var/tile_random_sprite_max = 24
|
||||
var/fall_on_cross = STABLE //If the tile has some sort of effect when crossed
|
||||
var/fallen = FALSE //If the tile is unusable
|
||||
var/falling = FALSE //If the tile is falling
|
||||
|
||||
/obj/structure/stone_tile/Initialize(mapload)
|
||||
. = ..()
|
||||
icon_state = "[tile_key][rand(1, tile_random_sprite_max)]"
|
||||
|
||||
/obj/structure/stone_tile/Destroy(force)
|
||||
if(force)
|
||||
if(force || fallen)
|
||||
. = ..()
|
||||
else
|
||||
return QDEL_HINT_LETMELIVE
|
||||
|
||||
/obj/structure/stone_tile/Crossed(atom/movable/AM)
|
||||
if(falling || fallen)
|
||||
return
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T, /turf/open/floor/plating/lava) && !istype(T, /turf/open/chasm)) //nothing to sink or fall into
|
||||
return
|
||||
var/obj/item/I
|
||||
if(istype(AM, /obj/item))
|
||||
I = AM
|
||||
var/mob/living/L
|
||||
if(isliving(AM))
|
||||
L = AM
|
||||
switch(fall_on_cross)
|
||||
if(COLLAPSE_ON_CROSS, DESTROY_ON_CROSS)
|
||||
if((I && I.w_class >= WEIGHT_CLASS_BULKY) || (L && !(L.movement_type & FLYING) && L.mob_size >= MOB_SIZE_HUMAN)) //too heavy! too big! aaah!
|
||||
collapse()
|
||||
if(UNIQUE_EFFECT)
|
||||
crossed_effect(AM)
|
||||
|
||||
/obj/structure/stone_tile/proc/collapse()
|
||||
falling = TRUE
|
||||
var/break_that_sucker = fall_on_cross == DESTROY_ON_CROSS
|
||||
playsound(src, 'sound/effects/pressureplate.ogg', 50, TRUE)
|
||||
Shake(-1, -1, 25)
|
||||
sleep(5)
|
||||
if(break_that_sucker)
|
||||
playsound(src, 'sound/effects/break_stone.ogg', 50, TRUE)
|
||||
else
|
||||
playsound(src, 'sound/mecha/mechmove04.ogg', 50, TRUE)
|
||||
animate(src, alpha = 0, pixel_y = pixel_y - 3, time = 5)
|
||||
fallen = TRUE
|
||||
if(break_that_sucker)
|
||||
QDEL_IN(src, 10)
|
||||
else
|
||||
addtimer(CALLBACK(src, .proc/rebuild), 55)
|
||||
|
||||
/obj/structure/stone_tile/proc/rebuild()
|
||||
pixel_x = initial(pixel_x)
|
||||
pixel_y = initial(pixel_y) - 5
|
||||
animate(src, alpha = initial(alpha), pixel_x = initial(pixel_x), pixel_y = initial(pixel_y), time = 30)
|
||||
sleep(30)
|
||||
falling = FALSE
|
||||
fallen = FALSE
|
||||
|
||||
/obj/structure/stone_tile/proc/crossed_effect(atom/movable/AM)
|
||||
return
|
||||
|
||||
/obj/structure/stone_tile/block
|
||||
name = "stone block"
|
||||
icon_state = "pristine_block1"
|
||||
@@ -340,3 +394,8 @@ GLOBAL_DATUM(necropolis_gate, /obj/structure/necropolis_gate/legion_gate)
|
||||
name = "burnt stone surrounding tile"
|
||||
icon_state = "burnt_surrounding_tile1"
|
||||
tile_key = "burnt_surrounding_tile"
|
||||
|
||||
#undef STABLE
|
||||
#undef COLLAPSE_ON_CROSS
|
||||
#undef DESTROY_ON_CROSS
|
||||
#undef UNIQUE_EFFECT
|
||||
|
||||
Reference in New Issue
Block a user