Skip to content

Commit

Permalink
Merge branch 'candles_from_tg' of https://github.com/RichardJones1/Ta…
Browse files Browse the repository at this point in the history
  • Loading branch information
volas committed Jan 28, 2019
2 parents 8ee9c15 + f8cca1c commit 178e40d
Show file tree
Hide file tree
Showing 15 changed files with 189 additions and 104 deletions.
6 changes: 5 additions & 1 deletion code/__DEFINES/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,15 @@
#define COLOR_TITANIUM "#d1e6e3"
#define COLOR_DARK_GUNMETAL "#4c535b"

#define PIPE_COLOR_GREY "#ffffff" //yes white is grey
#define PIPE_COLOR_GREY "#ffffff" // yes white is grey
#define PIPE_COLOR_RED "#ff0000"
#define PIPE_COLOR_BLUE "#0000ff"
#define PIPE_COLOR_CYAN "#00ffff"
#define PIPE_COLOR_GREEN "#00ff00"
#define PIPE_COLOR_YELLOW "#ffcc00"
#define PIPE_COLOR_BLACK "#444444"
#define PIPE_COLOR_ORANGE "#b95a00"

#define LIGHT_COLOR_FIRE "#FAA019" // Warm orange color, leaning strongly towards yellow. rgb(250, 160, 25)
#define LIGHT_COLOR_FLARE "#F93C2F" // Bright, non-saturated red. Leaning slightly towards pink for visibility. rgb(250, 100, 75)
#define LIGHT_COLOR_GHOST_CANDLE "#a2fad1" // Used by ghost candles. rgb(162, 250, 209)
3 changes: 0 additions & 3 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
#define GAME_STATE_PLAYING 3
#define GAME_STATE_FINISHED 4

//Object specific defines
#define CANDLE_LUM 3 //For how bright candles are

//Security levels
#define SEC_LEVEL_GREEN 0
#define SEC_LEVEL_BLUE 1
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1114,9 +1114,9 @@
icon_state = "holy"
product_slogans = "HolyVend: Select your Religion today"
product_ads = "Pray now!;Atheists are heretic;Everything 100% Holy;Thirsty? Wanna pray? Why without candles?"
products = list(/obj/item/weapon/reagent_containers/food/drinks/bottle/holywater = 10, /obj/item/weapon/storage/fancy/candle_box = 25)
products = list(/obj/item/weapon/reagent_containers/food/drinks/bottle/holywater = 10, /obj/item/weapon/storage/fancy/candle_box = 25, /obj/item/weapon/storage/fancy/candle_box/red = 25,)
contraband = list(/obj/item/weapon/nullrod = 2)
prices = list(/obj/item/weapon/reagent_containers/food/drinks/bottle/holywater = 30, /obj/item/weapon/storage/fancy/candle_box = 50, /obj/item/weapon/nullrod = 100)
prices = list(/obj/item/weapon/reagent_containers/food/drinks/bottle/holywater = 30, /obj/item/weapon/storage/fancy/candle_box = 50, /obj/item/weapon/storage/fancy/candle_box/red = 50, /obj/item/weapon/nullrod = 100)

/obj/machinery/vending/eva
name = "Hardsuit Kits"
Expand Down
196 changes: 125 additions & 71 deletions code/game/objects/items/candle.dm
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@
var/global/list/obj/item/candle/ghost/ghost_candles = list()
#define CANDLE_LUMINOSITY 3

/obj/item/candle
name = "red candle"
desc = "A candle."
name = "white candle"
desc = "In Greek myth, Prometheus stole fire from the Gods and gave it to \
humankind. The jewelry he kept for himself."

icon = 'icons/obj/candle.dmi'
icon_state = "candle"
item_state = "candle"
icon_state = "white_candle"
item_state = "white_candle"

var/candle_color
w_class = 1

var/wax = 200
var/wax = 0
var/lit = FALSE
light_color = LIGHT_COLOR_FIRE

/obj/item/candle/ghost
name = "black candle"
icon_state = "gcandle"
item_state = "gcandle"
candle_color = "#a2fad1"
var/infinite = FALSE
var/start_lit = FALSE

/obj/item/candle/ghost/atom_init()
. = ..()
ghost_candles += src

/obj/item/candle/ghost/Destroy()
ghost_candles -= src
return ..()
var/faded_candle = /obj/item/trash/candle

/obj/item/candle/ghost/attack_ghost()
if(!lit)
src.light("<span class='warning'>\The [name] suddenly lights up.</span>")
if(prob(10))
spook()
/obj/item/candle/atom_init()
. = ..()
wax = rand(600, 800)
if(start_lit)
// No visible message
light(show_message = FALSE)
update_icon()

