mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Adds checks to ensure target is valid, adds user feedback
This commit is contained in:
@@ -82,9 +82,16 @@
|
||||
if(A.density && usr.Adjacent(A) && !istype(A, /mob))
|
||||
things_to_smash_on += A
|
||||
|
||||
var/choice = input("Select what you want to smash the bottle on.") as null|anything in things_to_smash_on
|
||||
var/atom/choice = input("Select what you want to smash the bottle on.") as null|anything in things_to_smash_on
|
||||
if(!choice)
|
||||
return
|
||||
if(!(choice.density && usr.Adjacent(choice)))
|
||||
usr << "<span class='warning'>You must stay close to your target! You moved away from \the [choice]</span>"
|
||||
return
|
||||
|
||||
usr.put_in_hands(src.smash(usr.loc, choice))
|
||||
usr.visible_message("<span class='danger'>[usr] smashed the bottle on [choice]!</span>")
|
||||
usr.visible_message("<span class='danger'>\The [usr] smashed \the [src] on \the [choice]!</span>")
|
||||
usr << "<span class='danger'>You smash \the [src] on \the [choice]!</span>"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/bottle/attackby(obj/item/W, mob/user)
|
||||
if(!rag && istype(W, /obj/item/weapon/reagent_containers/glass/rag))
|
||||
|
||||
Reference in New Issue
Block a user