diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 46993431036..b61a5deb6bc 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -862,6 +862,7 @@ GLOBAL_LIST_EMPTY(allCasters) righthand_file = 'icons/mob/inhands/misc/books_righthand.dmi' w_class = WEIGHT_CLASS_SMALL attack_verb = list("bapped") + resistance_flags = FLAMMABLE var/screen = 0 var/pages = 0 var/curr_page = 0 @@ -1008,7 +1009,10 @@ GLOBAL_LIST_EMPTY(allCasters) if(ismob(loc)) attack_self(loc) -/obj/item/newspaper/attackby(obj/item/W, mob/user, params) +/obj/item/newspaper/attackby(obj/item/W, mob/living/user, params) + if(burn_paper_product_attackby_check(W, user)) + return + if(istype(W, /obj/item/pen)) if(!user.is_literate()) to_chat(user, "You scribble illegibly on [src]!") @@ -1024,5 +1028,6 @@ GLOBAL_LIST_EMPTY(allCasters) scribble_page = curr_page scribble = s attack_self(user) + add_fingerprint(user) else return ..() diff --git a/code/game/objects/items/miscellaneous.dm b/code/game/objects/items/miscellaneous.dm index 15436bfeb53..2fde0d20022 100644 --- a/code/game/objects/items/miscellaneous.dm +++ b/code/game/objects/items/miscellaneous.dm @@ -173,14 +173,10 @@ #define NICKNAME_CAP (MAX_NAME_LEN/2) /obj/item/virgin_mary/attackby(obj/item/W, mob/user, params) . = ..() - var/ignition_msg = W.ignition_effect(src, user) - if(!ignition_msg) - return if(resistance_flags & ON_FIRE) return - user.dropItemToGround(src) - user.visible_message("[user] lights [src] ablaze with [W]!", "You light [src] on fire!") - fire_act() + if(!burn_paper_product_attackby_check(W, user, TRUE)) + return if(used_up) return if(!isliving(user) || !user.mind) //A sentient mob needs to be burning it, ya cheezit. @@ -205,7 +201,7 @@ joe.real_name = new_name used_up = TRUE mob_mobs += joe - joe.say("My soul will burn like this saint if I betray my familiy. I enter alive and I will have to get out dead.", forced = /obj/item/virgin_mary) + joe.say("My soul will burn like this saint if I betray my family. I enter alive and I will have to get out dead.", forced = /obj/item/virgin_mary) to_chat(joe, "Being inducted into the mafia does not grant antagonist status.") #undef NICKNAME_CAP diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index 4a8f6b72ac5..1fb74e1164d 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -35,6 +35,8 @@ /obj/item/folder/attackby(obj/item/W, mob/user, params) + if(burn_paper_product_attackby_check(W, user)) + return if(istype(W, /obj/item/paper) || istype(W, /obj/item/photo) || istype(W, /obj/item/documents)) if(!user.transferItemToLoc(W, src)) return diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 0d6504349c3..51df052f895 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -243,7 +243,31 @@ ui_interact(user, "main", null, FALSE, null, state) -/obj/item/paper/attackby(obj/item/P, mob/living/carbon/human/user, params) +/obj/item/proc/burn_paper_product_attackby_check(obj/item/I, mob/living/user, bypass_clumsy) + var/ignition_message = I.ignition_effect(src, user) + if(!ignition_message) + return + . = TRUE + if(!bypass_clumsy && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10) && Adjacent(user)) + user.visible_message("[user] accidentally ignites [user.p_them()]self!", \ + "You miss [src] and accidentally light yourself on fire!") + if(user.is_holding(I)) //checking if they're holding it in case TK is involved + user.dropItemToGround(I) + user.adjust_fire_stacks(1) + user.IgniteMob() + return + + if(user.is_holding(src)) //no TK shit here. + user.dropItemToGround(src) + user.visible_message(ignition_message) + add_fingerprint(user) + fire_act(I.get_temperature()) + +/obj/item/paper/attackby(obj/item/P, mob/living/user, params) + if(burn_paper_product_attackby_check(P, user)) + close_all_ui() + return + if(istype(P, /obj/item/pen) || istype(P, /obj/item/toy/crayon)) if(length(info) >= MAX_PAPER_LENGTH) // Sheet must have less than 1000 charaters to_chat(user, "This sheet of paper is full!") @@ -278,31 +302,18 @@ create_ui(user, state) return /// Normaly you just stamp, you don't need to read the thing - else if(P.get_temperature()) - if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10)) - user.visible_message("[user] accidentally ignites [user.p_them()]self!", \ - "You miss the paper and accidentally light yourself on fire!") - user.dropItemToGround(P) - user.adjust_fire_stacks(1) - user.IgniteMob() - return - - user.dropItemToGround(src) - user.visible_message("[user] lights [src] ablaze with [P]!", "You light [src] on fire!") - close_all_ui() - fire_act() else // cut paper? the sky is the limit! var/datum/ui_state/default/paper_state/state = new state.edit_mode = MODE_READING create_ui(user, state) // The other ui will be created with just read mode outside of this - . = ..() + return ..() /obj/item/paper/fire_act(exposed_temperature, exposed_volume) . = ..() - if(!(resistance_flags & FIRE_PROOF)) + if(.) info = "[stars(info)]" /obj/item/paper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/default/paper_state/state = new) diff --git a/code/modules/paperwork/paper_cutter.dm b/code/modules/paperwork/paper_cutter.dm index f3d0768abcc..50a27914f62 100644 --- a/code/modules/paperwork/paper_cutter.dm +++ b/code/modules/paperwork/paper_cutter.dm @@ -113,6 +113,12 @@ resistance_flags = FLAMMABLE max_integrity = 50 +/obj/item/paperslip/attackby(obj/item/I, mob/living/user, params) + if(burn_paper_product_attackby_check(I, user)) + return + return ..() + + /obj/item/paperslip/Initialize() . = ..() pixel_x = rand(-5, 5) diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm index 9b2bfcd63ce..7fed4f02e13 100644 --- a/code/modules/paperwork/paperplane.dm +++ b/code/modules/paperwork/paperplane.dm @@ -78,7 +78,8 @@ user.put_in_hands(internal_paper_tmp) /obj/item/paperplane/attackby(obj/item/P, mob/living/carbon/human/user, params) - ..() + if(burn_paper_product_attackby_check(P, user)) + return if(istype(P, /obj/item/pen) || istype(P, /obj/item/toy/crayon)) to_chat(user, "You should unfold [src] before changing it!") return @@ -86,23 +87,10 @@ 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() + add_fingerprint(user) + return - else if(P.get_temperature()) - if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10)) - user.visible_message("[user] accidentally ignites [user.p_them()]self!", \ - "You miss [src] and accidentally light yourself on fire!") - user.dropItemToGround(P) - user.adjust_fire_stacks(1) - user.IgniteMob() - return - - if(!(in_range(user, src))) //to prevent issues as a result of telepathically lighting a paper - return - user.dropItemToGround(src) - user.visible_message("[user] lights [src] ablaze with [P]!", "You light [src] on fire!") - fire_act() - - add_fingerprint(user) + return ..() /obj/item/paperplane/throw_at(atom/target, range, speed, mob/thrower, spin=FALSE, diagonals_first = FALSE, datum/callback/callback, quickstart = TRUE) diff --git a/code/modules/paperwork/ticketmachine.dm b/code/modules/paperwork/ticketmachine.dm index c7f753b287f..a5bd681e8d9 100644 --- a/code/modules/paperwork/ticketmachine.dm +++ b/code/modules/paperwork/ticketmachine.dm @@ -213,17 +213,10 @@ 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(obj/item/P, mob/living/carbon/human/user, params) //Stolen from papercode - ..() - if(P.get_temperature()) - if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10)) - user.visible_message("[user] accidentally ignites [user.p_them()]self!", \ - "You miss the paper and accidentally light yourself on fire!") - user.dropItemToGround(P) - user.adjust_fire_stacks(1) - user.IgniteMob() - return - user.visible_message("[user] lights [src] ablaze with [P]!", "You light [src] on fire!") - fire_act() + if(burn_paper_product_attackby_check(P, user)) + return + + return ..() /obj/item/paper/extinguish() ..() diff --git a/code/modules/photography/photos/photo.dm b/code/modules/photography/photos/photo.dm index 026cefb4283..cdb36cc3789 100644 --- a/code/modules/photography/photos/photo.dm +++ b/code/modules/photography/photos/photo.dm @@ -51,6 +51,8 @@ user.examinate(src) /obj/item/photo/attackby(obj/item/P, mob/user, params) + if(burn_paper_product_attackby_check(P, user)) + return if(istype(P, /obj/item/pen) || istype(P, /obj/item/toy/crayon)) if(!user.is_literate()) to_chat(user, "You scribble illegibly on [src]!") @@ -58,7 +60,8 @@ var/txt = stripped_input(user, "What would you like to write on the back?", "Photo Writing", "", 128) if(txt && user.canUseTopic(src, BE_CLOSE)) scribble = txt - ..() + else + return ..() /obj/item/photo/examine(mob/user) . = ..()