Skip to content

Commit

Permalink
UPD читаемости
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoonij authored Sep 22, 2024
1 parent 0e3b590 commit a8069a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,14 @@
/mob/living/UnarmedAttack(atom/atom, proximity_flag)
if(!can_unarmed_attack())
return

var/signal = SEND_SIGNAL(src, COMSIG_LIVING_UNARMED_ATTACK, atom, proximity_flag)
if(signal & COMPONENT_CANCEL_UNARMED_ATTACK)
return

if(signal & COMPONENT_CANCEL_ATTACK_CHAIN)
return

if(pre_grab_attack(atom, proximity_flag))
return

Expand All @@ -114,6 +117,7 @@
if(atom.grab_attack(src, pulling))
changeNext_move(grab_state > GRAB_PASSIVE ? CLICK_CD_GRABBING : CLICK_CD_PULLING)
return TRUE

return FALSE

/mob/living/OnUnarmedAttack(atom/atom, proximity_flag)
Expand Down Expand Up @@ -142,6 +146,7 @@
if(atom.grab_attack(src, pulling))
changeNext_move(grab_state > GRAB_PASSIVE ? CLICK_CD_GRABBING : CLICK_CD_PULLING)
return TRUE

return FALSE

/atom/proc/attack_alien(mob/living/carbon/alien/user)
Expand Down
4 changes: 4 additions & 0 deletions code/datums/elements/reagent_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@
/datum/element/reagent_attack/proc/can_inject(mob/living/carbon/target, target_zone)
if(!istype(target))
return FALSE

if(reagent_limit && target.reagents.has_reagent(reagent_id, reagent_limit))
return FALSE

if(!piercing && !target.can_inject(null, FALSE, target_zone, FALSE))
return FALSE

return TRUE

/datum/element/reagent_attack/proc/inject(atom/source, mob/living/carbon/target, target_zone)
if(reagent_id && reagent_amount)
target.reagents.add_reagent(reagent_id, reagent_amount)

SEND_SIGNAL(source, COMSIG_REAGENT_INJECTED, target, reagent_id, reagent_amount, target_zone) // custom injections!
return

0 comments on commit a8069a4

Please sign in to comment.