From d5ba024e6b5f77034e7044f092159acd0a73a629 Mon Sep 17 00:00:00 2001 From: Fordoxia <143041327+Fordoxia@users.noreply.github.com> Date: Wed, 29 Jan 2025 20:22:04 +0000 Subject: [PATCH 1/2] Update scratch_card.dm --- code/game/objects/items/scratch_card.dm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items/scratch_card.dm b/code/game/objects/items/scratch_card.dm index f498a080acae..a69e6531033f 100644 --- a/code/game/objects/items/scratch_card.dm +++ b/code/game/objects/items/scratch_card.dm @@ -4,6 +4,7 @@ icon = 'icons/obj/economy.dmi' icon_state = "scard" w_class = WEIGHT_CLASS_TINY + new_attack_chain = TRUE /// Has this been scratched yet? var/scratched = FALSE /// The prob chance for it to be the winner card @@ -11,11 +12,12 @@ /// Is this the winner card? var/winner = FALSE -/obj/item/scratch/attackby__legacy__attackchain(obj/item/I, mob/user, params) +/obj/item/scratch/item_interaction(mob/living/user, obj/item/used, list/modifiers) . = ..() if(scratched) return - if(!(istype(I, /obj/item/card) || istype(I, /obj/item/coin))) // We scratch with cards or coins! + + if(!(istype(used, /obj/item/card) || istype(used, /obj/item/coin))) // We scratch with cards or coins! return if(prob(winning_chance)) @@ -28,16 +30,18 @@ playsound(user, 'sound/items/scratching.ogg', 25, TRUE) scratched = TRUE update_icon(UPDATE_ICON_STATE) + return ITEM_INTERACT_COMPLETE -/obj/item/scratch/attack_obj__legacy__attackchain(obj/O, mob/living/user, params) - if(winner && istype(O, /obj/machinery/economy/atm)) +/obj/item/scratch/interact_with_atom(atom/target, mob/living/user, list/modifiers) + if(winner && istype(target, /obj/machinery/economy/atm)) playsound(user, 'sound/machines/ping.ogg', 50, TRUE) - O.atom_say("Congratulations for winning the lottery!") + target.atom_say("Congratulations for winning the lottery!") var/obj/item/reward = new /obj/item/stack/spacecash/c1000 qdel(src) user.put_in_hands(reward) - return - ..() + return ITEM_INTERACT_COMPLETE + + return ..() /obj/item/storage/box/scratch_cards name = "scratch cards box" From 1946ce06eb1b00ff15123b77f3f9650cfeeedd78 Mon Sep 17 00:00:00 2001 From: Fordoxia <143041327+Fordoxia@users.noreply.github.com> Date: Wed, 5 Feb 2025 15:06:33 +0000 Subject: [PATCH 2/2] Update scratch_card.dm --- code/game/objects/items/scratch_card.dm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/code/game/objects/items/scratch_card.dm b/code/game/objects/items/scratch_card.dm index a69e6531033f..0953027eddac 100644 --- a/code/game/objects/items/scratch_card.dm +++ b/code/game/objects/items/scratch_card.dm @@ -33,15 +33,15 @@ return ITEM_INTERACT_COMPLETE /obj/item/scratch/interact_with_atom(atom/target, mob/living/user, list/modifiers) - if(winner && istype(target, /obj/machinery/economy/atm)) - playsound(user, 'sound/machines/ping.ogg', 50, TRUE) - target.atom_say("Congratulations for winning the lottery!") - var/obj/item/reward = new /obj/item/stack/spacecash/c1000 - qdel(src) - user.put_in_hands(reward) - return ITEM_INTERACT_COMPLETE - - return ..() + if(!winner || !istype(target, /obj/machinery/economy/atm)) + return ..() + + playsound(user, 'sound/machines/ping.ogg', 50, TRUE) + target.atom_say("Congratulations for winning the lottery!") + var/obj/item/reward = new /obj/item/stack/spacecash/c1000 + qdel(src) + user.put_in_hands(reward) + return ITEM_INTERACT_COMPLETE /obj/item/storage/box/scratch_cards name = "scratch cards box"