Merge pull request #7544 from Skullyton/Coin_String

Fixes (adds) stringed coin functionality with gashapons and candy machines
This commit is contained in:
clusterfack
2016-01-05 11:50:39 -06:00
3 changed files with 26 additions and 6 deletions

View File

@@ -23,7 +23,6 @@
sleep(rand(10,15))
src.visible_message("<span class='notice'>[src] dispenses a strange sweet!</span>")
new /obj/item/weapon/reagent_containers/food/snacks/sweet/strange(src.loc)
qdel(O)
else
if(user.drop_item(O, src))
user.visible_message("<span class='notice'>[user] puts a coin into [src] and turns the knob.", "<span class='notice'>You put a coin into [src] and turn the knob.</span>")
@@ -31,6 +30,17 @@
sleep(rand(10,15))
src.visible_message("<span class='notice'>[src] dispenses a sweet!</span>")
new /obj/item/weapon/reagent_containers/food/snacks/sweet(src.loc)
if(istype(O, /obj/item/weapon/coin/))
var/obj/item/weapon/coin/real_coin = O
if(real_coin.string_attached)
if(prob(30))
to_chat(user, "<SPAN CLASS='notice'>You were able to force the knob around and successfully pulled the coin out before [src] could swallow it.</SPAN>")
user.put_in_hands(O)
else
to_chat(user, "<SPAN CLASS='notice'>You weren't able to pull the coin out fast enough, the machine ate it, string and all.</SPAN>")
qdel(O)
else
qdel(O)
else if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/customizable/candy/coin))
to_chat(user, "<span class='rose'>That coin is smudgy and oddly soft, you don't think that would work.</span>")

View File

@@ -2,7 +2,7 @@
/obj/machinery/gashapon
name = "Gashapon Machine"
name = "\improper Gashapon Machine"
desc = "Insert coin, recieve capsule!"
icon = 'icons/obj/gashapon.dmi'
icon_state = "gashapon"
@@ -19,8 +19,18 @@
src.visible_message("<span class='notice'>[src] dispenses a capsule!</span>")
var/obj/item/weapon/capsule/b = new(src.loc)
b.icon_state = "capsule[rand(1,12)]"
if(istype(O, /obj/item/weapon/coin/))
var/obj/item/weapon/coin/real_coin = O
if(real_coin.string_attached)
if(prob(30))
to_chat(user, "<SPAN CLASS='notice'>You were able to force the knob around and successfully pulled the coin out before [src] could swallow it.</SPAN>")
user.put_in_hands(O)
else
to_chat(user, "<SPAN CLASS='notice'>You weren't able to pull the coin out fast enough, the machine ate it, string and all.</SPAN>")
qdel(O)
else
qdel(O)
O = null
else if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/customizable/candy/coin))
to_chat(user, "<span class='rose'>That coin is smudgy and oddly soft, you don't think that would work.</span>")
return

View File

@@ -724,7 +724,7 @@
/obj/item/toy/gasha/jani
name = "toy janitor"
desc = "cleanliness is next to godliness!"
desc = "Cleanliness is next to godliness!"
icon_state = "jani"
/obj/item/toy/gasha/miner