Status.cs 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using MaidStatus;
  5. using UnityEngine;
  6. using wf;
  7. namespace PlayerStatus
  8. {
  9. public class Status
  10. {
  11. public Status()
  12. {
  13. Shop.CreateData();
  14. Trophy.CreateData();
  15. this.playerName_ = MaidRandomName.GetPlayerName();
  16. this.clubName_ = "エンパイアクラブ";
  17. if (Product.isEnglish)
  18. {
  19. this.clubName_ = "EmpireClub";
  20. }
  21. this.flags_ = new Dictionary<string, int>();
  22. this.flags = new ReadOnlyDictionary<string, int>(this.flags_);
  23. this.havePartsItems_ = new Dictionary<string, bool>();
  24. this.havePartsItems = new ReadOnlyDictionary<string, bool>(this.havePartsItems_);
  25. this.haveItems_ = new Dictionary<string, bool>();
  26. this.haveItems = new ReadOnlyDictionary<string, bool>(this.haveItems_);
  27. this.shopLineups_ = new Dictionary<int, ShopItemStatus>();
  28. this.shopLineups = new ReadOnlyDictionary<int, ShopItemStatus>(this.shopLineups_);
  29. this.scheduleSlot = new ScheduleData[40];
  30. for (int i = 0; i < 40; i++)
  31. {
  32. this.scheduleSlot[i] = new ScheduleData();
  33. }
  34. this.scheduleSlotBackup = new ScheduleSlotBackup[ScheduleSlotBackup.BackUpMax];
  35. for (int j = 0; j < ScheduleSlotBackup.BackUpMax; j++)
  36. {
  37. this.scheduleSlotBackup[j] = new ScheduleSlotBackup();
  38. }
  39. this.nightWorksStates_ = new Dictionary<int, NightWorkState>();
  40. this.night_works_state_dic = new ReadOnlyDictionary<int, NightWorkState>(this.nightWorksStates_);
  41. this.haveTrophys = new HashSet<int>();
  42. this.jobClassOpenFlags = new HashSet<int>();
  43. this.yotogiClassOpenFlags = new HashSet<int>();
  44. Status.CreateHaveItemList();
  45. foreach (string key in Status.flagLockPartsItems)
  46. {
  47. this.havePartsItems_.Add(key, false);
  48. }
  49. this.UpdateingExtraTrophysHaveData();
  50. this.clubGrade = 1;
  51. }
  52. public bool isOldPlayer
  53. {
  54. get
  55. {
  56. return this.GetFlag("__isComPlayer") != 0;
  57. }
  58. set
  59. {
  60. this.SetFlag("__isComPlayer", (!value) ? 0 : 1);
  61. }
  62. }
  63. public string playerName
  64. {
  65. get
  66. {
  67. return this.playerName_;
  68. }
  69. set
  70. {
  71. this.playerName_ = ((value != null) ? Status.ConvertString(value, 8) : string.Empty);
  72. }
  73. }
  74. public int days
  75. {
  76. get
  77. {
  78. return this.days_;
  79. }
  80. set
  81. {
  82. this.days_ = System.Math.Max(0, value);
  83. }
  84. }
  85. public long totalPurchasePrice
  86. {
  87. get
  88. {
  89. return this.totalPurchasePrice_;
  90. }
  91. set
  92. {
  93. this.totalPurchasePrice_ = System.Math.Max(0L, value);
  94. }
  95. }
  96. public long money
  97. {
  98. get
  99. {
  100. return this.money_;
  101. }
  102. set
  103. {
  104. this.money_ = wf.Math.RoundMinMax(value, 0L, 9999999999L);
  105. }
  106. }
  107. public string moneyText
  108. {
  109. get
  110. {
  111. return Utility.ConvertMoneyText(GameMain.Instance.CharacterMgr.status.money);
  112. }
  113. }
  114. public long casinoCoin
  115. {
  116. get
  117. {
  118. return this.casinoCoin_;
  119. }
  120. set
  121. {
  122. this.casinoCoin_ = wf.Math.RoundMinMax(value, 0L, 999999L);
  123. }
  124. }
  125. public string clubName
  126. {
  127. get
  128. {
  129. return this.clubName_;
  130. }
  131. set
  132. {
  133. this.clubName_ = ((value != null) ? Status.ConvertString(value, 15) : string.Empty);
  134. }
  135. }
  136. public int clubGrade
  137. {
  138. get
  139. {
  140. return this.clubGrade_;
  141. }
  142. set
  143. {
  144. this.clubGrade_ = wf.Math.RoundMinMax(value, 1, 5);
  145. }
  146. }
  147. public int clubEvaluation
  148. {
  149. get
  150. {
  151. return this.baseClubEvaluation;
  152. }
  153. }
  154. public int baseClubEvaluation
  155. {
  156. get
  157. {
  158. return this.baseClubEvaluation_;
  159. }
  160. set
  161. {
  162. this.baseClubEvaluation_ = wf.Math.Round3(value);
  163. }
  164. }
  165. public int clubGauge
  166. {
  167. get
  168. {
  169. return this.clubGauge_;
  170. }
  171. set
  172. {
  173. this.clubGauge_ = wf.Math.RoundMinMax(value, 0, 100);
  174. }
  175. }
  176. public bool isDaytime
  177. {
  178. get
  179. {
  180. return this.GetFlag("時間帯") != 3;
  181. }
  182. }
  183. public bool lockUserDraftMaid
  184. {
  185. get
  186. {
  187. return this.GetFlag("__lockUserDraftMaid") != 0;
  188. }
  189. set
  190. {
  191. this.SetFlag("__lockUserDraftMaid", (!value) ? 0 : 1);
  192. }
  193. }
  194. public bool lockNTRPlay
  195. {
  196. get
  197. {
  198. return this.GetFlag("__lockNTRPlay") != 0;
  199. }
  200. set
  201. {
  202. this.SetFlag("__lockNTRPlay", (!value) ? 0 : 1);
  203. }
  204. }
  205. public int maidPoint
  206. {
  207. get
  208. {
  209. int num = 0;
  210. foreach (int id in this.haveTrophys)
  211. {
  212. if (Trophy.Contains(id) && Trophy.IsEnabled(id))
  213. {
  214. num += Trophy.GetData(id).maidPoint;
  215. }
  216. }
  217. return num;
  218. }
  219. }
  220. public bool isAvailableShop
  221. {
  222. get
  223. {
  224. return true;
  225. }
  226. }
  227. public bool isAvailableRanking
  228. {
  229. get
  230. {
  231. return false;
  232. }
  233. }
  234. public bool isAvailableCompetitiveShow
  235. {
  236. get
  237. {
  238. return true;
  239. }
  240. }
  241. public bool isAvailableDance
  242. {
  243. get
  244. {
  245. return true;
  246. }
  247. }
  248. public bool isAvailableEmploymentAndBanishment
  249. {
  250. get
  251. {
  252. return true;
  253. }
  254. }
  255. public bool isAvailableTransfer
  256. {
  257. get
  258. {
  259. return !string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path) && PluginData.IsEnabled("Legacy") && this.GetFlag("オープニング終了") == 1;
  260. }
  261. }
  262. public bool isAvailableClassChange
  263. {
  264. get
  265. {
  266. return true;
  267. }
  268. }
  269. public ReadOnlyDictionary<string, int> flags { get; private set; }
  270. public ReadOnlyDictionary<string, bool> havePartsItems { get; private set; }
  271. public ReadOnlyDictionary<string, bool> haveItems { get; private set; }
  272. public ReadOnlyDictionary<int, ShopItemStatus> shopLineups { get; private set; }
  273. public ReadOnlyDictionary<int, NightWorkState> night_works_state_dic { get; private set; }
  274. public GP003Status gp003Status
  275. {
  276. get
  277. {
  278. return this.gp003Status_;
  279. }
  280. }
  281. public void SetFlag(string flagName, int value)
  282. {
  283. if (!this.flags_.ContainsKey(flagName))
  284. {
  285. this.flags_.Add(flagName, value);
  286. }
  287. else
  288. {
  289. this.flags_[flagName] = value;
  290. }
  291. }
  292. public void AddFlag(string flagName, int value)
  293. {
  294. if (!this.flags_.ContainsKey(flagName))
  295. {
  296. this.flags_.Add(flagName, value);
  297. }
  298. else
  299. {
  300. Dictionary<string, int> dictionary;
  301. (dictionary = this.flags_)[flagName] = dictionary[flagName] + value;
  302. }
  303. }
  304. public int GetFlag(string flagName)
  305. {
  306. return (!this.flags_.ContainsKey(flagName)) ? 0 : this.flags_[flagName];
  307. }
  308. public bool RemoveFlag(string flagName)
  309. {
  310. return this.flags_.ContainsKey(flagName) && this.flags_.Remove(flagName);
  311. }
  312. public void AddShopLineup(int shopItemId)
  313. {
  314. if (!this.shopLineups_.ContainsKey(shopItemId))
  315. {
  316. this.shopLineups_.Add(shopItemId, ShopItemStatus.New);
  317. }
  318. }
  319. public void RemoveShopLineup(int shopItemId)
  320. {
  321. if (this.shopLineups_.ContainsKey(shopItemId))
  322. {
  323. this.shopLineups_.Remove(shopItemId);
  324. }
  325. }
  326. public void SetShopLineupStatus(int shopItemId, ShopItemStatus status)
  327. {
  328. if (this.shopLineups_.ContainsKey(shopItemId))
  329. {
  330. this.shopLineups_[shopItemId] = status;
  331. }
  332. }
  333. public bool IsShopLineupItem(int itemId)
  334. {
  335. return this.shopLineups_.ContainsKey(itemId);
  336. }
  337. public bool AddNightWorksState(NightWorkState data)
  338. {
  339. if (this.nightWorksStates_.ContainsKey(data.workId))
  340. {
  341. return false;
  342. }
  343. this.nightWorksStates_.Add(data.workId, data);
  344. return true;
  345. }
  346. public bool RemoveNightWorksState(int workId)
  347. {
  348. if (!this.nightWorksStates_.ContainsKey(workId))
  349. {
  350. return false;
  351. }
  352. this.nightWorksStates_.Remove(workId);
  353. return true;
  354. }
  355. public NightWorkState GetNightWorksState(int workId)
  356. {
  357. if (!this.nightWorksStates_.ContainsKey(workId))
  358. {
  359. return null;
  360. }
  361. return this.nightWorksStates_[workId];
  362. }
  363. public bool IsNightWorksState(int workId)
  364. {
  365. return this.nightWorksStates_.ContainsKey(workId);
  366. }
  367. public void AddHavePartsItem(string itemName)
  368. {
  369. itemName = itemName.ToLower();
  370. NDebug.Assert(this.havePartsItems_.ContainsKey(itemName), itemName + "の取得設定を変える事はできません");
  371. this.havePartsItems_[itemName] = true;
  372. }
  373. public void RemoveHavePartsItem(string itemName)
  374. {
  375. itemName = itemName.ToLower();
  376. NDebug.Assert(this.havePartsItems_.ContainsKey(itemName), itemName + "の取得設定を変える事はできません");
  377. this.havePartsItems_[itemName] = false;
  378. }
  379. public bool IsHavePartsItem(string itemName)
  380. {
  381. itemName = itemName.ToLower();
  382. return !this.havePartsItems_.ContainsKey(itemName) || this.havePartsItems_[itemName];
  383. }
  384. public void AddHaveItem(string itemName)
  385. {
  386. itemName = itemName.ToLower();
  387. if (!this.haveItems_.ContainsKey(itemName))
  388. {
  389. this.haveItems_.Add(itemName, true);
  390. }
  391. else
  392. {
  393. this.haveItems_[itemName] = true;
  394. }
  395. }
  396. public void RemoveHaveItem(string itemName)
  397. {
  398. itemName = itemName.ToLower();
  399. if (this.haveItems_.ContainsKey(itemName))
  400. {
  401. this.haveItems_.Remove(itemName);
  402. }
  403. this.haveItems_[itemName] = false;
  404. }
  405. public bool IsHaveItem(string itemName)
  406. {
  407. itemName = itemName.ToLower();
  408. return this.haveItems_.ContainsKey(itemName) && this.haveItems_[itemName];
  409. }
  410. public void AddJobClassOpenFlag(int id)
  411. {
  412. if (!this.jobClassOpenFlags.Contains(id))
  413. {
  414. this.jobClassOpenFlags.Add(id);
  415. }
  416. }
  417. public void RemoveJobClassOpenFlag(int id)
  418. {
  419. if (this.jobClassOpenFlags.Contains(id))
  420. {
  421. this.jobClassOpenFlags.Remove(id);
  422. }
  423. }
  424. public bool IsJobClassOpenFlag(int id)
  425. {
  426. return this.jobClassOpenFlags.Contains(id);
  427. }
  428. public void AddYotogiClassOpenFlag(int id)
  429. {
  430. if (!this.yotogiClassOpenFlags.Contains(id))
  431. {
  432. this.yotogiClassOpenFlags.Add(id);
  433. }
  434. }
  435. public void RemoveYotogiClassOpenFlag(int id)
  436. {
  437. if (this.yotogiClassOpenFlags.Contains(id))
  438. {
  439. this.yotogiClassOpenFlags.Remove(id);
  440. }
  441. }
  442. public bool IsYotogiClassOpenFlag(int id)
  443. {
  444. return this.yotogiClassOpenFlags.Contains(id);
  445. }
  446. public bool AddHaveTrophy(int trophyId)
  447. {
  448. bool flag = false;
  449. if (!Trophy.Contains(trophyId) || !Trophy.IsEnabled(trophyId))
  450. {
  451. return false;
  452. }
  453. Trophy.Data data = Trophy.GetData(trophyId);
  454. if (data != null)
  455. {
  456. if (!this.haveTrophys.Contains(trophyId))
  457. {
  458. this.haveTrophys.Add(trophyId);
  459. flag = true;
  460. }
  461. if (data.lineupIdArray != null)
  462. {
  463. foreach (int shopItemId in data.lineupIdArray)
  464. {
  465. this.AddShopLineup(shopItemId);
  466. }
  467. }
  468. if (flag && data.type != Trophy.Data.Type.Extra)
  469. {
  470. GameObject gameObject = GameObject.Find("SystemUI Root/TrophyAchieveEffect");
  471. if (gameObject != null)
  472. {
  473. TrophyAchieveEffect component = gameObject.GetComponent<TrophyAchieveEffect>();
  474. if (component != null)
  475. {
  476. component.EffectStart(data);
  477. }
  478. }
  479. }
  480. }
  481. return flag;
  482. }
  483. public bool IsHaveTrophy(int id)
  484. {
  485. return this.haveTrophys.Contains(id);
  486. }
  487. public bool IsHaveTrophy(int[] ids)
  488. {
  489. bool result = true;
  490. for (int i = 0; i < ids.Length; i++)
  491. {
  492. if (!this.IsHaveTrophy(ids[i]))
  493. {
  494. result = false;
  495. break;
  496. }
  497. }
  498. return result;
  499. }
  500. public int GetScheduleMaidSetting(Maid checkMaid)
  501. {
  502. for (int i = 0; i < this.scheduleSlot.Length; i++)
  503. {
  504. if (!string.IsNullOrEmpty(this.scheduleSlot[i].maid_guid))
  505. {
  506. if (checkMaid.status.guid == this.scheduleSlot[i].maid_guid)
  507. {
  508. return i;
  509. }
  510. }
  511. }
  512. return -1;
  513. }
  514. public Maid GetScheduleSlot(int slotNo)
  515. {
  516. NDebug.Assert(0 <= slotNo && slotNo < 40, "error.");
  517. if (string.IsNullOrEmpty(this.scheduleSlot[slotNo].maid_guid))
  518. {
  519. return null;
  520. }
  521. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  522. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  523. {
  524. if (characterMgr.GetStockMaid(i).status.guid == this.scheduleSlot[slotNo].maid_guid)
  525. {
  526. return characterMgr.GetStockMaid(i);
  527. }
  528. }
  529. return null;
  530. }
  531. public void BackupScheduleSlot(ScheduleSlotBackup.Type type)
  532. {
  533. if (type == ScheduleSlotBackup.Type.Max)
  534. {
  535. return;
  536. }
  537. ScheduleSlotBackup scheduleSlotBackup = this.scheduleSlotBackup[(int)type];
  538. for (int i = 0; i < this.scheduleSlot.Length; i++)
  539. {
  540. Maid maid = this.GetScheduleSlot(i);
  541. if (maid != null)
  542. {
  543. scheduleSlotBackup.slotDataArray[i].maid_guid = maid.status.guid;
  544. scheduleSlotBackup.slotDataArray[i].noonWorkId = maid.status.noonWorkId;
  545. scheduleSlotBackup.slotDataArray[i].nightWorkId = maid.status.nightWorkId;
  546. scheduleSlotBackup.slotDataArray[i].noonCommu = maid.status.noonCommu;
  547. scheduleSlotBackup.slotDataArray[i].nightCommu = maid.status.nightCommu;
  548. }
  549. else
  550. {
  551. scheduleSlotBackup.slotDataArray[i].maid_guid = string.Empty;
  552. }
  553. }
  554. }
  555. public void ApplyScheduleSlotBackup(ScheduleSlotBackup.Type type)
  556. {
  557. if (type == ScheduleSlotBackup.Type.Max)
  558. {
  559. return;
  560. }
  561. ScheduleSlotBackup scheduleSlotBackup = this.scheduleSlotBackup[(int)type];
  562. int i = 0;
  563. while (i < this.scheduleSlot.Length)
  564. {
  565. if (!(scheduleSlotBackup.slotDataArray[i].maid_guid != string.Empty))
  566. {
  567. goto IL_E1;
  568. }
  569. ScheduleSlotBackup.Data data = scheduleSlotBackup.slotDataArray[i];
  570. Maid stockMaid = GameMain.Instance.CharacterMgr.GetStockMaid(data.maid_guid);
  571. if (!(stockMaid != null))
  572. {
  573. goto IL_E1;
  574. }
  575. this.scheduleSlot[i].maid_guid = data.maid_guid;
  576. this.scheduleSlot[i].noon_communication = data.noonCommu;
  577. this.scheduleSlot[i].night_communication = data.nightCommu;
  578. stockMaid.status.noonWorkId = data.noonWorkId;
  579. stockMaid.status.nightWorkId = data.nightWorkId;
  580. stockMaid.status.noonCommu = data.noonCommu;
  581. stockMaid.status.nightCommu = data.nightCommu;
  582. IL_F3:
  583. i++;
  584. continue;
  585. IL_E1:
  586. this.scheduleSlot[i].maid_guid = string.Empty;
  587. goto IL_F3;
  588. }
  589. }
  590. public void CheckTrophyMainMenu()
  591. {
  592. FacilityManager facilityMgr = GameMain.Instance.FacilityMgr;
  593. int facilityAchievement = facilityMgr.GetFacilityAchievement<int>("施設総数");
  594. if (5 <= facilityAchievement)
  595. {
  596. this.AddHaveTrophy(1160);
  597. }
  598. if (10 <= facilityAchievement)
  599. {
  600. this.AddHaveTrophy(1170);
  601. }
  602. }
  603. public void CheckTrophyDayResultAndNightResult()
  604. {
  605. FacilityManager facilityMgr = GameMain.Instance.FacilityMgr;
  606. int facilityAchievement = facilityMgr.GetFacilityAchievement<int>("施設強化回数");
  607. if (5 <= facilityAchievement)
  608. {
  609. this.AddHaveTrophy(1180);
  610. }
  611. if (10 <= facilityAchievement)
  612. {
  613. this.AddHaveTrophy(1190);
  614. }
  615. }
  616. public void CheckTrophyJobClassAndYotogiClass(Maid checkMaid)
  617. {
  618. if (checkMaid == null || checkMaid.status.heroineType == HeroineType.Sub)
  619. {
  620. return;
  621. }
  622. if (Status.jobClassTrophyCheckSet == null)
  623. {
  624. Status.jobClassTrophyCheckSet = new Dictionary<string, int>();
  625. Status.jobClassTrophyCheckSet.Add("Novice2", 2000);
  626. Status.jobClassTrophyCheckSet.Add("Concierge", 2010);
  627. Status.jobClassTrophyCheckSet.Add("Waitress", 2020);
  628. Status.jobClassTrophyCheckSet.Add("Maitre", 2030);
  629. Status.jobClassTrophyCheckSet.Add("Bartender", 2040);
  630. Status.jobClassTrophyCheckSet.Add("Therapist", 2050);
  631. Status.jobClassTrophyCheckSet.Add("Empire", 2060);
  632. Status.jobClassTrophyCheckSet.Add("Dealer", 2070);
  633. Status.jobClassTrophyCheckSet.Add("Healing", 2080);
  634. Status.jobClassTrophyCheckSet.Add("Night", 2090);
  635. Status.yotogiClassCheckSet = new Dictionary<string, int>();
  636. }
  637. foreach (KeyValuePair<string, int> keyValuePair in Status.jobClassTrophyCheckSet)
  638. {
  639. if (checkMaid.status.jobClass.Contains(JobClass.uniqueNameToId(keyValuePair.Key)))
  640. {
  641. this.AddHaveTrophy(keyValuePair.Value);
  642. }
  643. }
  644. foreach (KeyValuePair<string, int> keyValuePair2 in Status.yotogiClassCheckSet)
  645. {
  646. if (checkMaid.status.jobClass.Contains(YotogiClass.uniqueNameToId(keyValuePair2.Key)))
  647. {
  648. this.AddHaveTrophy(keyValuePair2.Value);
  649. }
  650. }
  651. }
  652. public void CheckTrophyMaidStatus(Maid checkMaid)
  653. {
  654. if (checkMaid == null || checkMaid.status.heroineType == HeroineType.Sub)
  655. {
  656. return;
  657. }
  658. Status status = checkMaid.status;
  659. if (10 <= status.playCountYotogi)
  660. {
  661. this.AddHaveTrophy(140);
  662. }
  663. if (30 <= status.playCountYotogi)
  664. {
  665. this.AddHaveTrophy(150);
  666. }
  667. if (1000 <= status.inyoku)
  668. {
  669. this.AddHaveTrophy(1000);
  670. }
  671. if (5000 <= status.inyoku)
  672. {
  673. this.AddHaveTrophy(1010);
  674. }
  675. if (9999 <= status.inyoku)
  676. {
  677. this.AddHaveTrophy(1020);
  678. }
  679. if (1000 <= status.mvalue)
  680. {
  681. this.AddHaveTrophy(1030);
  682. }
  683. if (5000 <= status.mvalue)
  684. {
  685. this.AddHaveTrophy(1040);
  686. }
  687. if (9999 <= status.mvalue)
  688. {
  689. this.AddHaveTrophy(1050);
  690. }
  691. if (1000 <= status.hentai)
  692. {
  693. this.AddHaveTrophy(1060);
  694. }
  695. if (5000 <= status.hentai)
  696. {
  697. this.AddHaveTrophy(1070);
  698. }
  699. if (9999 <= status.hentai)
  700. {
  701. this.AddHaveTrophy(1080);
  702. }
  703. if (1000 <= status.housi)
  704. {
  705. this.AddHaveTrophy(1090);
  706. }
  707. if (5000 <= status.housi)
  708. {
  709. this.AddHaveTrophy(1100);
  710. }
  711. if (9999 <= status.housi)
  712. {
  713. this.AddHaveTrophy(1110);
  714. }
  715. }
  716. public void CheckTrophyContractTypeAndrelation()
  717. {
  718. int num = 0;
  719. int num2 = 0;
  720. int num3 = 0;
  721. foreach (Maid maid in GameMain.Instance.CharacterMgr.GetStockMaidList())
  722. {
  723. if (maid.status.heroineType != HeroineType.Sub)
  724. {
  725. if (maid.status.contract == Contract.Free)
  726. {
  727. num++;
  728. }
  729. else if (maid.status.contract == Contract.Exclusive)
  730. {
  731. num2++;
  732. }
  733. if (maid.status.relation == Relation.Lover)
  734. {
  735. num3++;
  736. }
  737. }
  738. }
  739. if (1 <= num)
  740. {
  741. this.AddHaveTrophy(10);
  742. }
  743. if (3 <= num)
  744. {
  745. this.AddHaveTrophy(20);
  746. }
  747. if (5 <= num)
  748. {
  749. this.AddHaveTrophy(30);
  750. }
  751. if (1 <= num2)
  752. {
  753. this.AddHaveTrophy(40);
  754. }
  755. if (3 <= num2)
  756. {
  757. this.AddHaveTrophy(50);
  758. }
  759. if (5 <= num2)
  760. {
  761. this.AddHaveTrophy(60);
  762. }
  763. if (1 <= num3)
  764. {
  765. this.AddHaveTrophy(70);
  766. }
  767. if (3 <= num3)
  768. {
  769. this.AddHaveTrophy(80);
  770. }
  771. }
  772. public void Serialize(BinaryWriter binary)
  773. {
  774. binary.Write("CM3D2_PLAYER_STATUS");
  775. binary.Write(1570);
  776. binary.Write(this.playerName_);
  777. binary.Write(this.days_);
  778. binary.Write(this.totalPurchasePrice_);
  779. binary.Write(this.money_);
  780. binary.Write(this.casinoCoin_);
  781. binary.Write(this.clubName_);
  782. binary.Write(this.clubGrade_);
  783. binary.Write(this.baseClubEvaluation_);
  784. binary.Write(this.clubGauge_);
  785. binary.Write((short)this.flags_.Count);
  786. foreach (KeyValuePair<string, int> keyValuePair in this.flags_)
  787. {
  788. binary.Write(keyValuePair.Key);
  789. binary.Write(keyValuePair.Value);
  790. }
  791. binary.Write((short)this.havePartsItems_.Count);
  792. foreach (KeyValuePair<string, bool> keyValuePair2 in this.havePartsItems_)
  793. {
  794. binary.Write(keyValuePair2.Key);
  795. binary.Write(keyValuePair2.Value);
  796. }
  797. binary.Write((short)this.haveItems_.Count);
  798. foreach (KeyValuePair<string, bool> keyValuePair3 in this.haveItems_)
  799. {
  800. binary.Write(keyValuePair3.Key);
  801. binary.Write(keyValuePair3.Value);
  802. }
  803. binary.Write((short)this.shopLineups_.Count);
  804. foreach (KeyValuePair<int, ShopItemStatus> keyValuePair4 in this.shopLineups_)
  805. {
  806. binary.Write(keyValuePair4.Key);
  807. binary.Write((int)keyValuePair4.Value);
  808. }
  809. binary.Write((short)this.scheduleSlot.Length);
  810. foreach (ScheduleData scheduleData in this.scheduleSlot)
  811. {
  812. scheduleData.Serialize(binary);
  813. }
  814. binary.Write((short)this.scheduleSlotBackup.Length);
  815. foreach (ScheduleSlotBackup scheduleSlotBackup in this.scheduleSlotBackup)
  816. {
  817. scheduleSlotBackup.Serialize(binary);
  818. }
  819. binary.Write((short)this.nightWorksStates_.Count);
  820. foreach (KeyValuePair<int, NightWorkState> keyValuePair5 in this.nightWorksStates_)
  821. {
  822. binary.Write(keyValuePair5.Key);
  823. keyValuePair5.Value.Serialize(binary);
  824. }
  825. binary.Write((short)this.haveTrophys.Count);
  826. foreach (int value in this.haveTrophys)
  827. {
  828. binary.Write(value);
  829. }
  830. binary.Write((short)this.jobClassOpenFlags.Count);
  831. foreach (int value2 in this.jobClassOpenFlags)
  832. {
  833. binary.Write(value2);
  834. }
  835. binary.Write((short)this.yotogiClassOpenFlags.Count);
  836. foreach (int value3 in this.yotogiClassOpenFlags)
  837. {
  838. binary.Write(value3);
  839. }
  840. binary.Write(1000);
  841. binary.Write(3830248615U);
  842. }
  843. public void Deserialize(BinaryReader binary)
  844. {
  845. string a = binary.ReadString();
  846. NDebug.Assert(a == "CM3D2_PLAYER_STATUS", "プレイヤーパラメータのヘッダーが不正です。");
  847. int num = binary.ReadInt32();
  848. this.playerName_ = binary.ReadString();
  849. this.days_ = binary.ReadInt32();
  850. this.totalPurchasePrice_ = binary.ReadInt64();
  851. this.money_ = binary.ReadInt64();
  852. this.casinoCoin_ = binary.ReadInt64();
  853. this.clubName_ = binary.ReadString();
  854. this.clubGrade_ = binary.ReadInt32();
  855. this.baseClubEvaluation_ = binary.ReadInt32();
  856. this.clubGauge_ = binary.ReadInt32();
  857. int num2 = (int)binary.ReadInt16();
  858. this.flags_.Clear();
  859. for (int i = 0; i < num2; i++)
  860. {
  861. string key = binary.ReadString();
  862. int value = binary.ReadInt32();
  863. this.flags_.Add(key, value);
  864. }
  865. num2 = (int)binary.ReadInt16();
  866. this.havePartsItems_.Clear();
  867. for (int j = 0; j < num2; j++)
  868. {
  869. string key2 = binary.ReadString();
  870. bool value2 = binary.ReadBoolean();
  871. this.havePartsItems_.Add(key2, value2);
  872. }
  873. if (204 < num)
  874. {
  875. num2 = (int)binary.ReadInt16();
  876. this.haveItems_.Clear();
  877. for (int k = 0; k < num2; k++)
  878. {
  879. string key3 = binary.ReadString();
  880. bool value3 = binary.ReadBoolean();
  881. this.haveItems_.Add(key3, value3);
  882. }
  883. }
  884. num2 = (int)binary.ReadInt16();
  885. this.shopLineups_.Clear();
  886. for (int l = 0; l < num2; l++)
  887. {
  888. int key4 = binary.ReadInt32();
  889. ShopItemStatus value4 = (ShopItemStatus)binary.ReadInt32();
  890. this.shopLineups_.Add(key4, value4);
  891. }
  892. num2 = (int)binary.ReadInt16();
  893. int slotCnt = num2;
  894. this.scheduleSlot = new ScheduleData[40];
  895. for (int m = 0; m < 40; m++)
  896. {
  897. this.scheduleSlot[m] = new ScheduleData();
  898. }
  899. for (int n = 0; n < num2; n++)
  900. {
  901. this.scheduleSlot[n].Deserialize(binary, num);
  902. }
  903. if (num >= 211)
  904. {
  905. num2 = (int)binary.ReadInt16();
  906. this.scheduleSlotBackup = new ScheduleSlotBackup[num2];
  907. for (int num3 = 0; num3 < num2; num3++)
  908. {
  909. this.scheduleSlotBackup[num3] = new ScheduleSlotBackup();
  910. this.scheduleSlotBackup[num3].Deserialize(binary, num, slotCnt);
  911. }
  912. }
  913. num2 = (int)binary.ReadInt16();
  914. this.nightWorksStates_.Clear();
  915. for (int num4 = 0; num4 < num2; num4++)
  916. {
  917. int key5 = binary.ReadInt32();
  918. NightWorkState nightWorkState = new NightWorkState();
  919. nightWorkState.Deserialize(binary, num);
  920. this.nightWorksStates_.Add(key5, nightWorkState);
  921. }
  922. num2 = (int)binary.ReadInt16();
  923. this.haveTrophys.Clear();
  924. for (int num5 = 0; num5 < num2; num5++)
  925. {
  926. int item = binary.ReadInt32();
  927. this.haveTrophys.Add(item);
  928. }
  929. num2 = (int)binary.ReadInt16();
  930. this.jobClassOpenFlags.Clear();
  931. for (int num6 = 0; num6 < num2; num6++)
  932. {
  933. int item2 = binary.ReadInt32();
  934. this.jobClassOpenFlags.Add(item2);
  935. }
  936. num2 = (int)binary.ReadInt16();
  937. this.yotogiClassOpenFlags.Clear();
  938. for (int num7 = 0; num7 < num2; num7++)
  939. {
  940. int item3 = binary.ReadInt32();
  941. this.yotogiClassOpenFlags.Add(item3);
  942. }
  943. if (1540 <= num)
  944. {
  945. int num8 = binary.ReadInt32();
  946. }
  947. uint num9 = binary.ReadUInt32();
  948. NDebug.Assert(3830248615U == num9, "プレイヤーパラメータのロードに失敗しました");
  949. foreach (string key6 in Status.flagLockPartsItems)
  950. {
  951. if (!this.havePartsItems_.ContainsKey(key6))
  952. {
  953. this.havePartsItems_.Add(key6, false);
  954. }
  955. }
  956. HashSet<string> hashSet = new HashSet<string>();
  957. foreach (KeyValuePair<string, bool> keyValuePair in this.havePartsItems_)
  958. {
  959. if (!Status.flagLockPartsItems.Contains(keyValuePair.Key))
  960. {
  961. hashSet.Add(keyValuePair.Key);
  962. }
  963. }
  964. foreach (string key7 in hashSet)
  965. {
  966. this.havePartsItems_.Remove(key7);
  967. }
  968. this.UpdateingExtraTrophysHaveData();
  969. }
  970. private void UpdateingExtraTrophysHaveData()
  971. {
  972. List<Trophy.Data> allDatas = Trophy.GetAllDatas(true);
  973. foreach (Trophy.Data data in allDatas)
  974. {
  975. if (data.type == Trophy.Data.Type.Extra)
  976. {
  977. this.AddHaveTrophy(data.id);
  978. }
  979. }
  980. }
  981. private static void CreateHaveItemList()
  982. {
  983. if (Status.flagLockPartsItems == null)
  984. {
  985. Status.flagLockPartsItems = new HashSet<string>();
  986. Dictionary<int, Shop.ItemDataBase> item_data_dic = Shop.item_data_dic;
  987. Dictionary<int, Shop.ItemDataGroup> item_data_group_dic = Shop.item_data_group_dic;
  988. foreach (KeyValuePair<int, Shop.ItemDataBase> keyValuePair in item_data_dic)
  989. {
  990. Shop.ItemDataBase value = keyValuePair.Value;
  991. if (!item_data_group_dic.ContainsKey(value.id))
  992. {
  993. for (int i = 0; i < value.item_menu_array.Length; i++)
  994. {
  995. string item = value.item_menu_array[i];
  996. if (!Status.flagLockPartsItems.Contains(item))
  997. {
  998. Status.flagLockPartsItems.Add(item);
  999. }
  1000. }
  1001. }
  1002. }
  1003. foreach (KeyValuePair<string[], HashSet<int>> keyValuePair2 in Shop.set_card_list)
  1004. {
  1005. foreach (string item2 in keyValuePair2.Key)
  1006. {
  1007. if (!Status.flagLockPartsItems.Contains(item2))
  1008. {
  1009. Status.flagLockPartsItems.Add(item2);
  1010. }
  1011. }
  1012. }
  1013. using (AFileBase afileBase = GameUty.FileSystem.FileOpen("scenario_get_item_list.nei"))
  1014. {
  1015. using (CsvParser csvParser = new CsvParser())
  1016. {
  1017. bool condition = csvParser.Open(afileBase);
  1018. NDebug.Assert(condition, "file open error[scenario_get_item_list.nei]");
  1019. for (int k = 0; k < csvParser.max_cell_y; k++)
  1020. {
  1021. if (csvParser.IsCellToExistData(0, k))
  1022. {
  1023. string text = csvParser.GetCellAsString(0, k).ToLower();
  1024. text += ".menu";
  1025. if (!Status.flagLockPartsItems.Contains(text))
  1026. {
  1027. Status.flagLockPartsItems.Add(text);
  1028. }
  1029. }
  1030. }
  1031. }
  1032. }
  1033. }
  1034. }
  1035. public const int SaveDataVersion = 1000;
  1036. public const int InitMaidPoint = 0;
  1037. public const long MoneyMax = 9999999999L;
  1038. public const long CoinMax = 999999L;
  1039. public const int MVPEventDay = 7;
  1040. public const int ScheduleSlotMax = 40;
  1041. public const int ClubGradeMax = 5;
  1042. private const uint SaveDataCheckCode = 3830248615U;
  1043. private static HashSet<string> flagLockPartsItems;
  1044. public ScheduleSlotBackup[] scheduleSlotBackup;
  1045. public ScheduleData[] scheduleSlot;
  1046. private string playerName_;
  1047. private int days_;
  1048. private long totalPurchasePrice_;
  1049. private long money_;
  1050. private long casinoCoin_;
  1051. private string clubName_;
  1052. private int clubGrade_;
  1053. private int baseClubEvaluation_;
  1054. private int clubGauge_;
  1055. private Dictionary<string, int> flags_;
  1056. private Dictionary<string, bool> havePartsItems_;
  1057. private Dictionary<string, bool> haveItems_;
  1058. private Dictionary<int, ShopItemStatus> shopLineups_;
  1059. private Dictionary<int, NightWorkState> nightWorksStates_;
  1060. private HashSet<int> haveTrophys;
  1061. private HashSet<int> jobClassOpenFlags;
  1062. private HashSet<int> yotogiClassOpenFlags;
  1063. private GP003Status gp003Status_ = new GP003Status();
  1064. private static Dictionary<string, int> jobClassTrophyCheckSet;
  1065. private static Dictionary<string, int> yotogiClassCheckSet;
  1066. }
  1067. }