Skip to content

Commit

Permalink
Mappers Love Him!: Makes a ton of /atom, /atom/movable, and /obj/item…
Browse files Browse the repository at this point in the history
… vars /tmp/ vars (#805)

* mappers love him

* fix 8 year old bug lol

* remove var that didnt even work

* oops
  • Loading branch information
Kapu1178 authored Feb 11, 2024
1 parent f4aac13 commit 7298c31
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 190 deletions.
4 changes: 0 additions & 4 deletions _maps/RandomRuins/SpaceRuins/onehalf.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,10 @@
pixel_y = 32
},
/obj/machinery/button/door/directional/north{
custom_acid_overlay = "onehalf_drone2int";
name = "Drone 2 Internal Hatch Override";
pixel_x = 8
},
/obj/machinery/button/door/directional/north{
custom_acid_overlay = "onehalf_drone1int";
name = "Drone 1 Internal Hatch Override";
pixel_x = -8
},
Expand Down Expand Up @@ -315,12 +313,10 @@
pixel_y = 32
},
/obj/machinery/button/door/directional/north{
custom_acid_overlay = "onehalf_drone4int";
name = "Drone 4 Internal Hatch Override";
pixel_x = 8
},
/obj/machinery/button/door/directional/north{
custom_acid_overlay = "onehalf_drone3int";
name = "Drone 3 Internal Hatch Override";
pixel_x = -8
},
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/acid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
/datum/component/acid/proc/on_update_overlays(atom/parent_atom, list/overlays)
SIGNAL_HANDLER

overlays += mutable_appearance('icons/effects/acid.dmi', parent_atom.custom_acid_overlay || ACID_OVERLAY_DEFAULT)
overlays += mutable_appearance('icons/effects/acid.dmi', ACID_OVERLAY_DEFAULT)

/// Alerts any examiners to the acid on the parent atom.
/datum/component/acid/proc/on_examine(atom/A, mob/user, list/examine_list)
Expand Down
144 changes: 72 additions & 72 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,68 @@
appearance_flags = TILE_BOUND|LONG_GLIDE

/// Has this atom's constructor ran?
var/initialized = FALSE
var/tmp/initialized = FALSE

///Reagents holder
var/tmp/datum/reagents/reagents = null
/// the datum handler for our contents - see create_storage() for creation method
var/tmp/datum/storage/atom_storage

///This atom's HUD (med/sec, etc) images. Associative list.
var/tmp/list/image/hud_list = null
///HUD images that this atom can provide.
var/tmp/list/hud_possible

/**
* used to store the different colors on an atom
*
* its inherent color, the colored paint applied on it, special color effect etc...
*/
var/tmp/list/atom_colours

/// a very temporary list of overlays to remove
var/tmp/list/remove_overlays
/// a very temporary list of overlays to add
var/tmp/list/add_overlays

///vis overlays managed by SSvis_overlays to automaticaly turn them like other overlays.
var/tmp/list/managed_vis_overlays
///overlays managed by [update_overlays][/atom/proc/update_overlays] to prevent removing overlays that weren't added by the same proc. Single items are stored on their own, not in a list.
var/tmp/list/managed_overlays

///Cooldown tick timer for buckle messages
var/tmp/buckle_message_cooldown = 0
///Last fingerprints to touch this atom
var/tmp/fingerprintslast

var/tmp/list/filter_data //For handling persistent filters

//List of datums orbiting this atom
var/tmp/datum/component/orbiter/orbiters

///The custom materials this atom is made of, used by a lot of things like furniture, walls, and floors (if I finish the functionality, that is.)
///The list referenced by this var can be shared by multiple objects and should not be directly modified. Instead, use [set_custom_materials][/atom/proc/set_custom_materials].
var/tmp/list/datum/material/custom_materials

var/tmp/datum/wires/wires = null

var/tmp/list/alternate_appearances

/// Last name used to calculate a color for the chatmessage overlays
var/tmp/chat_color_name
/// Last color calculated for the the chatmessage overlays
var/tmp/chat_color
/// A luminescence-shifted value of the last color calculated for chatmessage overlays
var/tmp/chat_color_darkened

///Holds merger groups currently active on the atom. Do not access directly, use GetMergeGroup() instead.
var/tmp/list/datum/merger/mergers

///Reference to atom being orbited
var/tmp/atom/orbit_target

