Made several improvements to flashlights (#16050)

* Made several improvements to flashlights, and added a sprite for device cells

* CL

* Added lathe recipes, and made eCigs use device power cells

* Add another entry to CL

* Fix nested cell

* Added `desc_info` to all flashlights, to teach the player about removing the cells and turning them on.

* Update code/game/objects/items/devices/lighting/lamp.dm

* More cleanup

* Allow Flashlights to use rechargers

* Apply suggestions from code review

Co-authored-by: Fluffy <65877598+FluffyGhoster@users.noreply.github.com>

* Update flare.dm

* Update flashlight.dm

Fix broken code review suggestion

* Update flare.dm

Ditto

---------

Co-authored-by: Fluffy <65877598+FluffyGhoster@users.noreply.github.com>
This commit is contained in:
Cody Brittain
2023-03-31 17:46:06 +00:00
committed by GitHub
co-authored by Fluffy
parent 2b144bb86f
commit 89855cff39
17 changed files with 419 additions and 180 deletions
+10 -8
View File
@@ -29,16 +29,18 @@
/obj/item/cell/update_icon()
cut_overlays()
if(charge < 0.01)
return
else if(charge/maxcharge >=0.995)
add_overlay("cell-o2")
else
add_overlay("cell-o1")
switch(percent())
if(95 to 100)
add_overlay("cell-o2")
if(25 to 94)
add_overlay("cell-o1")
if(0.05 to 25)
add_overlay("cell-o0")
if(0 to 0.05)
return
/obj/item/cell/proc/percent() // return % charge of cell
return 100.0*charge/maxcharge
return maxcharge && (100.0*charge/maxcharge)
/obj/item/cell/proc/fully_charged()
return (charge == maxcharge)