From d1a8f5f9d5317f8e575957156ba8de06e332f3c1 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 24 Jul 2026 15:36:15 -0400 Subject: [PATCH] Migrate nanopaper tickets to the new attack chain. (#32328) * Migrate nanopaper tickets to the new attack chain. * Apply suggestion from CRUNCH review. Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Signed-off-by: Alan --------- Signed-off-by: Alan Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> --- code/modules/paperwork/ticketmachine.dm | 49 ++++++++++++++++++------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/code/modules/paperwork/ticketmachine.dm b/code/modules/paperwork/ticketmachine.dm index 65c1b767376..e0be040b4bf 100644 --- a/code/modules/paperwork/ticketmachine.dm +++ b/code/modules/paperwork/ticketmachine.dm @@ -203,26 +203,47 @@ resistance_flags = FLAMMABLE max_integrity = 50 var/saved_maptext = null - var/owner //soft ref of the ticket owner's UID() + /// Soft ref of the ticket owner's `UID()`. + var/owner + /// Ticket machine that spawned this ticket. var/obj/machinery/ticket_machine/source + /// The number that determines when the HoP will see you. var/ticket_number + new_attack_chain = TRUE /obj/item/ticket_machine_ticket/attack_hand(mob/user) . = ..() - maptext = saved_maptext //For some reason, storage code removes all maptext off objs, this stops its number from being wiped off when taken out of storage. + maptext = saved_maptext // For some reason, storage code removes all maptext off objs, this stops its number from being wiped off when taken out of storage. -/obj/item/ticket_machine_ticket/attackby__legacy__attackchain(obj/item/P, mob/living/carbon/human/user, params) //Stolen from papercode - ..() - if(P.get_heat()) - if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10)) - user.visible_message(SPAN_WARNING("[user] accidentally ignites [user.p_themselves()]!"), \ - SPAN_USERDANGER("You miss the paper and accidentally light yourself on fire!")) - user.drop_item() - user.adjust_fire_stacks(1) - user.IgniteMob() - return - user.visible_message(SPAN_DANGER("[user] lights [src] ablaze with [P]!"), SPAN_DANGER("You light [src] on fire!")) - fire_act() +/obj/item/ticket_machine_ticket/item_interaction(mob/living/user, obj/item/used, list/modifiers) // Stolen from paper code. + . = ..() + if(resistance_flags & ON_FIRE) + to_chat(user, SPAN_WARNING("[src] is on fire!")) + return ITEM_INTERACT_COMPLETE + + if(!used.get_heat()) + return + + if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10)) + user.visible_message( + SPAN_WARNING("[user] accidentally ignites [user.p_themselves()]!"), + SPAN_USERDANGER("You miss [src] and accidentally light yourself on fire!") + ) + user.drop_item_to_ground(used) + user.adjust_fire_stacks(1) + user.IgniteMob() + return ITEM_INTERACT_COMPLETE + + if(!Adjacent(user)) // To prevent issues as a result of telepathically lighting a ticket. + return ITEM_INTERACT_COMPLETE + + user.drop_item_to_ground(src) + user.visible_message( + SPAN_DANGER("[user] lights [src] ablaze with [used]!"), + SPAN_DANGER("You light [src] on fire!") + ) + fire_act() + return ITEM_INTERACT_COMPLETE /obj/item/paper/extinguish() ..()