behavior3行为树
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 

23 行
562 B

%%%-------------------------------------------------------------------
%%% @author DY
%%% @copyright (C) 2020, <COMPANY>
%%% @doc
%%% 判断自己是否死亡
%%% 死亡:SUCCESS
%%% 存活:FAILURE
%%% @end
%%% Created : 07. 10月 2020 15:26
%%%-------------------------------------------------------------------
-module(cond_is_died).
-include("eBhv3.hrl").
%% API
-export([tick/2]).
tick(_BTree, #{cur_power := CurPower} = State) ->
case CurPower =< 0 of
true ->
{?BT_SUCCESS, State};
false ->
{?BT_FAILURE, State}
end.