// Use this for initialization void Start() { m_actionPointInfos.Clear(); Hashtable actionPointDB = sdConfDataMgr.Instance().m_actionPointDB; foreach (DictionaryEntry item in actionPointDB) { ActionPoint actionPoint = item.Value as ActionPoint; ActionPointInfo actionPointInfo = new ActionPointInfo(); actionPointInfo.SpiritNum = actionPoint.SpiritNum; actionPointInfo.CostNonCash = actionPoint.CostNonCash; actionPointInfo.NeedVIPLevel = actionPoint.NeedVIPLevel; m_actionPointInfos.Add(actionPointInfo); } m_actionPointInfos.Sort(delegate(ActionPointInfo x, ActionPointInfo y) { return(x.SpiritNum.CompareTo(y.SpiritNum)); }); /* * if (Application.platform == RuntimePlatform.Android || * Application.platform == RuntimePlatform.IPhonePlayer) * { * GHome.GetInstance().GetAreaConfig((code, msg, data) => * { * if (code == 0) * { * string json = (string)data["data"]; * JsonNode NODE = new JsonNode(); * int iPOS = 0; * NODE.Parse(json,ref iPOS); * List<JsonNode> lstAREA = new List<JsonNode>(); * NODE.FindListHasAttibuteName("area_code",lstAREA); * //foreach() * //SDGlobal.phoneNumber = (string)data["userId"]; * //SDGlobal.ticket = (string)data["ticket"]; * } * else * { * sdUICharacter.Instance.ShowMsgLine("GHome.GetInstance().GetAreaConfig() failure!", Color.red); * } * }); * } */ }
private void ChangeModeRelatedSleep(PlayerActor player) { PoseKeyPair sleepTogetherRight = Singleton <Resources> .Instance.AgentProfile.PoseIDTable.SleepTogetherRight; PoseKeyPair sleepTogetherLeft = Singleton <Resources> .Instance.AgentProfile.PoseIDTable.SleepTogetherLeft; List <ActionPoint> groupActionPoints = player.CurrentPoint.GroupActionPoints; ActionPoint actionPoint1 = (ActionPoint)null; foreach (ActionPoint actionPoint2 in groupActionPoints) { if (actionPoint2.IsNeutralCommand) { actionPoint1 = actionPoint2; break; } } bool flag = false; ActionPointInfo outInfo = new ActionPointInfo(); if (Object.op_Inequality((Object)actionPoint1, (Object)null)) { flag = actionPoint1.FindAgentActionPointInfo(AIProject.EventType.Sleep, sleepTogetherRight.poseID, out outInfo) || actionPoint1.FindAgentActionPointInfo(AIProject.EventType.Sleep, sleepTogetherLeft.poseID, out outInfo); } List <AgentActor> agentActorList1 = ListPool <AgentActor> .Get(); List <AgentActor> agentActorList2 = ListPool <AgentActor> .Get(); using (IEnumerator <KeyValuePair <int, AgentActor> > enumerator = Singleton <Manager.Map> .Instance.AgentTable.GetEnumerator()) { while (enumerator.MoveNext()) { KeyValuePair <int, AgentActor> current = enumerator.Current; if (current.Value.Mode != Desire.ActionType.Cold2A && current.Value.Mode != Desire.ActionType.Cold2B && (current.Value.Mode != Desire.ActionType.Cold3A && current.Value.Mode != Desire.ActionType.Cold3B) && (current.Value.Mode != Desire.ActionType.OverworkA && current.Value.Mode != Desire.ActionType.OverworkB && (current.Value.Mode != Desire.ActionType.Cold2BMedicated && current.Value.Mode != Desire.ActionType.Cold3BMedicated)) && (current.Value.Mode != Desire.ActionType.WeaknessA && current.Value.Mode != Desire.ActionType.WeaknessB && (current.Value.Mode != Desire.ActionType.FoundPeeping && current.Value.EventKey != AIProject.EventType.Sleep) && (current.Value.EventKey != AIProject.EventType.Toilet && current.Value.EventKey != AIProject.EventType.Bath && (current.Value.EventKey != AIProject.EventType.Move && current.Value.EventKey != AIProject.EventType.Masturbation))) && current.Value.EventKey != AIProject.EventType.Lesbian) { MapArea mapArea = current.Value.MapArea; int? nullable1; int? nullable2; if (mapArea == null) { nullable1 = new int?(); nullable2 = nullable1; } else { nullable2 = new int?(mapArea.ChunkID); } nullable1 = nullable2; int num = !nullable1.HasValue ? current.Value.AgentData.ChunkID : nullable1.Value; if (player.ChunkID == num) { if (Game.isAdd01 && current.Value.ChaControl.fileGameInfo.hSkill.ContainsValue(13)) { agentActorList1.Add(current.Value); } else if (flag && current.Value.ChaControl.fileGameInfo.flavorState[1] >= Singleton <Resources> .Instance.StatusProfile.SoineReliabilityBorder && (current.Value.Mode == Desire.ActionType.Normal || current.Value.Mode == Desire.ActionType.SearchSleep || current.Value.Mode == Desire.ActionType.Encounter)) { agentActorList2.Add(current.Value); } } } } } AgentActor element1 = agentActorList1.GetElement <AgentActor>(Random.Range(0, agentActorList1.Count)); ListPool <AgentActor> .Release(agentActorList1); AgentActor element2 = agentActorList2.GetElement <AgentActor>(Random.Range(0, agentActorList2.Count)); ListPool <AgentActor> .Release(agentActorList2); if (Object.op_Inequality((Object)element1, (Object)null)) { element1.Animation.ResetDefaultAnimatorController(); element1.TargetInSightActionPoint = (ActionPoint)null; element1.TargetInSightActor = (Actor)player; this.ChangeForceBehavior(element1, Desire.ActionType.ChaseYobai); } else { if (!Object.op_Inequality((Object)element2, (Object)null)) { return; } element2.Animation.ResetDefaultAnimatorController(); actionPoint1.Reserver = (Actor)element2; element2.TargetInSightActionPoint = actionPoint1; element2.TargetInSightActor = (Actor)null; this.ChangeForceBehavior(element2, Desire.ActionType.ComeSleepTogether); } }