Somatoray Buff, initial commit

This adds micro laser stock parts as a component to floral somatorays.
This commit is contained in:
FartMaster69420
2021-11-16 01:24:30 -05:00
parent 47c8115916
commit b0804eed80
@@ -47,7 +47,9 @@
modifystate = "floramut"
cell_type = /obj/item/weapon/cell/device/weapon/recharge
battery_lock = 1
var/decl/plantgene/gene = null
var/obj/item/weapon/stock_parts/micro_laser/emitter
firemodes = list(
list(mode_name="induce mutations", projectile_type=/obj/item/projectile/energy/floramut, modifystate="floramut"),
@@ -55,8 +57,44 @@
list(mode_name="induce specific mutations", projectile_type=/obj/item/projectile/energy/floramut/gene, modifystate="floramut"),
)
/obj/item/weapon/gun/energy/floragun/Initialize()
. = ..()
emitter = new(src)
/obj/item/weapon/gun/energy/floragun/examine(var/mob/user)
. = ..()
if(Adjacent(user))
. += "It has [emitter ? emitter : "no micro laser"] installed."
/obj/item/weapon/gun/energy/floragun/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/stock_parts/micro_laser))
if(!emitter)
user.drop_item()
W.loc = src
emitter = W
to_chat(user, "<span class='notice'>You install a [emitter.name] in [src].</span>")
else
to_chat(user, "<span class='notice'>[src] already has a laser.</span>")
else if(W.is_screwdriver())
if(emitter)
to_chat(user, "<span class='notice'>You remove the [emitter.name] from the [src].</span>")
emitter.loc = get_turf(src.loc)
playsound(src, W.usesound, 50, 1)
emitter = null
return
else
to_chat(user, "<span class='notice'>There is no micro laser in this [src].</span>")
return
..()
return
/obj/item/weapon/gun/energy/floragun/afterattack(obj/target, mob/user, adjacent_flag)
//allow shooting into adjacent hydrotrays regardless of intent
if(!emitter)
to_chat(user, "<span class='notice'>The [src] has no laser! </span>")
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
return
if(adjacent_flag && istype(target,/obj/machinery/portable_atmospherics/hydroponics))
user.visible_message("<span class='danger'>\The [user] fires \the [src] into \the [target]!</span>")
Fire(target,user)