functionality
This commit is contained in:
@@ -39,6 +39,37 @@
|
||||
|
||||
var/zfalling = FALSE
|
||||
|
||||
/// Either FALSE, [EMISSIVE_BLOCK_GENERIC], or [EMISSIVE_BLOCK_UNIQUE]
|
||||
var/blocks_emissive = FALSE
|
||||
///Internal holder for emissive blocker object, do not use directly use blocks_emissive
|
||||
var/atom/movable/emissive_blocker/em_block
|
||||
|
||||
|
||||
/atom/movable/Initialize(mapload)
|
||||
. = ..()
|
||||
switch(blocks_emissive)
|
||||
if(EMISSIVE_BLOCK_GENERIC)
|
||||
update_emissive_block()
|
||||
if(EMISSIVE_BLOCK_UNIQUE)
|
||||
render_target = ref(src)
|
||||
em_block = new(src, render_target)
|
||||
vis_contents += em_block
|
||||
|
||||
/atom/movable/Destroy()
|
||||
QDEL_NULL(em_block)
|
||||
return ..()
|
||||
|
||||
/atom/movable/proc/update_emissive_block()
|
||||
if(blocks_emissive != EMISSIVE_BLOCK_GENERIC)
|
||||
return
|
||||
if(length(managed_vis_overlays))
|
||||
for(var/a in managed_vis_overlays)
|
||||
var/obj/effect/overlay/vis/vs
|
||||
if(vs.plane == EMISSIVE_BLOCKER_PLANE)
|
||||
SSvis_overlays.remove_vis_overlay(src, list(vs))
|
||||
break
|
||||
SSvis_overlays.add_vis_overlay(src, icon, icon_state, EMISSIVE_BLOCKER_LAYER, EMISSIVE_BLOCKER_PLANE)
|
||||
|
||||
/atom/movable/proc/can_zFall(turf/source, levels = 1, turf/target, direction)
|
||||
if(!direction)
|
||||
direction = DOWN
|
||||
|
||||
@@ -7,6 +7,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
/obj/item
|
||||
name = "item"
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
blocks_emissive = EMISSIVE_BLOCK_GENERIC
|
||||
var/item_state = null
|
||||
var/lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
|
||||
var/righthand_file = 'icons/mob/inhands/items_righthand.dmi'
|
||||
|
||||
Reference in New Issue
Block a user