mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
RCD ammo can be directly clicked (#21536)
This commit is contained in:
@@ -162,27 +162,28 @@
|
||||
if(user.incapacitated() || !user.Adjacent(src))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/rcd/attackby(obj/item/W, mob/user, params)
|
||||
if(!istype(W, /obj/item/rcd_ammo))
|
||||
return ..()
|
||||
|
||||
var/obj/item/rcd_ammo/R = W
|
||||
if((matter + R.ammoamt) > max_matter)
|
||||
/**
|
||||
*Tries to load ammo into an RCD, borgs will not use this.
|
||||
* Arguments:
|
||||
* * cart - the compressed matter catridge to insert
|
||||
* * user - the user to display the chat messages to
|
||||
*/
|
||||
/obj/item/rcd/proc/load(obj/item/rcd_ammo/cart, mob/living/user)
|
||||
if(matter == max_matter)
|
||||
to_chat(user, "<span class='notice'>The RCD can't hold any more matter-units.</span>")
|
||||
return
|
||||
|
||||
if(!user.unEquip(R))
|
||||
to_chat(user, "<span class='warning'>[R] is stuck to your hand!</span>")
|
||||
return
|
||||
|
||||
matter += R.ammoamt
|
||||
qdel(R)
|
||||
return FALSE
|
||||
matter = clamp((matter + cart.ammoamt), 0, 100)
|
||||
qdel(cart)
|
||||
playsound(loc, 'sound/machines/click.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>The RCD now holds [matter]/[max_matter] matter-units.</span>")
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
SStgui.update_uis(src)
|
||||
|
||||
/obj/item/rcd/attackby(obj/item/W, mob/user, params)
|
||||
if(!istype(W, /obj/item/rcd_ammo))
|
||||
return ..()
|
||||
var/obj/item/rcd_ammo/R = W
|
||||
load(R, user)
|
||||
/**
|
||||
* Creates and displays a radial menu to a user when they trigger the `attack_self` of the RCD.
|
||||
*
|
||||
@@ -690,6 +691,12 @@
|
||||
materials = list(MAT_METAL=16000, MAT_GLASS=8000)
|
||||
var/ammoamt = 20
|
||||
|
||||
/obj/item/rcd_ammo/attackby(obj/item/I, mob/user)
|
||||
if(!istype(I, /obj/item/rcd) || issilicon(user))
|
||||
return ..()
|
||||
var/obj/item/rcd/R = I
|
||||
R.load(src, user)
|
||||
|
||||
/obj/item/rcd_ammo/large
|
||||
ammoamt = 100
|
||||
|
||||
|
||||
Reference in New Issue
Block a user