public Actor.SearchInfo GetSearchInfo() { if (this._searchInfo == null && Singleton <Resources> .IsInstance()) { CommonDefine commonDefine = Singleton <Resources> .Instance.CommonDefine; Resources.GameInfoTables gameInfo = Singleton <Resources> .Instance.GameInfo; ItemIDKeyPair driftwoodId = commonDefine.ItemIDDefine.DriftwoodID; StuffItemInfo stuffItemInfo = gameInfo.GetItem(driftwoodId.categoryID, driftwoodId.itemID); if (stuffItemInfo == null) { return((Actor.SearchInfo)null); } this._searchInfo = new Actor.SearchInfo() { IsSuccess = true, ItemList = new List <Actor.ItemSearchInfo>() { new Actor.ItemSearchInfo() { categoryID = stuffItemInfo.CategoryID, id = stuffItemInfo.ID, name = stuffItemInfo.Name, count = 1 } } }; } return(this._searchInfo); }
private void OnComplete(AgentActor agent) { ItemIDKeyPair gauzeID = Singleton <Resources> .Instance.CommonDefine.ItemIDDefine.GauzeID; StuffItem stuffItem1 = agent.AgentData.ItemList.Find((Predicate <StuffItem>)(x => x.CategoryID == gauzeID.categoryID && x.ID == gauzeID.itemID)); StuffItem stuffItem2 = new StuffItem(stuffItem1.CategoryID, stuffItem1.ID, 1); agent.AgentData.ItemList.RemoveItem(stuffItem2); }
public virtual TaskStatus OnUpdate() { if (this.Agent.EquipedItem == null) { return((TaskStatus)1); } ItemIDKeyPair umbrellaId = Singleton <Resources> .Instance.CommonDefine.ItemIDDefine.UmbrellaID; return(Singleton <Resources> .Instance.GameInfo.CommonEquipEventItemTable[umbrellaId.categoryID][umbrellaId.itemID].EventItemID == this.Agent.EquipedItem.EventItemID ? (TaskStatus)2 : (TaskStatus)1); }
public virtual TaskStatus OnUpdate() { ItemIDKeyPair gauzeId = Singleton <Resources> .Instance.CommonDefine.ItemIDDefine.GauzeID; foreach (StuffItem stuffItem in this.Agent.AgentData.ItemList) { if (stuffItem.CategoryID == gauzeId.categoryID && stuffItem.ID == gauzeId.itemID) { return((TaskStatus)2); } } return((TaskStatus)1); }
protected override void OnCompletedStateTask() { this.Agent.SetDesire(Desire.GetDesireKey(Desire.Type.Drink), 0.0f); AgentActor agent = this.Agent; agent.ApplyDrinkParameter(this._targetItem); ItemIDKeyPair coconutDrinkId = Singleton <Resources> .Instance.AgentProfile.CoconutDrinkID; if (this._targetItem.CategoryID == coconutDrinkId.categoryID && this._targetItem.ID == coconutDrinkId.itemID) { agent.SetStatus(0, 50f); } this._targetItem = (StuffItem)null; }
public virtual void OnStart() { AgentActor agent = this.Agent; if (agent.EquipedItem != null) { ItemCache equipedItem = agent.EquipedItem; if (equipedItem.EventItemID == Singleton <Resources> .Instance.LocomotionProfile.ObonEventItemID) { return; } ItemIDKeyPair umbrellaId = Singleton <Resources> .Instance.CommonDefine.ItemIDDefine.UmbrellaID; EquipEventItemInfo equipEventItemInfo = Singleton <Resources> .Instance.GameInfo.CommonEquipEventItemTable[umbrellaId.categoryID][umbrellaId.itemID]; if (equipedItem.EventItemID == equipEventItemInfo.EventItemID) { return; } } ((Task)this).OnStart(); agent.StopNavMeshAgent(); agent.ChangeStaticNavMeshAgentAvoidance(); int id = agent.AgentData.SickState.ID; this._info = (PlayState)null; Dictionary <int, Dictionary <int, PlayState> > agentActionAnimTable = Singleton <Resources> .Instance.Animation.AgentActionAnimTable; AgentProfile.PoseIDCollection poseIdTable = Singleton <Resources> .Instance.AgentProfile.PoseIDTable; PoseKeyPair?nullable = new PoseKeyPair?(); switch (id) { case 0: nullable = new PoseKeyPair?(poseIdTable.CoughID); break; case 4: nullable = new PoseKeyPair?(poseIdTable.StandHurtID); break; default: if ((double)agent.AgentData.StatsTable[2] <= 0.0) { nullable = new PoseKeyPair?(poseIdTable.StandHurtID); break; } switch (Singleton <Manager.Map> .Instance.Simulator.Temperature) { case Temperature.Hot: nullable = new PoseKeyPair?(poseIdTable.ColdPoseID); break; case Temperature.Cold: nullable = new PoseKeyPair?(poseIdTable.ColdPoseID); break; } break; } if (!nullable.HasValue) { return; } this._info = agentActionAnimTable[nullable.Value.postureID][nullable.Value.poseID]; if (this._info == null) { return; } agent.Animation.LoadEventKeyTable(nullable.Value.postureID, nullable.Value.poseID); this._layer = this._info.Layer; this._inEnableFade = this._info.MainStateInfo.InStateInfo.EnableFade; this._inFadeTime = this._info.MainStateInfo.InStateInfo.FadeSecond; agent.Animation.OnceActionStates.Clear(); if (!this._info.MainStateInfo.InStateInfo.StateInfos.IsNullOrEmpty <PlayState.Info>()) { foreach (PlayState.Info stateInfo in this._info.MainStateInfo.InStateInfo.StateInfos) { agent.Animation.OnceActionStates.Add(stateInfo); } } agent.Animation.OutStates.Clear(); if (!this._info.MainStateInfo.OutStateInfo.StateInfos.IsNullOrEmpty <PlayState.Info>()) { foreach (PlayState.Info stateInfo in this._info.MainStateInfo.OutStateInfo.StateInfos) { agent.Animation.OutStates.Enqueue(stateInfo); } } agent.Animation.PlayOnceActionAnimation(this._inEnableFade, this._inFadeTime, this._layer); this._onEndActionDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (Action <M0>)(_ => { agent.Animation.StopAllAnimCoroutine(); agent.Animation.PlayOutAnimation(this._outEnableFade, this._outFadeTime, this._layer); })); }