[MIRROR] Color standardization, vars moved, and signals (#194)

* Color standardization, vars moved, and signals (#52574)

    Defined all the existing light_color values.
    Moved their definitions to colors.dm
    Made white the default color. It was so already, but that was very obscured.
    Moved the atom light-related variables to the atom definition.
    Wrapped changes to variables such as light_color into procs that report the event through signals.
    Moved the light_on variable to the atom level, also adding a signal for its changing, to represent toggling lights.
    Cleaned up a little bit of code in where new variables were defined before redefinitions.

This is all atomization to reduce changes in #52413
None of this affect gameplay at all, it's all code cleaning and refactoring.

There's more colors to standardize, a search for color = will find lots of targets, and I see little need to have both the LIGHT_COLOR and COLOR patterns, but I don't want to make this PR bigger than it already is.

* Color standardization, vars moved, and signals

Co-authored-by: Rohesie <rohesie@gmail.com>
This commit is contained in:
SkyratBot
2020-08-04 12:20:31 +02:00
committed by GitHub
co-authored by Rohesie
parent 2a0db9c922
commit 5fd8cb072e
78 changed files with 355 additions and 281 deletions
+9 -9
View File
@@ -16,14 +16,17 @@
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'
var/acti_sound = 'sound/items/welderactivate.ogg'
var/deac_sound = 'sound/items/welderdeactivate.ogg'
light_color = LIGHT_COLOR_FIRE
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_SMALL
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 30)
resistance_flags = FIRE_PROOF
heat = 3800
tool_behaviour = TOOL_WELDER
toolspeed = 1
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)
var/status = TRUE //Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower)
@@ -32,11 +35,8 @@
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
heat = 3800
tool_behaviour = TOOL_WELDER
toolspeed = 1
wound_bonus = 10
bare_wound_bonus = 15
var/acti_sound = 'sound/items/welderactivate.ogg'
var/deac_sound = 'sound/items/welderdeactivate.ogg'
/obj/item/weldingtool/Initialize()
. = ..()
@@ -358,11 +358,11 @@
inhand_icon_state = "exwelder"
max_fuel = 40
custom_materials = list(/datum/material/iron=70, /datum/material/glass=120)
var/last_gen = 0
change_icons = 0
can_off_process = 1
light_intensity = 1
toolspeed = 0.5
var/last_gen = 0
var/nextrefueltick = 0
/obj/item/weldingtool/experimental/process()
+1 -1
View File
@@ -52,7 +52,7 @@
/obj/item/wrench/medical/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] is praying to the medical wrench to take [user.p_their()] soul. It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.Stun(100, ignore_canstun = TRUE)// Stun stops them from wandering off
user.light_color = "#FAE48E"
user.set_light_color(COLOR_VERY_SOFT_YELLOW)
user.set_light(2)
user.add_overlay(mutable_appearance('icons/effects/genetics.dmi', "servitude", -MUTATIONS_LAYER))
playsound(loc, 'sound/effects/pray.ogg', 50, TRUE, -1)