mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 20:20:33 +01:00
Fixes some issues with paper planes (#81453) 1. paper's examine was defined twice, which made spacemandmm throw a minor notice about 2. paper's altclick had a second arg for some item, which would never be the case because that's not a real arg 3. there was a check for src's type, now just removed to the type's altclick 4. some papercode was sitting in paper plane code file, now moved the rest is misc changes such as replacing camelCase and using SECONDS. None of this is player-facing but it's updating some rather old code to more modern code standards. Nothing player-facing. --------- Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com> Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
52 lines
1.3 KiB
Plaintext
52 lines
1.3 KiB
Plaintext
/obj/item/paper/carbon
|
|
name = "sheet of carbon"
|
|
icon_state = "paper_stack"
|
|
inhand_icon_state = "paper"
|
|
show_written_words = FALSE
|
|
var/copied = FALSE
|
|
|
|
/obj/item/paper/carbon/update_icon_state()
|
|
if(copied)
|
|
icon_state = "paper"
|
|
else
|
|
icon_state = "paper_stack"
|
|
if(get_total_length())
|
|
icon_state = "[icon_state]_words"
|
|
return ..()
|
|
|
|
/obj/item/paper/carbon/examine()
|
|
. = ..()
|
|
if(copied)
|
|
return
|
|
. += span_notice("Right-click to tear off the carbon-copy (you must use both hands).")
|
|
|
|
/obj/item/paper/carbon/AltClick(mob/living/user)
|
|
if(!copied)
|
|
to_chat(user, span_notice("Take off the carbon copy first."))
|
|
return
|
|
return ..()
|
|
|
|
/obj/item/paper/carbon/proc/removecopy(mob/living/user)
|
|
if(copied)
|
|
to_chat(user, span_notice("There are no more carbon copies attached to this paper!"))
|
|
return
|
|
|
|
var/obj/item/paper/carbon/copy = copy(/obj/item/paper/carbon_copy, loc.drop_location(), FALSE)
|
|
copy.name = "\improper Copy - [name]"
|
|
to_chat(user, span_notice("You tear off the carbon-copy!"))
|
|
copied = TRUE
|
|
update_icon_state()
|
|
user.put_in_hands(copy)
|
|
|
|
/obj/item/paper/carbon/attack_hand_secondary(mob/user, list/modifiers)
|
|
. = ..()
|
|
if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
|
|
return
|
|
|
|
if(loc == user && user.is_holding(src))
|
|
removecopy(user)
|
|
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
|
|
|
/obj/item/paper/carbon_copy
|
|
icon_state = "cpaper"
|