Files
Paradise/code/game/objects/effects/effects.dm
Charlie Nolan d3584b1d1c LINDA -> MILLA (#25328)
* LINDA -> MILLA

* Tiles now change their atmos mode properly.

* Fixed a bug that made walls generate supercold air when deconstructed/destroyed.

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
Signed-off-by: Charlie Nolan <funnyman3595@gmail.com>

* Begone, var!

* MILLA -> milla

* Lint.

* More lint.

* Prevent negative/NaN atmos from spreading.

* Made fires start more reliably.

* Undef what the rest should not see.

* Enums are nice.

* Match LINDA better.

* Debugging verbs.

* Debug verb fixes.

* Labelled more lavaland stuff with ATMOS_MODE_LAVALAND

* Block superconductivity on a couple more things for Lavaland.

* Updated milla.dll

* Lavaland map fixes.

* Missed a spot.

* Begone, var! (again)

* Add libmilla_ci.so for continuous integration tests.

* Install/contributing instructions for MILLA.

* Directional plasmaglass windows on shuttles shouldn't stop protecting from heat after moving.

* Banish bad naming.

* Better naming and debug stats for SSair.

* Apply suggestions from code review

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
Signed-off-by: Charlie Nolan <funnyman3595@gmail.com>

* Magic numbers and formatting.

* Don't screw up the temperature during reactions.

* Efficiency and readability.

* Fix hotspots.

* Removed redundant safety (MILLA will already output an error)

* Optimizations.

* oops

* TGS build script update.

* Change API of gas_mixture and how you get one from a turf.

* Get in there.

* so many vars

* MILLA binary updates.

* Lint

* Made MT cost more honest.

* Gave MILLA a read-only mode.

* More read-only vs synchronized mode work.

* Even more.

* Synchronize disposals.

* Updated a bunch of stuff to use SSair.synchronize or GM.synchronize.

* MILLA <3 Tracy

* lint

* cargo fmt

* more lint

* Test needed MILLA sync.

* Silence atmos machinery that's behaving as intended, but continue objecting to other potential failures to synchronize.

* Push new MILLA DLL

* Build MILLA

* Update PR instructions for MILLA.

* Add some fancy plasmaglass windows to the Lifebringers' ship.

* The golems remembered that they should insulate *all* their engines.

* First round of TM bugfixes.

* Build MILLA

* fix two lavaland ruin turf types

* bunch more maps

* fixes milla ci and makes the interesting turf verb better

* Solid turfs can no longer conduct heat (for now...)

* Made indoor tiles in beach and winter biodomes not lavaland air.

* Re-added random IT teleport, adjusted warning message

* Fixed a tinted window on Lavaland to be a plasglass window instead.

* Made firelocks and holofans heatproof

* Made RPD auto-wrench pipes if you have a wrench in your offhand.

* Runtime fixes.

* Made visuals update more reliably.

* Lint

* Update .github/CONTRIBUTING.md

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
Signed-off-by: Charlie Nolan <funnyman3595@gmail.com>

* Build MILLA

* The Syndicate have installed tiny fans on their research base.

* The syndicate have figured out how to make plastitanium windows heatproof.

* This is getting out of hand. Now there are two of them.

* Un-break the auto-wrenching that I broke before committing.

* Build MILLA

* Build MILLA

* Massive MILLA refactor, assorted bugfixes.

* Build MILLA

* Explicit typing.

* Less sleeping/blocking.

* Build MILLA

* Yes, yes, this part can sleep.

* Build MILLA

* SSair reporting improvements.

* Build MILLA

* Please do not dock twice and splat yourself.

* Build MILLA

* Pls to not make SM go nuts.

* Build MILLA

* Build MILLA

* Added stricter lower bounds on plasmafire, fixing perpetually-burning SM.

* Build MILLA

* Lint

* Temporary logging, begone.

* Build MILLA

* Prevent hotspot strobing.

* Add in radiate_to_spess behavior.

* Build MILLA

* progress

* Compiling is good.

* bugfixes

* Progress.

* Ruins update.

* This one exists.

* Fixup temporary hotspots to last longer than one tick.

* Add/fix comments.

* Cut the slash.

* Fix test.

* No sleep for you.

* Build MILLA

* Prevent nested MILLA safety from runtiming.

* Build MILLA

* Runtime fix.

* Build MILLA

* Fix canisters not updating icon when gas contents change.

* Build MILLA

* Build MILLA

* Fixed an issue that made mechs very cold on environment air.

* Build MILLA

* oops

* Build MILLA

* Walls can make loud noises again.

* Build MILLA

* Fixes a rare runtime.

* Build MILLA

* Update .github/DOWNLOADING.md

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
Signed-off-by: Charlie Nolan <funnyman3595@gmail.com>

* Review suggestions

* Lint

* Build MILLA

* bound_mixtures now only contains mixtures that can be written

* Build MILLA

* Apply suggestions from code review

Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Charlie Nolan <funnyman3595@gmail.com>

* Build MILLA

* Restore the original async behavior of pyro anomalies.

* Build MILLA

* Build MILLA

* Make the safety assertion in /datum/milla_safe safer.

* Build MILLA

---------

Signed-off-by: Charlie Nolan <funnyman3595@gmail.com>
Co-authored-by: FunnyMan3595 (Charlie Nolan) <funnyman@google.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
Co-authored-by: paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
Co-authored-by: GDN <Roanrichards1@Gmail.com>
2024-06-09 07:18:11 +00:00

215 lines
6.7 KiB
Plaintext

//objects in /obj/effect should never be things that are attackable, use obj/structure instead.
//Effects are mostly temporary visual effects like sparks, smoke, as well as decals, etc...
/obj/effect
icon = 'icons/effects/effects.dmi'
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF
move_resist = INFINITY
anchored = TRUE
can_be_hit = FALSE
/obj/effect/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
return
/obj/effect/singularity_act()
qdel(src)
return FALSE
/obj/effect/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
return
/obj/effect/acid_act()
return
/obj/effect/proc/is_cleanable() //Called when you want to clean something, and usualy delete it after
return FALSE
/obj/effect/mech_melee_attack(obj/mecha/M)
return 0
/obj/effect/blob_act(obj/structure/blob/B)
return
/obj/effect/experience_pressure_difference(flow_x, flow_y)
return // Immune to gas flow.
/obj/effect/ex_act(severity)
switch(severity)
if(1)
qdel(src)
if(2)
if(prob(60))
qdel(src)
if(3)
if(prob(25))
qdel(src)
/**
* # The abstract object
*
* This is an object that is intended to able to be placed, but that is completely invisible.
* The object should be immune to all forms of damage, or things that can delete it, such as the singularity, or explosions.
*/
/obj/effect/abstract
name = "Abstract object"
invisibility = INVISIBILITY_ABSTRACT
layer = TURF_LAYER
density = FALSE
icon = null
icon_state = null
armor = list(MELEE = 100, BULLET = 100, LASER = 100, ENERGY = 100, BOMB = 100, RAD = 100, FIRE = 100, ACID = 100)
// Most of these overrides procs below are overkill, but better safe than sorry.
/obj/effect/abstract/bullet_act(obj/item/projectile/P)
return
/obj/effect/abstract/decompile_act(obj/item/matter_decompiler/C, mob/user)
return
/obj/effect/abstract/singularity_act()
return
/obj/effect/abstract/narsie_act()
return
/obj/effect/abstract/ex_act(severity)
return
/obj/effect/abstract/blob_act()
return
/obj/effect/abstract/acid_act()
return
/obj/effect/abstract/fire_act()
return
/obj/effect/decal
plane = FLOOR_PLANE
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/no_scoop = FALSE //if it has this, don't let it be scooped up
var/no_clear = FALSE //if it has this, don't delete it when its' scooped up
var/list/scoop_reagents = null
/obj/effect/decal/Initialize(mapload)
. = ..()
if(scoop_reagents)
create_reagents(100)
reagents.add_reagent_list(scoop_reagents)
/obj/effect/decal/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/reagent_containers/glass) || istype(I, /obj/item/reagent_containers/drinks))
scoop(I, user)
else if(issimulatedturf(loc))
I.melee_attack_chain(user, loc)
/obj/effect/decal/attack_animal(mob/living/simple_animal/M)
if(issimulatedturf(loc))
loc.attack_animal(M)
/obj/effect/decal/attack_hand(mob/living/user)
if(issimulatedturf(loc))
loc.attack_hand(user)
/obj/effect/decal/attack_hulk(mob/living/carbon/human/user, does_attack_animation = FALSE)
if(issimulatedturf(loc))
loc.attack_hulk(user, does_attack_animation)
/obj/effect/decal/proc/scoop(obj/item/I, mob/user)
if(reagents && I.reagents && !no_scoop)
if(!reagents.total_volume)
to_chat(user, "<span class='notice'>There isn't enough [src] to scoop up!</span>")
return
if(I.reagents.total_volume >= I.reagents.maximum_volume)
to_chat(user, "<span class='notice'>[I] is full!</span>")
return
to_chat(user, "<span class='notice'>You scoop [src] into [I]!</span>")
on_scoop()
reagents.trans_to(I, reagents.total_volume)
if(!reagents.total_volume && !no_clear) //scooped up all of it
qdel(src)
/obj/effect/decal/ex_act()
if(reagents)
for(var/datum/reagent/R in reagents.reagent_list)
R.on_ex_act()
qdel(src)
/obj/effect/decal/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
if(reagents)
reagents.temperature_reagents(exposed_temperature)
if(!(resistance_flags & FIRE_PROOF)) //non fire proof decal or being burned by lava
qdel(src)
/obj/effect/decal/blob_act(obj/structure/blob/B)
if(B && B.loc == loc)
qdel(src)
/obj/effect/decal/proc/on_scoop()
return
/// These effects can be added to anything to hold particles, which is useful because Byond only allows a single particle per atom
/obj/effect/abstract/particle_holder
anchored = TRUE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
layer = ABOVE_ALL_MOB_LAYER
vis_flags = VIS_INHERIT_PLANE
invisibility = FALSE
///typepath of the last location we're in, if it's different when moved then we need to update vis contents
var/last_attached_location_type
/// The main item we're attached to at the moment, particle holders hold particles for something
var/atom/movable/parent
/// The mob that is holding our item
var/mob/holding_parent
/obj/effect/abstract/particle_holder/Initialize(mapload, particle_path = null)
. = ..()
if(!loc)
stack_trace("particle holder was created with no loc!")
return INITIALIZE_HINT_QDEL
parent = loc
if(ismovable(parent))
RegisterSignal(parent, COMSIG_MOVABLE_MOVED, PROC_REF(on_move))
RegisterSignal(parent, COMSIG_PARENT_QDELETING, PROC_REF(on_qdel))
particles = new particle_path
update_visual_contents(parent)
/obj/effect/abstract/particle_holder/Destroy(force)
if(parent)
UnregisterSignal(parent, list(COMSIG_MOVABLE_MOVED, COMSIG_PARENT_QDELETING))
QDEL_NULL(particles)
parent.vis_contents -= src
return ..()
///signal called when parent is moved
/obj/effect/abstract/particle_holder/proc/on_move(atom/movable/attached, atom/oldloc, direction)
SIGNAL_HANDLER
if(parent.loc.type != last_attached_location_type)
update_visual_contents(attached)
///signal called when parent is deleted
/obj/effect/abstract/particle_holder/proc/on_qdel(atom/movable/attached, force)
SIGNAL_HANDLER
attached.vis_contents -= src
qdel(src)//our parent is gone and we need to be as well
///logic proc for particle holders, aka where they move.
///subtypes of particle holders can override this for particles that should always be turf level or do special things when repositioning.
///this base subtype has some logic for items, as the loc of items becomes mobs very often hiding the particles
/obj/effect/abstract/particle_holder/proc/update_visual_contents(atom/movable/attached_to)
// Remove old
if(holding_parent && !(QDELETED(holding_parent)))
holding_parent.vis_contents -= src
// Add new
if(isitem(attached_to) && ismob(attached_to.loc)) //special case we want to also be emitting from the mob
var/mob/particle_mob = attached_to.loc
last_attached_location_type = attached_to.loc
particle_mob.vis_contents += src
// Readd to ourselves
attached_to.vis_contents |= src