/// !DO NOT DIRECTLY EDIT! Can mobs "interact" with this item? THIS IS ONLY USED FOR MOUSE ICONS. SEE interactables.dm.
var/tmp/is_mouseover_interactable

/// pass_flags that we are. If any of this matches a pass_flag on a moving thing, by default, we let them through.
var/pass_flags_self = NONE
Expand All @@ -33,63 +94,17 @@
///When a projectile ricochets off this atom, it deals the normal damage * this modifier to this atom
var/receive_ricochet_damage_coeff = 0.33

///Reagents holder
var/datum/reagents/reagents = null

///This atom's HUD (med/sec, etc) images. Associative list.
var/list/image/hud_list = null
///HUD images that this atom can provide.
var/list/hud_possible

///Value used to increment ex_act() if reactionary_explosions is on
var/explosion_block = 0

/**
* used to store the different colors on an atom
*
* its inherent color, the colored paint applied on it, special color effect etc...
*/
var/list/atom_colours


/// a very temporary list of overlays to remove
var/list/remove_overlays
/// a very temporary list of overlays to add
var/list/add_overlays

///vis overlays managed by SSvis_overlays to automaticaly turn them like other overlays.
var/list/managed_vis_overlays
///overlays managed by [update_overlays][/atom/proc/update_overlays] to prevent removing overlays that weren't added by the same proc. Single items are stored on their own, not in a list.
var/list/managed_overlays

///Cooldown tick timer for buckle messages
var/buckle_message_cooldown = 0
///Last fingerprints to touch this atom
var/fingerprintslast

var/list/filter_data //For handling persistent filters

//List of datums orbiting this atom
var/datum/component/orbiter/orbiters

/// Radiation insulation types
var/rad_insulation = RAD_NO_INSULATION

/// The icon state intended to be used for the acid component. Used to override the default acid overlay icon state.
var/custom_acid_overlay = null

///The custom materials this atom is made of, used by a lot of things like furniture, walls, and floors (if I finish the functionality, that is.)
///The list referenced by this var can be shared by multiple objects and should not be directly modified. Instead, use [set_custom_materials][/atom/proc/set_custom_materials].
var/list/datum/material/custom_materials
///Bitfield for how the atom handles materials.
var/material_flags = NONE
///Modifier that raises/lowers the effect of the amount of a material, prevents small and easy to get items from being death machines.
var/material_modifier = 1

var/datum/wires/wires = null

var/list/alternate_appearances

///Light systems, both shouldn't be active at the same time.
var/light_system = STATIC_LIGHT
///Range of the maximum brightness of light in tiles. Zero means no light.
Expand All @@ -111,13 +126,6 @@
///Any light sources that are "inside" of us, for example, if src here was a mob that's carrying a flashlight, that flashlight's light source would be part of this list.
var/tmp/list/light_sources

/// Last name used to calculate a color for the chatmessage overlays
var/chat_color_name
/// Last color calculated for the the chatmessage overlays
var/chat_color
/// A luminescence-shifted value of the last color calculated for chatmessage overlays
var/chat_color_darkened

///Default pixel x shifting for the atom's icon.
var/base_pixel_x = 0
///Default pixel y shifting for the atom's icon.
Expand All @@ -130,27 +138,23 @@
///A string of hex format colors to be used by greyscale sprites, ex: "#0054aa#badcff"
var/greyscale_colors

///Holds merger groups currently active on the atom. Do not access directly, use GetMergeGroup() instead.
var/list/datum/merger/mergers

///Icon-smoothing behavior.
var/smoothing_flags = NONE
var/tmp/smoothing_flags = NONE
///What directions this is currently smoothing with. IMPORTANT: This uses the smoothing direction flags as defined in icon_smoothing.dm, instead of the BYOND flags.
var/smoothing_junction = null //This starts as null for us to know when it's first set, but after that it will hold a 8-bit mask ranging from 0 to 255.
var/tmp/smoothing_junction = null //This starts as null for us to know when it's first set, but after that it will hold a 8-bit mask ranging from 0 to 255.
///Smoothing variable
var/top_left_corner
var/tmp/top_left_corner
///Smoothing variable
var/top_right_corner
var/tmp/top_right_corner
///Smoothing variable
var/bottom_left_corner
var/tmp/bottom_left_corner
///Smoothing variable
var/bottom_right_corner
var/tmp/bottom_right_corner
///What smoothing groups does this atom belongs to, to match canSmoothWith. If null, nobody can smooth with it. Must be sorted.
var/list/smoothing_groups = null
var/tmp/list/smoothing_groups = null
///List of smoothing groups this atom can smooth with. If this is null and atom is smooth, it smooths only with itself. Must be sorted.
var/list/canSmoothWith = null
///Reference to atom being orbited
var/atom/orbit_target
var/tmp/list/canSmoothWith = null

