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/on = 0
|
||||||
var/brightness_on = 4 //luminosity when on
|
var/brightness_on = 4 //luminosity when on
|
||||||
var/obj/item/weapon/cell/cell
|
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/list/brightness_levels
|
||||||
var/brightness_level = "medium"
|
var/brightness_level = "medium"
|
||||||
var/power_usage
|
var/power_usage
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
if(cell_type)
|
if(cell_type)
|
||||||
cell = new cell_type(src)
|
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]
|
power_usage = brightness_levels[brightness_level]
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -184,14 +184,17 @@
|
|||||||
/obj/item/device/flashlight/attackby(obj/item/weapon/W, mob/user as mob)
|
/obj/item/device/flashlight/attackby(obj/item/weapon/W, mob/user as mob)
|
||||||
if(power_use)
|
if(power_use)
|
||||||
if(istype(W, /obj/item/weapon/cell))
|
if(istype(W, /obj/item/weapon/cell))
|
||||||
if(!cell)
|
if(istype(W, /obj/item/weapon/cell/device))
|
||||||
user.drop_item()
|
if(!cell)
|
||||||
W.loc = src
|
user.drop_item()
|
||||||
cell = W
|
W.loc = src
|
||||||
user << "<span class='notice'>You install a cell in \the [src].</span>"
|
cell = W
|
||||||
update_icon()
|
user << "<span class='notice'>You install a cell in \the [src].</span>"
|
||||||
|
update_icon()
|
||||||
|
else
|
||||||
|
user << "<span class='notice'>\The [src] already has a cell.</span>"
|
||||||
else
|
else
|
||||||
user << "<span class='notice'>\The [src] already has a cell.</span>"
|
user << "<span class='notice'>\The [src] cannot use that type of cell.</span>"
|
||||||
|
|
||||||
else
|
else
|
||||||
..()
|
..()
|
||||||
|
|||||||
@@ -67,8 +67,9 @@
|
|||||||
icon = 'icons/obj/power.dmi'
|
icon = 'icons/obj/power.dmi'
|
||||||
icon_state = "cell"
|
icon_state = "cell"
|
||||||
item_to_spawn()
|
item_to_spawn()
|
||||||
return pick(prob(50);/obj/item/weapon/cell,
|
return pick(prob(40);/obj/item/weapon/cell,
|
||||||
prob(40);/obj/item/weapon/cell/high,
|
prob(25);/obj/item/weapon/cell/device,
|
||||||
|
prob(25);/obj/item/weapon/cell/high,
|
||||||
prob(9);/obj/item/weapon/cell/super,
|
prob(9);/obj/item/weapon/cell/super,
|
||||||
prob(1);/obj/item/weapon/cell/hyper)
|
prob(1);/obj/item/weapon/cell/hyper)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user