protected override void OnCompletedStateTask() { AgentActor agent = this.Agent; int desireKey = Desire.GetDesireKey(Desire.Type.Cook); agent.SetDesire(desireKey, 0.0f); if (this._createItem == null) { return; } StuffItemInfo info = Singleton <Resources> .Instance.GameInfo.GetItem(this._createItem.item.CategoryID, this._createItem.item.ID); MapUIContainer.AddItemLog((Actor)agent, info, this._createItem.info.CreateSum, false); this._createItem = (CraftUI.CreateItem)null; }
protected override void OnCompletedStateTask() { AgentActor agent = this.Agent; int desireKey = Desire.GetDesireKey(Desire.Type.Hunt); agent.SetDesire(desireKey, 0.0f); Dictionary <int, AIProject.SaveData.Environment.SearchActionInfo> searchActionLockTable = agent.AgentData.SearchActionLockTable; AIProject.SaveData.Environment.SearchActionInfo searchActionInfo; if (!searchActionLockTable.TryGetValue(agent.CurrentPoint.RegisterID, out searchActionInfo)) { searchActionInfo = new AIProject.SaveData.Environment.SearchActionInfo(); } ++searchActionInfo.Count; searchActionLockTable[agent.CurrentPoint.RegisterID] = searchActionInfo; ActionPoint currentPoint = this.Agent.CurrentPoint; Dictionary <int, ItemTableElement> itemTableInArea = Singleton <Resources> .Instance.GameInfo.GetItemTableInArea(currentPoint.IDList.IsNullOrEmpty <int>()?currentPoint.ID : currentPoint.IDList.GetElement <int>(0)); if (itemTableInArea != null) { ; } Actor.SearchInfo searchInfo = agent.RandomAddItem(itemTableInArea, false); if (!searchInfo.IsSuccess) { return; } foreach (Actor.ItemSearchInfo itemSearchInfo in searchInfo.ItemList) { StuffItem stuffItem = new StuffItem(itemSearchInfo.categoryID, itemSearchInfo.id, itemSearchInfo.count); agent.AgentData.ItemList.AddItem(stuffItem); StuffItemInfo info = Singleton <Resources> .Instance.GameInfo.GetItem(itemSearchInfo.categoryID, itemSearchInfo.id); MapUIContainer.AddItemLog((Actor)agent, info, itemSearchInfo.count, false); } }