Today I wanted to focus on adding all of the states to the boomshroom so I can begin to refine the boomshrooms AI and fix any bugs I encounter.
The explode state is activated when the boomshroom’s mine count has reached zero. Originally I had planned to use a enumeration to switch to the explode state but I felt this was a much more elegant solution as using an enumeration would involve an extra step. The explode sequence is fairly similar to the walk sequence as it finds the players location and moves towards that location. However, with the explode sequence the boomshroom explodes when the location has been reached.
To allow the plant mine state to be switched to the explode state the reduce number of mines custom event is called every time the boomshroom plants a mine. Eventually the boomshroom will run out of mines to plant and will charge towards the player and explode.
When the boomshroom reaches the players location the explode task is executed. This custom event plays a timeline that controls the size of a sphere that overlaps with the player and applies damage once if the player is within the radius. I had to restrict the damage to apply once because otherwise the damage would be applied every tick of the timeline. When the timeline is completed the boomshroom is destroyed.
Rees, O (2019). Boomshroom going through all of the states. [offline]. [Accessed 09/02/2019].
Rees, O (2019). Plant mine and explode self behaviour tree. [offline]. [Accessed 09/02/2019].
Rees, O (2019). Updated plant mine task. [offline]. [Accessed 09/02/2019].
Rees, O (2019). Reduce number of mines custom event. [offline]. [Accessed 09/02/2019].
Rees, O (2019). Explode self task. [offline]. [Accessed 09/02/2019].
Rees, O (2019). Explode custom event. [offline]. [Accessed 09/02/2019].