mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-20 19:49:39 +01:00
[MIRROR] Overlay lighting component (#469)
* Overlay lighting component (#52413) Sparks no longer lag, projectile beams move super smoothly, same with mobs and whatnot. This also allows for easy expansion into directional lights, field-of-view, wee-woo rotating lights or whatever. It does have a downside: things right-clicked or checked through the alt+click tab will show the light overlay: This is a BYOND limitation, very well worth it IMO. 🆑 add: Smooth movable lighting system implemented. Projectiles, sparks, thrown flashlights or moving mobs with lights should be much smoother and less laggy. balance: Light sources no longer stack in range, though they still do in intensity. /🆑 * Overlay lighting component Co-authored-by: Rohesie <rohesie@gmail.com>
This commit is contained in:
@@ -20,8 +20,9 @@
|
||||
name = "sparks"
|
||||
icon_state = "sparks"
|
||||
anchored = TRUE
|
||||
light_power = 1.3
|
||||
light_range = MINIMUM_USEFUL_LIGHT_RANGE
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_range = 2
|
||||
light_power = 0.5
|
||||
light_color = LIGHT_COLOR_FIRE
|
||||
|
||||
/obj/effect/particle_effect/sparks/Initialize()
|
||||
|
||||
@@ -75,13 +75,19 @@
|
||||
name = "lighting fx obj"
|
||||
desc = "Tell a coder if you're seeing this."
|
||||
icon_state = "nothing"
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_range = MINIMUM_USEFUL_LIGHT_RANGE
|
||||
light_color = COLOR_WHITE
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
|
||||
/obj/effect/dummy/lighting_obj/Initialize(mapload, _color, _range, _power, _duration)
|
||||
/obj/effect/dummy/lighting_obj/Initialize(mapload, _range, _power, _color, _duration)
|
||||
. = ..()
|
||||
set_light(_range ? _range : light_range, _power ? _power : light_power, _color ? _color : light_color)
|
||||
if(!isnull(_range))
|
||||
set_light_range(_range)
|
||||
if(!isnull(_power))
|
||||
set_light_power(_power)
|
||||
if(!isnull(_color))
|
||||
set_light_color(_color)
|
||||
if(_duration)
|
||||
QDEL_IN(src, _duration)
|
||||
|
||||
|
||||
@@ -64,3 +64,14 @@
|
||||
|
||||
layer = ATMOS_GROUP_LAYER
|
||||
plane = ATMOS_GROUP_PLANE
|
||||
|
||||
/obj/effect/overlay/light_visible
|
||||
name = ""
|
||||
icon = 'icons/effects/light_overlays/light_32.dmi'
|
||||
icon_state = "light"
|
||||
layer = O_LIGHTING_VISUAL_LAYER
|
||||
plane = O_LIGHTING_VISUAL_PLANE
|
||||
appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
alpha = 0
|
||||
vis_flags = NONE
|
||||
|
||||
@@ -621,7 +621,11 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
resistance_flags = FIRE_PROOF
|
||||
grind_results = list(/datum/reagent/iron = 1, /datum/reagent/fuel = 5, /datum/reagent/fuel/oil = 5)
|
||||
custom_price = 55
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_range = 2
|
||||
light_power = 0.6
|
||||
light_color = LIGHT_COLOR_FIRE
|
||||
light_on = FALSE
|
||||
var/lit = 0
|
||||
var/fancy = TRUE
|
||||
var/overlay_state
|
||||
@@ -667,6 +671,8 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
. = "<span class='rose'>With a single flick of [user.p_their()] wrist, [user] smoothly lights [A] with [src]. Damn [user.p_theyre()] cool.</span>"
|
||||
|
||||
/obj/item/lighter/proc/set_lit(new_lit)
|
||||
if(lit == new_lit)
|
||||
return
|
||||
lit = new_lit
|
||||
if(lit)
|
||||
force = 5
|
||||
@@ -674,15 +680,14 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
hitsound = 'sound/items/welder.ogg'
|
||||
attack_verb_continuous = list("burns", "sings")
|
||||
attack_verb_simple = list("burn", "sing")
|
||||
set_light(1)
|
||||
START_PROCESSING(SSobj, src)
|
||||
else
|
||||
hitsound = "swing_hit"
|
||||
force = 0
|
||||
attack_verb_continuous = null //human_defense.dm takes care of it
|
||||
attack_verb_simple = null
|
||||
set_light(0)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
set_light_on(lit)
|
||||
update_icon()
|
||||
|
||||
/obj/item/lighter/extinguish()
|
||||
|
||||
@@ -26,7 +26,11 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
actions_types = list(/datum/action/item_action/toggle_light)
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100)
|
||||
resistance_flags = FIRE_PROOF | ACID_PROOF
|
||||
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_range = 2.3
|
||||
light_power = 0.6
|
||||
light_color = "#FFCC66"
|
||||
light_on = FALSE
|
||||
|
||||
//Main variables
|
||||
var/owner = null // String name of owner
|
||||
@@ -49,8 +53,6 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
|
||||
//Secondary variables
|
||||
var/scanmode = PDA_SCANNER_NONE
|
||||
var/fon = FALSE //Is the flashlight function on?
|
||||
var/f_lum = 2.3 //Luminosity for the flashlight function
|
||||
var/silent = FALSE //To beep or not to beep, that is the question
|
||||
var/toff = FALSE //If TRUE, messenger disabled
|
||||
var/tnote = null //Current Texts
|
||||
@@ -106,8 +108,6 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
|
||||
/obj/item/pda/Initialize()
|
||||
. = ..()
|
||||
if(fon)
|
||||
set_light(f_lum)
|
||||
|
||||
GLOB.PDAs += src
|
||||
if(default_cartridge)
|
||||
@@ -175,7 +175,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
if(inserted_item)
|
||||
overlay.icon_state = "insert_overlay"
|
||||
. += new /mutable_appearance(overlay)
|
||||
if(fon)
|
||||
if(light_on)
|
||||
overlay.icon_state = "light_overlay"
|
||||
. += new /mutable_appearance(overlay)
|
||||
if(pai)
|
||||
@@ -311,7 +311,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
if (cartridge.access & CART_DRONEPHONE)
|
||||
dat += "<li><a href='byond://?src=[REF(src)];choice=Drone Phone'>[PDAIMG(dronephone)]Drone Phone</a></li>"
|
||||
dat += "<li><a href='byond://?src=[REF(src)];choice=3'>[PDAIMG(atmos)]Atmospheric Scan</a></li>"
|
||||
dat += "<li><a href='byond://?src=[REF(src)];choice=Light'>[PDAIMG(flashlight)][fon ? "Disable" : "Enable"] Flashlight</a></li>"
|
||||
dat += "<li><a href='byond://?src=[REF(src)];choice=Light'>[PDAIMG(flashlight)][light_on ? "Disable" : "Enable"] Flashlight</a></li>"
|
||||
if (pai)
|
||||
if(pai.loc != src)
|
||||
pai = null
|
||||
@@ -835,12 +835,10 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
/obj/item/pda/proc/toggle_light(mob/user)
|
||||
if(issilicon(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if(fon)
|
||||
fon = FALSE
|
||||
set_light(0)
|
||||
else if(f_lum)
|
||||
fon = TRUE
|
||||
set_light(f_lum)
|
||||
if(light_on)
|
||||
set_light_on(FALSE)
|
||||
else if(light_range)
|
||||
set_light_on(TRUE)
|
||||
update_icon()
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
/obj/item/pda/ai
|
||||
icon = null
|
||||
ttone = "data"
|
||||
fon = FALSE
|
||||
|
||||
|
||||
/obj/item/pda/ai/attack_self(mob/user)
|
||||
if ((honkamt > 0) && (prob(60)))//For clown virus.
|
||||
|
||||
@@ -13,9 +13,12 @@
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
custom_materials = list(/datum/material/iron=50, /datum/material/glass=20)
|
||||
actions_types = list(/datum/action/item_action/toggle_light)
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_range = 4
|
||||
light_power = 1
|
||||
light_on = FALSE
|
||||
var/on = FALSE
|
||||
var/brightness_on = 4 //range of light when on
|
||||
var/flashlight_power = 1 //strength of the light when on
|
||||
|
||||
|
||||
/obj/item/flashlight/Initialize()
|
||||
. = ..()
|
||||
@@ -23,16 +26,13 @@
|
||||
on = TRUE
|
||||
update_brightness()
|
||||
|
||||
/obj/item/flashlight/proc/update_brightness(mob/user = null)
|
||||
/obj/item/flashlight/proc/update_brightness(mob/user)
|
||||
if(on)
|
||||
icon_state = "[initial(icon_state)]-on"
|
||||
if(flashlight_power)
|
||||
set_light(l_range = brightness_on, l_power = flashlight_power)
|
||||
else
|
||||
set_light(brightness_on)
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
set_light(0)
|
||||
set_light_on(on)
|
||||
|
||||
|
||||
/obj/item/flashlight/attack_self(mob/user)
|
||||
on = !on
|
||||
@@ -64,7 +64,7 @@
|
||||
to_chat(user, "<span class='warning'>[M] doesn't have a head!</span>")
|
||||
return
|
||||
|
||||
if(flashlight_power < 1)
|
||||
if(light_power < 1)
|
||||
to_chat(user, "<span class='warning'>\The [src] isn't bright enough to see anything!</span> ")
|
||||
return
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
inhand_icon_state = ""
|
||||
worn_icon_state = "pen"
|
||||
flags_1 = CONDUCT_1
|
||||
brightness_on = 2
|
||||
light_range = 2
|
||||
var/holo_cooldown = 0
|
||||
|
||||
/obj/item/flashlight/pen/afterattack(atom/target, mob/user, proximity_flag)
|
||||
@@ -217,7 +217,7 @@
|
||||
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
|
||||
force = 9 // Not as good as a stun baton.
|
||||
brightness_on = 5 // A little better than the standard flashlight.
|
||||
light_range = 5 // A little better than the standard flashlight.
|
||||
hitsound = 'sound/weapons/genhit1.ogg'
|
||||
|
||||
// the desk lamps are a bit special
|
||||
@@ -229,7 +229,7 @@
|
||||
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
|
||||
force = 10
|
||||
brightness_on = 5
|
||||
light_range = 5
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
flags_1 = CONDUCT_1
|
||||
custom_materials = null
|
||||
@@ -265,7 +265,7 @@
|
||||
name = "flare"
|
||||
desc = "A red Nanotrasen issued flare. There are instructions on the side, it reads 'pull cord, make light'."
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
brightness_on = 7 // Pretty bright.
|
||||
light_range = 7 // Pretty bright.
|
||||
icon_state = "flare"
|
||||
inhand_icon_state = "flare"
|
||||
worn_icon_state = "flare"
|
||||
@@ -335,7 +335,7 @@
|
||||
name = "torch"
|
||||
desc = "A torch fashioned from some leaves and a log."
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
brightness_on = 4
|
||||
light_range = 4
|
||||
icon_state = "torch"
|
||||
inhand_icon_state = "torch"
|
||||
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
|
||||
@@ -351,19 +351,19 @@
|
||||
lefthand_file = 'icons/mob/inhands/equipment/mining_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/mining_righthand.dmi'
|
||||
desc = "A mining lantern."
|
||||
brightness_on = 6 // luminosity when on
|
||||
light_range = 6 // luminosity when on
|
||||
|
||||
/obj/item/flashlight/lantern/heirloom_moth
|
||||
name = "old lantern"
|
||||
desc = "An old lantern that has seen plenty of use."
|
||||
brightness_on = 4
|
||||
light_range = 4
|
||||
|
||||
/obj/item/flashlight/lantern/syndicate
|
||||
name = "suspicious lantern"
|
||||
desc = "A suspicious looking lantern."
|
||||
icon_state = "syndilantern"
|
||||
inhand_icon_state = "syndilantern"
|
||||
brightness_on = 10
|
||||
light_range = 10
|
||||
|
||||
/obj/item/flashlight/lantern/jade
|
||||
name = "jade lantern"
|
||||
@@ -381,7 +381,7 @@
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
custom_materials = null
|
||||
brightness_on = 6 //luminosity when on
|
||||
light_range = 6 //luminosity when on
|
||||
|
||||
/obj/item/flashlight/emp
|
||||
var/emp_max_charges = 4
|
||||
@@ -442,7 +442,7 @@
|
||||
desc = "A military-grade glowstick."
|
||||
custom_price = 50
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
brightness_on = 4
|
||||
light_range = 4
|
||||
color = LIGHT_COLOR_GREEN
|
||||
icon_state = "glowstick"
|
||||
inhand_icon_state = "glowstick"
|
||||
@@ -450,14 +450,17 @@
|
||||
grind_results = list(/datum/reagent/phenol = 15, /datum/reagent/hydrogen = 10, /datum/reagent/oxygen = 5) //Meth-in-a-stick
|
||||
var/fuel = 0
|
||||
|
||||
|
||||
/obj/item/flashlight/glowstick/Initialize()
|
||||
fuel = rand(1600, 2000)
|
||||
set_light_color(color)
|
||||
. = ..()
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/flashlight/glowstick/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
. = ..()
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/flashlight/glowstick/process()
|
||||
fuel = max(fuel - 1, 0)
|
||||
@@ -476,13 +479,13 @@
|
||||
if(!fuel)
|
||||
icon_state = "glowstick-empty"
|
||||
cut_overlays()
|
||||
set_light(0)
|
||||
set_light_on(FALSE)
|
||||
else if(on)
|
||||
var/mutable_appearance/glowstick_overlay = mutable_appearance(icon, "glowstick-glow")
|
||||
glowstick_overlay.color = color
|
||||
add_overlay(glowstick_overlay)
|
||||
inhand_icon_state = "glowstick-on"
|
||||
set_light(brightness_on)
|
||||
set_light_on(TRUE)
|
||||
else
|
||||
icon_state = "glowstick"
|
||||
cut_overlays()
|
||||
@@ -549,30 +552,56 @@
|
||||
name = "disco light"
|
||||
desc = "Groovy..."
|
||||
icon_state = null
|
||||
light_color = COLOR_WHITE
|
||||
brightness_on = 0
|
||||
light_range = 0
|
||||
light_range = 4
|
||||
light_power = 10
|
||||
alpha = 0
|
||||
layer = 0
|
||||
on = TRUE
|
||||
anchored = TRUE
|
||||
var/range = null
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
///Boolean that switches when a full color flip ends, so the light can appear in all colors.
|
||||
var/even_cycle = FALSE
|
||||
///Base light_range that can be set on Initialize to use in smooth light range expansions and contractions.
|
||||
var/base_light_range = 4
|
||||
|
||||
|
||||
/obj/item/flashlight/spotlight/Initialize(mapload, _light_range, _light_power, _light_color)
|
||||
. = ..()
|
||||
if(!isnull(_light_range))
|
||||
base_light_range = _light_range
|
||||
set_light_range(_light_range)
|
||||
if(!isnull(_light_power))
|
||||
set_light_power(_light_power)
|
||||
if(!isnull(_light_color))
|
||||
set_light_color(_light_color)
|
||||
|
||||
|
||||
/obj/item/flashlight/flashdark
|
||||
name = "flashdark"
|
||||
desc = "A strange device manufactured with mysterious elements that somehow emits darkness. Or maybe it just sucks in light? Nobody knows for sure."
|
||||
icon_state = "flashdark"
|
||||
inhand_icon_state = "flashdark"
|
||||
brightness_on = 2.5
|
||||
flashlight_power = -3
|
||||
light_system = STATIC_LIGHT //The overlay light component is not yet ready to produce darkness.
|
||||
light_range = 0
|
||||
///Variable to preserve old lighting behavior in flashlights, to handle darkness.
|
||||
var/dark_light_range = 2.5
|
||||
///Variable to preserve old lighting behavior in flashlights, to handle darkness.
|
||||
var/dark_light_power = -3
|
||||
|
||||
|
||||
/obj/item/flashlight/flashdark/update_brightness(mob/user)
|
||||
. = ..()
|
||||
if(on)
|
||||
set_light(dark_light_range, dark_light_power)
|
||||
else
|
||||
set_light(0)
|
||||
|
||||
|
||||
/obj/item/flashlight/eyelight
|
||||
name = "eyelight"
|
||||
desc = "This shouldn't exist outside of someone's head, how are you seeing this?"
|
||||
brightness_on = 15
|
||||
flashlight_power = 1
|
||||
light_range = 15
|
||||
light_power = 1
|
||||
flags_1 = CONDUCT_1
|
||||
item_flags = DROPDEL
|
||||
actions_types = list()
|
||||
|
||||
@@ -16,7 +16,10 @@
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
hitsound = "swing_hit"
|
||||
armour_penetration = 35
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_range = 6 //TWICE AS BRIGHT AS A REGULAR ESWORD
|
||||
light_color = LIGHT_COLOR_ELECTRIC_GREEN
|
||||
light_on = FALSE
|
||||
attack_verb_continuous = list("attacks", "slashes", "stabs", "slices", "tears", "lacerates", "rips", "dices", "cuts")
|
||||
attack_verb_simple = list("attack", "slash", "stab", "slice", "tear", "lacerate", "rip", "dice", "cut")
|
||||
block_chance = 75
|
||||
@@ -29,7 +32,6 @@
|
||||
var/saber_color = "green"
|
||||
var/two_hand_force = 34
|
||||
var/hacked = FALSE
|
||||
var/brightness_on = 6 //TWICE AS BRIGHT AS A REGULAR ESWORD
|
||||
var/list/possible_colors = list("red", "blue", "green", "purple")
|
||||
var/wielded = FALSE // track wielded status on item
|
||||
|
||||
@@ -50,7 +52,8 @@
|
||||
w_class = w_class_on
|
||||
hitsound = 'sound/weapons/blade1.ogg'
|
||||
START_PROCESSING(SSobj, src)
|
||||
set_light(brightness_on)
|
||||
set_light_on(TRUE)
|
||||
|
||||
|
||||
/// Triggered on unwield of two handed item
|
||||
/// switch hitsounds
|
||||
@@ -61,7 +64,8 @@
|
||||
w_class = initial(w_class)
|
||||
hitsound = "swing_hit"
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
set_light(0)
|
||||
set_light_on(FALSE)
|
||||
|
||||
|
||||
/obj/item/dualsaber/get_sharpness()
|
||||
return wielded * sharpness
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
custom_materials = list(/datum/material/iron=500)
|
||||
resistance_flags = FIRE_PROOF
|
||||
trigger_guard = TRIGGER_GUARD_NORMAL
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_on = FALSE
|
||||
var/status = FALSE
|
||||
var/lit = FALSE //on or off
|
||||
var/operating = FALSE//cooldown
|
||||
@@ -165,16 +167,15 @@
|
||||
to_chat(user, "<span class='notice'>You [lit ? "extinguish" : "ignite"] [src]!</span>")
|
||||
lit = !lit
|
||||
if(lit)
|
||||
set_light(1)
|
||||
playsound(loc, acti_sound, 50, TRUE)
|
||||
START_PROCESSING(SSobj, src)
|
||||
if(!warned_admins)
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] has lit a flamethrower.")
|
||||
warned_admins = TRUE
|
||||
else
|
||||
set_light(0)
|
||||
playsound(loc, deac_sound, 50, TRUE)
|
||||
STOP_PROCESSING(SSobj,src)
|
||||
set_light_on(lit)
|
||||
update_icon()
|
||||
|
||||
/obj/item/flamethrower/CheckParts(list/parts_list)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
return
|
||||
do_sparks(rand(5, 9), FALSE, src)
|
||||
playsound(flashbang_turf, 'sound/weapons/flashbang.ogg', 100, TRUE, 8, 0.9)
|
||||
new /obj/effect/dummy/lighting_obj (flashbang_turf, COLOR_WHITE, (flashbang_range + 2), 4, 2)
|
||||
new /obj/effect/dummy/lighting_obj (flashbang_turf, flashbang_range + 2, 4, COLOR_WHITE, 2)
|
||||
for(var/mob/living/M in get_hearers_in_view(flashbang_range, flashbang_turf))
|
||||
bang(get_turf(M), M)
|
||||
qdel(src)
|
||||
@@ -82,7 +82,7 @@
|
||||
return
|
||||
do_sparks(rand(5, 9), FALSE, src)
|
||||
playsound(flashbang_turf, 'sound/weapons/flashbang.ogg', 50, TRUE, 8, 0.9)
|
||||
new /obj/effect/dummy/lighting_obj (flashbang_turf, COLOR_WHITE, (flashbang_range + 2), 2, 1)
|
||||
new /obj/effect/dummy/lighting_obj (flashbang_turf, flashbang_range + 2, 2, COLOR_WHITE, 1)
|
||||
for(var/mob/living/M in get_hearers_in_view(flashbang_range, flashbang_turf))
|
||||
pop(get_turf(M), M)
|
||||
qdel(src)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
return
|
||||
do_sparks(rand(5, 9), FALSE, src)
|
||||
playsound(flashbang_turf, 'sound/effects/screech.ogg', 100, TRUE, 8, 0.9)
|
||||
new /obj/effect/dummy/lighting_obj (flashbang_turf, LIGHT_COLOR_PURPLE, (flashbang_range + 2), 4, 2)
|
||||
new /obj/effect/dummy/lighting_obj (flashbang_turf, flashbang_range + 2, 4, LIGHT_COLOR_PURPLE, 2)
|
||||
for(var/mob/living/M in get_hearers_in_view(flashbang_range, flashbang_turf))
|
||||
bang(get_turf(M), M)
|
||||
qdel(src)
|
||||
|
||||
@@ -5,13 +5,15 @@
|
||||
max_integrity = 200
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 30)
|
||||
resistance_flags = FIRE_PROOF
|
||||
var/brightness_on = 3
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_range = 3
|
||||
light_power = 1
|
||||
light_on = FALSE
|
||||
var/sword_color
|
||||
|
||||
/obj/item/melee/transforming/energy/Initialize()
|
||||
. = ..()
|
||||
if(active)
|
||||
set_light(brightness_on)
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/melee/transforming/energy/Destroy()
|
||||
@@ -40,10 +42,10 @@
|
||||
if(sword_color)
|
||||
icon_state = "sword[sword_color]"
|
||||
START_PROCESSING(SSobj, src)
|
||||
set_light(brightness_on)
|
||||
else
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
set_light(0)
|
||||
set_light_on(active)
|
||||
|
||||
|
||||
/obj/item/melee/transforming/energy/get_temperature()
|
||||
return active * heat
|
||||
@@ -167,7 +169,6 @@
|
||||
if(hacked)
|
||||
var/set_color = pick(possible_colors)
|
||||
set_light_color(possible_colors[set_color])
|
||||
update_light()
|
||||
|
||||
/obj/item/melee/transforming/energy/sword/saber/red
|
||||
possible_colors = list("red" = COLOR_SOFT_RED)
|
||||
|
||||
@@ -45,10 +45,11 @@
|
||||
desc = "A red pitchfork, it looks like the work of the devil."
|
||||
force = 19
|
||||
throwforce = 24
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_range = 3
|
||||
light_power = 6
|
||||
light_color = COLOR_SOFT_RED
|
||||
|
||||
/obj/item/pitchfork/demonic/Initialize()
|
||||
. = ..()
|
||||
set_light(3,6,COLOR_SOFT_RED)
|
||||
|
||||
/obj/item/pitchfork/demonic/ComponentInitialize()
|
||||
. = ..()
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
usesound = list('sound/items/welder.ogg', 'sound/items/welder2.ogg')
|
||||
drop_sound = 'sound/items/handling/weldingtool_drop.ogg'
|
||||
pickup_sound = 'sound/items/handling/weldingtool_pickup.ogg'
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_range = 2
|
||||
light_power = 0.75
|
||||
light_color = LIGHT_COLOR_FIRE
|
||||
light_on = FALSE
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
@@ -28,12 +32,12 @@
|
||||
wound_bonus = 10
|
||||
bare_wound_bonus = 15
|
||||
custom_materials = list(/datum/material/iron=70, /datum/material/glass=30)
|
||||
var/welding = 0 //Whether or not the welding tool is off(0), on(1) or currently welding(2)
|
||||
///Whether the welding tool is on or off.
|
||||
var/welding = FALSE
|
||||
var/status = TRUE //Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower)
|
||||
var/max_fuel = 20 //The max amount of fuel the welder can hold
|
||||
var/change_icons = 1
|
||||
var/can_off_process = 0
|
||||
var/light_intensity = 2 //how powerful the emitted light is when used.
|
||||
var/burned_fuel_for = 0 //when fuel was last removed
|
||||
var/acti_sound = 'sound/items/welderactivate.ogg'
|
||||
var/deac_sound = 'sound/items/welderdeactivate.ogg'
|
||||
@@ -47,7 +51,7 @@
|
||||
/obj/item/weldingtool/ComponentInitialize()
|
||||
. = ..()
|
||||
AddElement(/datum/element/update_icon_updates_onmob)
|
||||
AddElement(/datum/element/tool_flash, light_intensity)
|
||||
AddElement(/datum/element/tool_flash, light_range)
|
||||
|
||||
/obj/item/weldingtool/update_icon_state()
|
||||
if(welding)
|
||||
@@ -158,16 +162,16 @@
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] set [key_name_admin(L)] on fire with [src] at [AREACOORD(user)]")
|
||||
log_game("[key_name(user)] set [key_name(L)] on fire with [src] at [AREACOORD(user)]")
|
||||
|
||||
|
||||
/obj/item/weldingtool/attack_self(mob/user)
|
||||
if(src.reagents.has_reagent(/datum/reagent/toxin/plasma))
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] activated a rigged welder at [AREACOORD(user)].")
|
||||
explode()
|
||||
switched_on(user)
|
||||
if(welding)
|
||||
set_light(light_intensity)
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
// Ah fuck, I can't believe you've done this
|
||||
/obj/item/weldingtool/proc/handle_fuel_and_temps(used = 0, mob/living/user)
|
||||
use(used)
|
||||
@@ -194,10 +198,19 @@
|
||||
return FALSE
|
||||
|
||||
|
||||
//Toggles the welding value.
|
||||
/obj/item/weldingtool/proc/set_welding(new_value)
|
||||
if(welding == new_value)
|
||||
return
|
||||
. = welding
|
||||
welding = new_value
|
||||
set_light_on(welding)
|
||||
|
||||
|
||||
//Turns off the welder if there is no more fuel (does this really need to be its own proc?)
|
||||
/obj/item/weldingtool/proc/check_fuel(mob/user)
|
||||
if(get_fuel() <= 0 && welding)
|
||||
set_light(0)
|
||||
set_light_on(FALSE)
|
||||
switched_on(user)
|
||||
update_icon()
|
||||
return 0
|
||||
@@ -208,7 +221,7 @@
|
||||
if(!status)
|
||||
to_chat(user, "<span class='warning'>[src] can't be turned on while unsecured!</span>")
|
||||
return
|
||||
welding = !welding
|
||||
set_welding(!welding)
|
||||
if(welding)
|
||||
if(get_fuel() >= 1)
|
||||
to_chat(user, "<span class='notice'>You switch [src] on.</span>")
|
||||
@@ -228,8 +241,7 @@
|
||||
|
||||
//Switches the welder off
|
||||
/obj/item/weldingtool/proc/switched_off(mob/user)
|
||||
welding = 0
|
||||
set_light(0)
|
||||
set_welding(FALSE)
|
||||
|
||||
force = 3
|
||||
damtype = "brute"
|
||||
@@ -335,7 +347,8 @@
|
||||
icon = 'icons/obj/abductor.dmi'
|
||||
icon_state = "welder"
|
||||
toolspeed = 0.1
|
||||
light_intensity = 0
|
||||
light_system = NO_LIGHT_SUPPORT
|
||||
light_range = 0
|
||||
change_icons = 0
|
||||
|
||||
/obj/item/weldingtool/abductor/process()
|
||||
@@ -360,7 +373,7 @@
|
||||
custom_materials = list(/datum/material/iron=70, /datum/material/glass=120)
|
||||
change_icons = 0
|
||||
can_off_process = 1
|
||||
light_intensity = 1
|
||||
light_range = 1
|
||||
toolspeed = 0.5
|
||||
var/last_gen = 0
|
||||
var/nextrefueltick = 0
|
||||
|
||||
Reference in New Issue
Block a user