Colored Light Tiles

Light tiles (item) can now have their color changed by attacking them with a
multitool. These colors have special sprites and glow a color similar to
their sprite.
This commit is contained in:
Tigercat2000
2015-05-28 16:52:06 -07:00
parent 4e7cccffad
commit f7ccb2ef79
3 changed files with 50 additions and 24 deletions
+29 -14
View File
@@ -1,8 +1,16 @@
#define LIGHTFLOOR_ON 1
#define LIGHTFLOOR_WHITE 2
#define LIGHTFLOOR_RED 3
#define LIGHTFLOOR_GREEN 4
#define LIGHTFLOOR_YELLOW 5
#define LIGHTFLOOR_BLUE 6
#define LIGHTFLOOR_PURPLE 7
/obj/item/stack/tile/light
name = "light tiles"
singular_name = "light floor tile"
desc = "A floor tile, made out off glass. It produces light."
icon_state = "tile_e"
desc = "A floor tile, made out off glass. Use a multitool on it to change its color."
icon_state = "tile_light blue"
w_class = 3.0
force = 3.0
throwforce = 5.0
@@ -12,18 +20,18 @@
max_amount = 60
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed")
var/on = 1
var/state //0 = fine, 1 = flickering, 2 = breaking, 3 = broken
var/state = LIGHTFLOOR_ON
/obj/item/stack/tile/light/New(var/loc, var/amount=null)
..()
if(prob(5))
state = 3 //broken
else if(prob(5))
state = 2 //breaking
else if(prob(10))
state = 1 //flickering occasionally
else
state = 0 //fine
/obj/item/stack/tile/light/proc/color_desc()
switch(state)
if(LIGHTFLOOR_ON) return "light blue"
if(LIGHTFLOOR_WHITE) return "white"
if(LIGHTFLOOR_RED) return "red"
if(LIGHTFLOOR_GREEN) return "green"
if(LIGHTFLOOR_YELLOW) return "yellow"
if(LIGHTFLOOR_BLUE) return "dark blue"
if(LIGHTFLOOR_PURPLE) return "purple"
else return "broken"
/obj/item/stack/tile/light/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
..()
@@ -33,4 +41,11 @@
new/obj/item/stack/light_w(user.loc)
if(amount <= 0)
user.unEquip(src, 1)
del(src)
del(src)
else if(istype(O,/obj/item/device/multitool))
state++
if(state>LIGHTFLOOR_PURPLE) state=LIGHTFLOOR_ON
icon_state="tile_"+color_desc()
user << "[src] is now "+color_desc()
return ..()
+21 -10
View File
@@ -111,17 +111,28 @@ var/list/wood_icons = list("wood","wood-broken")
var/obj/item/stack/tile/light/T = floor_tile
if(T.on)
switch(T.state)
if(0)
if(LIGHTFLOOR_ON)
icon_state = "light_on"
set_light(5)
if(1)
var/num = pick("1","2","3","4")
icon_state = "light_on_flicker[num]"
set_light(5)
if(2)
icon_state = "light_on_broken"
set_light(5)
if(3)
set_light(5,null,LIGHT_COLOR_LIGHTBLUE)
if(LIGHTFLOOR_WHITE)
icon_state = "light_on-w"
set_light(5,null,LIGHT_COLOR_WHITE)
if(LIGHTFLOOR_RED)
icon_state = "light_on-r"
set_light(5,null,LIGHT_COLOR_RED)
if(LIGHTFLOOR_GREEN)
icon_state = "light_on-g"
set_light(5,null,LIGHT_COLOR_PURE_GREEN)
if(LIGHTFLOOR_YELLOW)
icon_state = "light_on-y"
set_light(5,null,"#FFFF00")
if(LIGHTFLOOR_BLUE)
icon_state = "light_on-b"
set_light(5,null,LIGHT_COLOR_DARKBLUE)
if(LIGHTFLOOR_PURPLE)
icon_state = "light_on-p"
set_light(5,null,LIGHT_COLOR_PURPLE)
else
icon_state = "light_off"
set_light(0)
else