mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 17:14:47 +01:00
Mob attackedby / check_block refactor, plus some minor cleanup of attack_x procs (#79563)
## About The Pull Request - Deletes `spec_attacked_by` - Elements simple/basic mob attack threshold - There was a skeleton mob that "mimics armor" but didn't use the actual mimicing armor thing we have, so I changed that. - Moves `check_shields` down to the living level, renames it to `check_block` - Martial art blocking is now signalized (only CQC uses it anyways) - Cleaned up a bit of `attack_x` procs, but not a lot. Should have an entire PR dedicated to this .... mess. - Deprecates `/obj/item/melee` ## Why It's Good For The Game Second verse, same as the first. - Less bad species related procs. - Largely brings a lot of code in line, making combat more consistent across types. - Makes it a lot easier to add new code relating to blocking or taking damage. ## Changelog 🆑 Melbert refactor: Refactored another large chuck of attack code, primarily involving melee item attacks and non-human mob attacks. Report if you see anything weird fix: Pacifists clicking on simple robots or silicons no longer causes sparks fix: Blocked thrown batons are now properly... blocked /🆑
This commit is contained in:
@@ -120,13 +120,13 @@
|
||||
/obj/item/mod/module/energy_shield/on_suit_activation()
|
||||
mod.AddComponent(/datum/component/shielded, max_charges = max_charges, recharge_start_delay = recharge_start_delay, charge_increment_delay = charge_increment_delay, \
|
||||
charge_recovery = charge_recovery, lose_multiple_charges = lose_multiple_charges, recharge_path = recharge_path, starting_charges = charges, shield_icon_file = shield_icon_file, shield_icon = shield_icon)
|
||||
RegisterSignal(mod.wearer, COMSIG_HUMAN_CHECK_SHIELDS, PROC_REF(shield_reaction))
|
||||
RegisterSignal(mod.wearer, COMSIG_LIVING_CHECK_BLOCK, PROC_REF(shield_reaction))
|
||||
|
||||
/obj/item/mod/module/energy_shield/on_suit_deactivation(deleting = FALSE)
|
||||
var/datum/component/shielded/shield = mod.GetComponent(/datum/component/shielded)
|
||||
charges = shield.current_charges
|
||||
qdel(shield)
|
||||
UnregisterSignal(mod.wearer, COMSIG_HUMAN_CHECK_SHIELDS)
|
||||
UnregisterSignal(mod.wearer, COMSIG_LIVING_CHECK_BLOCK)
|
||||
|
||||
/obj/item/mod/module/energy_shield/proc/shield_reaction(mob/living/carbon/human/owner,
|
||||
atom/movable/hitby,
|
||||
@@ -140,7 +140,7 @@
|
||||
|
||||
if(SEND_SIGNAL(mod, COMSIG_ITEM_HIT_REACT, owner, hitby, attack_text, 0, damage, attack_type, damage_type) & COMPONENT_HIT_REACTION_BLOCK)
|
||||
drain_power(use_power_cost)
|
||||
return SHIELD_BLOCK
|
||||
return SUCCESSFUL_BLOCK
|
||||
return NONE
|
||||
|
||||
/obj/item/mod/module/energy_shield/wizard
|
||||
|
||||
@@ -67,10 +67,10 @@
|
||||
overlay_state_use = "module_pepper_used"
|
||||
|
||||
/obj/item/mod/module/pepper_shoulders/on_suit_activation()
|
||||
RegisterSignal(mod.wearer, COMSIG_HUMAN_CHECK_SHIELDS, PROC_REF(on_check_shields))
|
||||
RegisterSignal(mod.wearer, COMSIG_LIVING_CHECK_BLOCK, PROC_REF(on_check_block))
|
||||
|
||||
/obj/item/mod/module/pepper_shoulders/on_suit_deactivation(deleting = FALSE)
|
||||
UnregisterSignal(mod.wearer, COMSIG_HUMAN_CHECK_SHIELDS)
|
||||
UnregisterSignal(mod.wearer, COMSIG_LIVING_CHECK_BLOCK)
|
||||
|
||||
/obj/item/mod/module/pepper_shoulders/on_use()
|
||||
. = ..()
|
||||
@@ -84,7 +84,7 @@
|
||||
smoke.start(log = TRUE)
|
||||
QDEL_NULL(capsaicin_holder) // Reagents have a ref to their holder which has a ref to them. No leaks please.
|
||||
|
||||
/obj/item/mod/module/pepper_shoulders/proc/on_check_shields()
|
||||
/obj/item/mod/module/pepper_shoulders/proc/on_check_block()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!COOLDOWN_FINISHED(src, cooldown_timer))
|
||||
|
||||
Reference in New Issue
Block a user