Some missed mirrors (#13415)

* Refactors firestacks into status effects (#66573)

This PR refactors firestacks into two status effects: fire_stacks, which behave like normal firestacks you have right now, and wet_stacks, which are your negative fire stacks right now. This allows for custom fires with custom behaviors and icons to be made.

Some fire related is moved away from species(what the fuck was it even doing there) into these as well.
Oh and I fixed the bug where monkeys on fire had a human fire overlay, why wasn't this fixed already, it's like ancient.

Also changed some related proc names to be snake_case like everything should be.

This allows for custom fire types with custom behaviours, like freezing freon fire or radioactive tritium fire. Removing vars from living and moving them to status effects for modularity is also good.
Nothing to argue about since there's nothing player-facing

* Hud Image Culling By Z Level: Theft edition (#65189)

* makes hud images only apply by z level

* makes some of the atom_hud procs have better names

* fixes warning with the hud_user list and adds better documentation

* better docs for hud_images

* removes TODOs

* docs for hud_list

* adds support for linked z levels so mobs can see lower ones

* fixes merge conflict and shittily makes only shocked airlocks get added

* adds support for setting images in the hud as active and inactive

* gets rid of unatomic spatial grid change

* maybe i should actually try COMPILING my changes

* fixes merge skew and makes it compile again

* fixes huds refusing to remove from users who changed z level

* improves z level and registration logic

* fixes antag huds not appearing

* Fixes antag huds not properly setting. We now use hud_list in init, so it needs to be set before the new call, not after. Not sure why the use of appearance key was split like this, but none else knows either so none can stop me

* Ensures that hiding a basic appearance also hides the atom's active list too

* Fixes antag huds going poof

Ensures that remove_atom_from_hud will return false if the passed atom
isn't managed by it

This fixes antag huds disappearing randomly, since they assumed that if
the parent call of remove_atom_from_hud returned true, we should delete
ourselves. This is a safe assumption for them to make, since they should
only ever have one atom.

Does kinda bork if we call remove_atom_from_hud in a way that is unsure
if the passed atom is actually in that list. We were forced into doing
this by how atom huds use the qdeleting signal.

* makes basic alternate_appearance's only update themselves when setting their hud image to active and makes them not add themselves to the global huds_by_category list

* fixes mistake with hud_users list being set non associatively (bad)

* as anything in bot path loops

* Fixes merge skew problems

* Makes bot paths non global

This way they can show themselves to only the bot that "owns" them, ya
feel me?

* Fixes huds not showing up sometimes, cleans up some code

Post Kapu's limb refactor, we were calling prepare_huds twice in a human
init call chain. What was happening was this:

call prepare_huds() // Human
I gained a new hud image
I set active hud icons to mirror it
call prepare_huds() // Living
I overwrote the new hud image
I attempted to set active hud icons, which failed because it assumes
this can never happen

*cries*

* Renames add_hud_to_atom to show_to

My hope is this will make understanding hud code a bit easier, by tying
the behavior to a "verb" more closely. Also renamed a few vars

* remove_hud_from_mob -> hide_from

* Nitpicks a few comments

* Whoops/fuck/shit/damn it all/hhhhhhhhhhhh

* Moves check down, improves stack trace a bit

Co-authored-by: KylerAce <kylerlumpkin1@gmail.com>

* small touch-up

* this should do it

Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: KylerAce <kylerlumpkin1@gmail.com>
This commit is contained in:
Useroth
2022-05-08 03:59:40 +01:00
committed by GitHub
co-authored by KylerAce SmArtKar LemonInTheDark
parent cd45c0f943
commit cca7f8ee4c
138 changed files with 1288 additions and 646 deletions
+55 -9
View File
@@ -94,23 +94,69 @@
/mob/GenerateTag()
tag = "mob_[next_mob_id++]"
/**
* set every hud image in the given category active so other people with the given hud can see it.
* Arguments:
* * hud_category - the index in our active_hud_list corresponding to an image now being shown.
* * update_huds - if FALSE we will just put the hud_category into active_hud_list without actually updating the atom_hud datums subscribed to it
* * exclusive_hud - if given a reference to an atom_hud, will just update that hud instead of all global ones attached to that category.
* This is because some atom_hud subtypes arent supposed to work via global categories, updating normally would affect all of these which we dont want.
*/
/atom/proc/set_hud_image_active(hud_category, update_huds = TRUE, datum/atom_hud/exclusive_hud)
if(!istext(hud_category) || !hud_list?[hud_category] || active_hud_list?[hud_category])
return FALSE
LAZYSET(active_hud_list, hud_category, hud_list[hud_category])
if(!update_huds)
return TRUE
if(exclusive_hud)
exclusive_hud.add_single_hud_category_on_atom(src, hud_category)
else
for(var/datum/atom_hud/hud_to_update as anything in GLOB.huds_by_category[hud_category])
hud_to_update.add_single_hud_category_on_atom(src, hud_category)
return TRUE
///sets every hud image in the given category inactive so no one can see it
/atom/proc/set_hud_image_inactive(hud_category, update_huds = TRUE, datum/atom_hud/exclusive_hud)
if(!istext(hud_category))
return FALSE
LAZYREMOVE(active_hud_list, hud_category)
if(!update_huds)
return TRUE
if(exclusive_hud)
exclusive_hud.remove_single_hud_category_on_atom(src, hud_category)
else
for(var/datum/atom_hud/hud_to_update as anything in GLOB.huds_by_category[hud_category])
hud_to_update.remove_single_hud_category_on_atom(src, hud_category)
return TRUE
/**
* Prepare the huds for this atom
*
* Goes through hud_possible list and adds the images to the hud_list variable (if not already
* cached)
* Goes through hud_possible list and adds the images to the hud_list variable (if not already cached)
*/
/atom/proc/prepare_huds()
if(hud_list) // I choose to be lienient about people calling this proc more then once
return
hud_list = list()
for(var/hud in hud_possible)
var/hint = hud_possible[hud]
switch(hint)
if(HUD_LIST_LIST)
hud_list[hud] = list()
else
var/image/I = image('modular_skyrat/master_files/icons/mob/huds/hud.dmi', src, "") //SKYRAT EDIT: original filepath 'icons/mob/huds/hud.dmi'
I.appearance_flags = RESET_COLOR|RESET_TRANSFORM
hud_list[hud] = I
if(hint == HUD_LIST_LIST)
hud_list[hud] = list()
else
var/image/I = image('modular_skyrat/master_files/icons/mob/huds/hud.dmi', src, "") //SKYRAT EDIT: original filepath 'icons/mob/huds/hud.dmi'
I.appearance_flags = RESET_COLOR|RESET_TRANSFORM
hud_list[hud] = I
set_hud_image_active(hud, update_huds = FALSE) //by default everything is active. but dont add it to huds to keep control.
/**
* Some kind of debug verb that gives atmosphere environment details