Status.cs 26 KB

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