mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Flashlights use device cells
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
var/on = 0
|
||||
var/brightness_on = 4 //luminosity when on
|
||||
var/obj/item/weapon/cell/cell
|
||||
var/cell_type = /obj/item/weapon/cell/high
|
||||
var/cell_type = /obj/item/weapon/cell/device
|
||||
var/list/brightness_levels
|
||||
var/brightness_level = "medium"
|
||||
var/power_usage
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
if(cell_type)
|
||||
cell = new cell_type(src)
|
||||
brightness_levels = list("low" = 5, "medium" = 10, "high" = 20)
|
||||
brightness_levels = list("low" = 0.25, "medium" = 0.5, "high" = 1)
|
||||
power_usage = brightness_levels[brightness_level]
|
||||
|
||||
else
|
||||
@@ -184,6 +184,7 @@
|
||||
/obj/item/device/flashlight/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
if(power_use)
|
||||
if(istype(W, /obj/item/weapon/cell))
|
||||
if(istype(W, /obj/item/weapon/cell/device))
|
||||
if(!cell)
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
@@ -192,6 +193,8 @@
|
||||
update_icon()
|
||||
else
|
||||
user << "<span class='notice'>\The [src] already has a cell.</span>"
|
||||
else
|
||||
user << "<span class='notice'>\The [src] cannot use that type of cell.</span>"
|
||||
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -67,8 +67,9 @@
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "cell"
|
||||
item_to_spawn()
|
||||
return pick(prob(50);/obj/item/weapon/cell,
|
||||
prob(40);/obj/item/weapon/cell/high,
|
||||
return pick(prob(40);/obj/item/weapon/cell,
|
||||
prob(25);/obj/item/weapon/cell/device,
|
||||
prob(25);/obj/item/weapon/cell/high,
|
||||
prob(9);/obj/item/weapon/cell/super,
|
||||
prob(1);/obj/item/weapon/cell/hyper)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user