diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index e2c841e2b9..486b735018 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -245,7 +245,17 @@ return if (R in coin_records) - del(coin) + if(!coin) + usr << "\blue You need to insert a coin to get this item." + return + if(coin.string_attached) + if(prob(50)) + usr << "\blue You successfully pull the coin out before the [src] could swallow it." + else + usr << "\blue You weren't able to pull the coin out fast enough, the machine ate it, string and all." + del(coin) + else + del(coin) R.amount-- diff --git a/code/modules/mining/ores_materials_coins.dm b/code/modules/mining/ores_materials_coins.dm index 4ee80e3a1d..a2ac8920f4 100644 --- a/code/modules/mining/ores_materials_coins.dm +++ b/code/modules/mining/ores_materials_coins.dm @@ -98,6 +98,7 @@ force = 0.0 throwforce = 0.0 w_class = 1.0 + var/string_attached /obj/item/weapon/coin/New() pixel_x = rand(0,16)-8 @@ -135,6 +136,34 @@ name = "Adamantine coin" icon_state = "coin_adamantine" +/obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W,/obj/item/weapon/cable_coil) ) + var/obj/item/weapon/cable_coil/CC = W + if(string_attached) + user << "\blue There already is a string attached to this coin." + return + + if(CC.amount <= 0) + user << "\blue This cable coil appears to be empty." + del(CC) + return + + overlays += image('items.dmi',"coin_string_overlay") + string_attached = 1 + user << "\blue You attach a string to the coin." + CC.use(1) + else if(istype(W,/obj/item/weapon/wirecutters) ) + if(!string_attached) + ..() + return + + var/obj/item/weapon/cable_coil/CC = new/obj/item/weapon/cable_coil(user.loc) + CC.amount = 1 + CC.updateicon() + overlays = list() + string_attached = null + user << "\blue You detach the string from the coin." + else ..() /******************************Materials****************************/ diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi index 7cec8440e6..2957ed198c 100644 Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