This commit is contained in:
Artur
2021-07-22 18:59:47 +03:00
committed by Artur
parent 9fcc762b7d
commit 30016f38a8
15 changed files with 94 additions and 13 deletions

View File

@@ -24,6 +24,7 @@
#define COLOR_BEIGE "#CEB689" #define COLOR_BEIGE "#CEB689"
#define COLOR_BLUE_GRAY "#75A2BB" #define COLOR_BLUE_GRAY "#75A2BB"
#define COLOR_BROWN "#BA9F6D" #define COLOR_BROWN "#BA9F6D"
#define COLOR_SOFT_RED "#FA8282"
#define COLOR_DARK_BROWN "#997C4F" #define COLOR_DARK_BROWN "#997C4F"
#define COLOR_DARK_ORANGE "#C3630C" #define COLOR_DARK_ORANGE "#C3630C"
#define COLOR_GREEN_GRAY "#99BB76" #define COLOR_GREEN_GRAY "#99BB76"

View File

@@ -131,8 +131,6 @@
///from obj/machinery/bsa/full/proc/fire(): () ///from obj/machinery/bsa/full/proc/fire(): ()
#define COMSIG_ATOM_BSA_BEAM "atom_bsa_beam_pass" #define COMSIG_ATOM_BSA_BEAM "atom_bsa_beam_pass"
#define COMSIG_ATOM_BLOCKS_BSA_BEAM (1<<0) #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. ///from base of atom/setDir(): (old_dir, new_dir). Called before the direction changes.
#define COMSIG_ATOM_DIR_CHANGE "atom_dir_change" #define COMSIG_ATOM_DIR_CHANGE "atom_dir_change"
///from base of atom/handle_atom_del(): (atom/deleted) ///from base of atom/handle_atom_del(): (atom/deleted)
@@ -297,6 +295,32 @@
///from base of mob/AltClickOn(): (atom/A) ///from base of mob/AltClickOn(): (atom/A)
#define COMSIG_MOB_ALTCLICKON "mob_altclickon" #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 // /client signals
#define COMSIG_MOB_CLIENT_LOGIN "mob_client_login" //sent when a mob/login() finishes: (client) #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) #define COMSIG_MOB_CLIENT_LOGOUT "mob_client_logout" //sent when a mob/logout() starts: (client)

View File

@@ -124,7 +124,6 @@
#define EMISSIVE_PLANE 13 #define EMISSIVE_PLANE 13
#define EMISSIVE_LAYER 13 #define EMISSIVE_LAYER 13
#define EMISSIVE_RENDER_TARGET "*EMISSIVE_PLANE"
#define EMISSIVE_UNBLOCKABLE_PLANE 14 #define EMISSIVE_UNBLOCKABLE_PLANE 14
#define EMISSIVE_UNBLOCKABLE_LAYER 14 #define EMISSIVE_UNBLOCKABLE_LAYER 14

View File

@@ -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 // 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() // 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() var/mutable_appearance/MA = new()
MA.icon = icon MA.icon = icon
MA.icon_state = icon_state MA.icon_state = icon_state
@@ -18,5 +18,6 @@
MA.plane = plane MA.plane = plane
MA.alpha = alpha MA.alpha = alpha
MA.appearance_flags |= appearance_flags MA.appearance_flags |= appearance_flags
MA.color = color
return MA return MA

View File

@@ -103,6 +103,9 @@
/// A luminescence-shifted value of the last color calculated for chatmessage overlays /// A luminescence-shifted value of the last color calculated for chatmessage overlays
var/chat_color_darkened 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() ///Mobs that are currently do_after'ing this atom, to be cleared from on Destroy()
var/list/targeted_by var/list/targeted_by

View File

@@ -78,9 +78,9 @@
. += "fire_overlay" . += "fire_overlay"
if(is_station_level(z)) if(is_station_level(z))
. += "fire_[GLOB.security_level.current_level]" . += "fire_[GLOB.security_level]"
. += mutable_appearance(icon, "fire_[GLOB.security_level.current_level]") . += mutable_appearance(icon, "fire_[GLOB.security_level]")
. += emissive_appearance(icon, "fire_[GLOB.security_level.current_level]") . += emissive_appearance(icon, "fire_[GLOB.security_level]")
else else
. += "fire_[SEC_LEVEL_GREEN]" . += "fire_[SEC_LEVEL_GREEN]"
. += mutable_appearance(icon, "fire_[SEC_LEVEL_GREEN]") . += mutable_appearance(icon, "fire_[SEC_LEVEL_GREEN]")