/obj/item/candle/proc/light(flavor_text = "<span class='warning'>[usr] lights the [name].</span>")
if(!src.lit)
if(!lit)
lit = TRUE
//src.damtype = "fire"
visible_message(flavor_text)
set_light(CANDLE_LUM, 1, candle_color)
set_light(CANDLE_LUMINOSITY, 1)
START_PROCESSING(SSobj, src)

/obj/item/candle/ghost/proc/spook()
visible_message("<span class='warning bold'>Out of the tip of the flame, a face appears.</span>")
playsound(get_turf(src), 'sound/effects/screech.ogg', 50, 0)
for(var/mob/living/carbon/M in hearers(4, get_turf(src)))
if(!iscultist(M))
M.confused += 10
M.make_jittery(150)
for(var/obj/machinery/light/L in range(4, get_turf(src)))
L.on = TRUE
L.broken()
playsound(get_turf(src), 'sound/items/matchstick_light.ogg', 50, 0)

/obj/item/candle/update_icon()
var/i
if(wax>150)
i = 1
else if(wax>80)
i = 2
var/lighning_stage
if(wax > 450)
lighning_stage = 1
else if(wax > 200)
lighning_stage = 2
else
lighning_stage = 3
icon_state = "[initial(icon_state)][lighning_stage][lit ? "_lit" : ""]"
if(lit)
item_state = "[initial(icon_state)]_lit"
else
i = 3
icon_state = "[initial(icon_state)][i][lit ? "_lit" : ""]"
item_state = "[initial(icon_state)]"
if(istype(loc, /mob))
var/mob/M = loc
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.l_hand == src)
M.update_inv_l_hand()
if(H.r_hand == src)
M.update_inv_r_hand()

/obj/item/candle/attackby(obj/item/weapon/W, mob/user)
..()
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool
light("\red [user] casually lights the [name] with [W].")
if(WT.isOn()) // Badasses dont get blinded by lighting their candle with a welding tool
light("<span class='warning'>[user] casually lights the [name] with [W].</span>")
else if(istype(W, /obj/item/weapon/lighter))
var/obj/item/weapon/lighter/L = W
if(L.lit)
Expand All @@ -80,6 +80,75 @@ var/global/list/obj/item/candle/ghost/ghost_candles = list()
if(C.lit)
light()

/obj/item/candle/process()
if(!lit)
return
if(!infinite)
wax--
if(!wax)
dropped()
fade()
qdel(src)
return
update_icon()
if(istype(loc, /turf)) // start a fire if possible
var/turf/T = loc
T.hotspot_expose(700, 5)

/obj/item/candle/proc/fade()
var/obj/item/candle/C = new faded_candle(src.loc)
if(istype(loc, /mob))
var/mob/M = loc
M.put_in_hands(C)

/obj/item/candle/attack_self(mob/user)
if(lit)
user.visible_message("<span class='notice'>[user] blows out the [src].</span>")
lit = FALSE
update_icon()
set_light(0)
STOP_PROCESSING(SSobj, src)

// Ghost candle
/obj/item/candle/ghost
name = "black candle"

icon_state = "black_candle"
item_state = "black_candle"

light_color = LIGHT_COLOR_GHOST_CANDLE

faded_candle = /obj/item/trash/candle/ghost

/obj/item/candle/ghost/atom_init()
. = ..()
ghost_candles += src

/obj/item/candle/ghost/Destroy()
ghost_candles -= src
return ..()

/obj/item/candle/ghost/attack_ghost()
if(!lit)
src.light("<span class='warning'>\The [name] suddenly lights up.</span>")
if(prob(10))
spook()

/obj/item/candle/ghost/attack_self(mob/user)
if(lit)
to_chat(user, "<span class='notice'>You can't just extinguish it.</span>")

/obj/item/candle/ghost/proc/spook()
visible_message("<span class='warning bold'>Out of the tip of the flame, a face appears.</span>")
playsound(get_turf(src), 'sound/effects/screech.ogg', 50, 0)
for(var/mob/living/carbon/M in hearers(4, get_turf(src)))
if(!iscultist(M))
M.confused += 10
M.make_jittery(150)
for(var/obj/machinery/light/L in range(4, get_turf(src)))
L.on = TRUE
L.broken()

/obj/item/candle/ghost/attackby(obj/item/weapon/W, mob/living/carbon/human/user)
..()
if(istype(W, /obj/item/device/occult_scanner))
Expand Down Expand Up @@ -117,32 +186,17 @@ var/global/list/obj/item/candle/ghost/ghost_candles = list()
user.drop_item()
qdel(W)

