ScheduleCalcAPI.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. using System;
  2. using System.Collections.Generic;
  3. using MaidStatus;
  4. using PlayerStatus;
  5. using UnityEngine;
  6. namespace Schedule
  7. {
  8. public class ScheduleCalcAPI
  9. {
  10. public static ScheduleCalcAPI.ResultSimulateParam SimulateMaidStatusResult(Maid maid, int workId, ScheduleData.WorkSuccessLv successLv = ScheduleData.WorkSuccessLv.Success, bool commu = false)
  11. {
  12. ScheduleCalcAPI.ResultSimulateParam resultSimulateParam = new ScheduleCalcAPI.ResultSimulateParam();
  13. if (maid == null)
  14. {
  15. return resultSimulateParam;
  16. }
  17. ScheduleCSVData.Training training = (ScheduleCSVData.Training)ScheduleCSVData.AllData[workId];
  18. switch (training.trainingType)
  19. {
  20. case ScheduleCSVData.TrainingType.Basic:
  21. case ScheduleCSVData.TrainingType.Dispatch:
  22. {
  23. int revisionLevel = ScheduleCalcAPI.GetRevisionLevel(ScheduleCalcAPI.NoonWorkPlayToLv(ScheduleCalcAPI.NoonWorkPlayCount(maid, workId)));
  24. double revisionFacilityLevel = ScheduleCalcAPI.GetRevisionFacilityLevel(training.facility);
  25. BonusStatus bonusStatusAsFeatureAndPropensitys = maid.status.GetBonusStatusAsFeatureAndPropensitys();
  26. double revisionFacility = ScheduleCalcAPI.GetRevisionFacility1(training.facility);
  27. double revisionSuccess = ScheduleCalcAPI.GetRevisionSuccess(successLv, commu);
  28. ScheduleCalcAPI.log.SetTarget(maid);
  29. resultSimulateParam.reception = ScheduleCalcAPI.Simulate_basic("接待", training.reception, revisionLevel, revisionFacilityLevel, bonusStatusAsFeatureAndPropensitys.reception, revisionFacility, revisionSuccess);
  30. resultSimulateParam.care = ScheduleCalcAPI.Simulate_basic("お世話", training.care, revisionLevel, revisionFacilityLevel, bonusStatusAsFeatureAndPropensitys.care, revisionFacility, revisionSuccess);
  31. resultSimulateParam.lovely = ScheduleCalcAPI.Simulate_basic("可燐", training.lovely, revisionLevel, revisionFacilityLevel, bonusStatusAsFeatureAndPropensitys.lovely, revisionFacility, revisionSuccess);
  32. resultSimulateParam.elegance = ScheduleCalcAPI.Simulate_basic("気品", training.elegance, revisionLevel, revisionFacilityLevel, bonusStatusAsFeatureAndPropensitys.elegance, revisionFacility, revisionSuccess);
  33. resultSimulateParam.charm = ScheduleCalcAPI.Simulate_basic("魅惑", training.charm, revisionLevel, revisionFacilityLevel, bonusStatusAsFeatureAndPropensitys.charm, revisionFacility, revisionSuccess);
  34. resultSimulateParam.teach_rate = ScheduleCalcAPI.Simulate_basic("指導", training.teach_rate, revisionLevel, revisionFacilityLevel, bonusStatusAsFeatureAndPropensitys.teachRate, revisionFacility, revisionSuccess);
  35. resultSimulateParam.cooking = ScheduleCalcAPI.Simulate_basic("料理", training.cooking, revisionLevel, revisionFacilityLevel, bonusStatusAsFeatureAndPropensitys.cooking, revisionFacility, revisionSuccess);
  36. resultSimulateParam.vocal = ScheduleCalcAPI.Simulate_basic("ボーカル", training.vocal, revisionLevel, revisionFacilityLevel, bonusStatusAsFeatureAndPropensitys.vocal, revisionFacility, revisionSuccess);
  37. resultSimulateParam.dance = ScheduleCalcAPI.Simulate_basic("ダンス", training.dance, revisionLevel, revisionFacilityLevel, bonusStatusAsFeatureAndPropensitys.dance, revisionFacility, revisionSuccess);
  38. resultSimulateParam.appealPoint = ScheduleCalcAPI.Simulate_basic("アピール", training.appealPoint, revisionLevel, revisionFacilityLevel, bonusStatusAsFeatureAndPropensitys.appealPoint, revisionFacility, revisionSuccess);
  39. resultSimulateParam.exp = ScheduleCalcAPI.Simulate_basic("ジョブEXP", training.exp, revisionLevel, revisionFacilityLevel, 0, revisionFacility, revisionSuccess);
  40. resultSimulateParam.study_rate = training.study_rate;
  41. resultSimulateParam.income = ScheduleCalcAPI.Simulate_basic("収入", training.income, revisionLevel, 0.0, 0, 0.0, revisionSuccess);
  42. resultSimulateParam.income = (int)((double)resultSimulateParam.income * (Math.Ceiling((double)maid.status.care / (double)ScheduleCSVData.dispatchIncomCoefficient) / 100.0 + 1.0));
  43. break;
  44. }
  45. case ScheduleCSVData.TrainingType.Trainee:
  46. {
  47. Maid stockMaidLeader = ScheduleAPI.GetStockMaidLeader();
  48. if (stockMaidLeader != null)
  49. {
  50. int noonTrainerWorkId = ScheduleAPI.GetNoonTrainerWorkId();
  51. int revisionLevel2 = ScheduleCalcAPI.GetRevisionLevel(ScheduleCalcAPI.NoonWorkPlayToLv(ScheduleCalcAPI.NoonWorkPlayCount(stockMaidLeader, noonTrainerWorkId)));
  52. int teachRevision = stockMaidLeader.status.teachRate / 50;
  53. MaidStatus.Status status = stockMaidLeader.status;
  54. ScheduleCalcAPI.log.SetTarget(maid);
  55. resultSimulateParam.study_rate = training.study_rate;
  56. resultSimulateParam.reception = ScheduleCalcAPI.Simulate_trainee("接待", status.reception, revisionLevel2, teachRevision);
  57. resultSimulateParam.care = ScheduleCalcAPI.Simulate_trainee("お世話", status.care, revisionLevel2, teachRevision);
  58. resultSimulateParam.lovely = ScheduleCalcAPI.Simulate_trainee("可燐", status.lovely, revisionLevel2, teachRevision);
  59. resultSimulateParam.elegance = ScheduleCalcAPI.Simulate_trainee("気品", status.elegance, revisionLevel2, teachRevision);
  60. resultSimulateParam.charm = ScheduleCalcAPI.Simulate_trainee("魅惑", status.charm, revisionLevel2, teachRevision);
  61. resultSimulateParam.cooking = ScheduleCalcAPI.Simulate_trainee("料理", status.cooking, revisionLevel2, teachRevision);
  62. resultSimulateParam.vocal = ScheduleCalcAPI.Simulate_trainee("ボーカル", status.vocal, revisionLevel2, teachRevision);
  63. resultSimulateParam.dance = ScheduleCalcAPI.Simulate_trainee("ダンス", status.dance, revisionLevel2, teachRevision);
  64. resultSimulateParam.inyoku = ScheduleCalcAPI.Simulate_trainee("淫欲", status.inyoku, revisionLevel2, teachRevision);
  65. resultSimulateParam.mvalue = ScheduleCalcAPI.Simulate_trainee("M性", status.mvalue, revisionLevel2, teachRevision);
  66. resultSimulateParam.hentai = ScheduleCalcAPI.Simulate_trainee("変態", status.hentai, revisionLevel2, teachRevision);
  67. resultSimulateParam.housi = ScheduleCalcAPI.Simulate_trainee("奉仕", status.housi, revisionLevel2, teachRevision);
  68. }
  69. break;
  70. }
  71. }
  72. return resultSimulateParam;
  73. }
  74. public static ScheduleCalcAPI.ResultSimulateParam SimulateIncomeResult(Maid maid, int workId, Facility facility, ScheduleMgr.ScheduleTime time, ScheduleData.WorkSuccessLv successLv = ScheduleData.WorkSuccessLv.Success, bool commu = false)
  75. {
  76. ScheduleCalcAPI.ResultSimulateParam resultSimulateParam = new ScheduleCalcAPI.ResultSimulateParam();
  77. if (maid == null)
  78. {
  79. return resultSimulateParam;
  80. }
  81. ScheduleCSVData.Training training = (ScheduleCSVData.Training)ScheduleCSVData.AllData[workId];
  82. double revisionMainFacility = ScheduleCalcAPI.GetRevisionMainFacility(facility);
  83. double revisionFacilityLevel = ScheduleCalcAPI.GetRevisionFacilityLevel(facility.defaultData);
  84. double revisionFacility = ScheduleCalcAPI.GetRevisionFacility1(facility.defaultData);
  85. double revisionFacility2 = ScheduleCalcAPI.GetRevisionFacility2(facility);
  86. int num = 0;
  87. int num2 = 0;
  88. int clubGrade = GameMain.Instance.CharacterMgr.status.clubGrade;
  89. int num3 = ScheduleCSVData.EntertainNumberData[clubGrade];
  90. double revisionSuccess = ScheduleCalcAPI.GetRevisionSuccess(successLv, commu);
  91. if (revisionSuccess == 0.0)
  92. {
  93. return resultSimulateParam;
  94. }
  95. num3 = (int)((double)num3 * ScheduleCalcAPI.CP(revisionMainFacility));
  96. ScheduleCalcAPI.log.SetTarget(maid);
  97. ScheduleCalcAPI.log.AddLog(string.Empty);
  98. ScheduleCalcAPI.log.AddLog(facility.defaultData.name + " 収支:" + training.facility.businessType.ToString());
  99. for (int i = 0; i < num3; i++)
  100. {
  101. int count = ScheduleCSVData.EntertainGuestData[clubGrade].Count;
  102. int index = UnityEngine.Random.Range(0, count);
  103. ScheduleCSVData.EntertainGuest entertainGuest = ScheduleCSVData.EntertainGuestData[clubGrade][index];
  104. double num4 = 0.0;
  105. double num5 = 0.0;
  106. ScheduleCalcAPI.log.AddLog(i + "人目------------------------------------------------------------");
  107. FacilityDataTable.BusinessType businessType = training.facility.businessType;
  108. if (businessType != FacilityDataTable.BusinessType.接待系)
  109. {
  110. if (businessType != FacilityDataTable.BusinessType.営業系)
  111. {
  112. if (businessType == FacilityDataTable.BusinessType.アイドル系)
  113. {
  114. double revisionAllMaid = ScheduleCalcAPI.GetRevisionAllMaid();
  115. double revisionStatusIdol = ScheduleCalcAPI.GetRevisionStatusIdol(maid.status);
  116. double num6 = ScheduleCalcAPI.CP(revisionAllMaid + revisionStatusIdol * ScheduleCalcAPI.CP(revisionFacility + revisionFacilityLevel)) * ScheduleCalcAPI.CP(revisionFacility2) * revisionSuccess;
  117. num4 = (double)entertainGuest.baseIcome * num6;
  118. ScheduleCalcAPI.log.AddLog(string.Format("基本金額{0}*(100+所属合計補正{1}+(ステータス補正『アイドル』{2}*(100+施設補正①{3}+施設レベル補正{4})/100)/100*(100+施設補正②{5})/100*成功補正{6}", new object[]
  119. {
  120. entertainGuest.baseIcome,
  121. revisionAllMaid,
  122. revisionStatusIdol,
  123. revisionFacility,
  124. revisionFacilityLevel,
  125. revisionFacility2,
  126. revisionSuccess
  127. }) + "=" + num4);
  128. double num7 = ScheduleCalcAPI.CP(revisionStatusIdol * ScheduleCalcAPI.CP(revisionFacility + revisionFacilityLevel)) * ScheduleCalcAPI.CP(revisionFacility2) * revisionSuccess;
  129. num5 = (double)entertainGuest.baseEvaluation * num7;
  130. ScheduleCalcAPI.log.AddLog(string.Format("基本評価{0}*(100+ステータス補正『アイドル』{1}*(100+施設補正①{2}+施設レベル補正{3})/100)/100*(100+施設補正②{4})/100*成功補正{5}", new object[]
  131. {
  132. entertainGuest.baseEvaluation,
  133. revisionStatusIdol,
  134. revisionFacility,
  135. revisionFacilityLevel,
  136. revisionFacility2,
  137. revisionSuccess
  138. }) + "=" + num5);
  139. }
  140. }
  141. else
  142. {
  143. double revisionStatusSales = ScheduleCalcAPI.GetRevisionStatusSales(maid, facility, time);
  144. double num8 = ScheduleCalcAPI.CP(revisionStatusSales * ScheduleCalcAPI.CP(revisionFacility + revisionFacilityLevel)) * ScheduleCalcAPI.CP(revisionFacility2) * revisionSuccess;
  145. num4 = (double)entertainGuest.baseIcome * num8;
  146. ScheduleCalcAPI.log.AddLog(string.Format("基本金額{0}*(100+ステータス補正『営業』{1}*(100+施設補正①{2}+施設レベル補正{3})/100)/100*(100+施設補正②{4})/100*成功補正{5}", new object[]
  147. {
  148. entertainGuest.baseIcome,
  149. revisionStatusSales,
  150. revisionFacility,
  151. revisionFacilityLevel,
  152. revisionFacility2,
  153. revisionSuccess
  154. }) + "=" + num4);
  155. double num9 = ScheduleCalcAPI.CP(revisionStatusSales * ScheduleCalcAPI.CP(revisionFacility + revisionFacilityLevel)) * ScheduleCalcAPI.CP(revisionFacility2) * revisionSuccess;
  156. num5 = (double)entertainGuest.baseEvaluation * num9;
  157. ScheduleCalcAPI.log.AddLog(string.Format("基本評価{0}*(100+ステータス補正『営業』{1}*(100+施設補正①{2}+施設レベル補正{3})/100)/100*(100+施設補正②{4})/100*成功補正{5}", new object[]
  158. {
  159. entertainGuest.baseEvaluation,
  160. revisionStatusSales,
  161. revisionFacility,
  162. revisionFacilityLevel,
  163. revisionFacility2,
  164. revisionSuccess
  165. }) + "=" + num5);
  166. }
  167. }
  168. else
  169. {
  170. double revisionStatusReception = ScheduleCalcAPI.GetRevisionStatusReception(maid.status, entertainGuest.sexual);
  171. double revisionAttribute = ScheduleCalcAPI.GetRevisionAttribute(entertainGuest.sexual);
  172. double num10 = ScheduleCalcAPI.CP(revisionStatusReception * ScheduleCalcAPI.CP(revisionFacility + revisionFacilityLevel) + revisionAttribute) * ScheduleCalcAPI.CP(revisionFacility2) * revisionSuccess;
  173. num4 = (double)entertainGuest.baseIcome * num10;
  174. ScheduleCalcAPI.log.AddLog(string.Format("基本金額{0}*(100+ステータス補正『接待』{1}*(100+施設補正①{2}+施設レベル補正{3})/100+属性補正①{4})/100*(100+施設補正②{5})/100*成功補正{6}", new object[]
  175. {
  176. entertainGuest.baseIcome,
  177. revisionStatusReception,
  178. revisionFacility,
  179. revisionFacilityLevel,
  180. revisionAttribute,
  181. revisionFacility2,
  182. revisionSuccess
  183. }) + "=" + num4);
  184. double num11 = ScheduleCalcAPI.CP(revisionStatusReception * ScheduleCalcAPI.CP(revisionFacility + revisionFacilityLevel)) * ScheduleCalcAPI.CP(revisionFacility2) * revisionSuccess;
  185. num5 = (double)entertainGuest.baseEvaluation * num11;
  186. ScheduleCalcAPI.log.AddLog(string.Format("基本評価{0}*(100+ステータス補正『接待』{1}*(100+施設補正①{2}+施設レベル補正{3})/100)/100*(100+施設補正②{4})/100*成功補正{5}", new object[]
  187. {
  188. entertainGuest.baseEvaluation,
  189. revisionStatusReception,
  190. revisionFacility,
  191. revisionFacilityLevel,
  192. revisionFacility2,
  193. revisionSuccess
  194. }) + "=" + num5);
  195. }
  196. num4 = (double)((int)Math.Ceiling(num4 / 1000.0) * 1000);
  197. num += (int)num4;
  198. num2 += (int)num5;
  199. }
  200. resultSimulateParam.income = num;
  201. resultSimulateParam.evaluation = num2;
  202. resultSimulateParam.otherPlayNumber = num3;
  203. ScheduleCalcAPI.log.AddLog(string.Empty);
  204. ScheduleCalcAPI.log.AddLog(string.Concat(new object[]
  205. {
  206. "合計金額:",
  207. resultSimulateParam.income,
  208. " 合計評価:",
  209. resultSimulateParam.evaluation,
  210. " 接客回数:",
  211. resultSimulateParam.otherPlayNumber
  212. }));
  213. return resultSimulateParam;
  214. }
  215. public static double CP(double value)
  216. {
  217. return (100.0 + value) / 100.0;
  218. }
  219. public static void AddResultParam(Maid maid, ScheduleCalcAPI.ResultSimulateParam param)
  220. {
  221. if (maid.status.heroineType == HeroineType.Original || maid.status.heroineType == HeroineType.Transfer)
  222. {
  223. maid.status.studyRate += param.study_rate;
  224. maid.status.baseReception += param.reception;
  225. maid.status.baseCare += param.care;
  226. maid.status.baseLovely += param.lovely;
  227. maid.status.baseElegance += param.elegance;
  228. maid.status.baseCharm += param.charm;
  229. maid.status.baseTeachRate += param.teach_rate;
  230. maid.status.baseCooking += param.cooking;
  231. maid.status.baseVocal += param.vocal;
  232. maid.status.baseDance += param.dance;
  233. maid.status.baseAppealPoint += param.appealPoint;
  234. if (maid.status.selectedJobClass != null)
  235. {
  236. maid.status.selectedJobClass.expSystem.AddExp(param.exp);
  237. }
  238. maid.status.baseInyoku += param.inyoku;
  239. maid.status.baseMvalue += param.mvalue;
  240. maid.status.baseHentai += param.hentai;
  241. maid.status.baseHousi += param.housi;
  242. maid.status.evaluation += param.evaluation;
  243. maid.status.totalEvaluations += (long)param.evaluation;
  244. maid.status.sexPlayNumberOfPeople += param.playNumber;
  245. }
  246. maid.status.sales += (long)param.income;
  247. maid.status.totalSales += (long)param.income;
  248. GameMain.Instance.CharacterMgr.status.baseClubEvaluation += param.evaluation;
  249. GameMain.Instance.CharacterMgr.status.money += (long)param.income;
  250. maid.status.playCountNightWork += param.otherPlayNumber;
  251. }
  252. private static int Simulate_basic(string name, int basic, int level, double facilityLevel, int sexualChara, double facility1, double success)
  253. {
  254. double num = (double)basic * ScheduleCalcAPI.CP((double)level + facilityLevel + (double)sexualChara) * ScheduleCalcAPI.CP(facility1) * success;
  255. if (num > 0.0)
  256. {
  257. ScheduleCalcAPI.log.AddLog("[ステータス." + name + "]");
  258. ScheduleCalcAPI.log.AddLog(string.Format("基本値{0} *(100+レベル補正{1} +施設レベル補正 {2} +性癖特徴補正 {3})/100*(100+施設補正①{4} )/100*成功補正 {5}", new object[]
  259. {
  260. basic,
  261. level,
  262. facilityLevel,
  263. sexualChara,
  264. facility1,
  265. success
  266. }) + "=" + num);
  267. }
  268. return (int)Math.Ceiling(num);
  269. }
  270. private static int Simulate_trainee(string name, int trainerParam, int workLvRevision, int teachRevision)
  271. {
  272. double num = (double)(trainerParam / 20) * ScheduleCalcAPI.CP((double)(workLvRevision + teachRevision)) / 2.0;
  273. if (num > 0.0)
  274. {
  275. ScheduleCalcAPI.log.AddLog("[ステータス." + name + "]");
  276. ScheduleCalcAPI.log.AddLog(string.Format("育成する側のメイド長のパラメータ{0}/20)*((100+レベル補正{1}+指導補正{2})/100) / 2", trainerParam, workLvRevision, teachRevision) + "=" + num);
  277. }
  278. return (int)Math.Ceiling(num);
  279. }
  280. private static double GetRevisionSuccess(ScheduleData.WorkSuccessLv successLv, bool commu)
  281. {
  282. double result = 0.0;
  283. if (successLv == ScheduleData.WorkSuccessLv.Unexecuted)
  284. {
  285. result = 0.0;
  286. }
  287. else if (commu)
  288. {
  289. result = 1.3;
  290. }
  291. else if (successLv != ScheduleData.WorkSuccessLv.Miss)
  292. {
  293. if (successLv != ScheduleData.WorkSuccessLv.Success)
  294. {
  295. if (successLv == ScheduleData.WorkSuccessLv.Perfect)
  296. {
  297. result = 1.5;
  298. }
  299. }
  300. else
  301. {
  302. result = 1.0;
  303. }
  304. }
  305. else
  306. {
  307. result = 0.5;
  308. }
  309. return result;
  310. }
  311. private static double GetBasicIncome()
  312. {
  313. return 0.0;
  314. }
  315. private static double GetEvaluation()
  316. {
  317. return 0.0;
  318. }
  319. private static double GetVisitorCnt()
  320. {
  321. return 0.0;
  322. }
  323. public static int GetRevisionLevel(int lv)
  324. {
  325. return (lv - 1) * 10;
  326. }
  327. public static int NoonWorkPlayToLv(int noonWorkPlayCount)
  328. {
  329. if (noonWorkPlayCount < ScheduleCSVData.noonWorkLv2Exp)
  330. {
  331. return 1;
  332. }
  333. if (noonWorkPlayCount < ScheduleCSVData.noonWorkLv3Exp)
  334. {
  335. return 2;
  336. }
  337. return 3;
  338. }
  339. public static int NoonWorkPlayCount(Maid maid, int workId)
  340. {
  341. if (maid.status.workDatas.ContainsKey(workId))
  342. {
  343. return (int)maid.status.workDatas.Get(workId).playCount;
  344. }
  345. return 0;
  346. }
  347. private static double GetRevisionStatusReception(MaidStatus.Status status, bool guestSexual)
  348. {
  349. double num = 0.0;
  350. if (guestSexual)
  351. {
  352. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.inyoku);
  353. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.mvalue);
  354. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.hentai);
  355. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.housi);
  356. }
  357. else
  358. {
  359. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.lovely);
  360. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.elegance);
  361. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.charm);
  362. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.reception);
  363. }
  364. return (double)Mathf.Clamp((float)(num / 2.0), 0f, 40f);
  365. }
  366. private static double GetRevisionStatusSales(Maid maid, Facility facility, ScheduleMgr.ScheduleTime time)
  367. {
  368. double num = 0.0;
  369. double num2 = (double)maid.status.lovely;
  370. double num3 = (double)maid.status.charm;
  371. double num4 = (double)maid.status.elegance;
  372. double num5 = (double)maid.status.cooking;
  373. double num6 = (double)maid.status.reception;
  374. foreach (Maid maid2 in facility.GetAllocationMaidArray(time))
  375. {
  376. if (maid2 != null && maid2 != maid)
  377. {
  378. num2 += (double)maid2.status.lovely * 0.1;
  379. num3 += (double)maid2.status.charm * 0.1;
  380. num4 += (double)maid2.status.elegance * 0.1;
  381. num5 += (double)maid2.status.cooking * 0.1;
  382. num6 += (double)maid2.status.reception * 0.1;
  383. }
  384. }
  385. num2 = (double)Mathf.Clamp((float)num2, 0f, 9999f);
  386. num3 = (double)Mathf.Clamp((float)num3, 0f, 9999f);
  387. num4 = (double)Mathf.Clamp((float)num4, 0f, 9999f);
  388. num5 = (double)Mathf.Clamp((float)num5, 0f, 9999f);
  389. num6 = (double)Mathf.Clamp((float)num6, 0f, 9999f);
  390. num += ScheduleCalcAPI.ConvertRevisionStatus(num2);
  391. num += ScheduleCalcAPI.ConvertRevisionStatus(num3);
  392. num += ScheduleCalcAPI.ConvertRevisionStatus(num4);
  393. num += ScheduleCalcAPI.ConvertRevisionStatus(num5);
  394. num += ScheduleCalcAPI.ConvertRevisionStatus(num6);
  395. return (double)Mathf.Clamp((float)(num / 3.0), 0f, 33f);
  396. }
  397. private static double GetRevisionStatusIdol(MaidStatus.Status status)
  398. {
  399. double num = 0.0;
  400. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.lovely);
  401. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.elegance);
  402. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.charm);
  403. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.dance);
  404. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.vocal);
  405. return (double)Mathf.Clamp((float)(num / 3.0), 0f, 33f);
  406. }
  407. private static double GetRevisionMainFacility(Facility facility)
  408. {
  409. return 0.0;
  410. }
  411. private static double GetRevisionFacilityLevel(FacilityDataTable.FacilityDefaultData defaultData)
  412. {
  413. int num = GameMain.Instance.FacilityMgr.GetFacilityLevel(defaultData.ID);
  414. num = Mathf.Clamp((num - 1) * 5, 0, int.MaxValue);
  415. return (double)num;
  416. }
  417. private static double GetRevisionFacility1(FacilityDataTable.FacilityDefaultData facilityDefaultData)
  418. {
  419. return (double)facilityDefaultData.heroineMagnification;
  420. }
  421. private static double GetRevisionFacility2(Facility facility)
  422. {
  423. Facility.FacilityParameter facilityParameter = facility.CalcRecipeParameter();
  424. return (double)facilityParameter.experienceValue;
  425. }
  426. private static double GetRevisionAttribute(bool guestSexual)
  427. {
  428. return 1.0;
  429. }
  430. private static double GetRevisionAllMaid()
  431. {
  432. double num = 0.0;
  433. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
  434. {
  435. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
  436. if (maid != null)
  437. {
  438. double basicMaidEvaluation = ScheduleCalcAPI.GetBasicMaidEvaluation(maid.status);
  439. double workEvalution = ScheduleCalcAPI.GetWorkEvalution(maid.status);
  440. double num2 = (double)Mathf.Clamp((float)(basicMaidEvaluation + workEvalution), 0f, 100f);
  441. num += num2;
  442. }
  443. }
  444. return num;
  445. }
  446. private static double GetBasicMaidEvaluation(MaidStatus.Status status)
  447. {
  448. double num = 0.0;
  449. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.lovely);
  450. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.elegance);
  451. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.charm);
  452. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.care);
  453. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.reception);
  454. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.dance);
  455. num += ScheduleCalcAPI.ConvertRevisionStatus((double)status.vocal);
  456. return (double)Mathf.Clamp((float)(num / 2.0), 0f, 50f);
  457. }
  458. private static double GetWorkEvalution(MaidStatus.Status status)
  459. {
  460. return 0.0;
  461. }
  462. private static double ConvertRevisionStatus(double value)
  463. {
  464. double num = (double)Mathf.Clamp((float)value, 0f, 9999f);
  465. return Math.Ceiling(value / 500.0);
  466. }
  467. public static ScheduleCalcAPI.ResultLog log = new ScheduleCalcAPI.ResultLog();
  468. public class ResultLog
  469. {
  470. public void SetTarget(Maid target)
  471. {
  472. this.target = target;
  473. }
  474. public void AddLog(Maid key, string message)
  475. {
  476. if (!this.resultLog.ContainsKey(key))
  477. {
  478. this.resultLog.Add(key, new List<string>());
  479. }
  480. this.resultLog[key].Add(message);
  481. }
  482. public void AddLog(string message)
  483. {
  484. if (this.target == null)
  485. {
  486. return;
  487. }
  488. this.AddLog(this.target, message);
  489. }
  490. public void LogClear()
  491. {
  492. this.resultLog.Clear();
  493. }
  494. public Dictionary<Maid, List<string>> resultLog = new Dictionary<Maid, List<string>>();
  495. public Maid target;
  496. }
  497. public class ResultSimulateParam
  498. {
  499. public int study_rate;
  500. public int reception;
  501. public int care;
  502. public int lovely;
  503. public int elegance;
  504. public int charm;
  505. public int teach_rate;
  506. public int exp;
  507. public int cooking;
  508. public int vocal;
  509. public int dance;
  510. public int appealPoint;
  511. public int income;
  512. public int evaluation;
  513. public int playNumber;
  514. public int otherPlayNumber;
  515. public int commandExp;
  516. public int inyoku;
  517. public int mvalue;
  518. public int hentai;
  519. public int housi;
  520. }
  521. }
  522. }