///AI controller that controls this atom. type on init, then turned into an instance during runtime.
///Note: If you are for some reason giving this to a non-mob, it needs to create it's own in Initialize()
var/datum/ai_controller/ai_controller
Expand All @@ -159,7 +163,7 @@
var/uses_integrity = FALSE

///Atom armor. Use returnArmor()
var/datum/armor/armor
var/tmp/datum/armor/armor
VAR_PRIVATE/atom_integrity //defaults to max_integrity
var/max_integrity = 500
var/integrity_failure = 0 //0 if we have no special broken behavior, otherwise is a percentage of at what point the atom breaks. 0.5 being 50%
Expand All @@ -168,12 +172,8 @@

var/resistance_flags = NONE // INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ON_FIRE | UNACIDABLE | ACID_PROOF

/// the datum handler for our contents - see create_storage() for creation method
var/datum/storage/atom_storage
/// How this atom should react to having its astar blocking checked
var/can_astar_pass = CANASTARPASS_DENSITY
/// !DO NOT DIRECTLY EDIT! Can mobs "interact" with this item? THIS IS ONLY USED FOR MOUSE ICONS. SEE interactables.dm.
var/is_mouseover_interactable

/**
* Called when an atom is created in byond (built in engine proc)
Expand Down
107 changes: 56 additions & 51 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,66 @@
glide_size = 8
appearance_flags = TILE_BOUND|PIXEL_SCALE|LONG_GLIDE

var/last_move = null
/// The last direction we moved in.
var/tmp/last_move = null
///Are we moving with inertia? Mostly used as an optimization
var/tmp/inertia_moving = FALSE
///The last time we pushed off something
///This is a hack to get around dumb him him me scenarios
var/tmp/last_pushoff
///0: not doing a diagonal move. 1 and 2: doing the first/second step of the diagonal move
var/tmp/moving_diagonally = 0
/// Tracks if the mob is currently in the movechain during a pulling movement.
var/tmp/moving_from_pull = FALSE
/// Tracks if forceMove() should break grabs or not.
var/tmp/forcemove_should_maintain_grab = FALSE

///is the mob currently ascending or descending through z levels?
var/tmp/currently_z_moving

///Holds information about any movement loops currently running/waiting to run on the movable. Lazy, will be null if nothing's going on
var/tmp/datum/movement_packet/move_packet
var/tmp/datum/forced_movement/force_moving = null //handled soley by forced_movement.dm

/**
* an associative lazylist of relevant nested contents by "channel", the list is of the form: list(channel = list(important nested contents of that type))
* each channel has a specific purpose and is meant to replace potentially expensive nested contents iteration.
* do NOT add channels to this for little reason as it can add considerable memory usage.
*/
var/tmp/list/important_recursive_contents
///contains every client mob corresponding to every client eye in this container. lazily updated by SSparallax and is sparse:
///only the last container of a client eye has this list assuming no movement since SSparallax's last fire
var/tmp/list/client_mobs_in_contents

/// String representing the spatial grid groups we want to be held in.
/// acts as a key to the list of spatial grid contents types we exist in via SSspatial_grid.spatial_grid_categories.
/// We do it like this to prevent people trying to mutate them and to save memory on holding the lists ourselves
var/tmp/spatial_grid_key

var/tmp/datum/component/orbiter/orbiting

///Lazylist to keep track on the sources of illumination.
var/tmp/list/affected_dynamic_lights
///Highest-intensity light affecting us, which determines our visibility.
var/tmp/affecting_dynamic_lumi = 0

///For storing what do_after's someone has, key = string, value = amount of interactions of that type happening.
var/tmp/list/do_afters

///A lazylist of grab objects gripping us
var/tmp/list/grabbed_by

/// Look, we're defining this here so it doesn't need to be redefined 4 times, okay? Sorry.
var/tmp/germ_level = GERM_LEVEL_AMBIENT

