Diverse Police Tape fixes/tweaks

This commit is contained in:
Hubblenaut
2016-01-05 19:14:18 +01:00
parent 422fd27f56
commit e1f58161ac
2 changed files with 29 additions and 9 deletions
+29 -9
View File
@@ -22,6 +22,19 @@ var/list/tape_roll_applications = list()
var/tape_dir = 0
var/icon_base = "tape"
/obj/item/tape/update_icon()
//Possible directional bitflags: 0 (AIRLOCK), 1 (NORTH), 2 (SOUTH), 4 (EAST), 8 (WEST), 3 (VERTICAL), 12 (HORIZONTAL)
switch (tape_dir)
if(0) // AIRLOCK
icon_state = "[icon_base]_door_[crumpled]"
if(3) // VERTICAL
icon_state = "[icon_base]_v_[crumpled]"
if(12) // HORIZONTAL
icon_state = "[icon_base]_h_[crumpled]"
else // END POINT (1|2|4|8)
icon_state = "[icon_base]_dir_[crumpled]"
dir = tape_dir
/obj/item/tape/New()
..()
if(!hazard_overlays)
@@ -93,19 +106,26 @@ var/list/tape_roll_applications = list()
/obj/item/taperoll/update_icon()
overlays.Cut()
var/image/overlay = image(icon = src.icon)
overlay.appearance_flags = RESET_COLOR
if(ismob(loc))
if(!start)
overlays += "start"
overlay.icon_state = "start"
else
overlays += "stop"
overlay.icon_state = "stop"
overlays += overlay
/obj/item/taperoll/dropped(mob/user)
..()
update_icon()
return ..()
/obj/item/taperoll/pickup(mob/user)
..()
update_icon()
return ..()
/obj/item/taperoll/attack_hand()
update_icon()
return ..()
/obj/item/taperoll/attack_self(mob/user as mob)
if(!start)
@@ -142,13 +162,13 @@ var/list/tape_roll_applications = list()
for(var/dir in list(NORTH, SOUTH))
if (possible_dirs & dir)
TP.tape_dir += dir
TP.icon_state = "[TP.icon_base]_[TP.tape_dir]"
TP.update_icon()
if(possible_dirs & (EAST|WEST))
var/obj/item/tape/TP = new tape_type(start)
for(var/dir in list(EAST, WEST))
if (possible_dirs & dir)
TP.tape_dir += dir
TP.icon_state = "[TP.icon_base]_[TP.tape_dir]"
TP.update_icon()
start = null
update_icon()
usr << "<span class='notice'>You finish placing \the [src].</span>"
@@ -207,8 +227,8 @@ var/list/tape_roll_applications = list()
break
if(!tapetest)
var/obj/item/tape/T = new tape_type(cur)
T.icon_state = "[T.icon_base]_[tape_dir]"
T.tape_dir = tape_dir
T.update_icon()
if(tape_dir & SOUTH)
T.layer += 0.1 // Must always show above other tapes
if(cur == end)
@@ -227,7 +247,7 @@ var/list/tape_roll_applications = list()
var/turf/T = get_turf(A)
var/obj/item/tape/P = new tape_type(T.x,T.y,T.z)
P.loc = locate(T.x,T.y,T.z)
P.icon_state = "[src.icon_base]_door"
P.update_icon()
P.layer = 3.2
user << "<span class='notice'>You finish placing \the [src].</span>"
@@ -251,7 +271,7 @@ var/list/tape_roll_applications = list()
/obj/item/tape/proc/crumple()
if(!crumpled)
crumpled = 1
icon_state = "[icon_state]_c"
update_icon()
name = "crumpled [name]"
/obj/item/tape/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB