INIT
ITEM:__Me
EXTERN TRIGGER:S_BoulderMoveTowardsLocation
// Goal: If player found within range of 10, chase him. If item is blocking within range of 6, take priority and destroy it.
// If nobody in range, continue moving forward
BEHAVIOUR
REACTION BoulderChaseNotBlocked,2000
USAGE COMBAT
CHECK "(c1$!c2)" // if not blocked by items/pathing; c1=getclosestplayer, c2 = potential item in way
CharacterGet(_ClosestChar, __Me, 10.0, Lowest, Distance)
IsEqual(_ClosestChar, null)
ACTIONS
CharacterAttack(_ClosestChar,1)
REACTION BoulderChaseBlocked,3000
USAGE COMBAT
VARS
ITEM:_ClosestItem
CHECK "(c1&!c2)" // if not blocked by items/pathing; c1=getclosestplayer, c1 = item in way
ItemGet(_ClosestItem, __Me, 6.0, Lowest, Distance)
IsEqual(_ClosestItem, null)
ACTIONS
CharacterMoveTo(_ClosestItem)
ItemDestroy(_ClosestItem)
CharacterUseActionPoints(__Me, 2)
REACTION BoulderChaseNobodyFound,1000
USAGE COMBAT
VARS
ITEM:_ClosestItem
CHARACTER:_ClosestChar
CHECK "(c1&c2&c3&c4)" // if not blocked by items/pathing; c1=getclosestplayer, c2 = item in way
CharacterGet(_ClosestChar, __Me, 10.0, Lowest, Distance)
IsEqual(_ClosestChar, null)
ItemGet(_ClosestItem, __Me, 10.0, Lowest, Distance)
IsEqual(_ClosestItem, null)
ACTIONS
CharacterMoveTo(S_BoulderMoveTowardsLocation)
INTERRUPT
ON
OnMovementFailed(_)
ACTIONS
DelayReaction("BoulderChaseNobodyFound", 0.25)