Basic mobs targeting, attacks, and pig migration. (#28987)

* Basic mobs targeting, attacks, and pig migration.

* run updatepaths

* fix duplicate macro def

* Update code/datums/ai/basic_mobs/basic_ai_behaviors/basic_attacking.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: warriorstar-orion <orion@snowfrost.garden>

---------

Signed-off-by: warriorstar-orion <orion@snowfrost.garden>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
warriorstar-orion
2025-04-15 14:45:56 +00:00
committed by GitHub
co-authored by Burzah
parent 5da3694877
commit efc8adb6dd
44 changed files with 1190 additions and 69 deletions
+17 -2
View File
@@ -66,14 +66,29 @@
if(sigreturn & COMPONENT_SKIP_ATTACK)
return FALSE
target.attack_animal(src)
resolve_unarmed_attack(target, modifiers)
/mob/living/simple_animal/hostile/UnarmedAttack(atom/A)
target = A
AttackingTarget()
/mob/living/proc/resolve_unarmed_attack(atom/attack_target, list/modifiers)
attack_target.attack_animal(src, modifiers)
/atom/proc/attack_animal(mob/user)
return
SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_ANIMAL, user)
///When a basic mob attacks something, either by AI or user.
/atom/proc/attack_basic_mob(mob/user, list/modifiers)
SHOULD_CALL_PARENT(TRUE)
if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_BASIC_MOB, user) & COMPONENT_BASIC_ATTACK_CANCEL_CHAIN)
return
return handle_basic_attack(user, modifiers) //return value of attack animal, this is how much damage was dealt to the attacked thing
///This exists so stuff can override the default call of attack_animal for attack_basic_mob
///Remove this when simple animals are removed and everything can be handled on attack basic mob.
/atom/proc/handle_basic_attack(user, modifiers)
return attack_animal(user, modifiers)
/mob/living/RestrainedClickOn(atom/A)
return