mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
fix lightfloors
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
#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"
|
||||
gender = PLURAL
|
||||
singular_name = "light floor tile"
|
||||
desc = "A floor tile, made out off glass. Use a multitool on it to change its color."
|
||||
icon_state = "tile_light blue"
|
||||
force = 3
|
||||
throwforce = 5
|
||||
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed")
|
||||
var/on = 1
|
||||
var/state = LIGHTFLOOR_ON
|
||||
|
||||
/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)
|
||||
..()
|
||||
if(istype(O,/obj/item/weapon/crowbar))
|
||||
new/obj/item/stack/sheet/metal(user.loc)
|
||||
amount--
|
||||
new/obj/item/stack/light_w(user.loc)
|
||||
if(amount <= 0)
|
||||
user.unEquip(src, 1)
|
||||
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 ..()
|
||||
|
||||
@@ -70,4 +70,18 @@
|
||||
throw_range = 7
|
||||
flags = CONDUCT
|
||||
turf_type = /turf/simulated/floor/plasteel
|
||||
mineralType = "metal"
|
||||
mineralType = "metal"
|
||||
|
||||
/*
|
||||
* Light
|
||||
*/
|
||||
/obj/item/stack/tile/light
|
||||
name = "light tiles"
|
||||
gender = PLURAL
|
||||
singular_name = "light floor tile"
|
||||
desc = "A floor tile, made out off glass. Use a multitool on it to change its color."
|
||||
icon_state = "tile_light blue"
|
||||
force = 3
|
||||
throwforce = 5
|
||||
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed")
|
||||
turf_type = /turf/simulated/floor/light
|
||||
@@ -1,9 +1,19 @@
|
||||
#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
|
||||
|
||||
/turf/simulated/floor/light
|
||||
name = "Light floor"
|
||||
light_range = 5
|
||||
icon_state = "light_on"
|
||||
floor_tile = /obj/item/stack/tile/light
|
||||
broken_states = list("light_broken")
|
||||
var/on = 1
|
||||
var/state = LIGHTFLOOR_ON
|
||||
|
||||
/turf/simulated/floor/light/New()
|
||||
..()
|
||||
@@ -11,58 +21,63 @@
|
||||
|
||||
/turf/simulated/floor/light/update_icon()
|
||||
..()
|
||||
if(istype(builtin_tile, /obj/item/stack/tile/light))
|
||||
var/obj/item/stack/tile/light/T = builtin_tile
|
||||
if(T.on)
|
||||
switch(T.state)
|
||||
if(LIGHTFLOOR_ON)
|
||||
icon_state = "light_on"
|
||||
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
|
||||
set_light(0)
|
||||
icon_state = "light_off"
|
||||
if(on)
|
||||
switch(state)
|
||||
if(LIGHTFLOOR_ON)
|
||||
icon_state = "light_on"
|
||||
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
|
||||
set_light(0)
|
||||
icon_state = "light_off"
|
||||
|
||||
/turf/simulated/floor/light/ChangeTurf(turf/T)
|
||||
set_light(0)
|
||||
..()
|
||||
|
||||
/turf/simulated/floor/light/attack_hand(mob/user)
|
||||
if(istype(builtin_tile, /obj/item/stack/tile/light))
|
||||
var/obj/item/stack/tile/light/T = builtin_tile
|
||||
T.on = !T.on
|
||||
update_icon()
|
||||
on = !on
|
||||
update_icon()
|
||||
|
||||
/turf/simulated/floor/light/attackby(obj/item/C, mob/user, params)
|
||||
if(..())
|
||||
return
|
||||
if(istype(C,/obj/item/weapon/light/bulb)) //only for light tiles
|
||||
if(istype(builtin_tile, /obj/item/stack/tile/light))
|
||||
var/obj/item/stack/tile/light/T = builtin_tile
|
||||
if(T.state)
|
||||
if(!state)
|
||||
qdel(C)
|
||||
T.state = C //fixing it by bashing it with a light bulb, fun eh?
|
||||
state = LIGHTFLOOR_ON
|
||||
update_icon()
|
||||
user << "<span class='notice'>You replace the light bulb.</span>"
|
||||
else
|
||||
user << "<span class='notice'>The light bulb seems fine, no need to replace it.</span>"
|
||||
user << "<span class='notice'>The light bulb seems fine, no need to replace it.</span>"
|
||||
if(istype(C,/obj/item/device/multitool))
|
||||
if(state != 0)
|
||||
if(state < LIGHTFLOOR_PURPLE)
|
||||
state++
|
||||
else
|
||||
state = LIGHTFLOOR_ON
|
||||
user << "<span class='notice'>You change \the [src]'s light bulb color.</span>"
|
||||
update_icon()
|
||||
else
|
||||
user << "<span class='warning'>\The [src]'s light bulb appears to have burned out.</span>"
|
||||
@@ -690,7 +690,6 @@
|
||||
#include "code\game\objects\items\stacks\sheets\mineral.dm"
|
||||
#include "code\game\objects\items\stacks\sheets\sheet_types.dm"
|
||||
#include "code\game\objects\items\stacks\sheets\sheets.dm"
|
||||
#include "code\game\objects\items\stacks\tiles\light.dm"
|
||||
#include "code\game\objects\items\stacks\tiles\tile_types.dm"
|
||||
#include "code\game\objects\items\weapons\AI_modules.dm"
|
||||
#include "code\game\objects\items\weapons\alien_specific.dm"
|
||||
|
||||
Reference in New Issue
Block a user