Skip to content

Commit

Permalink
Standardizes & documents Attack Chain. Telekinesis cleanup (#10903)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsar-Salat authored May 7, 2024
1 parent 634339f commit 22f035f
Show file tree
Hide file tree
Showing 46 changed files with 442 additions and 283 deletions.
5 changes: 4 additions & 1 deletion beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@
#include "code\__DEFINES\dcs\helpers.dm"
#include "code\__DEFINES\dcs\signals.dm"
#include "code\__DEFINES\dcs\signals\signals_area.dm"
#include "code\__DEFINES\dcs\signals\signals_atom.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_attack.dm"
#include "code\__DEFINES\dcs\signals\signals_global.dm"
#include "code\__DEFINES\dcs\signals\signals_lighting.dm"
#include "code\__DEFINES\dcs\signals\signals_movable.dm"
Expand All @@ -212,6 +213,7 @@
#include "code\__DEFINES\dcs\signals\signals_mob\signals_human.dm"
#include "code\__DEFINES\dcs\signals\signals_mob\signals_living.dm"
#include "code\__DEFINES\dcs\signals\signals_mob\signals_mob.dm"
#include "code\__DEFINES\dcs\signals\signals_mob\signals_mobattack.dm"
#include "code\__DEFINES\dcs\signals\signals_mob\signals_silicon.dm"
#include "code\__DEFINES\dcs\signals\signals_mob\signals_simplemob.dm"
#include "code\__DEFINES\dcs\signals\signals_mob\signals_xenobiology.dm"
Expand All @@ -223,6 +225,7 @@
#include "code\__DEFINES\dcs\signals\signals_obj\signals_item\signals_food.dm"
#include "code\__DEFINES\dcs\signals\signals_obj\signals_item\signals_grenade.dm"
#include "code\__DEFINES\dcs\signals\signals_obj\signals_item\signals_implant.dm"
#include "code\__DEFINES\dcs\signals\signals_obj\signals_item\signals_itemattack.dm"
#include "code\__DEFINES\dcs\signals\signals_obj\signals_item\signals_item.dm"
#include "code\__DEFINES\dcs\signals\signals_obj\signals_item\signals_organs.dm"
#include "code\__DEFINES\dcs\signals\signals_obj\signals_machine\signals_airlock.dm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
// /atom signals
///from base of atom/proc/Initialize(mapload): sent any time a new atom is created
#define COMSIG_ATOM_CREATED "atom_created"
///! from base of atom/attackby(): (/obj/item, /mob/living, params)
#define COMSIG_PARENT_ATTACKBY "atom_attackby"
///! Return this in response if you don't want afterattack to be called
#define COMPONENT_NO_AFTERATTACK 1
///! from base of atom/attack_hulk(): (/mob/living/carbon/human)
#define COMSIG_ATOM_HULK_ATTACK "hulk_attack"
/// from base of atom/examine(): (/mob, list/examine_text)
#define COMSIG_PARENT_EXAMINE "atom_examine"
/// from base of atom/get_examine_name(): (/mob, list/overrides)
Expand All @@ -20,8 +14,6 @@
#define EXAMINE_POSITION_BEFORE (1<<1)
//End positions
#define COMPONENT_EXNAME_CHANGED (1<<0)
//from base of atom/attack_basic_mob(): (/mob/user)
#define COMSIG_ATOM_ATTACK_BASIC_MOB "attack_basic_mob"

/// from base of [/atom/proc/update_appearance]: (updates)
#define COMSIG_ATOM_UPDATE_APPEARANCE "atom_update_appearance"
Expand Down Expand Up @@ -133,24 +125,6 @@
/// called when an atom stops orbiting another atom: (atom)
#define COMSIG_ATOM_ORBIT_STOP "atom_orbit_stop"

/////////////////
/* 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/dead/observer/ghost)
#define COMSIG_ATOM_ATTACK_GHOST "atom_attack_ghost"
///! from base of atom/attack_hand(): (mob/user)
#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
///! from base of atom/animal_attack(): (/mob/user)
#define COMSIG_ATOM_ATTACK_ANIMAL "attack_animal"
///This signal return value bitflags can be found in __DEFINES/misc.dm
///called for each movable in a turf contents on /turf/attempt_z_impact(): (atom/movable/A, levels)
#define COMSIG_ATOM_INTERCEPT_Z_FALL "movable_intercept_z_impact"
Expand Down
27 changes: 27 additions & 0 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_attack.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Atom attack signals. Format:
// When the signal is called: (signal arguments)
// 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"
///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"

/* 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/dead/observer/ghost)
#define COMSIG_ATOM_ATTACK_GHOST "atom_attack_ghost"
///from base of atom/attack_hand(): (mob/user)
#define COMSIG_ATOM_ATTACK_HAND "atom_attack_hand"
///from base of atom/attack_paw(): (mob/user)
#define COMSIG_ATOM_ATTACK_PAW "atom_attack_paw"
2 changes: 0 additions & 2 deletions code/__DEFINES/dcs/signals/signals_mob/signals_human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// All signals send the source datum of the signal as the first argument

// /mob/living/carbon/human signals
#define COMSIG_HUMAN_MELEE_UNARMED_ATTACK "human_melee_unarmed_attack" //! from mob/living/carbon/human/UnarmedAttack(): (atom/target)
#define COMSIG_HUMAN_MELEE_UNARMED_ATTACKBY "human_melee_unarmed_attackby" //! from mob/living/carbon/human/UnarmedAttack(): (mob/living/carbon/human/attacker)
#define COMSIG_HUMAN_DISARM_HIT "human_disarm_hit" //! Hit by successful disarm attack (mob/living/carbon/human/attacker,zone_targeted)
#define COMSIG_HUMAN_ATTACKED "carbon_attacked" //hit by something that checks shields.

Expand Down
6 changes: 0 additions & 6 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,11 @@
#define COMSIG_MOB_RECEIVE_ARTIFACT "mob_receive_artifact" //
#define COMPONENT_BLOCK_ARTIFACT 1
#define COMSIG_MOB_HUD_CREATED "mob_hud_created" //! from base of mob/create_mob_hud(): ()
#define COMSIG_MOB_ATTACK_HAND "mob_attack_hand" //! from base of
#define COMSIG_MOB_ATTACK_HAND_TURF "mob_attack_hand_turf" //! from base of turf/attack_hand
#define COMSIG_MOB_HAND_ATTACKED "mob_hand_attacked" //! from base of
#define COMSIG_MOB_ITEM_ATTACK "mob_item_attack" //! from base of /obj/item/attack(): (mob/M, mob/user)
#define COMPONENT_ITEM_NO_ATTACK 1
#define COMSIG_MOB_ITEM_ATTACKBY "mob_item_attackby" //! from base of /obj/item/attack(): (mob/user, src)
#define COMSIG_MOB_EQUIPPED_ITEM "mob_equipped_item" //! from base of /item/equipped(): (/mob/user, /obj/item, slot)
#define COMSIG_MOB_DROPPED_ITEM "mob_dropped_item" //! from base of /item/dropped(): (/mob/user, /obj/item, loc)
#define COMSIG_MOB_APPLY_DAMGE "mob_apply_damage" //! from base of /mob/living/proc/apply_damage(): (damage, damagetype, def_zone)
#define COMSIG_MOB_ITEM_AFTERATTACK "mob_item_afterattack" //! from base of obj/item/afterattack(): (atom/target, mob/user, proximity_flag, click_parameters)
#define COMSIG_MOB_ATTACK_RANGED "mob_attack_ranged" //! from base of mob/RangedAttack(): (atom/A, params)
#define COMSIG_MOB_THROW "mob_throw" //! from base of /mob/throw_item(): (atom/target)
#define COMSIG_MOB_UPDATE_SIGHT "mob_update_sight" //! from base of /mob/update_sight(): ()
#define COMSIG_MOB_EXAMINATE "mob_examinate" //from base of /mob/verb/examinate(): (atom/target)
Expand Down
20 changes: 20 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mobattack.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Format:
// When the signal is called: (signal arguments)
// All signals send the source datum of the signal as the first argument

/* Attack signals. They should share the returned flags, to standardize the attack chain. */

///from base of atom/attack_hand(): (mob/user)
#define COMSIG_MOB_ATTACK_HAND "mob_attack_hand"
///from base of /obj/item/attack(): (mob/M, mob/user)
#define COMSIG_MOB_ITEM_ATTACK "mob_item_attack"
///from base of obj/item/afterattack(): (atom/target, mob/user, proximity_flag, click_parameters)
#define COMSIG_MOB_ITEM_AFTERATTACK "mob_item_afterattack"
///from base of obj/item/attack_qdeleted(): (atom/target, mob/user, proxiumity_flag, click_parameters)
#define COMSIG_MOB_ITEM_ATTACK_QDELETED "mob_item_attack_qdeleted"
///from base of mob/RangedAttack(): (atom/A, params)
#define COMSIG_MOB_ATTACK_RANGED "mob_attack_ranged"
///from mob/living/carbon/human/UnarmedAttack(): (atom/target, proximity)
#define COMSIG_HUMAN_EARLY_UNARMED_ATTACK "human_early_unarmed_attack"
///from mob/living/carbon/human/UnarmedAttack(): (atom/target, proximity)
#define COMSIG_HUMAN_MELEE_UNARMED_ATTACK "human_melee_unarmed_attack"
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
// All signals send the source datum of the signal as the first argument

// /obj/item signals
#define COMSIG_ITEM_ATTACK "item_attack" //! from base of obj/item/attack(): (/mob/living/target, /mob/living/user)
#define COMSIG_ITEM_ATTACK_SELF "item_attack_self" //! from base of obj/item/attack_self(): (/mob)
#define COMPONENT_NO_INTERACT 1
#define COMSIG_ITEM_ATTACK_OBJ "item_attack_obj" //! from base of obj/item/attack_obj(): (/obj, /mob)
#define COMPONENT_NO_ATTACK_OBJ 1
#define COMSIG_ITEM_PRE_ATTACK "item_pre_attack" //! from base of obj/item/pre_attack(): (atom/target, mob/user, params)
#define COMPONENT_NO_ATTACK 1
#define COMSIG_ITEM_AFTERATTACK "item_afterattack" //! from base of obj/item/afterattack(): (atom/target, mob/user, proximity_flag, params)
///from base of obj/item/equipped(): (/mob/equipper, slot)
#define COMSIG_ITEM_EQUIPPED "item_equip"
///from base of obj/item/on_grind(): ())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Format:
// When the signal is called: (signal arguments)
// All signals send the source datum of the signal as the first argument

/* Attack signals. They should share the returned flags, to standardize the attack chain. */
///from base of obj/item/attack(): (/mob/living/target, /mob/living/user)
#define COMSIG_ITEM_ATTACK "item_attack"

#define COMSIG_MOB_ITEM_ATTACKBY "item_attackby"
///from base of obj/item/attack_self(): (/mob)
#define COMSIG_ITEM_ATTACK_SELF "item_attack_self"
///from base of obj/item/attack_obj(): (/obj, /mob)
#define COMSIG_ITEM_ATTACK_OBJ "item_attack_obj"
///from base of obj/item/pre_attack(): (atom/target, mob/user, params)
#define COMSIG_ITEM_PRE_ATTACK "item_pre_attack"
///from base of obj/item/afterattack(): (atom/target, mob/user, params)
#define COMSIG_ITEM_AFTERATTACK "item_afterattack"
///from base of obj/item/attack_qdeleted(): (atom/target, mob/user, params)
#define COMSIG_ITEM_ATTACK_QDELETED "item_attack_qdeleted"
Loading

0 comments on commit 22f035f

Please sign in to comment.