From 1a725b9708847e1c0db55504db64f58e27740ba6 Mon Sep 17 00:00:00 2001 From: Alan Date: Sun, 17 May 2026 14:42:16 -0400 Subject: [PATCH] Migrate paper planes to the new attack chain. (#31997) * Migrate paper planes to the new attack chain. * Call parent in activate_self(). * Add examine hint about folding paper planes. * Add many fingerprints. --- code/modules/paperwork/paper.dm | 1 + code/modules/paperwork/paperplane.dm | 46 +++++++++++++++++----------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index f80e99b32e0..cd2b514b5fd 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -71,6 +71,7 @@ /obj/item/paper/examine(mob/user) . = ..() . += SPAN_NOTICE("Alt-Click [src] with a pen in hand to rename it.") + . += SPAN_NOTICE("Alt-Click [src] inhand to fold it into an airplane.") if(user.is_literate()) if(in_range(user, src) || isobserver(user)) show_content(user) diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm index de35d8c4a68..9d326d0f787 100644 --- a/code/modules/paperwork/paperplane.dm +++ b/code/modules/paperwork/paperplane.dm @@ -12,6 +12,7 @@ var/obj/item/paper/internal_paper scatter_distance = 8 + new_attack_chain = TRUE /obj/item/paperplane/Initialize(mapload, obj/item/paper/new_paper) . = ..() @@ -49,41 +50,48 @@ var/obj/item/stamp = S . += "paperplane_[initial(stamp.icon_state)]" -/obj/item/paperplane/attack_self__legacy__attackchain(mob/user) // Unfold the paper plane +/obj/item/paperplane/activate_self(mob/user) // Unfold the paper plane + if(!user) + return ..() to_chat(user, SPAN_NOTICE("You unfold [src].")) - if(internal_paper) - internal_paper.forceMove(get_turf(src)) - user.put_in_hands(internal_paper) - internal_paper = null - qdel(src) + if(!internal_paper) + return ITEM_INTERACT_COMPLETE + internal_paper.forceMove(get_turf(src)) + user.put_in_hands(internal_paper) + internal_paper.add_fingerprint(user) + internal_paper = null + qdel(src) + return ITEM_INTERACT_COMPLETE -/obj/item/paperplane/attackby__legacy__attackchain(obj/item/P, mob/living/carbon/human/user, params) - ..() - - if(is_pen(P) || istype(P, /obj/item/toy/crayon)) +/obj/item/paperplane/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(is_pen(used) || istype(used, /obj/item/toy/crayon)) to_chat(user, SPAN_NOTICE("You should unfold [src] before changing it.")) - return + return ITEM_INTERACT_COMPLETE - else if(istype(P, /obj/item/stamp)) //we don't randomize stamps on a paperplane - internal_paper.item_interaction(user, P) // spoofed attack to update internal paper. + if(istype(used, /obj/item/stamp)) //we don't randomize stamps on a paperplane + internal_paper.item_interaction(user, used) // spoofed attack to update internal paper. update_icon() + add_fingerprint(user) + return ITEM_INTERACT_COMPLETE - else if(P.get_heat()) + if(used.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 [src] and accidentally light yourself on fire!")) - user.drop_item_to_ground(P) + user.drop_item_to_ground(used) user.adjust_fire_stacks(1) user.IgniteMob() - return + return ITEM_INTERACT_COMPLETE if(!in_range(user, src)) //to prevent issues as a result of telepathically lighting a paper - return + return ITEM_INTERACT_COMPLETE user.drop_item_to_ground(src) - user.visible_message(SPAN_DANGER("[user] lights [src] on fire with [P]!"), SPAN_DANGER("You lights [src] on fire!")) + user.visible_message(SPAN_DANGER("[user] lights [src] on fire with [used]!"), SPAN_DANGER("You lights [src] on fire!")) fire_act() + return ITEM_INTERACT_COMPLETE add_fingerprint(user) + return ..() /obj/item/paperplane/throw_impact(atom/hit_atom) if(..()) @@ -114,5 +122,7 @@ user.unequip(src) // forceMove happens in paperplane/Initialize I = new /obj/item/paperplane(user, src) user.put_in_hands(I) + add_fingerprint(user) + I.add_fingerprint(user) else to_chat(user, SPAN_NOTICE("You lack the dexterity to fold [src]."))