var/anchored = FALSE
var/move_resist = MOVE_RESIST_DEFAULT
var/move_force = MOVE_FORCE_DEFAULT
var/pull_force = PULL_FORCE_DEFAULT
var/datum/thrownthing/throwing = null
var/throw_speed = 2 //How many tiles to move per ds when being thrown. Float values are fully supported
var/throw_range = 7
var/throwforce = 0
///Max range this atom can be thrown via telekinesis
var/tk_throw_range = 10
var/initial_language_holder = /datum/language_holder
Expand All @@ -22,41 +74,14 @@
var/verb_sing = "sings"
var/verb_yell = "yells"
var/speech_span
///Are we moving with inertia? Mostly used as an optimization
var/inertia_moving = FALSE

///Delay in deciseconds between inertia based movement
var/inertia_move_delay = 5
///The last time we pushed off something
///This is a hack to get around dumb him him me scenarios
var/last_pushoff

/// Things we can pass through while moving. If any of this matches the thing we're trying to pass's [pass_flags_self], then we can pass through.
var/pass_flags = NONE
/// If false makes [CanPass][/atom/proc/CanPass] call [CanPassThrough][/atom/movable/proc/CanPassThrough] on this type instead of using default behaviour
var/generic_canpass = TRUE
///0: not doing a diagonal move. 1 and 2: doing the first/second step of the diagonal move
var/moving_diagonally = 0
/// Tracks if the mob is currently in the movechain during a pulling movement.
var/moving_from_pull = FALSE
/// Tracks if forceMove() should break grabs or not.
var/forcemove_should_maintain_grab = FALSE

///Holds information about any movement loops currently running/waiting to run on the movable. Lazy, will be null if nothing's going on
var/datum/movement_packet/move_packet
var/datum/forced_movement/force_moving = null //handled soley by forced_movement.dm
/**
* an associative lazylist of relevant nested contents by "channel", the list is of the form: list(channel = list(important nested contents of that type))
* each channel has a specific purpose and is meant to replace potentially expensive nested contents iteration.
* do NOT add channels to this for little reason as it can add considerable memory usage.
*/
var/list/important_recursive_contents
///contains every client mob corresponding to every client eye in this container. lazily updated by SSparallax and is sparse:
///only the last container of a client eye has this list assuming no movement since SSparallax's last fire
var/list/client_mobs_in_contents

/// String representing the spatial grid groups we want to be held in.
/// acts as a key to the list of spatial grid contents types we exist in via SSspatial_grid.spatial_grid_categories.
/// We do it like this to prevent people trying to mutate them and to save memory on holding the lists ourselves
var/spatial_grid_key

/**
* In case you have multiple types, you automatically use the most useful one.
Expand All @@ -65,25 +90,14 @@
*/
var/movement_type = GROUND

var/throwforce = 0
var/datum/component/orbiter/orbiting

///is the mob currently ascending or descending through z levels?
var/currently_z_moving

/// Either FALSE, [EMISSIVE_BLOCK_GENERIC], or [EMISSIVE_BLOCK_UNIQUE]
var/blocks_emissive = FALSE
///Internal holder for emissive blocker object, do not use directly use blocks_emissive
var/atom/movable/emissive_blocker/em_block
var/tmp/atom/movable/emissive_blocker/em_block

///Used for the calculate_adjacencies proc for icon smoothing.
var/can_be_unanchored = FALSE

///Lazylist to keep track on the sources of illumination.
var/list/affected_dynamic_lights
///Highest-intensity light affecting us, which determines our visibility.
var/affecting_dynamic_lumi = 0

/// Whether this atom should have its dir automatically changed when it moves. Setting this to FALSE allows for things such as directional windows to retain dir on moving without snowflake code all of the place.
var/set_dir_on_move = TRUE

Expand All @@ -92,15 +106,6 @@
/// The degree of pressure protection that mobs in list/contents have from the external environment, between 0 and 1
var/contents_pressure_protection = 0

///For storing what do_after's someone has, key = string, value = amount of interactions of that type happening.
var/list/do_afters

///A lazylist of grab objects gripping us
var/list/grabbed_by

/// Look, we're defining this here so it doesn't need to be redefined 4 times, okay? Sorry.
var/germ_level = GERM_LEVEL_AMBIENT

/mutable_appearance/emissive_blocker

/mutable_appearance/emissive_blocker/New()
Expand Down
Loading

0 comments on commit 7298c31

Please sign in to comment.