mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 18:44:48 +01:00
Merge branch 'pai_light' of https://github.com/Tayyyyyyy/Paradise into pai_light
Conflicts: code/game/gamemodes/shadowling/shadowling_abilities.dm code/game/objects/items/devices/flashlight.dm code/modules/mob/living/carbon/human/human.dm code/modules/mob/living/living.dm code/modules/mob/living/silicon/robot/robot.dm Changes to be committed: modified: code/game/gamemodes/shadowling/shadowling_abilities.dm modified: code/game/machinery/computer/computer.dm modified: code/game/machinery/floodlight.dm modified: code/game/objects/items/devices/flashlight.dm modified: code/game/objects/items/devices/paicard.dm modified: code/modules/clothing/head/hardhat.dm modified: code/modules/clothing/spacesuits/hardsuit.dm modified: code/modules/clothing/spacesuits/plasmamen.dm modified: code/modules/lighting/lighting_atom.dm modified: code/modules/mob/living/carbon/human/human.dm modified: code/modules/mob/living/living.dm modified: code/modules/mob/living/silicon/pai/pai.dm modified: code/modules/mob/living/silicon/pai/software_modules.dm modified: code/modules/mob/living/silicon/robot/robot.dm modified: code/modules/pda/PDA.dm modified: code/modules/power/lighting.dm modified: code/modules/projectiles/gun.dm
This commit is contained in:
@@ -61,61 +61,6 @@
|
||||
var/blacklisted_lights = list(/obj/item/flashlight/flare, /obj/item/flashlight/slime)
|
||||
action_icon_state = "veil"
|
||||
|
||||
/obj/effect/proc_holder/spell/aoe_turf/veil/proc/extinguishItem(var/obj/item/I) //WARNING NOT SUFFICIENT TO EXTINGUISH AN ITEM HELD BY A MOB
|
||||
if(istype(I, /obj/item/flashlight))
|
||||
var/obj/item/flashlight/F = I
|
||||
if(istype(F, /obj/item/flashlight/flare/glowstick))
|
||||
var/obj/item/flashlight/flare/glowstick/gstick = F
|
||||
gstick.fuel = 0
|
||||
if(F.on)
|
||||
if(is_type_in_list(I, blacklisted_lights))
|
||||
I.visible_message("<span class='danger'>[I] dims slightly before scattering the shadows around it.</span>")
|
||||
return
|
||||
F.on = 0
|
||||
F.update_brightness()
|
||||
else if(istype(I, /obj/item/pda))
|
||||
var/obj/item/pda/P = I
|
||||
var/datum/data/pda/utility/flashlight/FL = P.find_program(/datum/data/pda/utility/flashlight)
|
||||
if(FL && FL.fon)
|
||||
FL.start()
|
||||
else if(istype(I, /obj/item/clothing/head/helmet/space/hardsuit))
|
||||
var/obj/item/clothing/head/helmet/space/hardsuit/R = I
|
||||
if(R.on)
|
||||
R.toggle_light()
|
||||
R.visible_message("<span class='danger'>[R]'s light fades and turns off.</span>")
|
||||
else if(istype(I, /obj/item/clothing/head/helmet/space/eva/plasmaman))
|
||||
var/obj/item/clothing/head/helmet/space/eva/plasmaman/P = I
|
||||
if(P.on)
|
||||
P.toggle_light()
|
||||
P.visible_message("<span class='danger'>[P]'s light fades and turns off.</span>")
|
||||
else if(istype(I, /obj/item/gun))
|
||||
var/obj/item/gun/G = I
|
||||
if(G.gun_light)
|
||||
var/obj/item/flashlight/F = G.gun_light
|
||||
if(F.on)
|
||||
G.toggle_gunlight()
|
||||
G.visible_message("<span class='danger'>[G]'s light fades and turns off.</span>")
|
||||
else if(istype(I, /obj/item/clothing/head/hardhat)) //There really needs to be a better way to handle this.
|
||||
var/obj/item/clothing/head/hardhat/hhat = I
|
||||
if(hhat.on)
|
||||
hhat.on = 0
|
||||
hhat.set_light(0)
|
||||
hhat.icon_state = "hardhat0_[hhat.item_color]"
|
||||
hhat.item_state = "hardhat0_[hhat.item_color]"
|
||||
hhat.visible_message("<span class='danger'>[hhat]'s light fades and turns off.</span>")
|
||||
return I.light_range
|
||||
|
||||
/obj/effect/proc_holder/spell/aoe_turf/veil/proc/extinguishMob(mob/living/L)
|
||||
for(var/obj/item/F in L)
|
||||
if(F.light_range > 0)
|
||||
extinguishItem(F)
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
var/obj/item/organ/internal/lantern/O = H.get_int_organ(/obj/item/organ/internal/lantern)
|
||||
if(O && O.glowing)
|
||||
O.toggle_biolum(1)
|
||||
H.visible_message("<span class='danger'>[H] is engulfed in shadows and fades into the darkness.</span>", "<span class='danger'>A sense of dread washes over you as you suddenly dim dark.</span>")
|
||||
|
||||
/obj/effect/proc_holder/spell/aoe_turf/veil/cast(list/targets, mob/user = usr)
|
||||
if(!shadowling_check(user))
|
||||
charge_counter = charge_max
|
||||
@@ -125,23 +70,8 @@
|
||||
G.visible_message("<span class='warning'>\The [G] withers away!</span>")
|
||||
qdel(G)
|
||||
for(var/turf/T in targets)
|
||||
for(var/obj/item/F in T.contents)
|
||||
extinguishItem(F)
|
||||
for(var/obj/machinery/floodlight/F in T.contents)
|
||||
F.on = 0
|
||||
F.set_light(0)
|
||||
for(var/obj/machinery/light/L in T.contents)
|
||||
L.on = 0
|
||||
L.visible_message("<span class='danger'>[L] flickers and falls dark.</span>")
|
||||
L.update(0)
|
||||
for(var/obj/machinery/computer/C in T.contents)
|
||||
C.set_light(0)
|
||||
C.visible_message("<span class='danger'>[C] grows dim, its screen barely readable.</span>")
|
||||
for(var/mob/living/H in T.contents)
|
||||
extinguishMob(H)
|
||||
for(var/mob/living/silicon/robot/borg in T.contents)
|
||||
borg.update_headlamp(1, charge_max)
|
||||
|
||||
for(var/atom/A in T.contents)
|
||||
A.extinguish_light()
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/shadow_walk
|
||||
name = "Shadow Walk"
|
||||
|
||||
@@ -68,6 +68,10 @@
|
||||
set_broken()
|
||||
density = 0
|
||||
|
||||
/obj/machinery/computer/extinguish_light()
|
||||
set_light(0)
|
||||
visible_message("<span class='danger'>[src] grows dim, its screen barely readable.</span>")
|
||||
|
||||
/obj/machinery/computer/update_icon()
|
||||
overlays.Cut()
|
||||
if(stat & NOPOWER)
|
||||
|
||||
@@ -132,3 +132,7 @@
|
||||
cell = W
|
||||
to_chat(user, "You insert the power cell.")
|
||||
updateicon()
|
||||
|
||||
/obj/machinery/floodlight/extinguish_light()
|
||||
on = 0
|
||||
set_light(0)
|
||||
|
||||
@@ -84,6 +84,11 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/flashlight/extinguish_light()
|
||||
if(on)
|
||||
on = FALSE
|
||||
update_brightness()
|
||||
|
||||
/obj/item/flashlight/pen
|
||||
name = "penlight"
|
||||
desc = "A pen-sized light, used by medical staff."
|
||||
@@ -122,7 +127,7 @@
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
flags = CONDUCT
|
||||
materials = list()
|
||||
on = 1
|
||||
on = TRUE
|
||||
|
||||
|
||||
// green-shaded desk lamp
|
||||
@@ -292,6 +297,9 @@
|
||||
new T(loc)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
/obj/item/flashlight/flare/extinguish_light()
|
||||
visible_message("<span class='danger'>[src] dims slightly before scattering the shadows around it.</span>")
|
||||
|
||||
/obj/item/flashlight/flare/torch
|
||||
name = "torch"
|
||||
desc = "A torch fashioned from some leaves and a log."
|
||||
@@ -312,7 +320,7 @@
|
||||
brightness_on = 6
|
||||
light_color = "#FFBF00"
|
||||
materials = list()
|
||||
on = 1 //Bio-luminesence has one setting, on.
|
||||
on = TRUE //Bio-luminesence has one setting, on.
|
||||
|
||||
/obj/item/flashlight/slime/New()
|
||||
set_light(brightness_on)
|
||||
@@ -323,6 +331,9 @@
|
||||
/obj/item/flashlight/slime/attack_self(mob/user)
|
||||
return //Bio-luminescence does not toggle.
|
||||
|
||||
/obj/item/flashlight/slime/extinguish_light()
|
||||
visible_message("<span class='danger'>[src] dims slightly before scattering the shadows around it.</span>")
|
||||
|
||||
/obj/item/flashlight/emp
|
||||
origin_tech = "magnets=3;syndicate=1"
|
||||
|
||||
|
||||
@@ -339,3 +339,7 @@
|
||||
pai.ex_act(severity)
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/item/paicard/extinguish_light()
|
||||
pai.extinguish_light()
|
||||
set_light(0)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
icon_state = "hardhat0_yellow"
|
||||
item_state = "hardhat0_yellow"
|
||||
var/brightness_on = 4 //luminosity when on
|
||||
var/on = 0
|
||||
var/on = FALSE
|
||||
item_color = "yellow" //Determines used sprites: hardhat[on]_[color] and hardhat[on]_[color]2 (lying down sprite)
|
||||
armor = list(melee = 15, bullet = 5, laser = 20, energy = 10, bomb = 20, bio = 10, rad = 20)
|
||||
flags_inv = 0
|
||||
@@ -29,6 +29,13 @@
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/head/hardhat/extinguish_light()
|
||||
if(on)
|
||||
on = FALSE
|
||||
set_light(0)
|
||||
icon_state = "hardhat0_[item_color]"
|
||||
item_state = "hardhat0_[item_color]"
|
||||
visible_message("<span class='danger'>[src]'s light fades and turns off.</span>")
|
||||
|
||||
/obj/item/clothing/head/hardhat/orange
|
||||
icon_state = "hardhat0_orange"
|
||||
|
||||
@@ -57,6 +57,11 @@
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/extinguish_light()
|
||||
if(on)
|
||||
toggle_light()
|
||||
visible_message("<span class='danger'>[src]'s light fades and turns off.</span>")
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/item_action_slot_check(slot)
|
||||
if(slot == slot_head)
|
||||
return 1
|
||||
|
||||
@@ -102,6 +102,11 @@
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/head/helmet/space/eva/plasmaman/extinguish_light()
|
||||
if(on)
|
||||
toggle_light()
|
||||
visible_message("<span class='danger'>[src]'s light fades and turns off.</span>")
|
||||
|
||||
// ENGINEERING
|
||||
/obj/item/clothing/suit/space/eva/plasmaman/atmostech
|
||||
name = "plasmaman atmospheric suit"
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
else
|
||||
light = new /datum/light_source(src, .)
|
||||
|
||||
/atom/proc/extinguish_light()
|
||||
return
|
||||
|
||||
/atom/Destroy()
|
||||
if(light)
|
||||
light.destroy()
|
||||
|
||||
@@ -1992,3 +1992,12 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
|
||||
dna.SetSEState(block, FALSE, TRUE)
|
||||
genemutcheck(src, block, null, MUTCHK_FORCED)
|
||||
dna.UpdateSE()
|
||||
|
||||
/mob/living/carbon/human/extinguish_light()
|
||||
// Parent function handles stuff the human may be holding
|
||||
..()
|
||||
|
||||
var/obj/item/organ/internal/lantern/O = get_int_organ(/obj/item/organ/internal/lantern)
|
||||
if(O && O.glowing)
|
||||
O.toggle_biolum(TRUE)
|
||||
visible_message("<span class='danger'>[src] is engulfed in shadows and fades into the darkness.</span>", "<span class='danger'>A sense of dread washes over you as you suddenly dim dark.</span>")
|
||||
|
||||
@@ -987,3 +987,8 @@
|
||||
|
||||
/mob/living/proc/fakefire()
|
||||
return
|
||||
|
||||
/mob/living/extinguish_light()
|
||||
for(var/atom/A in src)
|
||||
if(A.light_range > 0)
|
||||
A.extinguish_light()
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
var/obj/item/integrated_radio/signal/sradio // AI's signaller
|
||||
|
||||
var/translator_on = 0 // keeps track of the translator module
|
||||
var/flashlight_on = FALSE //keeps track of the flashlight module
|
||||
|
||||
var/current_pda_messaging = null
|
||||
var/custom_sprite = 0
|
||||
@@ -607,3 +608,8 @@
|
||||
else //something went very wrong.
|
||||
CRASH("pAI without card")
|
||||
loc = card
|
||||
|
||||
/mob/living/silicon/pai/extinguish_light()
|
||||
flashlight_on = FALSE
|
||||
set_light(0)
|
||||
card.set_light(0)
|
||||
|
||||
@@ -609,3 +609,20 @@
|
||||
data["holder"] = 0
|
||||
|
||||
return data
|
||||
|
||||
/datum/pai_software/flashlight
|
||||
name = "Flashlight"
|
||||
ram_cost = 5
|
||||
id = "flashlight"
|
||||
|
||||
/datum/pai_software/flashlight/toggle(mob/living/silicon/pai/user)
|
||||
user.flashlight_on = !user.flashlight_on
|
||||
if(user.flashlight_on)
|
||||
user.set_light(2)
|
||||
user.card.set_light(2)
|
||||
return
|
||||
user.set_light(0)
|
||||
user.card.set_light(0)
|
||||
|
||||
/datum/pai_software/flashlight/is_active(mob/living/silicon/pai/user)
|
||||
return user.flashlight_on
|
||||
|
||||
@@ -1382,6 +1382,9 @@ var/list/robot_verbs_default = list(
|
||||
if(2)
|
||||
disable_component("comms", 60)
|
||||
|
||||
/mob/living/silicon/robot/extinguish_light()
|
||||
update_headlamp(1, 150)
|
||||
|
||||
/mob/living/silicon/robot/rejuvenate()
|
||||
..()
|
||||
var/brute = 1000
|
||||
|
||||
@@ -511,3 +511,8 @@ var/global/list/obj/item/pda/PDAs = list()
|
||||
/obj/item/pda/process()
|
||||
if(current_app)
|
||||
current_app.program_process()
|
||||
|
||||
/obj/item/pda/extinguish_light()
|
||||
var/datum/data/pda/utility/flashlight/FL = find_program(/datum/data/pda/utility/flashlight)
|
||||
if(FL && FL.fon)
|
||||
FL.start()
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 20
|
||||
power_channel = LIGHT //Lights are calc'd via area so they dont need to be in the machine list
|
||||
var/on = 0 // 1 if on, 0 if off
|
||||
var/on = FALSE // 1 if on, 0 if off
|
||||
var/on_gs = 0
|
||||
var/static_power_used = 0
|
||||
var/brightness_range = 8 // luminosity when on, also used in power calculation
|
||||
@@ -159,7 +159,6 @@
|
||||
var/nightshift_light_power = 0.45
|
||||
var/nightshift_light_color = "#FFDDCC"
|
||||
|
||||
|
||||
// the smaller bulb light fixture
|
||||
|
||||
/obj/machinery/light/small
|
||||
@@ -213,7 +212,7 @@
|
||||
/obj/machinery/light/Destroy()
|
||||
var/area/A = get_area(src)
|
||||
if(A)
|
||||
on = 0
|
||||
on = FALSE
|
||||
// A.update_lights()
|
||||
return ..()
|
||||
|
||||
@@ -224,13 +223,13 @@
|
||||
icon_state = "[base_state][on]"
|
||||
if(LIGHT_EMPTY)
|
||||
icon_state = "[base_state]-empty"
|
||||
on = 0
|
||||
on = FALSE
|
||||
if(LIGHT_BURNED)
|
||||
icon_state = "[base_state]-burned"
|
||||
on = 0
|
||||
on = FALSE
|
||||
if(LIGHT_BROKEN)
|
||||
icon_state = "[base_state]-broken"
|
||||
on = 0
|
||||
on = FALSE
|
||||
return
|
||||
|
||||
// update the icon_state and luminosity of the light depending on its state
|
||||
@@ -255,7 +254,7 @@
|
||||
if(status == LIGHT_OK && trigger)
|
||||
status = LIGHT_BURNED
|
||||
icon_state = "[base_state]-burned"
|
||||
on = 0
|
||||
on = FALSE
|
||||
set_light(0)
|
||||
else
|
||||
use_power = ACTIVE_POWER_USE
|
||||
@@ -730,3 +729,8 @@
|
||||
if(limb)
|
||||
limb.droplimb(0, DROPLIMB_BURN)
|
||||
return FIRELOSS
|
||||
|
||||
/obj/machinery/light/extinguish_light()
|
||||
on = FALSE
|
||||
visible_message("<span class='danger'>[src] flickers and falls dark.</span>")
|
||||
update(0)
|
||||
|
||||
@@ -305,6 +305,11 @@ obj/item/gun/proc/newshot()
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/gun/extinguish_light()
|
||||
if(gun_light.on)
|
||||
toggle_gunlight()
|
||||
visible_message("<span class='danger'>[src]'s light fades and turns off.</span>")
|
||||
|
||||
/obj/item/gun/pickup(mob/user)
|
||||
..()
|
||||
if(azoom)
|
||||
|
||||
Reference in New Issue
Block a user