Skip to content

Commit

Permalink
Trowback -> Throwback and nade AI action define
Browse files Browse the repository at this point in the history
  • Loading branch information
xDanilcusx committed Sep 19, 2024
1 parent 0e4e5e1 commit 59d88ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion code/__DEFINES/human_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#define AI_ACTION_PICKUP_GUN /datum/ongoing_action/item_pickup/pickup_primary
#define AI_ACTION_COVER /datum/ongoing_action/take_cover
#define AI_ACTION_COVER_I /datum/ongoing_action/take_inside_cover
#define AI_ACTION_TROWBACK /datum/ongoing_action/throw_back_nade
#define AI_ACTION_THROWBACK /datum/ongoing_action/throw_back_nade
#define AI_ACTION_NADE /datum/ongoing_action/throw_grenade

/// Action is completed, delete this and move onto the next ongoing action
#define ONGOING_ACTION_COMPLETED "completed"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/ai/brain/ai_brain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ GLOBAL_LIST_EMPTY(human_ai_brains)
tied_human.swap_hand()

/datum/human_ai_brain/proc/nade_throwback(list/things_around)
if(has_ongoing_action(AI_ACTION_TROWBACK))
if(has_ongoing_action(AI_ACTION_THROWBACK))
return

var/turf/place_to_throw
Expand Down Expand Up @@ -192,7 +192,7 @@ GLOBAL_LIST_EMPTY(human_ai_brains)
return

throw_back_nade:
ADD_ONGOING_ACTION(src, AI_ACTION_TROWBACK, throw_nade, place_to_throw)
ADD_ONGOING_ACTION(src, AI_ACTION_THROWBACK, throw_nade, place_to_throw)

/// Use ADD_ONGOING_ACTION() macro instead of calling this directly
/datum/human_ai_brain/proc/_add_ongoing_action(datum/ongoing_action/path, ...)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,13 @@
attack_target()

/datum/human_ai_brain/proc/throw_grenade_cover()
if(!target_floor || has_ongoing_action(/datum/ongoing_action/throw_grenade))
if(!target_floor || has_ongoing_action(AI_ACTION_NADE))
return

var/obj/item/explosive/grenade/nade = locate() in equipment_map[HUMAN_AI_GRENADES]
if(!nade)
return

ADD_ONGOING_ACTION(src, /datum/ongoing_action/throw_grenade, nade, target_floor)
ADD_ONGOING_ACTION(src, AI_ACTION_NADE, nade, target_floor)

#undef EXTRA_CHECK_DISTANCE_MULTIPLIER

0 comments on commit 59d88ad

Please sign in to comment.