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.
This commit is contained in:
Alan
2026-05-17 14:42:16 -04:00
committed by GitHub
parent e68d074a01
commit 1a725b9708
2 changed files with 29 additions and 18 deletions
+1
View File
@@ -71,6 +71,7 @@
/obj/item/paper/examine(mob/user)
. = ..()
. += SPAN_NOTICE("<b>Alt-Click</b> [src] with a pen in hand to rename it.")
. += SPAN_NOTICE("<b>Alt-Click</b> [src] inhand to fold it into an airplane.")
if(user.is_literate())
if(in_range(user, src) || isobserver(user))
show_content(user)
+28 -18
View File
@@ -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]."))