Skip to content

Commit

Permalink
Underfloor refactor + Mild codebase cleanup (#6518)
Browse files Browse the repository at this point in the history
refactors deprecated and old level / hide system to a more orchestrated
and slightly more efficient one
  • Loading branch information
silicons committed Jun 20, 2024
1 parent 624552b commit 83bc9a7
Show file tree
Hide file tree
Showing 101 changed files with 639 additions and 1,382 deletions.
13 changes: 6 additions & 7 deletions citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -163,28 +163,26 @@
#include "code\__DEFINES\dcs\signals\global_signals.dm"
#include "code\__DEFINES\dcs\signals\signals_area.dm"
#include "code\__DEFINES\dcs\signals\signals_datum.dm"
#include "code\__DEFINES\dcs\signals\signals_fish.dm"
#include "code\__DEFINES\dcs\signals\signals_object.dm"
#include "code\__DEFINES\dcs\signals\signals_turf.dm"
#include "code\__DEFINES\dcs\signals\datums\signals_beam.dm"
#include "code\__DEFINES\dcs\signals\datums\signals_perspective.dm"
#include "code\__DEFINES\dcs\signals\elements\conflict.dm"
#include "code\__DEFINES\dcs\signals\elements\signals_element_conflict_checking.dm"
#include "code\__DEFINES\dcs\signals\items\signals_inducer.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\context_system.dm"
#include "code\__DEFINES\dcs\signals\modules\signals_module_fishing.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_appearance.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_attack.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_buckling.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_context_system.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_defense.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_lighting.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_main.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_mouse.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movable.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movement.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_radiation.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_throwing.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_visuals.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_tool_system.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_x_act.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\tool_system.dm"
#include "code\__DEFINES\dcs\signals\signals_item\signals_item_economy.dm"
#include "code\__DEFINES\dcs\signals\signals_item\signals_item_inventory.dm"
#include "code\__DEFINES\dcs\signals\signals_item\signals_item_mouse.dm"
Expand Down Expand Up @@ -260,6 +258,7 @@
#include "code\__DEFINES\mobs\silicon_privileges.dm"
#include "code\__DEFINES\mobs\sprite_accessories.dm"
#include "code\__DEFINES\mobs\stat.dm"
#include "code\__DEFINES\objects\objects.dm"
#include "code\__DEFINES\objects\type_generation.dm"
#include "code\__DEFINES\overmaps\misc.dm"
#include "code\__DEFINES\overmaps\overmap.dm"
Expand Down Expand Up @@ -2029,7 +2028,6 @@
#include "code\game\turfs\simulated\floor\floor_attackby.dm"
#include "code\game\turfs\simulated\floor\floor_damage.dm"
#include "code\game\turfs\simulated\floor\floor_icon.dm"
#include "code\game\turfs\simulated\floor\floor_static.dm"
#include "code\game\turfs\simulated\floor\floor_types.dm"
#include "code\game\turfs\simulated\floor\floor_types_eris.dm"
#include "code\game\turfs\simulated\floor\floor_types_vr.dm"
Expand Down Expand Up @@ -2181,6 +2179,7 @@
#include "code\modules\admin\verbs\SDQL2\SDQL_2.dm"
#include "code\modules\admin\verbs\SDQL2\SDQL_2_parser.dm"
#include "code\modules\admin\verbs\SDQL2\SDQL_2_wrappers.dm"
#include "code\modules\admin\verbs\SDQL2\wrappers\map.dm"
#include "code\modules\admin\verbs\server\admin_reboot.dm"
#include "code\modules\admin\view_variables\admin_delete.dm"
#include "code\modules\admin\view_variables\color_matrix_editor.dm"
Expand Down
15 changes: 8 additions & 7 deletions code/__DEFINES/dcs/signals/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Hierarchy

- /components - component-specific signals
- /datums - datum-specific signals
- /elements - element-specific signals
- /items - item-specific signals
- /signals_atom - /atom signals
- /signals_item - /item signals
- /signals_mob - /mob signals
- /components - component-specific signals, `signals_component_*`
- /datums - datum-specific signals, `signals_<datumname>`
- /elements - element-specific signals, `signals_element_*`
- /items - item-specific signals, `signals_<itemname>`
- /modules - sets of signals for a module, `signals_module_*`
- /signals_atom - /atom signals, `signals_atom_*` or `signals_movable_*`
- /signals_item - /item signals, `signals_item_*`
- /signals_mob - /mob signals, `signals_mob_*`
File renamed without changes.
19 changes: 0 additions & 19 deletions code/__DEFINES/dcs/signals/signals_action.dm

This file was deleted.

13 changes: 0 additions & 13 deletions code/__DEFINES/dcs/signals/signals_admin.dm

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* * All signals send the source datum of the signal as the first argument
*/

// todo: rethink this if needed

/// From base of [/atom/proc/update_appearance]: (updates)
#define COMSIG_ATOM_UPDATE_APPEARANCE "atom_update_appearance"
/// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its name.
Expand Down
37 changes: 0 additions & 37 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,5 @@
* * All signals send the source datum of the signal as the first argument
*/

/// From base of atom/attackby(): (/obj/item, /mob/living, params)
////#define COMSIG_PARENT_ATTACKBY "atom_attackby"
/// From base of [atom/proc/attacby_secondary()]: (/obj/item/weapon, /mob/user, params)
////#define COMSIG_PARENT_ATTACKBY_SECONDARY "atom_attackby_secondary"
/// From base of [/atom/proc/attack_hand_secondary]: (mob/user, list/modifiers) - Called when the atom receives a secondary unarmed attack.
////#define COMSIG_ATOM_ATTACK_HAND_SECONDARY "atom_attack_hand_secondary"
///? Return this in response if you don't want afterattack to be called
////#define COMPONENT_NO_AFTERATTACK (1<<0)
/// From base of atom/attack_hulk(): (/mob/living/carbon/human)
////#define COMSIG_ATOM_HULK_ATTACK "hulk_attack"
/// From base of atom/animal_attack(): (/mob/user)
////#define COMSIG_ATOM_ATTACK_ANIMAL "attack_animal"
/// From base of atom/attack_basic_mob(): (/mob/user)
////#define COMSIG_ATOM_ATTACK_BASIC_MOB "attack_basic_mob"
/// From /atom/proc/atom_break: ()
////#define COMSIG_ATOM_BREAK "atom_break"
/// From base of [/atom/proc/atom_fix]: ()
////#define COMSIG_ATOM_FIX "atom_fix"
/// From base of [/atom/proc/update_integrity]: (old_value, new_value)
////#define COMSIG_ATOM_INTEGRITY_CHANGED "atom_integrity_changed"
/// From base of [/atom/proc/take_damage]: (damage_amount, damage_type, damage_flag, sound_effect, attack_dir, aurmor_penetration)
////#define COMSIG_ATOM_TAKE_DAMAGE "atom_take_damage"
///? Return bitflags for the above signal which prevents the atom taking any damage.
////#define COMPONENT_NO_TAKE_DAMAGE (1<<0)

//* Attack signals. They should share the returned flags, to standardize the attack chain. *//
/// tool_act -> pre_attack -> target.attackby (item.attack) -> afterattack
///? Ends the attack chain. If sent early might cause posterior attacks not to happen.
////#define COMPONENT_CANCEL_ATTACK_CHAIN (1<<0)
///? Skips the specific attack step, continuing for the next one to happen.
////#define COMPONENT_SKIP_ATTACK (1<<1)
/// From base of atom/attack_ghost(): (mob/observer/dead/ghost)
#define COMSIG_ATOM_ATTACK_GHOST "atom_attack_ghost"
/// From base of atom/attack_hand(mob/user, list/params): (mob/user, list/modifiers)
////#define COMSIG_ATOM_ATTACK_HAND "atom_attack_hand"
/// From base of atom/attack_paw(): (mob/user)
////#define COMSIG_ATOM_ATTACK_PAW "atom_attack_paw"
///? Works on all 3.
////#define COMPONENT_NO_ATTACK_HAND (1<<0)
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
//* Copyright (c) 2023 Citadel Station developers. *//

// todo: this file left intentionally empty since shieldcalls were moved to datums
// todo: add signals for integrity
14 changes: 0 additions & 14 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_explosion.dm

This file was deleted.

31 changes: 0 additions & 31 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_lighting.dm

This file was deleted.

34 changes: 19 additions & 15 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
* * All signals send the source datum of the signal as the first argument
*/

//* Movement - Move / Moved *//

/// From base of atom/movable/Moved(): (/atom)
#define COMSIG_MOVABLE_PRE_MOVE "movable_pre_move"
#define COMPONENT_MOVABLE_BLOCK_PRE_MOVE (1<<0)
/// From base of atom/movable/Moved(): (atom/old_loc, dir, forced, list/old_locs, momentum_change)
#define COMSIG_MOVABLE_MOVED "movable_moved"
// todo: abstract move and attach_loc or whatever from tg, no more cross/uncross!!!

//* Movement - Collision *//

// todo: crossers and uncrossers!!!
/// From base of atom/movable/Cross(): (/atom/movable)
#define COMSIG_MOVABLE_CROSS "movable_cross"
/// From base of atom/movable/Crossed(): (/atom/movable)
Expand All @@ -21,24 +26,23 @@
#define COMSIG_MOVABLE_UNCROSSED "movable_uncrossed"
/// From base of atom/movable/Bump(): (/atom)
#define COMSIG_MOVABLE_BUMP "movable_bump"
/// From base of atom/movable/newtonian_move(): (inertia_direction)
//#define COMSIG_MOVABLE_NEWTONIAN_MOVE "movable_newtonian_move"
//#define COMPONENT_MOVABLE_NEWTONIAN_BLOCK (1<<0)

//* Movement - Z Change *//

/// From base of atom/movable/on_changed_z_level(): (old_z, new_z)
#define COMSIG_MOVABLE_Z_CHANGED "movable_ztransit"
/// From base of atom/movable/Hear(): (proc args list(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, list/message_mods = list()))
//#define COMSIG_MOVABLE_HEAR "movable_hear"
//#define HEARING_MESSAGE 1
//#define HEARING_SPEAKER 2
//#define HEARING_LANGUAGE 3
//#define HEARING_RAW_MESSAGE 4
/* #define HEARING_RADIO_FREQ 5
#define HEARING_SPANS 6
#define HEARING_MESSAGE_MODE 7 */

/// Called when the movable sucessfully has it's anchored var changed, from base atom/movable/set_anchored(): (value)
#define COMSIG_MOVABLE_SET_ANCHORED "movable_set_anchored"
//* Movement - Glide Size *//

/// Called when the movable's glide size is updated: (new_glide_size)
#define COMSIG_MOVABLE_UPDATE_GLIDE_SIZE "movable_glide_size"

//* Pixel Offsets *//

/// called when we have a drastic pixel x/y change and things should update
#define COMSIG_MOVABLE_PIXEL_OFFSET_CHANGED "pixel_offset_changed"

//* State Changes *//

/// Called when the movable sucessfully has it's anchored var changed, from base atom/movable/set_anchored(): (value)
#define COMSIG_MOVABLE_SET_ANCHORED "movable_set_anchored"
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
* * All signals send the source datum of the signal as the first argument
*/

//! STOP. Are you about to add RAD_PROBE?
//! Well, don't. Add a trait system to manage rad_flags & RAD_BLOCK_CONTENTS, because
//! that's all it does, and there's literally no point in sending arg-less signals!
//! If we ever decide to make the signal have an arg, then yes, feel free to. For now, DON'T.
//* -- READ THIS -- *//
/// STOP. Are you about to add RAD_PROBE?
/// Well, don't. Add a trait system to manage rad_flags & RAD_BLOCK_CONTENTS, because
/// that's all it does, and there's literally no point in sending arg-less signals!
/// If we ever decide to make the signal have an arg, then yes, feel free to. For now, DON'T.
//* -- END -- *//

/// From /datum/radiation_wave's iteration: (strength, datum/radiation_wave/wave)
#define COMSIG_ATOM_RAD_PULSE_ITERATE "rad_pulse_iterate"
/// From base on atom/rad_act(): (strength, datum/radiation_wave/wave)
#define COMSIG_ATOM_RAD_ACT "atom_rad_act"

This file was deleted.

35 changes: 0 additions & 35 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,5 @@
//! ## /x_act Signals.
/// from base of atom/ex_act: (power, dir, wave datum)
#define COMSIG_ATOM_EX_ACT "atom_ex_act"
/// From the [LEGACY_EX_ACT] wrapper macro: (severity, target)
////#define COMSIG_ATOM_LEGACY_EX_ACT "atom_legacy_ex_act"
/// From base of atom/emp_act(): (severity)
#define COMSIG_ATOM_EMP_ACT "atom_emp_act"
/// From base of atom/fire_act(): (exposed_temperature, exposed_volume)
////#define COMSIG_ATOM_FIRE_ACT "atom_fire_act"
/// From base of atom/bullet_act(): (/obj/projectile, def_zone)
////#define COMSIG_ATOM_BULLET_ACT "atom_bullet_act"
/// From base of atom/CheckParts(): (list/parts_list, datum/crafting_recipe/R)
////#define COMSIG_ATOM_CHECKPARTS "atom_checkparts"
/// From base of atom/CheckParts(): (atom/movable/new_craft) - The atom has just been used in a crafting recipe and has been moved inside new_craft.
////#define COMSIG_ATOM_USED_IN_CRAFT "atom_used_in_craft"
/// From base of atom/blob_act(): (/obj/structure/blob)
////#define COMSIG_ATOM_BLOB_ACT "atom_blob_act"
//? If returned, forces nothing to happen when the atom is attacked by a blob
////#define COMPONENT_CANCEL_BLOB_ACT (1<<0)
/// From base of atom/acid_act(): (acidpwr, acid_volume)
////#define COMSIG_ATOM_ACID_ACT "atom_acid_act"
/// From base of atom/emag_act(): (/mob/user)
////#define COMSIG_ATOM_EMAG_ACT "atom_emag_act"
/// From base of atom/narsie_act(): ()
////#define COMSIG_ATOM_NARSIE_ACT "atom_narsie_act"
/// From base of atom/ratvar_act(): ()
////#define COMSIG_ATOM_RATVAR_ACT "atom_ratvar_act"
/// From base of atom/rcd_act(): (/mob, /obj/item/construction/rcd, passed_mode)
////#define COMSIG_ATOM_RCD_ACT "atom_rcd_act"
/// From base of atom/singularity_pull(): (/datum/component/singularity, current_size)
////#define COMSIG_ATOM_SING_PULL "atom_sing_pull"
/// From obj/machinery/bsa/full/proc/fire(): ()
////#define COMSIG_ATOM_BSA_BEAM "atom_bsa_beam_pass"
////#define COMSIG_ATOM_BLOCKS_BSA_BEAM (1<<0)
/// From base on atom/rad_act(): (strength, /datum/radiation_wave_legacy)
#define COMSIG_ATOM_RAD_ACT "atom_rad_act"

/// Called when teleporting into a protected turf: (channel, turf/origin)
#define COMSIG_ATOM_INTERCEPT_TELEPORT "intercept_teleport"
#define COMPONENT_BLOCK_TELEPORT (1<<0)
Loading

0 comments on commit 83bc9a7

Please sign in to comment.