BackupParamAccessor.cs 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. using System;
  2. using PlayerStatus;
  3. namespace BackupParamAccessor
  4. {
  5. public static class BackupParamAccessor
  6. {
  7. public static void BackupParam(int? slotId, SCENE_ID sceneId_f)
  8. {
  9. if (slotId == null)
  10. {
  11. for (int i = 0; i < 40; i++)
  12. {
  13. BackupParamAccessor.BackupParam(new int?(i), sceneId_f);
  14. }
  15. }
  16. int num = (slotId == null) ? 0 : slotId.Value;
  17. string str = sceneId_f.ToString();
  18. Params @params = new Params();
  19. Maid scheduleSlot = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(num);
  20. if (scheduleSlot != null)
  21. {
  22. @params.salon_cleanliness = 0;
  23. @params.salon_gorgeous = 0;
  24. @params.salon_evaluation = GameMain.Instance.CharacterMgr.status.clubEvaluation;
  25. @params.money = GameMain.Instance.CharacterMgr.status.money;
  26. @params.clubEvaluation = GameMain.Instance.CharacterMgr.status.clubEvaluation;
  27. @params.clubMoney = (int)GameMain.Instance.CharacterMgr.status.money;
  28. @params.evaluation = scheduleSlot.status.evaluation;
  29. @params.sales = scheduleSlot.status.sales;
  30. @params.study_rate = scheduleSlot.status.studyRate;
  31. @params.reception = scheduleSlot.status.reception;
  32. @params.care = scheduleSlot.status.care;
  33. @params.lovely = scheduleSlot.status.lovely;
  34. @params.elegance = scheduleSlot.status.elegance;
  35. @params.charm = scheduleSlot.status.charm;
  36. @params.teach_rate = scheduleSlot.status.teachRate;
  37. @params.cooking = scheduleSlot.status.cooking;
  38. @params.vocal = scheduleSlot.status.vocal;
  39. @params.dance = scheduleSlot.status.dance;
  40. @params.appealPoint = scheduleSlot.status.appealPoint;
  41. @params.inyoku = scheduleSlot.status.inyoku;
  42. @params.m_value = scheduleSlot.status.mvalue;
  43. @params.hentai = scheduleSlot.status.hentai;
  44. @params.housi = scheduleSlot.status.housi;
  45. if (scheduleSlot.status.selectedJobClass != null)
  46. {
  47. @params.maidClassLv = scheduleSlot.status.selectedJobClass.level;
  48. @params.maidClassExp = scheduleSlot.status.selectedJobClass.expSystem.GetTotalExp();
  49. }
  50. if (scheduleSlot.status.selectedYotogiClass != null)
  51. {
  52. @params.yotogiClassLv = scheduleSlot.status.selectedYotogiClass.level;
  53. @params.yotogiClassExp = scheduleSlot.status.selectedYotogiClass.expSystem.GetTotalExp();
  54. }
  55. @params.yotogi_play_count = scheduleSlot.status.playCountYotogi;
  56. @params.others_play_count = scheduleSlot.status.playCountNightWork;
  57. @params.likability = scheduleSlot.status.likability;
  58. }
  59. BackupParamAccessor.slots = GameMain.Instance.CharacterMgr.status.scheduleSlot;
  60. BackupParamAccessor.slots[num].backup_status_dic[str + "_clubMoney"] = @params.clubMoney;
  61. BackupParamAccessor.slots[num].backup_status_dic[str + "_clubEvaluation"] = @params.clubEvaluation;
  62. BackupParamAccessor.slots[num].backup_status_dic[str + "_salon_cleanliness"] = @params.salon_cleanliness;
  63. BackupParamAccessor.slots[num].backup_status_dic[str + "_salon_gorgeous"] = @params.salon_gorgeous;
  64. BackupParamAccessor.slots[num].backup_status_dic[str + "_salon_evaluation"] = @params.salon_evaluation;
  65. BackupParamAccessor.slots[num].backup_status_dic[str + "_money_top0"] = @params.money_top0;
  66. BackupParamAccessor.slots[num].backup_status_dic[str + "_money_top10"] = @params.money_top10;
  67. BackupParamAccessor.slots[num].backup_status_dic[str + "_evaluation"] = @params.evaluation;
  68. BackupParamAccessor.slots[num].backup_status_dic[str + "_sales_top0"] = @params.sales_top0;
  69. BackupParamAccessor.slots[num].backup_status_dic[str + "_sales_top10"] = @params.sales_top10;
  70. BackupParamAccessor.slots[num].backup_status_dic[str + "_study_rate"] = @params.study_rate;
  71. BackupParamAccessor.slots[num].backup_status_dic[str + "_reception"] = @params.reception;
  72. BackupParamAccessor.slots[num].backup_status_dic[str + "_care"] = @params.care;
  73. BackupParamAccessor.slots[num].backup_status_dic[str + "_lovely"] = @params.lovely;
  74. BackupParamAccessor.slots[num].backup_status_dic[str + "_elegance"] = @params.elegance;
  75. BackupParamAccessor.slots[num].backup_status_dic[str + "_charm"] = @params.charm;
  76. BackupParamAccessor.slots[num].backup_status_dic[str + "_teach_rate"] = @params.teach_rate;
  77. BackupParamAccessor.slots[num].backup_status_dic[str + "_cooking"] = @params.cooking;
  78. BackupParamAccessor.slots[num].backup_status_dic[str + "_vocal"] = @params.vocal;
  79. BackupParamAccessor.slots[num].backup_status_dic[str + "_dance"] = @params.dance;
  80. BackupParamAccessor.slots[num].backup_status_dic[str + "_appealPoint"] = @params.appealPoint;
  81. BackupParamAccessor.slots[num].backup_status_dic[str + "_inyoku"] = @params.inyoku;
  82. BackupParamAccessor.slots[num].backup_status_dic[str + "_m_value"] = @params.m_value;
  83. BackupParamAccessor.slots[num].backup_status_dic[str + "_hentai"] = @params.hentai;
  84. BackupParamAccessor.slots[num].backup_status_dic[str + "_housi"] = @params.housi;
  85. BackupParamAccessor.slots[num].backup_status_dic[str + "_maidClassLv"] = @params.maidClassLv;
  86. BackupParamAccessor.slots[num].backup_status_dic[str + "_maidClassExp"] = @params.maidClassExp;
  87. BackupParamAccessor.slots[num].backup_status_dic[str + "_yotogiClassLv"] = @params.yotogiClassLv;
  88. BackupParamAccessor.slots[num].backup_status_dic[str + "_yotogiClassExp"] = @params.yotogiClassExp;
  89. BackupParamAccessor.slots[num].backup_status_dic[str + "_yotogi_play_count"] = @params.yotogi_play_count;
  90. BackupParamAccessor.slots[num].backup_status_dic[str + "_others_play_count"] = @params.others_play_count;
  91. BackupParamAccessor.slots[num].backup_status_dic[str + "_likability"] = @params.likability;
  92. }
  93. public static void Clear(int? slotId = null)
  94. {
  95. if (slotId == null)
  96. {
  97. for (int i = 0; i < 40; i++)
  98. {
  99. BackupParamAccessor.Clear(new int?(i));
  100. }
  101. }
  102. int num = (slotId == null) ? 0 : slotId.Value;
  103. BackupParamAccessor.slots[num].backup_status_dic.Clear();
  104. }
  105. public static Params GetBackupParams(int slotId, SCENE_ID sceneId)
  106. {
  107. return new Params
  108. {
  109. clubMoney = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "clubMoney"),
  110. clubEvaluation = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "clubEvaluation"),
  111. salon_cleanliness = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "salon_cleanliness"),
  112. salon_gorgeous = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "salon_gorgeous"),
  113. salon_evaluation = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "salon_evaluation"),
  114. money_top0 = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "money_top0"),
  115. money_top10 = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "money_top10"),
  116. evaluation = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "evaluation"),
  117. sales_top0 = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "sales_top0"),
  118. sales_top10 = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "sales_top10"),
  119. study_rate = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "study_rate"),
  120. teach_rate = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "teach_rate"),
  121. reception = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "reception"),
  122. care = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "care"),
  123. lovely = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "lovely"),
  124. elegance = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "elegance"),
  125. charm = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "charm"),
  126. cooking = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "cooking"),
  127. vocal = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "vocal"),
  128. dance = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "dance"),
  129. appealPoint = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "appealPoint"),
  130. inyoku = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "inyoku"),
  131. m_value = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "m_value"),
  132. hentai = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "hentai"),
  133. housi = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "housi"),
  134. maidClassLv = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "maidClassLv"),
  135. maidClassExp = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "maidClassExp"),
  136. yotogiClassLv = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "yotogiClassLv"),
  137. yotogiClassExp = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "yotogiClassExp"),
  138. yotogi_play_count = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "yotogi_play_count"),
  139. others_play_count = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "others_play_count"),
  140. likability = BackupParamAccessor.GetBackupParamsParts(slotId, sceneId, "likability")
  141. };
  142. }
  143. public static int GetBackupParamsParts(int slotId, SCENE_ID sceneId_f, string name)
  144. {
  145. BackupParamAccessor.slots = GameMain.Instance.CharacterMgr.status.scheduleSlot;
  146. string str = sceneId_f.ToString();
  147. if (BackupParamAccessor.slots[slotId].backup_status_dic.ContainsKey(str + "_" + name))
  148. {
  149. return BackupParamAccessor.slots[slotId].backup_status_dic[str + "_" + name];
  150. }
  151. return 0;
  152. }
  153. public static bool YotogiPlayed(int slotId, SCENE_ID baseId)
  154. {
  155. return (BackupParamAccessor.GetBackupParams(slotId, baseId + 1) - BackupParamAccessor.GetBackupParams(slotId, baseId - 1)).yotogi_play_count > 0;
  156. }
  157. public static ScheduleData[] slots = GameMain.Instance.CharacterMgr.status.scheduleSlot;
  158. }
  159. }