mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 12:08:55 +01:00
## About The Pull Request - Deletes `spec_unarmedattack` - Deletes `spec_unarmedattacked` - Replaces `COMSIG_HUMAN_EARLY_UNARMED_ATTACK` with `COMSIG_LIVING_EARLY_UNARMED_ATTACK` - Replaces uses of `COMSIG_HUMAN_MELEE_UNARMED_ATTACK` with `COMSIG_LIVING_EARLY_UNARMED_ATTACK` - Fixes(?)(I've never seen this work) / Elementizes Monkey ability to bite while handcuffed - Monkey clever `attack paw` / `attack hand` thing is now handled the same on the human level (via `resolve_unarmed_attack`) ## Why It's Good For The Game Atomized from swing branch. I was really annoyed with these two signals, this kinda unifies the behavior between living and human mobs (they were already quite similar). One thing of note is that this will make dis-coordinated humans use `attack_paw` rather than `attack_hand`, so they'll bite people instead of punching them. I'm not sure if this is what we want, if we wanna tweak that before then I can by all means. ## Changelog 🆑 Melbert refactor: Refactored unarmed attacking mechanisms, this means dis-coordinated humans will now bite people like monkeys (like how coordinated monkeys punch people like humans?) refactor: Dis-coordinated humans smashing up machines now use their hands, rather than their paws /🆑 --------- Co-authored-by: san7890 <the@san7890.com>
43 lines
1.4 KiB
Plaintext
43 lines
1.4 KiB
Plaintext
/// This component lets mobs dig up the floor with their bare hands
|
|
/datum/component/shovel_hands
|
|
dupe_mode = COMPONENT_DUPE_SOURCES
|
|
/// It's a lie, they're actually just using a shovel
|
|
var/obj/item/shovel/internal_shovel
|
|
|
|
/datum/component/shovel_hands/Initialize()
|
|
. = ..()
|
|
if (!isliving(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
|
|
internal_shovel = new(null)
|
|
RegisterSignal(internal_shovel, COMSIG_QDELETING, PROC_REF(shovel_destroyed))
|
|
|
|
/datum/component/shovel_hands/RegisterWithParent()
|
|
. = ..()
|
|
RegisterSignals(parent, list(COMSIG_LIVING_UNARMED_ATTACK, COMSIG_HOSTILE_PRE_ATTACKINGTARGET), PROC_REF(dig))
|
|
|
|
/datum/component/shovel_hands/UnregisterFromParent()
|
|
UnregisterSignal(parent, list(COMSIG_LIVING_UNARMED_ATTACK, COMSIG_HOSTILE_PRE_ATTACKINGTARGET))
|
|
return ..()
|
|
|
|
/datum/component/shovel_hands/Destroy(force, silent)
|
|
if (internal_shovel)
|
|
UnregisterSignal(internal_shovel, COMSIG_QDELETING)
|
|
QDEL_NULL(internal_shovel)
|
|
return ..()
|
|
|
|
/// Called when you click on literally anything with your hands
|
|
/datum/component/shovel_hands/proc/dig(mob/living/mole, atom/target)
|
|
SIGNAL_HANDLER
|
|
if (!isopenturf(target))
|
|
return
|
|
|
|
INVOKE_ASYNC(target, TYPE_PROC_REF(/atom, attackby), internal_shovel, mole)
|
|
return COMPONENT_CANCEL_ATTACK_CHAIN
|
|
|
|
/// Don't know how the fuck this happened but I guess you can't dig any more
|
|
/datum/component/shovel_hands/proc/shovel_destroyed(atom/shovel)
|
|
SIGNAL_HANDLER
|
|
UnregisterSignal(shovel, COMSIG_QDELETING)
|
|
qdel(src)
|