Files
VOREStation/code/modules/paperwork/paperplane.dm
T
Cameron Lennox d5849910e5 Begin clickcode attack_self fix (#18797)
* Begin clickcode attack_self fix

Begins the work to make everything call back to parent for attack_self so that signals are sacred.

* Makes MORE things call the attack_self() parent

Yes, I could make special_handling a var on obj/item HOWEVER i want it to be specific so it can be tracked down later and ONLY the objects that use it can be refactored instead of sitting there literally forever and it just becoming 'a thing'.

* Finishes making the rest of attack_self call parent.

As mentioned, things such as 'specialty_goggles' 'special_handling' and the such are only there to help with attack_self until the attack_self is recoded for those items.

* begone foul demon

* some more cleanup

* These

* GOD this was annoying

* yeh

* Fix this

* fLARES

* Thesee too

* toys!

* Even more!

* More fixes

* Even more

* rest of em

* these too

* Update syndie.dm

* hardref clear

* Update code/game/gamemodes/nuclear/pinpointer.dm

* Update code/game/objects/effects/mines.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/contraband_vr.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/weapons/gift_wrappaper.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* these too

* Update maintpanel_stack.dm

* angry warning

* Fixes packaged snacks.

Fixes improper var default.

* Special handling for these

* proper poly types

* Fixes magclaws

Makes the 'features' it had just part  of base magboots that can be adjusted via varswap.

* Fixes jackets

Fixes https://github.com/VOREStation/VOREStation/issues/18941

* Small bugfix

Makes p_Theyre properly capitialize
Makes examine show proper wording

* Update gift_wrappaper.dm
2025-12-29 13:21:10 -05:00

109 lines
3.4 KiB
Plaintext

// Ported from TG. Known issue: Throw hit can possibly double-proc. Seems to be throw code.
/obj/item/paperplane
name = "paper plane"
desc = "Paper folded into the shape of a plane."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "paperplane"
throw_range = 7
throw_speed = 1
throwforce = 0
w_class = ITEMSIZE_TINY
var/obj/item/paper/internalPaper
/obj/item/paperplane/Initialize(mapload, obj/item/paper/newPaper)
. = ..()
pixel_y = rand(-8, 8)
pixel_x = rand(-9, 9)
if(newPaper)
internalPaper = newPaper
flags = newPaper.flags
color = newPaper.color
if(isstorage(newPaper.loc))
var/obj/item/storage/S = newPaper.loc
S.remove_from_storage(newPaper, src)
else
newPaper.forceMove(src)
else
internalPaper = new /obj/item/paper(src)
update_icon()
/obj/item/paperplane/Destroy()
if(internalPaper)
qdel(internalPaper)
internalPaper = null
return ..()
/obj/item/paperplane/update_icon()
cut_overlays()
var/list/stamped = internalPaper.stamped
if(!stamped)
stamped = new
else if(stamped)
for(var/obj/item/stamp/stamp as anything in stamped)
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi', "paperplane_[initial(stamp.icon_state)]")
add_overlay(stampoverlay)
/obj/item/paperplane/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
to_chat(user, span_notice("You unfold [src]."))
var/atom/movable/internal_paper_tmp = internalPaper
internal_paper_tmp.forceMove(loc)
internalPaper = null
qdel(src)
user.put_in_hands(internal_paper_tmp)
/obj/item/paperplane/attackby(obj/item/P, mob/living/carbon/human/user, params)
..()
if(istype(P, /obj/item/pen))
to_chat(user, span_notice("You should unfold [src] before changing it."))
return
else if(istype(P, /obj/item/stamp)) //we don't randomize stamps on a paperplane
internalPaper.attackby(P, user) //spoofed attack to update internal paper.
update_icon()
else if(is_hot(P))
if(user.disabilities & CLUMSY && prob(10))
user.visible_message(span_warning("[user] accidentally ignites themselves!"), \
span_userdanger("You miss the [src] and accidentally light yourself on fire!"))
user.unEquip(P)
user.adjust_fire_stacks(1)
user.ignite_mob()
return
if(!(in_range(user, src))) //to prevent issues as a result of telepathically lighting a paper
return
user.unEquip(src)
user.visible_message(span_danger("[user] lights [src] ablaze with [P]!"), span_danger("You light [src] on fire!"))
fire_act()
add_fingerprint(user)
/obj/item/paperplane/throw_impact(atom/hit_atom)
if(..() || !ishuman(hit_atom))//if the plane is caught or it hits a nonhuman
return
var/mob/living/carbon/human/H = hit_atom
if(prob(2))
if((H.head && H.head.body_parts_covered & EYES) || (H.wear_mask && H.wear_mask.body_parts_covered & EYES) || (H.glasses && H.glasses.body_parts_covered & EYES))
return
visible_message(span_danger("\The [src] hits [H] in the eye!"))
H.eye_blurry += 10
var/obj/item/organ/internal/eyes/E = H.internal_organs_by_name[O_EYES]
if(E)
E.damage += 2.5
H.emote("scream")
/obj/item/paper/click_alt(mob/living/carbon/user, obj/item/I)
if ( istype(user) )
if( (!in_range(src, user)) || user.stat || user.restrained() )
return
to_chat(user, span_notice("You fold [src] into the shape of a plane!"))
user.unEquip(src)
I = new /obj/item/paperplane(user, src)
user.put_in_hands(I)
else
to_chat(user, span_notice(" You lack the dexterity to fold \the [src]. "))