/obj/item/candle/process()
if(!lit)
return
wax--
if(!wax)
var/obj/item/candle/C
if(istype(src, /obj/item/candle/ghost))
C = new /obj/item/trash/candle/ghost(src.loc)
else
C = new /obj/item/trash/candle(src.loc)
if(istype(loc, /mob))
var/mob/M = loc
M.put_in_hands(C)
dropped()
qdel(src)
update_icon()
if(istype(loc, /turf)) //start a fire if possible
var/turf/T = loc
T.hotspot_expose(700, 5)
/obj/item/candle/red
name = "red candle"

/obj/item/candle/attack_self(mob/user)
if(lit)
lit = FALSE
update_icon()
set_light(0)
icon_state = "red_candle"
item_state = "red_candle"

/obj/item/candle/ghost/attack_self(mob/user)
if(lit)
to_chat(user, "<span class='notice'>You can't just extinguish it.</span>")
faded_candle = /obj/item/trash/candle/red

// Infinite candle (Admin item)
/obj/item/candle/infinite
infinite = TRUE
start_lit = TRUE

#undef CANDLE_LUMINOSITY
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/flashlight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
var/fuel = 0
var/on_damage = 7
var/produce_heat = 1500
light_color = "#ff0000"
light_color = LIGHT_COLOR_FLARE
light_power = 2
action_button_name = "Toggle Flare"

Expand Down
12 changes: 9 additions & 3 deletions code/game/objects/items/trash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,21 @@
name = "Tray"
icon_state = "tray"
candle
name = "candle"
name = "white candle"
icon = 'icons/obj/candle.dmi'
icon_state = "candle4"
icon_state = "white_candle4"
liquidfood
name = "\improper \"LiquidFood\" ration"
icon_state = "liquidfood"

/obj/item/trash/candle/ghost
icon_state = "gcandle4"
name = "black candle"
icon_state = "black_candle4"

/obj/item/trash/candle/red
name = "red candle"
icon_state = "red_candle4"


/obj/item/trash/candle/ghost/attackby(obj/item/weapon/W, mob/living/carbon/human/user)
..()
Expand Down
46 changes: 35 additions & 11 deletions code/game/objects/items/weapons/storage/fancy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,53 @@
*/

/obj/item/weapon/storage/fancy/candle_box
name = "candle pack"
desc = "A pack of red candles."
name = "white candle pack"
desc = "A pack of white candles."
icon = 'icons/obj/candle.dmi'
icon_state = "candlebox5"
icon_state = "candlebox"
icon_type = "candle"
item_state = "candlebox5"
item_state = "candlebox"
storage_slots = 5
throwforce = 2
slot_flags = SLOT_BELT

var/candle_type = "white"

/obj/item/weapon/storage/fancy/candle_box/atom_init()
. = ..()
for (var/i in 1 to storage_slots)
new /obj/item/candle(src)
if(candle_type == "white")
for (var/i in 1 to storage_slots)
new /obj/item/candle(src)
if(candle_type == "red")
for (var/i in 1 to storage_slots)
new /obj/item/candle/red(src)
update_icon()

/obj/item/weapon/storage/fancy/candle_box/update_icon()
var/list/candle_overlays = list()
var/candle_position = 0
for(var/obj/item/candle/C in contents)
candle_position ++
var/candle_color = "red_"
if(C.name == "white candle")
candle_color = "white_"
if(C.name == "black candle")
candle_color = "black_"
candle_overlays += image('icons/obj/candle.dmi', "[candle_color][candle_position]")
overlays = candle_overlays
return

/obj/item/weapon/storage/fancy/candle_box/red
name = "red candle pack"
desc = "A pack of red candles."
candle_type = "red"

/obj/item/weapon/storage/fancy/black_candle_box
name = "candle pack"
name = "black candle pack"
desc = "A pack of black candles."
icon = 'icons/obj/candle.dmi'
icon_state = "gcandlebox5"
icon_type = "gcandle"
item_state = "gcandlebox5"
icon_state = "black_candlebox5"
icon_type = "black_candle"
item_state = "black_candlebox5"
storage_slots = 5
throwforce = 2
slot_flags = SLOT_BELT
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
src.icon_state = initial(src.icon_state) + "1"
if(prob(5))
remove_fuel(1)
light_color = "#dbe2ff"
light_color = LIGHT_COLOR_FIRE
set_light(2)

//If you're actually actively welding, use fuel faster.
Expand Down
Loading

0 comments on commit 178e40d

Please sign in to comment.