123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- using System;
- using PlayerStatus;
- namespace BackupParamAccessor
- {
- public static class BackupParamAccessor
- {
- public static void BackupParam(int? slotId, SCENE_ID sceneId_f)
- {
- if (slotId == null)
- {
- for (int i = 0; i < 40; i++)
- {
- BackupParamAccessor.BackupParam(new int?(i), sceneId_f);
- }
- }
- int num = (slotId == null) ? 0 : slotId.Value;
- string str = sceneId_f.ToString();
- Params @params = new Params();
- Maid scheduleSlot = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(num);
- if (scheduleSlot != null)
- {
- @params.salon_cleanliness = 0;
- @params.salon_gorgeous = 0;
- @params.salon_evaluation = GameMain.Instance.CharacterMgr.status.clubEvaluation;
- @params.money = GameMain.Instance.CharacterMgr.status.money;
- @params.clubEvaluation = GameMain.Instance.CharacterMgr.status.clubEvaluation;
- @params.clubMoney = GameMain.Instance.CharacterMgr.status.money;
- @params.evaluation = scheduleSlot.status.evaluation;
- @params.sales = scheduleSlot.status.sales;
- @params.study_rate = scheduleSlot.status.studyRate;
- @params.reception = scheduleSlot.status.reception;
- @params.care = scheduleSlot.status.care;
- @params.lovely = scheduleSlot.status.lovely;
- @params.elegance = scheduleSlot.status.elegance;
- @params.charm = scheduleSlot.status.charm;
- @params.teach_rate = scheduleSlot.status.teachRate;
- @params.cooking = scheduleSlot.status.cooking;
- @params.vocal = scheduleSlot.status.vocal;
- @params.dance = scheduleSlot.status.dance;
- @params.appealPoint = scheduleSlot.status.appealPoint;
- @params.inyoku = scheduleSlot.status.inyoku;
- @params.m_value = scheduleSlot.status.mvalue;
- @params.hentai = scheduleSlot.status.hentai;
- @params.housi = scheduleSlot.status.housi;
- if (scheduleSlot.status.selectedJobClass != null)
- {
- @params.maidClassLv = scheduleSlot.status.selectedJobClass.level;
- @params.maidClassExp = scheduleSlot.status.selectedJobClass.expSystem.GetTotalExp();
- }
- if (scheduleSlot.status.selectedYotogiClass != null)
- {
- @params.yotogiClassLv = scheduleSlot.status.selectedYotogiClass.level;
- @params.yotogiClassExp = scheduleSlot.status.selectedYotogiClass.expSystem.GetTotalExp();
- }
- @params.yotogi_play_count = scheduleSlot.status.playCountYotogi;
- @params.others_play_count = scheduleSlot.status.playCountNightWork;
- @params.likability = scheduleSlot.status.likability;
- }
- BackupParamAccessor.slots = GameMain.Instance.CharacterMgr.status.scheduleSlot;
- byte[] bytes = BitConverter.GetBytes(@params.clubMoney);
- int value = BitConverter.ToInt32(new byte[]
- {
- bytes[0],
- bytes[1],
- bytes[2],
- bytes[3]
- }, 0);
- int value2 = BitConverter.ToInt32(new byte[]
- {
- bytes[4],
- bytes[5],
- bytes[6],
- bytes[7]
- }, 0);
- BackupParamAccessor.slots[num].backup_status_dic[str + "_clubMoney_byte1"] = value;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_clubMoney_byte2"] = value2;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_clubMoney"] = (int)@params.clubMoney;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_clubEvaluation"] = @params.clubEvaluation;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_salon_cleanliness"] = @params.salon_cleanliness;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_salon_gorgeous"] = @params.salon_gorgeous;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_salon_evaluation"] = @params.salon_evaluation;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_money_top0"] = @params.money_top0;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_money_top10"] = @params.money_top10;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_evaluation"] = @params.evaluation;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_sales_top0"] = @params.sales_top0;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_sales_top10"] = @params.sales_top10;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_study_rate"] = @params.study_rate;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_reception"] = @params.reception;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_care"] = @params.care;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_lovely"] = @params.lovely;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_elegance"] = @params.elegance;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_charm"] = @params.charm;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_teach_rate"] = @params.teach_rate;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_cooking"] = @params.cooking;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_vocal"] = @params.vocal;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_dance"] = @params.dance;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_appealPoint"] = @params.appealPoint;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_inyoku"] = @params.inyoku;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_m_value"] = @params.m_value;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_hentai"] = @params.hentai;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_housi"] = @params.housi;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_maidClassLv"] = @params.maidClassLv;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_maidClassExp"] = @params.maidClassExp;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_yotogiClassLv"] = @params.yotogiClassLv;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_yotogiClassExp"] = @params.yotogiClassExp;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_yotogi_play_count"] = @params.yotogi_play_count;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_others_play_count"] = @params.others_play_count;
- BackupParamAccessor.slots[num].backup_status_dic[str + "_likability"] = @params.likability;
- }
- public static void Clear(int? slotId = null)
- {
- if (slotId == null)
- {
- for (int i = 0; i < 40; i++)
- {
- BackupParamAccessor.Clear(new int?(i));
- }
- }
- int num = (slotId == null) ? 0 : slotId.Value;
- BackupParamAccessor.slots[num].backup_status_dic.Clear();
- }
- public static Params GetBackupParams(int slotId, SCENE_ID sceneId)
- {
- Params @params = new Params();
- @params.clubMoney = (long)BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "clubMoney");
- @params.clubEvaluation = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "clubEvaluation");
- @params.salon_cleanliness = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "salon_cleanliness");
- @params.salon_gorgeous = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "salon_gorgeous");
- @params.salon_evaluation = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "salon_evaluation");
- @params.money_top0 = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "money_top0");
- @params.money_top10 = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "money_top10");
- @params.evaluation = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "evaluation");
- @params.sales_top0 = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "sales_top0");
- @params.sales_top10 = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "sales_top10");
- @params.study_rate = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "study_rate");
- if (BackupParamAccessor.BackupParamsPartsContainsKey(slotId, sceneId, "clubMoney_byte1") && BackupParamAccessor.BackupParamsPartsContainsKey(slotId, sceneId, "clubMoney_byte2"))
- {
- byte[] bytes = BitConverter.GetBytes(BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "clubMoney_byte1"));
- byte[] bytes2 = BitConverter.GetBytes(BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "clubMoney_byte2"));
- @params.clubMoney = BitConverter.ToInt64(new byte[]
- {
- bytes[0],
- bytes[1],
- bytes[2],
- bytes[3],
- bytes2[0],
- bytes2[1],
- bytes2[2],
- bytes2[3]
- }, 0);
- }
- @params.teach_rate = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "teach_rate");
- @params.reception = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "reception");
- @params.care = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "care");
- @params.lovely = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "lovely");
- @params.elegance = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "elegance");
- @params.charm = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "charm");
- @params.cooking = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "cooking");
- @params.vocal = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "vocal");
- @params.dance = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "dance");
- @params.appealPoint = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "appealPoint");
- @params.inyoku = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "inyoku");
- @params.m_value = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "m_value");
- @params.hentai = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "hentai");
- @params.housi = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "housi");
- @params.maidClassLv = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "maidClassLv");
- @params.maidClassExp = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "maidClassExp");
- @params.yotogiClassLv = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "yotogiClassLv");
- @params.yotogiClassExp = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "yotogiClassExp");
- @params.yotogi_play_count = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "yotogi_play_count");
- @params.others_play_count = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "others_play_count");
- @params.likability = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "likability");
- return @params;
- }
- public static bool BackupParamsPartsContainsKey(int slotId, SCENE_ID sceneId_f, string name)
- {
- BackupParamAccessor.slots = GameMain.Instance.CharacterMgr.status.scheduleSlot;
- string str = sceneId_f.ToString();
- return BackupParamAccessor.slots[slotId].backup_status_dic.ContainsKey(str + "_" + name);
- }
- public static int GetBackupParamsParts(int slotId, SCENE_ID sceneId_f, string name)
- {
- BackupParamAccessor.slots = GameMain.Instance.CharacterMgr.status.scheduleSlot;
- string str = sceneId_f.ToString();
- if (BackupParamAccessor.slots[slotId].backup_status_dic.ContainsKey(str + "_" + name))
- {
- return BackupParamAccessor.slots[slotId].backup_status_dic[str + "_" + name];
- }
- return 0;
- }
- public static bool YotogiPlayed(int slotId, SCENE_ID baseId)
- {
- return (BackupParamAccessor.GetBackupParams(slotId, baseId + 1) - BackupParamAccessor.GetBackupParams(slotId, baseId - 1)).yotogi_play_count > 0;
- }
- public static ScheduleData[] slots = GameMain.Instance.CharacterMgr.status.scheduleSlot;
- }
- }
|