123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- using System;
- using BackupParamAccessor;
- using PlayerStatus;
- using TextureBank;
- namespace Schedule
- {
- public class WorkResultScene
- {
- public void Calc(WorkResultSceneMode mode = WorkResultSceneMode.Noon, bool intervene = true)
- {
- if (this.textureBank == null)
- {
- this.textureBank = new TextureBank();
- }
- if (this.slot == null)
- {
- this.slot = new WorkResultSlot[40];
- for (int i = 0; i < this.slot.Length; i++)
- {
- this.slot[i] = new WorkResultSlot(this, i);
- }
- }
- bool flag = false;
- if (intervene)
- {
- string flagName = string.Empty;
- if (mode == WorkResultSceneMode.Noon)
- {
- flagName = "_Schedule_Noon_Resulted";
- }
- if (mode == WorkResultSceneMode.Night)
- {
- flagName = "_Schedule_Night_Resulted";
- }
- if (GameMain.Instance.CharacterMgr.status.GetFlag(flagName) > 0)
- {
- flag = true;
- }
- else
- {
- GameMain.Instance.CharacterMgr.status.SetFlag(flagName, 1);
- }
- }
- this.mode = mode;
- this.intervene = intervene;
- if (!flag)
- {
- ScheduleCalcAPI.log.LogClear();
- for (int j = 0; j < 40; j++)
- {
- Maid scheduleSlot = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(j);
- if (!(scheduleSlot == null))
- {
- int num = 0;
- SCENE_ID scene_ID = SCENE_ID.Start;
- if (mode == WorkResultSceneMode.Noon)
- {
- num = scheduleSlot.status.noonWorkId;
- scene_ID = SCENE_ID.Noon;
- }
- else if (mode == WorkResultSceneMode.Night)
- {
- num = scheduleSlot.status.nightWorkId;
- scene_ID = SCENE_ID.Night;
- }
- SCENE_ID sceneId_f = scene_ID + 1;
- ScheduleCSVData.ScheduleBase scheduleBase = ScheduleCSVData.AllData[num];
- ScheduleData scheduleData = GameMain.Instance.CharacterMgr.status.scheduleSlot[j];
- ScheduleTaskCtrl.TaskType type = scheduleBase.type;
- if (type != ScheduleTaskCtrl.TaskType.Work && type != ScheduleTaskCtrl.TaskType.Training)
- {
- if (type == ScheduleTaskCtrl.TaskType.Yotogi)
- {
- ScheduleCSVData.Yotogi yotogi = (ScheduleCSVData.Yotogi)scheduleBase;
- if (BackupParamAccessor.YotogiPlayed(j, scene_ID))
- {
- scheduleSlot.status.SetFlag("_YotogiPlayed", 1);
- }
- else
- {
- scheduleSlot.status.SetFlag("_YotogiPlayed", 0);
- }
- ScheduleAPI.YotogiResultSimulateParam param = ScheduleAPI.YotogiResultSimulate(scheduleSlot, num);
- ScheduleAPI.AddYotogiWorkResultParam(yotogi, scheduleSlot, param);
- BackupParamAccessor.BackupParam(new int?(j), sceneId_f);
- if (DailyMgr.IsLegacy)
- {
- scheduleSlot.status.OldStatus.SetFlag("_PlayedNightWorkId" + scheduleSlot.status.nightWorkId.ToString(), 1);
- }
- else
- {
- scheduleSlot.status.SetFlag("_PlayedNightWorkId" + scheduleSlot.status.nightWorkId.ToString(), 1);
- }
- ScheduleCSVData.YotogiType yotogiType = yotogi.yotogiType;
- if (yotogiType == ScheduleCSVData.YotogiType.Vip || yotogiType == ScheduleCSVData.YotogiType.VipCall)
- {
- if (DailyMgr.IsLegacy)
- {
- scheduleSlot.status.OldStatus.SetFlag("_PlayedNightWorkVip", 1);
- }
- else
- {
- scheduleSlot.status.SetFlag("_PlayedNightWorkVip", 1);
- }
- }
- ScheduleCSVData.YotogiType yotogiType2 = yotogi.yotogiType;
- if (yotogiType2 == ScheduleCSVData.YotogiType.Vip || yotogiType2 == ScheduleCSVData.YotogiType.VipCall)
- {
- if (GameMain.Instance.CharacterMgr.status.night_works_state_dic.ContainsKey(num))
- {
- GameMain.Instance.CharacterMgr.status.night_works_state_dic[num].finish = true;
- }
- }
- }
- }
- else
- {
- ScheduleData.WorkSuccessLv workSuccessLv = ScheduleData.WorkSuccessLv.Miss;
- bool flag2 = false;
- ScheduleMgr.ScheduleTime scheduleTime = ScheduleMgr.ScheduleTime.DayTime;
- if (mode == WorkResultSceneMode.Noon)
- {
- scheduleData.noon_communication = scheduleSlot.status.noonCommu;
- flag2 = scheduleData.noon_communication;
- ScheduleAPI.DecideSuccess(WorkResultSceneMode.Noon, j, flag2);
- workSuccessLv = scheduleData.noon_success_level;
- scheduleTime = ScheduleMgr.ScheduleTime.DayTime;
- }
- else if (mode == WorkResultSceneMode.Night)
- {
- scheduleData.night_communication = scheduleSlot.status.nightCommu;
- flag2 = scheduleData.night_communication;
- ScheduleAPI.DecideSuccess(WorkResultSceneMode.Night, j, flag2);
- workSuccessLv = scheduleData.night_success_level;
- scheduleTime = ScheduleMgr.ScheduleTime.Night;
- }
- Facility maidAssignedFacility = GameMain.Instance.FacilityMgr.GetMaidAssignedFacility(scheduleSlot, scheduleTime);
- if (scheduleBase.type == ScheduleTaskCtrl.TaskType.Training)
- {
- ScheduleCSVData.Training training = (ScheduleCSVData.Training)scheduleBase;
- if (ScheduleCSVData.TrainingData.ContainsKey(training.id))
- {
- ScheduleCSVData.TrainingType trainingType = training.trainingType;
- if (trainingType == ScheduleCSVData.TrainingType.Trainer || trainingType == ScheduleCSVData.TrainingType.Trainee || trainingType == ScheduleCSVData.TrainingType.Travel)
- {
- workSuccessLv = ScheduleData.WorkSuccessLv.Success;
- }
- }
- }
- if (mode == WorkResultSceneMode.Noon)
- {
- scheduleData.noon_success_level = workSuccessLv;
- scheduleData.noon_communication = flag2;
- }
- else if (mode == WorkResultSceneMode.Night)
- {
- scheduleData.night_success_level = workSuccessLv;
- scheduleData.night_communication = flag2;
- }
- scheduleSlot.status.SetFlag("_communication", Convert.ToInt32(flag2));
- if (workSuccessLv != ScheduleData.WorkSuccessLv.Unexecuted)
- {
- scheduleSlot.status.AddWorkDataPlayCount(num, 1);
- int level = ScheduleAPI.NoonWorkPlayToLv(ScheduleAPI.NoonWorkPlayCount(scheduleSlot, num));
- scheduleSlot.status.SetWorkDataLevel(num, level);
- }
- ScheduleCalcAPI.ResultSimulateParam param2 = ScheduleCalcAPI.SimulateMaidStatusResult(scheduleSlot, num, workSuccessLv, flag2);
- ScheduleCalcAPI.AddResultParam(scheduleSlot, param2);
- if (scheduleBase.type == ScheduleTaskCtrl.TaskType.Work && maidAssignedFacility != null)
- {
- param2 = ScheduleCalcAPI.SimulateIncomeResult(scheduleSlot, num, maidAssignedFacility, scheduleTime, workSuccessLv, flag2);
- ScheduleCalcAPI.AddResultParam(scheduleSlot, param2);
- GameMain.Instance.CharacterMgr.status.clubGauge += WorkResultScene.GetAddClubGaugeValue(maidAssignedFacility.defaultData.businessType);
- }
- BackupParamAccessor.BackupParam(new int?(j), scene_ID);
- if (maidAssignedFacility != null)
- {
- SimpleExperienceSystem expSystem = maidAssignedFacility.expSystem;
- int num2 = maidAssignedFacility.facilityExperienceValue;
- Facility.FacilityParameter facilityParameter = maidAssignedFacility.CalcRecipeParameter();
- if (facilityParameter != null)
- {
- num2 += facilityParameter.experienceValue;
- }
- expSystem.AddExp(num2);
- }
- BackupParamAccessor.BackupParam(new int?(j), sceneId_f);
- }
- }
- }
- }
- for (int k = 0; k < this.slot.Length; k++)
- {
- Maid scheduleSlot2 = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(k);
- if (!(scheduleSlot2 == null))
- {
- this.slot[k].InitResultWork(mode);
- }
- }
- }
- public void Update()
- {
- for (int i = 0; i < this.slot.Length; i++)
- {
- this.slot[i].Update();
- }
- }
- public void Dispace()
- {
- if (this.textureBank != null)
- {
- this.textureBank.Dispace();
- }
- }
- public static ScheduleCSVData.ScheduleBase GetWorkResultSceneMode(WorkResultSceneMode mode, Maid maid)
- {
- int key = 0;
- if (mode == WorkResultSceneMode.Noon)
- {
- key = maid.status.noonWorkId;
- }
- else if (mode == WorkResultSceneMode.Night)
- {
- key = maid.status.nightWorkId;
- }
- return ScheduleCSVData.AllData[key];
- }
- public static int GetAddClubGaugeValue(FacilityDataTable.BusinessType type)
- {
- if (type == FacilityDataTable.BusinessType.接待系)
- {
- return 1;
- }
- if (type == FacilityDataTable.BusinessType.営業系)
- {
- return 2;
- }
- if (type == FacilityDataTable.BusinessType.アイドル系)
- {
- return 3;
- }
- return 0;
- }
- public WorkResultSceneMode mode;
- public bool intervene = true;
- public WorkResultSlot[] slot;
- public TextureBank textureBank;
- }
- }
|