behavior3行为树
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 line
562 B

  1. %%%-------------------------------------------------------------------
  2. %%% @author DY
  3. %%% @copyright (C) 2020, <COMPANY>
  4. %%% @doc
  5. %%% 判断自己是否死亡
  6. %%% 死亡:SUCCESS
  7. %%% 存活:FAILURE
  8. %%% @end
  9. %%% Created : 07. 10月 2020 15:26
  10. %%%-------------------------------------------------------------------
  11. -module(cond_is_died).
  12. -include("eBhv3.hrl").
  13. %% API
  14. -export([tick/2]).
  15. tick(_BTree, #{cur_power := CurPower} = State) ->
  16. case CurPower =< 0 of
  17. true ->
  18. {?BT_SUCCESS, State};
  19. false ->
  20. {?BT_FAILURE, State}
  21. end.