public virtual TaskStatus OnUpdate() { ChaFileGameInfo fileGameInfo = this.Agent.ChaControl.fileGameInfo; if (this._checkLow) { if (fileGameInfo.phase <= 1) { return((TaskStatus)2); } if (fileGameInfo.flavorState[1] <= this._border) { return((TaskStatus)2); } } else { if (fileGameInfo.phase <= 1) { return((TaskStatus)1); } if (fileGameInfo.flavorState[1] >= this._border) { return((TaskStatus)2); } } return((TaskStatus)1); }
public void SetFlavorSkill(int id, int value) { ChaFileGameInfo fileGameInfo = this.param.actor.ChaControl.fileGameInfo; if (!fileGameInfo.flavorState.ContainsKey(id)) { return; } int num1 = value - fileGameInfo.flavorState[id]; fileGameInfo.flavorState[id] = Mathf.Clamp(value, 0, 99999); int num2 = fileGameInfo.totalFlavor + num1; fileGameInfo.totalFlavor = Mathf.Max(num2, 0); this.AddFlavorAdditionAmount(num1); }
static void Draw(int id) { GUI.DragWindow(dragRect); GUILayout.BeginArea(innerRect); { GUILayout.BeginHorizontal(); { ChaFileGameInfo info = agent.ChaControl.fileGameInfo; if (info.phase >= 2) { Draw_Agent(info); } } GUILayout.EndHorizontal(); } GUILayout.EndArea(); }
public static void SetFlavorSkill(ChaFileGameInfo fileGameInfo, int id, int value) { int num = value - fileGameInfo.flavorState[id]; fileGameInfo.flavorState[id] = Mathf.Clamp(value, 0, 99999); if (id == 4) { if (!fileGameInfo.isHAddTaii0 && fileGameInfo.flavorState[id] >= 100) { fileGameInfo.isHAddTaii0 = true; } if (!fileGameInfo.isHAddTaii1 && fileGameInfo.flavorState[id] >= 170) { fileGameInfo.isHAddTaii1 = true; } } int a = fileGameInfo.totalFlavor + num; fileGameInfo.totalFlavor = Mathf.Max(a, 0); }
static void Draw_Agent(ChaFileGameInfo info) { scroll0 = Draw_Agent_List(scroll0, "Normal Skills", 16, info.normalSkill); scroll1 = Draw_Agent_List(scroll1, "H Skills", 17, info.hSkill); }
private void OnComplete() { AgentActor agent = this.Agent; int desireKey1 = Desire.GetDesireKey(agent.RuntimeDesire); if (desireKey1 != -1) { agent.SetDesire(desireKey1, 0.0f); } agent.RuntimeDesire = Desire.Type.None; if (agent.CommandPartner is AgentActor) { int num1 = this._relationShip + Random.Range(-10, 10); agent.AgentData.FriendlyRelationShipTable[agent.CommandPartner.ID] = Mathf.Clamp(num1, 0, 100); agent.ApplySituationResultParameter(23); AgentActor commandPartner = agent.CommandPartner as AgentActor; ChaFileGameInfo fileGameInfo = agent.ChaControl.fileGameInfo; if (agent.ChaControl.fileGameInfo.normalSkill.ContainsValue(39)) { commandPartner.AddStatus(3, -20f); } int num2 = fileGameInfo.flavorState[4]; int num3 = fileGameInfo.flavorState[7]; int desireKey2 = Desire.GetDesireKey(Desire.Type.H); float? desire = agent.GetDesire(desireKey2); StatusProfile statusProfile = Singleton <Resources> .Instance.StatusProfile; bool flag = num2 >= statusProfile.LesbianBorder && num3 >= statusProfile.GirlsActionBorder && (desire.HasValue && (double)desire.GetValueOrDefault() >= (double)statusProfile.LesbianBorderDesire); int lesbianBorder = Singleton <Resources> .Instance.StatusProfile.LesbianBorder; if (flag) { agent.Partner = this._partner; commandPartner.Partner = (Actor)agent; agent.ChangeBehavior(Desire.ActionType.GotoLesbianSpot); commandPartner.BehaviorResources.ChangeMode(Desire.ActionType.GotoLesbianSpotFollow); } else { agent.ChangeBehavior(Desire.ActionType.Normal); commandPartner.ChangeBehavior(Desire.ActionType.Normal); } } else if (agent.CommandPartner is MerchantActor) { int num1; if (!Singleton <Resources> .Instance.MerchantProfile.ResultAddFriendlyRelationShipTable.TryGetValue(Merchant.ActionType.TalkWithAgent, out num1)) { num1 = 0; } int num2 = this._relationShip + num1; agent.AgentData.FriendlyRelationShipTable[agent.CommandPartner.ID] = Mathf.Clamp(num2, 0, 100); agent.ApplySituationResultParameter(25); MerchantActor commandPartner = agent.CommandPartner as MerchantActor; StatusProfile statusProfile = Singleton <Resources> .Instance.StatusProfile; int desireKey2 = Desire.GetDesireKey(Desire.Type.H); float? desire = agent.GetDesire(desireKey2); ChaFileGameInfo fileGameInfo = agent.ChaControl.fileGameInfo; int num3 = fileGameInfo.flavorState[4]; int num4 = fileGameInfo.flavorState[7]; if (statusProfile.LesbianBorder <= num3 && statusProfile.GirlsActionBorder <= num4 && (desire.HasValue && (double)statusProfile.LesbianBorderDesire <= (double)desire.GetValueOrDefault())) { agent.Partner = this._partner; this._partner.Partner = (Actor)agent; agent.ChangeBehavior(Desire.ActionType.GotoLesbianSpot); commandPartner.ChangeBehavior(Merchant.ActionType.GotoLesbianSpotFollow); } else { agent.ChangeBehavior(Desire.ActionType.Normal); commandPartner.ChangeBehavior(commandPartner.LastNormalMode); } } int desireKey3 = Desire.GetDesireKey(Desire.Type.Lonely); agent.SetDesire(desireKey3, 0.0f); agent.TargetInSightActor = (Actor)null; agent.CommandPartner = (Actor)null; }
void Draw_Info_Sliders() { ChaFileGameInfo fileGameInfo = controller.ChaControl.fileGameInfo; Dictionary <int, string> lifestyles = Lifestyle.LifestyleName; GUILayout.BeginVertical(GUILayout.Width(ENTRY_WIDTH)); { GUILayout.Label("Sliders", sectionLabelStyle); int phase = (int)Draw_Info_Slider( "Hearts", fileGameInfo.phase, 0, 3, v => (int)v + 1 + " Heart(s)" ); if (phase != fileGameInfo.phase) { fileGameInfo.phase = phase; } int lifestyle = (int)Draw_Info_Slider( "Lifestyle", fileGameInfo.lifestyle, -1, lifestyles.Count - 1, v => (int)v == -1 ? "None" : lifestyles.ContainsKey((int)v) ? lifestyles[(int)v] : "Unknown" ); if (lifestyle != fileGameInfo.lifestyle) { fileGameInfo.lifestyle = lifestyle; } int favoritePlace = (int)Draw_Info_Slider( "Favorite Place", fileGameInfo.favoritePlace, 0, 11 ); if (favoritePlace != fileGameInfo.favoritePlace) { fileGameInfo.favoritePlace = favoritePlace; } GUILayout.Label("Clothes", sectionLabelStyle); for (int i = 0; i < CATEGORY.Length; i++) { int curr = controller.ChaControl.fileStatus.clothesState[i]; int next = (int)Draw_Info_Slider(CATEGORY[i], curr, 0, 2, drawValue: false); if (curr != next) { controller.ChaControl.SetClothesState(i, (byte)next); } } } GUILayout.EndVertical(); }
public virtual TaskStatus OnUpdate() { if (Object.op_Equality((Object)this._partner, (Object)null)) { return((TaskStatus)1); } AgentActor agent = this.Agent; if (agent.LivesTalkSequence) { return((TaskStatus)3); } ChaFileGameInfo fileGameInfo = agent.ChaControl.fileGameInfo; int num1 = fileGameInfo.flavorState[4]; int num2 = fileGameInfo.flavorState[7]; int desireKey = Desire.GetDesireKey(Desire.Type.H); float? desire = agent.GetDesire(desireKey); StatusProfile statusProfile = Singleton <Resources> .Instance.StatusProfile; bool flag = num1 >= statusProfile.LesbianBorder && num2 >= statusProfile.GirlsActionBorder && (desire.HasValue && (double)desire.GetValueOrDefault() >= (double)statusProfile.LesbianBorderDesire); Actor partner = this._partner; if (flag) { agent.Partner = partner; partner.Partner = (Actor)agent; agent.ChangeBehavior(Desire.ActionType.GotoLesbianSpot); switch (partner) { case AgentActor _: AgentActor agentActor = partner as AgentActor; Desire.ActionType mode = Desire.ActionType.GotoLesbianSpotFollow; agentActor.Mode = mode; agentActor.BehaviorResources.ChangeMode(mode); break; case MerchantActor _: (partner as MerchantActor).ChangeBehavior(Merchant.ActionType.GotoLesbianSpotFollow); break; } } else { if ((double)Random.get_value() < 0.5) { agent.ChangeBehavior(Desire.ActionType.SearchMasturbation); } else { agent.SetDesire(desireKey, 0.0f); agent.ChangeBehavior(Desire.ActionType.Normal); } switch (partner) { case AgentActor _: (partner as AgentActor).ChangeBehavior(Desire.ActionType.Normal); break; case MerchantActor _: MerchantActor merchantActor = partner as MerchantActor; merchantActor.ChangeBehavior(merchantActor.LastNormalMode); break; } } agent.CommandPartner = (Actor)null; agent.TargetInSightActor = (Actor)null; switch (partner) { case AgentActor _: (partner as AgentActor).CommandPartner = (Actor)null; break; case MerchantActor _: (partner as MerchantActor).CommandPartner = (Actor)null; break; } return((TaskStatus)2); }
public IEnumerable <CommandData> CreateCommandData(string head) { List <CommandData> list = new List <CommandData>(); string str1 = head + "DesireTable"; foreach (KeyValuePair <int, float> keyValuePair in this.DesireTable) { KeyValuePair <int, float> item = keyValuePair; AgentData agentData = this; int key = item.Key; list.Add(new CommandData(CommandData.Command.FLOAT, str1 + string.Format("[{0}]", (object)key), (Func <object>)(() => (object)item.Value), (System.Action <object>)(o => closure_0.DesireTable[key] = Mathf.Clamp((float)o, 0.0f, 100f)))); } string head1 = head + "SickState"; this.SickState.AddList(list, head1); if (Object.op_Inequality((Object)this.param.actor, (Object)null) && Object.op_Inequality((Object)this.param.actor.ChaControl, (Object)null) && this.param.actor.ChaControl.fileGameInfo != null) { string str2 = head + "StatsTable"; foreach (KeyValuePair <int, float> keyValuePair in this.StatsTable) { KeyValuePair <int, float> item = keyValuePair; int key = item.Key; list.Add(new CommandData(CommandData.Command.FLOAT, str2 + string.Format("[{0}]", (object)key), (Func <object>)(() => item.Key == 7 ? (object)this.param.actor.ChaControl.fileGameInfo.morality : (object)item.Value), (System.Action <object>)(o => { AgentActor actor = this.param.actor as AgentActor; if (!Object.op_Inequality((Object)actor, (Object)null)) { return; } float num1 = (float)o; if (key == 3) { StatusProfile statusProfile = Singleton <Resources> .Instance.StatusProfile; int flavor = actor.ChaControl.fileGameInfo.flavorState[6]; float num2 = AgentActor.FlavorVariation(statusProfile.DarknessPhysicalBuffMinMax, statusProfile.DarknessPhysicalBuff, flavor); num1 += num2; } actor.SetStatus(key, num1); }))); } ChaFileGameInfo fileGameInfo = this.param.actor.ChaControl.fileGameInfo; ChaFileGameInfo.MinMaxInfo tempBound = fileGameInfo.tempBound; string str3 = head + "tempBound"; list.Add(new CommandData(CommandData.Command.FLOAT, str3 + ".low", (Func <object>)(() => (object)tempBound.lower), (System.Action <object>)null)); list.Add(new CommandData(CommandData.Command.FLOAT, str3 + ".high", (Func <object>)(() => (object)tempBound.upper), (System.Action <object>)null)); ChaFileGameInfo.MinMaxInfo MoodBound = fileGameInfo.moodBound; string str4 = head + "MoodBound"; list.Add(new CommandData(CommandData.Command.FLOAT, str4 + ".low", (Func <object>)(() => (object)MoodBound.lower), (System.Action <object>)null)); list.Add(new CommandData(CommandData.Command.FLOAT, str4 + ".high", (Func <object>)(() => (object)MoodBound.upper), (System.Action <object>)null)); Dictionary <int, int> flavorState = fileGameInfo.flavorState; string str5 = head + "FlavorSkillTable"; foreach (KeyValuePair <int, int> keyValuePair in flavorState) { KeyValuePair <int, int> item = keyValuePair; list.Add(new CommandData(CommandData.Command.Int, str5 + string.Format("[{0}]", (object)item.Key), (Func <object>)(() => (object)item.Value), (System.Action <object>)(o => this.SetFlavorSkill(item.Key, (int)o)))); } string key1 = string.Format("{0}{1}", (object)head, (object)"TalkMotivation"); list.Add(new CommandData(CommandData.Command.FLOAT, key1, (Func <object>)(() => (object)this.TalkMotivation), (System.Action <object>)(o => { float num = this.StatsTable[5]; this.TalkMotivation = Mathf.Clamp((float)o, 0.0f, num); }))); string key2 = string.Format("{0}InstructProb", (object)head); list.Add(new CommandData(CommandData.Command.FLOAT, key2, (Func <object>)(() => { int num1 = fileGameInfo.flavorState[1]; StatusProfile statusProfile = Singleton <Resources> .Instance.StatusProfile; float defaultInstructionRate = statusProfile.DefaultInstructionRate; Threshold instructionMinMax = statusProfile.FlavorReliabilityInstructionMinMax; float t = Mathf.InverseLerp(instructionMinMax.min, instructionMinMax.max, (float)num1); float num2 = defaultInstructionRate + statusProfile.FlavorReliabilityInstruction.Lerp(t); if (fileGameInfo.normalSkill.ContainsValue(27)) { num2 += statusProfile.InstructionRateDebuff; } return((object)num2); }), (System.Action <object>)null)); string key3 = string.Format("{0}FollowProb", (object)head); list.Add(new CommandData(CommandData.Command.FLOAT, key3, (Func <object>)(() => { int num1 = fileGameInfo.flavorState[1]; StatusProfile statusProfile = Singleton <Resources> .Instance.StatusProfile; float defaultFollowRate = statusProfile.DefaultFollowRate; float t = Mathf.InverseLerp(statusProfile.FollowReliabilityMinMax.min, statusProfile.FollowReliabilityMinMax.max, (float)num1); float num2 = defaultFollowRate + statusProfile.FollowRateReliabilityBuff.Lerp(t); if (fileGameInfo.normalSkill.ContainsValue(8)) { num2 += statusProfile.FollowRateBuff; } return((object)num2); }), (System.Action <object>)null)); int TotalFlavor = fileGameInfo.totalFlavor; string key4 = head + "TotalFlavor"; list.Add(new CommandData(CommandData.Command.Int, key4, (Func <object>)(() => (object)TotalFlavor), (System.Action <object>)null)); Dictionary <int, float> desireDefVal = fileGameInfo.desireDefVal; string str6 = head + "DesireDef"; foreach (KeyValuePair <int, float> keyValuePair in desireDefVal) { KeyValuePair <int, float> item = keyValuePair; int desireKey = Desire.GetDesireKey((Desire.Type)item.Key); list.Add(new CommandData(CommandData.Command.FLOAT, str6 + string.Format("[{0}]", (object)desireKey), (Func <object>)(() => (object)item.Value), (System.Action <object>)null)); } int Phase = fileGameInfo.phase; string key5 = head + "Phase"; list.Add(new CommandData(CommandData.Command.Int, key5, (Func <object>)(() => (object)Phase), (System.Action <object>)null)); Dictionary <int, int> NormalSkill = fileGameInfo.normalSkill; string str7 = head + "NormalSkill"; foreach (KeyValuePair <int, int> keyValuePair in NormalSkill) { KeyValuePair <int, int> item = keyValuePair; list.Add(new CommandData(CommandData.Command.Int, str7 + string.Format("[{0}]", (object)item.Key), (Func <object>)(() => (object)item.Value), (System.Action <object>)(o => NormalSkill[item.Key] = (int)o))); } Dictionary <int, int> HSkill = fileGameInfo.hSkill; string str8 = head + "HSkill"; foreach (KeyValuePair <int, int> keyValuePair in HSkill) { KeyValuePair <int, int> item = keyValuePair; list.Add(new CommandData(CommandData.Command.Int, str8 + string.Format("[{0}]", (object)item.Key), (Func <object>)(() => (object)item.Value), (System.Action <object>)(o => HSkill[item.Key] = (int)o))); } int FavoritePlace = fileGameInfo.favoritePlace; string key6 = head + "FavoritePlace"; list.Add(new CommandData(CommandData.Command.Int, key6, (Func <object>)(() => (object)FavoritePlace), (System.Action <object>)null)); } return((IEnumerable <CommandData>)list); }