diff --git a/code/__DEFINES/colors.dm b/code/__DEFINES/colors.dm index 9f45d8da79..db78144689 100644 --- a/code/__DEFINES/colors.dm +++ b/code/__DEFINES/colors.dm @@ -24,6 +24,7 @@ #define COLOR_BEIGE "#CEB689" #define COLOR_BLUE_GRAY "#75A2BB" #define COLOR_BROWN "#BA9F6D" +#define COLOR_SOFT_RED "#FA8282" #define COLOR_DARK_BROWN "#997C4F" #define COLOR_DARK_ORANGE "#C3630C" #define COLOR_GREEN_GRAY "#99BB76" diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index e692e424e8..986023e3ff 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -131,8 +131,6 @@ ///from obj/machinery/bsa/full/proc/fire(): () #define COMSIG_ATOM_BSA_BEAM "atom_bsa_beam_pass" #define COMSIG_ATOM_BLOCKS_BSA_BEAM (1<<0) -///from base of atom/set_light(): (l_range, l_power, l_color) -#define COMSIG_ATOM_SET_LIGHT "atom_set_light" ///from base of atom/setDir(): (old_dir, new_dir). Called before the direction changes. #define COMSIG_ATOM_DIR_CHANGE "atom_dir_change" ///from base of atom/handle_atom_del(): (atom/deleted) @@ -297,6 +295,32 @@ ///from base of mob/AltClickOn(): (atom/A) #define COMSIG_MOB_ALTCLICKON "mob_altclickon" +// Lighting: +///from base of [atom/proc/set_light]: (l_range, l_power, l_color, l_on) +#define COMSIG_ATOM_SET_LIGHT "atom_set_light" + /// Blocks [/atom/proc/set_light], [/atom/proc/set_light_power], [/atom/proc/set_light_range], [/atom/proc/set_light_color], [/atom/proc/set_light_on], and [/atom/proc/set_light_flags]. + #define COMPONENT_BLOCK_LIGHT_UPDATE (1<<0) +///Called right before the atom changes the value of light_power to a different one, from base [atom/proc/set_light_power]: (new_power) +#define COMSIG_ATOM_SET_LIGHT_POWER "atom_set_light_power" +///Called right after the atom changes the value of light_power to a different one, from base of [/atom/proc/set_light_power]: (old_power) +#define COMSIG_ATOM_UPDATE_LIGHT_POWER "atom_update_light_power" +///Called right before the atom changes the value of light_range to a different one, from base [atom/proc/set_light_range]: (new_range) +#define COMSIG_ATOM_SET_LIGHT_RANGE "atom_set_light_range" +///Called right after the atom changes the value of light_range to a different one, from base of [/atom/proc/set_light_range]: (old_range) +#define COMSIG_ATOM_UPDATE_LIGHT_RANGE "atom_update_light_range" +///Called right before the atom changes the value of light_color to a different one, from base [atom/proc/set_light_color]: (new_color) +#define COMSIG_ATOM_SET_LIGHT_COLOR "atom_set_light_color" +///Called right after the atom changes the value of light_color to a different one, from base of [/atom/proc/set_light_color]: (old_color) +#define COMSIG_ATOM_UPDATE_LIGHT_COLOR "atom_update_light_color" +///Called right before the atom changes the value of light_on to a different one, from base [atom/proc/set_light_on]: (new_value) +#define COMSIG_ATOM_SET_LIGHT_ON "atom_set_light_on" +///Called right after the atom changes the value of light_on to a different one, from base of [/atom/proc/set_light_on]: (old_value) +#define COMSIG_ATOM_UPDATE_LIGHT_ON "atom_update_light_on" +///Called right before the atom changes the value of light_flags to a different one, from base [atom/proc/set_light_flags]: (new_flags) +#define COMSIG_ATOM_SET_LIGHT_FLAGS "atom_set_light_flags" +///Called right after the atom changes the value of light_flags to a different one, from base of [/atom/proc/set_light_flags]: (old_flags) +#define COMSIG_ATOM_UPDATE_LIGHT_FLAGS "atom_update_light_flags" + // /client signals #define COMSIG_MOB_CLIENT_LOGIN "mob_client_login" //sent when a mob/login() finishes: (client) #define COMSIG_MOB_CLIENT_LOGOUT "mob_client_logout" //sent when a mob/logout() starts: (client) diff --git a/code/__DEFINES/layers_planes.dm b/code/__DEFINES/layers_planes.dm index a6e2e8a695..ea7b1b2e0a 100644 --- a/code/__DEFINES/layers_planes.dm +++ b/code/__DEFINES/layers_planes.dm @@ -124,7 +124,6 @@ #define EMISSIVE_PLANE 13 #define EMISSIVE_LAYER 13 -#define EMISSIVE_RENDER_TARGET "*EMISSIVE_PLANE" #define EMISSIVE_UNBLOCKABLE_PLANE 14 #define EMISSIVE_UNBLOCKABLE_LAYER 14 diff --git a/code/datums/mutable_appearance.dm b/code/datums/mutable_appearance.dm index 1256286ff8..968809747b 100644 --- a/code/datums/mutable_appearance.dm +++ b/code/datums/mutable_appearance.dm @@ -10,7 +10,7 @@ // And yes this does have to be in the constructor, BYOND ignores it if you set it as a normal var // Helper similar to image() -/proc/mutable_appearance(icon, icon_state = "", layer = FLOAT_LAYER, plane = FLOAT_PLANE, alpha = 255, appearance_flags = NONE) +/proc/mutable_appearance(icon, icon_state = "", layer = FLOAT_LAYER, plane = FLOAT_PLANE, alpha = 255, appearance_flags = NONE, color = "#FFFFFF") var/mutable_appearance/MA = new() MA.icon = icon MA.icon_state = icon_state @@ -18,5 +18,6 @@ MA.plane = plane MA.alpha = alpha MA.appearance_flags |= appearance_flags + MA.color = color return MA diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 0379897c08..b51ce3115a 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -103,6 +103,9 @@ /// A luminescence-shifted value of the last color calculated for chatmessage overlays var/chat_color_darkened + ///Used for changing icon states for different base sprites. + var/base_icon_state + ///Mobs that are currently do_after'ing this atom, to be cleared from on Destroy() var/list/targeted_by diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 50517e9082..229a2d98d8 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -78,9 +78,9 @@ . += "fire_overlay" if(is_station_level(z)) - . += "fire_[GLOB.security_level.current_level]" - . += mutable_appearance(icon, "fire_[GLOB.security_level.current_level]") - . += emissive_appearance(icon, "fire_[GLOB.security_level.current_level]") + . += "fire_[GLOB.security_level]" + . += mutable_appearance(icon, "fire_[GLOB.security_level]") + . += emissive_appearance(icon, "fire_[GLOB.security_level]") else . += "fire_[SEC_LEVEL_GREEN]" . += mutable_appearance(icon, "fire_[SEC_LEVEL_GREEN]") diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index 40ceaf8eb9..0b55f80c39 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -5,6 +5,7 @@ name = "light switch" icon = 'icons/obj/power.dmi' icon_state = "light1" + base_icon_state = "light" plane = ABOVE_WALL_PLANE desc = "Make dark." var/on = TRUE diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index 231075a27d..e346439e03 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -30,7 +30,7 @@ integrity_failure = 0.5 armor = list("melee" = 50, "bullet" = 30, "laser" = 30, "energy" = 30, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 90, "acid" = 90) /// Base turret icon state - var/base_icon_state = "standard" + base_icon_state = "standard" /// Scan range of the turret for locating targets var/scan_range = 7 /// For turrets inside other objects diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 583b258df6..62696a0853 100755 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -2,6 +2,7 @@ name = "recharger" icon = 'icons/obj/stationobjs.dmi' icon_state = "recharger0" + base_icon_state = "recharger" desc = "A charging dock for energy based weaponry." use_power = IDLE_POWER_USE idle_power_usage = 4 diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index ee65bd5c96..affa5d5768 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -283,7 +283,7 @@ var/combat = FALSE //If it penetrates armor and gives additional functionality var/grab_ghost = FALSE var/tlimit = DEFIB_TIME_LIMIT * 10 - var/base_icon_state = "defibpaddles" + base_icon_state = "defibpaddles" var/disarm_shock_time = 10 var/wielded = FALSE // track wielded status on item diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm index 9aed545509..74efe3a196 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -548,7 +548,7 @@ force = 3 throwforce = 3 throw_speed = 3 - var/base_icon_state = "eshield" // [base_icon_state]1 for expanded, [base_icon_state]0 for contracted + base_icon_state = "eshield" // [base_icon_state]1 for expanded, [base_icon_state]0 for contracted var/on_force = 10 var/on_throwforce = 8 var/on_throw_speed = 2 diff --git a/code/modules/lighting/lighting_atom.dm b/code/modules/lighting/lighting_atom.dm index 71702bef12..f9df19d2ac 100644 --- a/code/modules/lighting/lighting_atom.dm +++ b/code/modules/lighting/lighting_atom.dm @@ -132,3 +132,54 @@ /mob/living/proc/mob_light(_color, _range, _power, _duration) var/obj/effect/dummy/lighting_obj/moblight/mob_light_obj = new (src, _color, _range, _power, _duration) return mob_light_obj + +// Setter for the light power of this atom. +/atom/proc/set_light_power(new_power) + if(new_power == light_power) + return + if(SEND_SIGNAL(src, COMSIG_ATOM_SET_LIGHT_POWER, new_power) & COMPONENT_BLOCK_LIGHT_UPDATE) + return + . = light_power + light_power = new_power + SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_LIGHT_POWER, .) + +/// Setter for the light range of this atom. +/atom/proc/set_light_range(new_range) + if(new_range == light_range) + return + if(SEND_SIGNAL(src, COMSIG_ATOM_SET_LIGHT_RANGE, new_range) & COMPONENT_BLOCK_LIGHT_UPDATE) + return + . = light_range + light_range = new_range + SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_LIGHT_RANGE, .) + +/// Setter for the light color of this atom. +/atom/proc/set_light_color(new_color) + if(new_color == light_color) + return + if(SEND_SIGNAL(src, COMSIG_ATOM_SET_LIGHT_COLOR, new_color) & COMPONENT_BLOCK_LIGHT_UPDATE) + return + . = light_color + light_color = new_color + SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_LIGHT_COLOR, .) +/* +/// Setter for whether or not this atom's light is on. +/atom/proc/set_light_on(new_value) + if(new_value == ) + return + if(SEND_SIGNAL(src, COMSIG_ATOM_SET_LIGHT_ON, new_value) & COMPONENT_BLOCK_LIGHT_UPDATE) + return + . = light_on + light_on = new_value + SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_LIGHT_ON, .) + +/// Setter for the light flags of this atom. +/atom/proc/set_light_flags(new_value) + if(new_value == light_flags) + return + if(SEND_SIGNAL(src, COMSIG_ATOM_SET_LIGHT_FLAGS, new_value) & COMPONENT_BLOCK_LIGHT_UPDATE) + return + . = light_flags + light_flags = new_value + SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_LIGHT_FLAGS, .) +*/ diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index db9ce3e92d..fdfe18d0e3 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -328,7 +328,7 @@ /obj/machinery/power/apc/update_overlays() . = ..() - if((machine_stat & (BROKEN|MAINT)) || update_state) + if((stat & (BROKEN|MAINT)) || update_state) return . += mutable_appearance(icon, "apcox-[locked]") diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 16317bf9a3..363d3f6b71 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -116,7 +116,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) ///The portion of the gasmix we're on that we should remove var/gasefficency = 0.15 ///Used for changing icon states for diff base sprites - var/base_icon_state = "darkmatter" + base_icon_state = "darkmatter" ///Are we exploding? var/final_countdown = FALSE diff --git a/code/modules/spells/spell_types/aimed.dm b/code/modules/spells/spell_types/aimed.dm index 8fab4a221d..aa2a2e4083 100644 --- a/code/modules/spells/spell_types/aimed.dm +++ b/code/modules/spells/spell_types/aimed.dm @@ -4,7 +4,7 @@ var/projectile_type = /obj/item/projectile/magic/teleport var/deactive_msg = "You discharge your projectile..." var/active_msg = "You charge your projectile!" - var/base_icon_state = "projectile" + base_icon_state = "projectile" var/active_icon_state = "projectile" var/list/projectile_var_overrides = list() var/projectile_amount = 1 //Projectiles per cast.