View File

@@ -5,6 +5,7 @@
name = "light switch" name = "light switch"
icon = 'icons/obj/power.dmi' icon = 'icons/obj/power.dmi'
icon_state = "light1" icon_state = "light1"
base_icon_state = "light"
plane = ABOVE_WALL_PLANE plane = ABOVE_WALL_PLANE
desc = "Make dark." desc = "Make dark."
var/on = TRUE var/on = TRUE

View File

@@ -30,7 +30,7 @@
integrity_failure = 0.5 integrity_failure = 0.5
armor = list("melee" = 50, "bullet" = 30, "laser" = 30, "energy" = 30, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 90, "acid" = 90) armor = list("melee" = 50, "bullet" = 30, "laser" = 30, "energy" = 30, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 90, "acid" = 90)
/// Base turret icon state /// Base turret icon state
var/base_icon_state = "standard" base_icon_state = "standard"
/// Scan range of the turret for locating targets /// Scan range of the turret for locating targets
var/scan_range = 7 var/scan_range = 7
/// For turrets inside other objects /// For turrets inside other objects

View File

@@ -2,6 +2,7 @@
name = "recharger" name = "recharger"
icon = 'icons/obj/stationobjs.dmi' icon = 'icons/obj/stationobjs.dmi'
icon_state = "recharger0" icon_state = "recharger0"
base_icon_state = "recharger"
desc = "A charging dock for energy based weaponry." desc = "A charging dock for energy based weaponry."
use_power = IDLE_POWER_USE use_power = IDLE_POWER_USE
idle_power_usage = 4 idle_power_usage = 4

View File

@@ -283,7 +283,7 @@
var/combat = FALSE //If it penetrates armor and gives additional functionality var/combat = FALSE //If it penetrates armor and gives additional functionality
var/grab_ghost = FALSE var/grab_ghost = FALSE
var/tlimit = DEFIB_TIME_LIMIT * 10 var/tlimit = DEFIB_TIME_LIMIT * 10
var/base_icon_state = "defibpaddles" base_icon_state = "defibpaddles"
var/disarm_shock_time = 10 var/disarm_shock_time = 10
var/wielded = FALSE // track wielded status on item var/wielded = FALSE // track wielded status on item

View File

@@ -548,7 +548,7 @@
force = 3 force = 3
throwforce = 3 throwforce = 3
throw_speed = 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_force = 10
var/on_throwforce = 8 var/on_throwforce = 8
var/on_throw_speed = 2 var/on_throw_speed = 2

View File

@@ -132,3 +132,54 @@
/mob/living/proc/mob_light(_color, _range, _power, _duration) /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) var/obj/effect/dummy/lighting_obj/moblight/mob_light_obj = new (src, _color, _range, _power, _duration)
return mob_light_obj 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, .)
*/

View File

@@ -328,7 +328,7 @@
/obj/machinery/power/apc/update_overlays() /obj/machinery/power/apc/update_overlays()
. = ..() . = ..()
if((machine_stat & (BROKEN|MAINT)) || update_state) if((stat & (BROKEN|MAINT)) || update_state)
return return
. += mutable_appearance(icon, "apcox-[locked]") . += mutable_appearance(icon, "apcox-[locked]")

View File

@@ -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 ///The portion of the gasmix we're on that we should remove
var/gasefficency = 0.15 var/gasefficency = 0.15
///Used for changing icon states for diff base sprites ///Used for changing icon states for diff base sprites
var/base_icon_state = "darkmatter" base_icon_state = "darkmatter"
///Are we exploding? ///Are we exploding?
var/final_countdown = FALSE var/final_countdown = FALSE

View File

@@ -4,7 +4,7 @@
var/projectile_type = /obj/item/projectile/magic/teleport var/projectile_type = /obj/item/projectile/magic/teleport
var/deactive_msg = "You discharge your projectile..." var/deactive_msg = "You discharge your projectile..."
var/active_msg = "You charge your projectile!" var/active_msg = "You charge your projectile!"
var/base_icon_state = "projectile" base_icon_state = "projectile"
var/active_icon_state = "projectile" var/active_icon_state = "projectile"
var/list/projectile_var_overrides = list() var/list/projectile_var_overrides = list()
var/projectile_amount = 1 //Projectiles per cast. var/projectile_amount = 1 //Projectiles per cast.