Paper icon fixes, adds support for objects to have custom fire overlays (#51862)

* Fixes papers constantly adding overlays when on fire

* things

* neediful

* better var name
This commit is contained in:
ShizCalev
2020-06-29 19:16:45 +02:00
committed by GitHub
parent 42dec900da
commit 295f4249b4
10 changed files with 24 additions and 44 deletions
+1 -10
View File
@@ -623,15 +623,6 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
// *** THE ORION TRAIL ** //
/obj/item/gamer_pamphlet
name = "pamphlet - \'Violent Video Games and You\'"
desc = "A pamphlet encouraging the reader to maintain a balanced lifestyle and take care of their mental health, while still enjoying video games in a healthy way. You probably don't need this..."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "pamphlet"
inhand_icon_state = "paper"
w_class = WEIGHT_CLASS_TINY
#define ORION_TRAIL_WINTURN 9
//Orion Trail Events
@@ -756,7 +747,7 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
if(gamers[gamer] == -1)
say("WARNING: Continued antisocial behavior detected: Dispensing self-help literature.")
new /obj/item/gamer_pamphlet(get_turf(src))
new /obj/item/paper/pamphlet/violent_video_games(drop_location())
gamers[gamer]--
return
+3 -1
View File
@@ -33,6 +33,8 @@
var/req_access_txt = "0"
var/list/req_one_access
var/req_one_access_txt = "0"
/// Custom fire overlay icon
var/custom_fire_overlay
var/renamedByPlayer = FALSE //set when a player uses a pen on a renamable object
@@ -342,7 +344,7 @@
if(acid_level)
. += GLOB.acid_overlay
if(resistance_flags & ON_FIRE)
. += GLOB.fire_overlay
. += custom_fire_overlay ? custom_fire_overlay : GLOB.fire_overlay
/// Handles exposing an object to reagents.
/obj/expose_reagents(list/reagents, datum/reagents/source, method=TOUCH, volume_modifier=1, show_message=TRUE)
@@ -402,6 +402,7 @@
/obj/item/paper/guides/antag/abductor
name = "Dissection Guide"
icon_state = "alienpaper_words"
show_written_words = FALSE
info = {"<b>Dissection for Dummies</b><br>
<br>
@@ -421,10 +422,6 @@
<br>
Congratulations! You are now trained for invasive xenobiology research!"}
/obj/item/paper/guides/antag/abductor/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/item/paper/guides/antag/abductor/AltClick()
return //otherwise it would fold into a paperplane.
+7 -5
View File
@@ -1,6 +1,13 @@
/obj/item/paper/pamphlet
name = "pamphlet"
icon_state = "pamphlet"
show_written_words = FALSE
/obj/item/paper/pamphlet/violent_video_games
name = "pamphlet - \'Violent Video Games and You\'"
desc = "A pamphlet encouraging the reader to maintain a balanced lifestyle and take care of their mental health, while still enjoying video games in a healthy way. You probably don't need this..."
info = "They don't make you kill people. There, we said it. Now get back to work!"
/obj/item/paper/pamphlet/gateway
info = "<b>Welcome to the Nanotrasen Gateway project...</b><br>\
@@ -33,8 +40,3 @@
As a participant in the Nanotrasen Gateway Project, you will be on the frontiers of space. \
Though complete safety is assured, participants are advised to prepare for inhospitable \
environs."
//we don't want the silly text overlay!
/obj/item/paper/pamphlet/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
@@ -212,7 +212,7 @@
desc = "This isn't just rum, oh no. It's practically GRIFF in a bottle."
icon_state = "rumbottle"
list_reagents = list(/datum/reagent/consumable/ethanol/rum = 100)
/obj/item/reagent_containers/food/drinks/bottle/maltliquor
name = "\improper Rabid Bear malt liquor"
desc = "A 40 full of malt liquor. Kicks stronger than, well, a rabid bear."
@@ -528,7 +528,7 @@
log_bomber(user, "has primed a", src, "for detonation")
to_chat(user, "<span class='info'>You light [src] on fire.</span>")
add_overlay(GLOB.fire_overlay)
add_overlay(custom_fire_overlay ? custom_fire_overlay : GLOB.fire_overlay)
if(!isGlass)
addtimer(CALLBACK(src, .proc/explode), 5 SECONDS)
@@ -550,7 +550,7 @@
to_chat(user, "<span class='danger'>The flame's spread too far on it!</span>")
return
to_chat(user, "<span class='info'>You snuff out the flame on [src].</span>")
cut_overlay(GLOB.fire_overlay)
cut_overlay(custom_fire_overlay ? custom_fire_overlay : GLOB.fire_overlay)
active = 0
/obj/item/reagent_containers/food/drinks/bottle/pruno
-1
View File
@@ -924,7 +924,6 @@
var/obj/item/I = X
I.acid_level = 0 //washes off the acid on our clothes
I.extinguish() //extinguishes our clothes
I.cut_overlay(GLOB.fire_overlay, TRUE)
..()
/mob/living/carbon/fakefire(var/fire_icon = "Generic_mob_burning")
@@ -650,7 +650,6 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians
/obj/item/paper/guides/antag/guardian
name = "Holoparasite Guide"
icon_state = "paper_words"
info = {"<b>A list of Holoparasite Types</b><br>
<br>
@@ -674,10 +673,6 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians
<br>
"}
/obj/item/paper/guides/antag/guardian/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/item/paper/guides/antag/guardian/wizard
name = "Guardian Guide"
info = {"<b>A list of Guardian Types</b><br>
+1
View File
@@ -2,6 +2,7 @@
name = "sheet of carbon"
icon_state = "paper_stack"
inhand_icon_state = "paper"
show_written_words = FALSE
var/copied = FALSE
var/iscopy = FALSE
+7 -15
View File
@@ -61,6 +61,7 @@
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "paper"
inhand_icon_state = "paper"
custom_fire_overlay = "paper_onfire_overlay"
throwforce = 0
w_class = WEIGHT_CLASS_TINY
throw_range = 1
@@ -77,6 +78,7 @@
color = "white"
/// What's actually written on the paper.
var/info = ""
var/show_written_words = TRUE
/// The (text for the) stamps on the paper.
var/list/stamps /// Positioning for the stamp in tgui
@@ -158,17 +160,12 @@
. = ..()
pixel_y = rand(-8, 8)
pixel_x = rand(-9, 9)
update_icon_state()
update_icon()
/obj/item/paper/update_icon_state()
if(resistance_flags & ON_FIRE)
icon_state = "paper_onfire"
return
if(info)
icon_state = "paper_words"
return
icon_state = "paper"
if(info && show_written_words)
icon_state = "[initial(icon_state)]_words"
/obj/item/paper/ui_base_html(html)
/// This might change in a future PR
@@ -304,16 +301,10 @@
/obj/item/paper/fire_act(exposed_temperature, exposed_volume)
..()
. = ..()
if(!(resistance_flags & FIRE_PROOF))
add_overlay("paper_onfire_overlay")
info = "[stars(info)]"
/obj/item/paper/extinguish()
..()
cut_overlay("paper_onfire_overlay")
/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)
ui_key = "main-[REF(user)]"
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
@@ -462,6 +453,7 @@
name = "paper scrap"
icon_state = "scrap"
slot_flags = null
show_written_words = FALSE
/obj/item/paper/crumpled/update_icon_state()
return
+1
View File
@@ -3,6 +3,7 @@
desc = "Paper, folded in the shape of a plane."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "paperplane"
custom_fire_overlay = "paperplane_onfire"
throw_range = 7
throw_speed = 1
throwforce = 0