mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-27 23:14:18 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user