mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Moves integrity to the atom level (ported from tgstation/tgstation#61183), and allows turfs to be destroyed in the same way objects can. Many things which destroy walls have been reworked to use the integrity system instead, and walls can now be destroyed through conventional means like hitting them with something strong. They can also be repaired with welding tools while not on harm intent. Reinforced walls are still very strong and require powerful tools or weapons to damage. Also changes some demolition modifiers slightly to fit the new system: emitters have 2.4x, overcharged emitters have 4x, and pulse rifles have 6x. Standard wall - 300 integrity, 20 damage deflection, 60 melee/bullet/laser armor Reinforced wall - 400 integrity, 75 damage deflection, 80 melee/bullet armor, 60 laser armor
84 lines
2.4 KiB
Plaintext
84 lines
2.4 KiB
Plaintext
/datum/component/thermite
|
|
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
|
|
var/amount
|
|
var/overlay
|
|
|
|
var/static/list/blacklist = typecacheof(list(
|
|
/turf/open/lava,
|
|
/turf/open/space,
|
|
/turf/open/water,
|
|
/turf/open/chasm)
|
|
)
|
|
|
|
var/static/list/immunelist = typecacheof(list(
|
|
/turf/closed/wall/mineral/diamond,
|
|
/turf/closed/indestructible,
|
|
/turf/open/indestructible,
|
|
/turf/closed/wall/r_wall)
|
|
)
|
|
|
|
var/static/list/resistlist = typecacheof(
|
|
/turf/closed/wall/mineral
|
|
)
|
|
|
|
/datum/component/thermite/Initialize(_amount)
|
|
if(!istype(parent, /turf) || blacklist[parent.type])
|
|
return COMPONENT_INCOMPATIBLE
|
|
if(immunelist[parent.type])
|
|
_amount*=0 //Yeah the overlay can still go on it and be cleaned but you arent burning down a diamond wall
|
|
if(resistlist[parent.type])
|
|
_amount*=0.25
|
|
|
|
amount = _amount*10
|
|
|
|
var/turf/master = parent
|
|
overlay = mutable_appearance('icons/effects/effects.dmi', "thermite")
|
|
master.add_overlay(overlay)
|
|
|
|
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, PROC_REF(clean_react))
|
|
RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, PROC_REF(attackby_react))
|
|
RegisterSignal(parent, COMSIG_ATOM_FIRE_ACT, PROC_REF(flame_react))
|
|
|
|
/datum/component/thermite/Destroy()
|
|
var/turf/master = parent
|
|
master.cut_overlay(overlay)
|
|
return ..()
|
|
|
|
/datum/component/thermite/InheritComponent(datum/component/thermite/newC, i_am_original, _amount)
|
|
if(!i_am_original)
|
|
return
|
|
if(newC)
|
|
amount += newC.amount
|
|
else
|
|
amount += _amount
|
|
|
|
/datum/component/thermite/proc/thermite_melt(mob/user)
|
|
var/turf/master = parent
|
|
master.cut_overlay(overlay)
|
|
var/obj/effect/overlay/thermite/fakefire = new(master)
|
|
|
|
playsound(master, 'sound/items/welder.ogg', 100, 1)
|
|
|
|
if(amount >= 50)
|
|
var/burning_time = max(100, 100-amount)
|
|
master = master.Melt()
|
|
master.burn_tile()
|
|
if(user)
|
|
master.add_hiddenprint(user)
|
|
QDEL_IN(fakefire, burning_time)
|
|
else
|
|
QDEL_IN(fakefire, 50)
|
|
|
|
/datum/component/thermite/proc/clean_react(datum/source, strength)
|
|
//Thermite is just some loose powder, you could probably clean it with your hands. << todo?
|
|
qdel(src)
|
|
return TRUE
|
|
|
|
/datum/component/thermite/proc/flame_react(datum/source, exposed_temperature, exposed_volume)
|
|
if(exposed_temperature > 1922) // This is roughly the real life requirement to ignite thermite
|
|
thermite_melt()
|
|
|
|
/datum/component/thermite/proc/attackby_react(datum/source, obj/item/thing, mob/user, params)
|
|
if(thing.is_hot())
|
|
thermite_melt(user)
|