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.

28 lines
797 B

преди 4 години
преди 4 години
преди 4 години
преди 4 години
  1. %%%-------------------------------------------------------------------
  2. %%% @author DY
  3. %%% @copyright (C) 2020, <COMPANY>
  4. %%% @doc
  5. %%% 判断目标是否死亡
  6. %%% 死亡:SUCCESS
  7. %%% 未死亡:FAILURE
  8. %%% @end
  9. %%% Created : 07. 10月 2020 15:20
  10. %%%-------------------------------------------------------------------
  11. -module(cond_is_target_died).
  12. -include("eBhv3.hrl").
  13. -include("example.hrl").
  14. %% API
  15. -export([tick/2]).
  16. tick(_BTree, State) ->
  17. case State of
  18. #{rival_list := [RivalUID | _]} ->
  19. case game_dict:get_role_state(RivalUID) of
  20. #{cur_state := CurState} when ?IS_STATE(?STATE_TYPE_DEAD, CurState) ->
  21. {?BT_SUCCESS, State};
  22. #{} ->
  23. {?BT_FAILURE, State}
  24. end;
  25. #{} ->
  26. {?BT_FAILURE, State}
  27. end.