Merge pull request #12646 from Chiirno/emi

[READY] Alt-click cigarette pack functionality added to pill bottles.
This commit is contained in:
silicons
2020-07-20 16:15:38 -07:00
committed by GitHub
17 changed files with 50 additions and 31 deletions
@@ -466,7 +466,7 @@
/obj/effect/spawner/lootdrop/cigars_cases/no_turf = 2,
/obj/effect/spawner/lootdrop/space_cash/no_turf = 5,
/obj/item/reagent_containers/food/snacks/grown/cannabis = 5,
/obj/item/storage/pill_bottle/dice = 5,
/obj/item/storage/box/dice = 5,
/obj/item/toy/cards/deck = 5,
/obj/effect/spawner/lootdrop/druggie_pill/no_turf = 5
)
@@ -485,7 +485,7 @@
/obj/effect/spawner/lootdrop/cig_packs/no_turf = 10,
/obj/effect/spawner/lootdrop/cigars_cases/no_turf = 5,
/obj/item/reagent_containers/food/snacks/grown/cannabis = 5,
/obj/item/storage/pill_bottle/dice = 5,
/obj/item/storage/box/dice = 5,
/obj/item/toy/cards/deck = 5,
/obj/effect/spawner/lootdrop/druggie_pill/no_turf = 5,
/obj/item/kitchen/knife = 5,
+1 -1
View File
@@ -93,7 +93,7 @@ RSF
use_matter(50, user)
if(4)
to_chat(user, "Dispensing Dice Pack...")
new /obj/item/storage/pill_bottle/dice(T)
new /obj/item/storage/box/dice(T)
use_matter(200, user)
if(5)
to_chat(user, "Dispensing Cigarette...")
+3 -3
View File
@@ -1,10 +1,10 @@
/obj/item/storage/pill_bottle/dice
/obj/item/storage/box/dice
name = "bag of dice"
desc = "Contains all the luck you'll ever need."
icon = 'icons/obj/dice.dmi'
icon_state = "dicebag"
/obj/item/storage/pill_bottle/dice/Initialize()
/obj/item/storage/box/dice/Initialize()
. = ..()
var/special_die = pick("1","2","fudge","space","00","8bd20","4dd6","100")
if(special_die == "1")
@@ -30,7 +30,7 @@
if(special_die == "100")
new /obj/item/dice/d100(src)
/obj/item/storage/pill_bottle/dice/suicide_act(mob/user)
/obj/item/storage/box/dice/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is gambling with death! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (OXYLOSS)
@@ -229,6 +229,25 @@
STR.click_gather = TRUE
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/pill, /obj/item/dice))
/obj/item/storage/pill_bottle/AltClick(mob/living/carbon/user)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
if(!length(user.get_empty_held_indexes()))
to_chat(user, "<span class='warning'>Your hands are full!</span>")
return
var/obj/item/reagent_containers/pill/P = locate() in contents
if(P)
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, P, user)
if(!user.put_in_hands(P))
P.forceMove(user.drop_location()) // make sure it's not stuck in the user if the put in hands somehow fails
to_chat(user, "<span class='warning'>[P] drops to the floor!</span>")
else
to_chat(user, "<span class='notice'>You take \a [P] out of [src].</span>")
else
to_chat(user, "<span class='notice'>There are no pills left in the bottle.</span>")
return TRUE
/obj/item/storage/pill_bottle/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is trying to get the cap off [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (TOXLOSS)