Refactors is_hot and fixes some issues from the beaker lighting PR (#22964)

* Idk what I'm doing

* The is_hot refactor

* Fixes that I forgot to push before making the PR

* Update code/game/objects/items.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Contra review

* TODO: Find out why this isn't working

* Removes the signal stuff for now, this works

* Fixes it all

* Add new signal

* Update code/_onclick/item_attack.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* Contra reivew

* Ayyy it works

* Merge master

* Forgot this one

* Update code/game/machinery/doors/airlock_types.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/objects/structures/mineral_doors.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/turfs/simulated/floor/mineral_floors.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/turfs/simulated/walls_mineral.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

---------

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
This commit is contained in:
DGamerL
2023-12-11 16:53:51 +00:00
committed by GitHub
co-authored by Burzah Contrabang
parent cbc45c1336
commit 004d7d10b7
29 changed files with 77 additions and 84 deletions
+4 -1
View File
@@ -42,7 +42,7 @@
return TRUE
/obj/item/candle/attackby(obj/item/W, mob/user, params)
if(is_hot(W))
if(W.get_heat())
light("<span class='notice'>[user] lights [src] with [W].</span>")
return
return ..()
@@ -152,6 +152,9 @@
infinite = FALSE
wax = 1 // next process will burn it out
/obj/item/candle/get_heat()
return lit * 1000
#undef TALL_CANDLE
#undef MID_CANDLE
#undef SHORT_CANDLE
@@ -230,6 +230,9 @@
return TRUE
return ..()
/obj/item/flashlight/flare/get_heat()
return produce_heat * on * 1000
// GLOWSTICKS
/obj/item/flashlight/flare/glowstick
+2 -2
View File
@@ -13,7 +13,7 @@
/obj/item/flag/attackby(obj/item/W, mob/user, params)
. = ..()
if(is_hot(W) && !(resistance_flags & ON_FIRE))
if(W.get_heat() && !(resistance_flags & ON_FIRE))
user.visible_message("<span class='notice'>[user] lights [src] with [W].</span>", "<span class='notice'>You light [src] with [W].</span>", "<span class='warning'>You hear a low whoosh.</span>")
fire_act()
@@ -259,7 +259,7 @@
log_game("[key_name(user)] has hidden [I] in [src] ready for detonation at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]).")
investigate_log("[key_name(user)] has hidden [I] in [src] ready for detonation at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]).", INVESTIGATE_BOMB)
add_attack_logs(user, src, "has hidden [I] ready for detonation in", ATKLOG_MOST)
else if(is_hot(I) && !(resistance_flags & ON_FIRE) && boobytrap && trapper)
else if(I.get_heat() && !(resistance_flags & ON_FIRE) && boobytrap && trapper)
var/turf/bombturf = get_turf(src)
var/area/A = get_area(bombturf)
log_game("[key_name_admin(user)] has lit [src] trapped with [boobytrap] by [key_name_admin(trapper)] at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]).")
+1 -1
View File
@@ -61,5 +61,5 @@
var/obj/item/tank/T = W
blow(T, user)
return
if(is_sharp(W) || is_hot(W) || is_pointed(W))
if(is_sharp(W) || W.get_heat() || is_pointed(W))
burst()
@@ -264,7 +264,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list (
return TRUE
/obj/item/stack/sheet/mineral/plasma/attackby(obj/item/I, mob/living/user, params)
if(is_hot(I))
if(I.get_heat())
log_and_set_aflame(user, I)
else
return ..()
+3
View File
@@ -207,6 +207,9 @@
if(reagents.check_and_add("fuel", maximum_fuel, 2 * coeff))
update_icon()
/obj/item/weldingtool/get_heat()
return tool_enabled * 2500
/obj/item/weldingtool/largetank
name = "industrial welding tool"
desc = "A slightly larger welder with a larger tank."
+9
View File
@@ -47,12 +47,19 @@ LIGHTERS ARE IN LIGHTERS.DM
reagents.set_reacting(FALSE) // so it doesn't react until you light it
if(list_reagents)
reagents.add_reagent_list(list_reagents)
RegisterSignal(src, COMSIG_ITEM_BEING_ATTACKED, PROC_REF(can_light))
/obj/item/clothing/mask/cigarette/Destroy()
QDEL_NULL(reagents)
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/clothing/mask/cigarette/proc/can_light(obj/item/cigarette, obj/item/lighting_item)
SIGNAL_HANDLER
if(lighting_item.get_heat())
light()
return COMPONENT_CANCEL_ATTACK_CHAIN
/obj/item/clothing/mask/cigarette/decompile_act(obj/item/matter_decompiler/C, mob/user)
if(isdrone(user))
C.stored_comms["wood"] += 1
@@ -250,6 +257,8 @@ LIGHTERS ARE IN LIGHTERS.DM
STOP_PROCESSING(SSobj, src)
qdel(src)
/obj/item/clothing/mask/cigarette/get_heat()
return lit * 1000
/obj/item/clothing/mask/cigarette/menthol
list_reagents = list("nicotine" = 40, "menthol" = 20)
@@ -125,6 +125,9 @@
item_state = "[initial(item_state)][lit ? "-on" : ""]"
return ..()
/obj/item/lighter/get_heat()
return lit * 1500
// Zippo lighters
/obj/item/lighter/zippo
name = "zippo lighter"
@@ -304,6 +307,9 @@
if(istype(mask_item, /obj/item/clothing/mask/cigarette))
return mask_item
/obj/item/match/get_heat()
return lit * 1000
/obj/item/match/firebrand
name = "firebrand"
desc = "An unlit firebrand. It makes you wonder why it's not just called a stick."
@@ -85,6 +85,9 @@
add_fingerprint(user)
return
/obj/item/melee/energy/get_heat()
return active * 3500
/obj/item/melee/energy/axe
name = "energy axe"
desc = "An energised battle axe."