local Base = require("Battle/Logic/AI/Decision/Decision_Base") local Decision_SendAiMessage = class("Decision_SendAiMessage", Base) --[[ 初始化 --]] function Decision_SendAiMessage:initialize(entity) --类型 self.Type = LuaConst.DecisionType.SendAiMessage --瞬时 self.IsOnce = true end --[[ 输出指令 --]] function Decision_SendAiMessage:SetCommand(entity, decisionData, command) command.DecisionID = decisionData.ID return command end --[[ 执行 --]] function Decision_SendAiMessage:Handle(entity, decisionData, stateType, animName) local id = decisionData.IntParam1 local characterId = decisionData.IntParam2 or 0 local entityDic = BattleDataGetter.GetEntityDic() if characterId > 0 then for k,v in pairs(entityDic) do if v:GetCharacterID() == characterId then SystemManager.OnNotifyAI(v,id) end end else for k,v in pairs(entityDic) do SystemManager.OnNotifyAI(v,id) end end return LuaConst.StateType.None,nil end return Decision_SendAiMessage