Port current /tg/ lighting system

This commit is contained in:
Chompstation Bot
2021-06-18 04:23:09 +00:00
parent 8aa043f4f4
commit 55e3dc7904
369 changed files with 16264 additions and 2783 deletions

View File

@@ -123,4 +123,4 @@
return (BRUTELOSS|FIRELOSS)
/obj/item/weapon/cell/device/weapon/gunsword/update_icon()
overlays.Cut()
cut_overlays()

View File

@@ -57,7 +57,7 @@
//Update icons from /tg/, so fancy! Use this more!
/obj/item/weapon/gun/energy/gun/protector/update_icon()
overlays.Cut()
cut_overlays()
var/ratio = 0
/* Don't have one for this gun
@@ -68,7 +68,7 @@
var/iconState = "[icon_state]_charge"
if (modifystate)
overlays += "[icon_state]_[modifystate]"
add_overlay("[icon_state]_[modifystate]")
iconState += "_[modifystate]"
/* Don't have one for this gun
if(itemState)
@@ -78,21 +78,21 @@
ratio = CEILING(((power_supply.charge / power_supply.maxcharge) * charge_sections), 1)
if(power_supply.charge < charge_cost)
overlays += "[icon_state]_empty"
add_overlay("[icon_state]_empty")
else
if(!shaded_charge)
var/mutable_appearance/charge_overlay = mutable_appearance(icon, iconState)
for(var/i = ratio, i >= 1, i--)
charge_overlay.pixel_x = ammo_x_offset * (i - 1)
overlays += charge_overlay
add_overlay(charge_overlay)
else
overlays += "[icon_state]_[modifystate][ratio]"
add_overlay("[icon_state]_[modifystate][ratio]")
if(can_flashlight & gun_light)
var/mutable_appearance/flashlight_overlay = mutable_appearance(icon, light_state)
flashlight_overlay.pixel_x = flight_x_offset
flashlight_overlay.pixel_y = flight_y_offset
overlays += flashlight_overlay
add_overlay(flashlight_overlay)
/* Don't have one for this gun
if(itemState)

View File

@@ -145,11 +145,11 @@
if(ratio < 0.25 && ratio != 0)
ratio = 0.25
ratio = round(ratio, 0.25) * 100
overlays += "smg_[ratio]"
add_overlay("smg_[ratio]")
/obj/item/weapon/gun/projectile/automatic/sol/update_icon()
icon_state = (ammo_magazine)? "SMG-IS" : "SMG-IS-empty"
overlays.Cut()
cut_overlays()
update_charge()
//--------------- StG-60 ----------------

View File

@@ -28,12 +28,12 @@
origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 4)
/obj/item/weapon/gun/projectile/lamia/update_icon()
overlays.Cut()
cut_overlays()
if(!ammo_magazine)
return
var/ratio = ammo_magazine.stored_ammo.len * 100 / ammo_magazine.max_ammo
ratio = round(ratio, 33)
overlays += "deagle_[ratio]"
add_overlay("deagle_[ratio]")
//Civilian gun
/obj/item/weapon/gun/projectile/giskard

View File

@@ -12,13 +12,13 @@
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 3)
/obj/item/weapon/gun/projectile/revolver/consul/proc/update_charge()
cut_overlays()
if(loaded.len==0)
overlays += "inspector_off"
add_overlay("inspector_off")
else
overlays += "inspector_on"
add_overlay("inspector_on")
/obj/item/weapon/gun/projectile/revolver/consul/update_icon()
overlays.Cut()
update_charge()
//.357 special ammo

View File

@@ -11,6 +11,9 @@
pass_flags = PASSTABLE
mouse_opacity = 0
hitsound = 'sound/weapons/pierce.ogg'
blocks_emissive = EMISSIVE_BLOCK_GENERIC
var/hitsound_wall = null // Played when something hits a wall, or anything else that isn't a mob.
////TG PROJECTILE SYTSEM
@@ -49,6 +52,7 @@
var/datum/beam_components_cache/beam_components
//Fancy hitscan lighting effects!
light_on = TRUE
var/hitscan_light_intensity = 1.5
var/hitscan_light_range = 0.75
var/hitscan_light_color_override