Status.cs 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151
  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 void SetFlag(string flagName, int value)
  275. {
  276. if (!this.flags_.ContainsKey(flagName))
  277. {
  278. this.flags_.Add(flagName, value);
  279. }
  280. else
  281. {
  282. this.flags_[flagName] = value;
  283. }
  284. }
  285. public void AddFlag(string flagName, int value)
  286. {
  287. if (!this.flags_.ContainsKey(flagName))
  288. {
  289. this.flags_.Add(flagName, value);
  290. }
  291. else
  292. {
  293. Dictionary<string, int> dictionary;
  294. (dictionary = this.flags_)[flagName] = dictionary[flagName] + value;
  295. }
  296. }
  297. public int GetFlag(string flagName)
  298. {
  299. return (!this.flags_.ContainsKey(flagName)) ? 0 : this.flags_[flagName];
  300. }
  301. public bool RemoveFlag(string flagName)
  302. {
  303. return this.flags_.ContainsKey(flagName) && this.flags_.Remove(flagName);
  304. }
  305. public void AddShopLineup(int shopItemId)
  306. {
  307. if (!this.shopLineups_.ContainsKey(shopItemId))
  308. {
  309. this.shopLineups_.Add(shopItemId, ShopItemStatus.New);
  310. }
  311. }
  312. public void RemoveShopLineup(int shopItemId)
  313. {
  314. if (this.shopLineups_.ContainsKey(shopItemId))
  315. {
  316. this.shopLineups_.Remove(shopItemId);
  317. }
  318. }
  319. public void SetShopLineupStatus(int shopItemId, ShopItemStatus status)
  320. {
  321. if (this.shopLineups_.ContainsKey(shopItemId))
  322. {
  323. this.shopLineups_[shopItemId] = status;
  324. }
  325. }
  326. public bool IsShopLineupItem(int itemId)
  327. {
  328. return this.shopLineups_.ContainsKey(itemId);
  329. }
  330. public bool AddNightWorksState(NightWorkState data)
  331. {
  332. if (this.nightWorksStates_.ContainsKey(data.workId))
  333. {
  334. return false;
  335. }
  336. this.nightWorksStates_.Add(data.workId, data);
  337. return true;
  338. }
  339. public bool RemoveNightWorksState(int workId)
  340. {
  341. if (!this.nightWorksStates_.ContainsKey(workId))
  342. {
  343. return false;
  344. }
  345. this.nightWorksStates_.Remove(workId);
  346. return true;
  347. }
  348. public NightWorkState GetNightWorksState(int workId)
  349. {
  350. if (!this.nightWorksStates_.ContainsKey(workId))
  351. {
  352. return null;
  353. }
  354. return this.nightWorksStates_[workId];
  355. }
  356. public bool IsNightWorksState(int workId)
  357. {
  358. return this.nightWorksStates_.ContainsKey(workId);
  359. }
  360. public void AddHavePartsItem(string itemName)
  361. {
  362. itemName = itemName.ToLower();
  363. NDebug.Assert(this.havePartsItems_.ContainsKey(itemName), itemName + "の取得設定を変える事はできません");
  364. this.havePartsItems_[itemName] = true;
  365. }
  366. public void RemoveHavePartsItem(string itemName)
  367. {
  368. itemName = itemName.ToLower();
  369. NDebug.Assert(this.havePartsItems_.ContainsKey(itemName), itemName + "の取得設定を変える事はできません");
  370. this.havePartsItems_[itemName] = false;
  371. }
  372. public bool IsHavePartsItem(string itemName)
  373. {
  374. itemName = itemName.ToLower();
  375. return !this.havePartsItems_.ContainsKey(itemName) || this.havePartsItems_[itemName];
  376. }
  377. public void AddHaveItem(string itemName)
  378. {
  379. itemName = itemName.ToLower();
  380. if (!this.haveItems_.ContainsKey(itemName))
  381. {
  382. this.haveItems_.Add(itemName, true);
  383. }
  384. else
  385. {
  386. this.haveItems_[itemName] = true;
  387. }
  388. }
  389. public void RemoveHaveItem(string itemName)
  390. {
  391. itemName = itemName.ToLower();
  392. if (this.haveItems_.ContainsKey(itemName))
  393. {
  394. this.haveItems_.Remove(itemName);
  395. }
  396. this.haveItems_[itemName] = false;
  397. }
  398. public bool IsHaveItem(string itemName)
  399. {
  400. itemName = itemName.ToLower();
  401. return this.haveItems_.ContainsKey(itemName) && this.haveItems_[itemName];
  402. }
  403. public void AddJobClassOpenFlag(int id)
  404. {
  405. if (!this.jobClassOpenFlags.Contains(id))
  406. {
  407. this.jobClassOpenFlags.Add(id);
  408. }
  409. }
  410. public void RemoveJobClassOpenFlag(int id)
  411. {
  412. if (this.jobClassOpenFlags.Contains(id))
  413. {
  414. this.jobClassOpenFlags.Remove(id);
  415. }
  416. }
  417. public bool IsJobClassOpenFlag(int id)
  418. {
  419. return this.jobClassOpenFlags.Contains(id);
  420. }
  421. public void AddYotogiClassOpenFlag(int id)
  422. {
  423. if (!this.yotogiClassOpenFlags.Contains(id))
  424. {
  425. this.yotogiClassOpenFlags.Add(id);
  426. }
  427. }
  428. public void RemoveYotogiClassOpenFlag(int id)
  429. {
  430. if (this.yotogiClassOpenFlags.Contains(id))
  431. {
  432. this.yotogiClassOpenFlags.Remove(id);
  433. }
  434. }
  435. public bool IsYotogiClassOpenFlag(int id)
  436. {
  437. return this.yotogiClassOpenFlags.Contains(id);
  438. }
  439. public bool AddHaveTrophy(int trophyId)
  440. {
  441. bool flag = false;
  442. if (!Trophy.Contains(trophyId) || !Trophy.IsEnabled(trophyId))
  443. {
  444. return false;
  445. }
  446. Trophy.Data data = Trophy.GetData(trophyId);
  447. if (data != null)
  448. {
  449. if (!this.haveTrophys.Contains(trophyId))
  450. {
  451. this.haveTrophys.Add(trophyId);
  452. flag = true;
  453. }
  454. if (data.lineupIdArray != null)
  455. {
  456. foreach (int shopItemId in data.lineupIdArray)
  457. {
  458. this.AddShopLineup(shopItemId);
  459. }
  460. }
  461. if (flag && data.type != Trophy.Data.Type.Extra)
  462. {
  463. GameObject gameObject = GameObject.Find("SystemUI Root/TrophyAchieveEffect");
  464. if (gameObject != null)
  465. {
  466. TrophyAchieveEffect component = gameObject.GetComponent<TrophyAchieveEffect>();
  467. if (component != null)
  468. {
  469. component.EffectStart(data);
  470. }
  471. }
  472. }
  473. }
  474. return flag;
  475. }
  476. public bool IsHaveTrophy(int id)
  477. {
  478. return this.haveTrophys.Contains(id);
  479. }
  480. public bool IsHaveTrophy(int[] ids)
  481. {
  482. bool result = true;
  483. for (int i = 0; i < ids.Length; i++)
  484. {
  485. if (!this.IsHaveTrophy(ids[i]))
  486. {
  487. result = false;
  488. break;
  489. }
  490. }
  491. return result;
  492. }
  493. public int GetScheduleMaidSetting(Maid checkMaid)
  494. {
  495. for (int i = 0; i < this.scheduleSlot.Length; i++)
  496. {
  497. if (!string.IsNullOrEmpty(this.scheduleSlot[i].maid_guid))
  498. {
  499. if (checkMaid.status.guid == this.scheduleSlot[i].maid_guid)
  500. {
  501. return i;
  502. }
  503. }
  504. }
  505. return -1;
  506. }
  507. public Maid GetScheduleSlot(int slotNo)
  508. {
  509. NDebug.Assert(0 <= slotNo && slotNo < 40, "error.");
  510. if (string.IsNullOrEmpty(this.scheduleSlot[slotNo].maid_guid))
  511. {
  512. return null;
  513. }
  514. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  515. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  516. {
  517. if (characterMgr.GetStockMaid(i).status.guid == this.scheduleSlot[slotNo].maid_guid)
  518. {
  519. return characterMgr.GetStockMaid(i);
  520. }
  521. }
  522. return null;
  523. }
  524. public void BackupScheduleSlot(ScheduleSlotBackup.Type type)
  525. {
  526. if (type == ScheduleSlotBackup.Type.Max)
  527. {
  528. return;
  529. }
  530. ScheduleSlotBackup scheduleSlotBackup = this.scheduleSlotBackup[(int)type];
  531. for (int i = 0; i < this.scheduleSlot.Length; i++)
  532. {
  533. Maid maid = this.GetScheduleSlot(i);
  534. if (maid != null)
  535. {
  536. scheduleSlotBackup.slotDataArray[i].maid_guid = maid.status.guid;
  537. scheduleSlotBackup.slotDataArray[i].noonWorkId = maid.status.noonWorkId;
  538. scheduleSlotBackup.slotDataArray[i].nightWorkId = maid.status.nightWorkId;
  539. scheduleSlotBackup.slotDataArray[i].noonCommu = maid.status.noonCommu;
  540. scheduleSlotBackup.slotDataArray[i].nightCommu = maid.status.nightCommu;
  541. }
  542. else
  543. {
  544. scheduleSlotBackup.slotDataArray[i].maid_guid = string.Empty;
  545. }
  546. }
  547. }
  548. public void ApplyScheduleSlotBackup(ScheduleSlotBackup.Type type)
  549. {
  550. if (type == ScheduleSlotBackup.Type.Max)
  551. {
  552. return;
  553. }
  554. ScheduleSlotBackup scheduleSlotBackup = this.scheduleSlotBackup[(int)type];
  555. int i = 0;
  556. while (i < this.scheduleSlot.Length)
  557. {
  558. if (!(scheduleSlotBackup.slotDataArray[i].maid_guid != string.Empty))
  559. {
  560. goto IL_E1;
  561. }
  562. ScheduleSlotBackup.Data data = scheduleSlotBackup.slotDataArray[i];
  563. Maid stockMaid = GameMain.Instance.CharacterMgr.GetStockMaid(data.maid_guid);
  564. if (!(stockMaid != null))
  565. {
  566. goto IL_E1;
  567. }
  568. this.scheduleSlot[i].maid_guid = data.maid_guid;
  569. this.scheduleSlot[i].noon_communication = data.noonCommu;
  570. this.scheduleSlot[i].night_communication = data.nightCommu;
  571. stockMaid.status.noonWorkId = data.noonWorkId;
  572. stockMaid.status.nightWorkId = data.nightWorkId;
  573. stockMaid.status.noonCommu = data.noonCommu;
  574. stockMaid.status.nightCommu = data.nightCommu;
  575. IL_F3:
  576. i++;
  577. continue;
  578. IL_E1:
  579. this.scheduleSlot[i].maid_guid = string.Empty;
  580. goto IL_F3;
  581. }
  582. }
  583. public void CheckTrophyMainMenu()
  584. {
  585. FacilityManager facilityMgr = GameMain.Instance.FacilityMgr;
  586. int facilityAchievement = facilityMgr.GetFacilityAchievement<int>("施設総数");
  587. if (5 <= facilityAchievement)
  588. {
  589. this.AddHaveTrophy(1160);
  590. }
  591. if (10 <= facilityAchievement)
  592. {
  593. this.AddHaveTrophy(1170);
  594. }
  595. }
  596. public void CheckTrophyDayResultAndNightResult()
  597. {
  598. FacilityManager facilityMgr = GameMain.Instance.FacilityMgr;
  599. int facilityAchievement = facilityMgr.GetFacilityAchievement<int>("施設強化回数");
  600. if (5 <= facilityAchievement)
  601. {
  602. this.AddHaveTrophy(1180);
  603. }
  604. if (10 <= facilityAchievement)
  605. {
  606. this.AddHaveTrophy(1190);
  607. }
  608. }
  609. public void CheckTrophyJobClassAndYotogiClass(Maid checkMaid)
  610. {
  611. if (checkMaid == null || checkMaid.status.heroineType == HeroineType.Sub)
  612. {
  613. return;
  614. }
  615. if (Status.jobClassTrophyCheckSet == null)
  616. {
  617. Status.jobClassTrophyCheckSet = new Dictionary<string, int>();
  618. Status.jobClassTrophyCheckSet.Add("Novice2", 2000);
  619. Status.jobClassTrophyCheckSet.Add("Concierge", 2010);
  620. Status.jobClassTrophyCheckSet.Add("Waitress", 2020);
  621. Status.jobClassTrophyCheckSet.Add("Maitre", 2030);
  622. Status.jobClassTrophyCheckSet.Add("Bartender", 2040);
  623. Status.jobClassTrophyCheckSet.Add("Therapist", 2050);
  624. Status.jobClassTrophyCheckSet.Add("Empire", 2060);
  625. Status.jobClassTrophyCheckSet.Add("Dealer", 2070);
  626. Status.jobClassTrophyCheckSet.Add("Healing", 2080);
  627. Status.jobClassTrophyCheckSet.Add("Night", 2090);
  628. Status.yotogiClassCheckSet = new Dictionary<string, int>();
  629. }
  630. foreach (KeyValuePair<string, int> keyValuePair in Status.jobClassTrophyCheckSet)
  631. {
  632. if (checkMaid.status.jobClass.Contains(JobClass.uniqueNameToId(keyValuePair.Key)))
  633. {
  634. this.AddHaveTrophy(keyValuePair.Value);
  635. }
  636. }
  637. foreach (KeyValuePair<string, int> keyValuePair2 in Status.yotogiClassCheckSet)
  638. {
  639. if (checkMaid.status.jobClass.Contains(YotogiClass.uniqueNameToId(keyValuePair2.Key)))
  640. {
  641. this.AddHaveTrophy(keyValuePair2.Value);
  642. }
  643. }
  644. }
  645. public void CheckTrophyMaidStatus(Maid checkMaid)
  646. {
  647. if (checkMaid == null || checkMaid.status.heroineType == HeroineType.Sub)
  648. {
  649. return;
  650. }
  651. Status status = checkMaid.status;
  652. if (10 <= status.playCountYotogi)
  653. {
  654. this.AddHaveTrophy(140);
  655. }
  656. if (30 <= status.playCountYotogi)
  657. {
  658. this.AddHaveTrophy(150);
  659. }
  660. if (1000 <= status.inyoku)
  661. {
  662. this.AddHaveTrophy(1000);
  663. }
  664. if (5000 <= status.inyoku)
  665. {
  666. this.AddHaveTrophy(1010);
  667. }
  668. if (9999 <= status.inyoku)
  669. {
  670. this.AddHaveTrophy(1020);
  671. }
  672. if (1000 <= status.mvalue)
  673. {
  674. this.AddHaveTrophy(1030);
  675. }
  676. if (5000 <= status.mvalue)
  677. {
  678. this.AddHaveTrophy(1040);
  679. }
  680. if (9999 <= status.mvalue)
  681. {
  682. this.AddHaveTrophy(1050);
  683. }
  684. if (1000 <= status.hentai)
  685. {
  686. this.AddHaveTrophy(1060);
  687. }
  688. if (5000 <= status.hentai)
  689. {
  690. this.AddHaveTrophy(1070);
  691. }
  692. if (9999 <= status.hentai)
  693. {
  694. this.AddHaveTrophy(1080);
  695. }
  696. if (1000 <= status.housi)
  697. {
  698. this.AddHaveTrophy(1090);
  699. }
  700. if (5000 <= status.housi)
  701. {
  702. this.AddHaveTrophy(1100);
  703. }
  704. if (9999 <= status.housi)
  705. {
  706. this.AddHaveTrophy(1110);
  707. }
  708. }
  709. public void CheckTrophyContractTypeAndrelation()
  710. {
  711. int num = 0;
  712. int num2 = 0;
  713. int num3 = 0;
  714. foreach (Maid maid in GameMain.Instance.CharacterMgr.GetStockMaidList())
  715. {
  716. if (maid.status.heroineType != HeroineType.Sub)
  717. {
  718. if (maid.status.contract == Contract.Free)
  719. {
  720. num++;
  721. }
  722. else if (maid.status.contract == Contract.Exclusive)
  723. {
  724. num2++;
  725. }
  726. if (maid.status.relation == Relation.Lover)
  727. {
  728. num3++;
  729. }
  730. }
  731. }
  732. if (1 <= num)
  733. {
  734. this.AddHaveTrophy(10);
  735. }
  736. if (3 <= num)
  737. {
  738. this.AddHaveTrophy(20);
  739. }
  740. if (5 <= num)
  741. {
  742. this.AddHaveTrophy(30);
  743. }
  744. if (1 <= num2)
  745. {
  746. this.AddHaveTrophy(40);
  747. }
  748. if (3 <= num2)
  749. {
  750. this.AddHaveTrophy(50);
  751. }
  752. if (5 <= num2)
  753. {
  754. this.AddHaveTrophy(60);
  755. }
  756. if (1 <= num3)
  757. {
  758. this.AddHaveTrophy(70);
  759. }
  760. if (3 <= num3)
  761. {
  762. this.AddHaveTrophy(80);
  763. }
  764. }
  765. public void Serialize(BinaryWriter binary)
  766. {
  767. binary.Write("CM3D2_PLAYER_STATUS");
  768. binary.Write(1290);
  769. binary.Write(this.playerName_);
  770. binary.Write(this.days_);
  771. binary.Write(this.totalPurchasePrice_);
  772. binary.Write(this.money_);
  773. binary.Write(this.casinoCoin_);
  774. binary.Write(this.clubName_);
  775. binary.Write(this.clubGrade_);
  776. binary.Write(this.baseClubEvaluation_);
  777. binary.Write(this.clubGauge_);
  778. binary.Write((short)this.flags_.Count);
  779. foreach (KeyValuePair<string, int> keyValuePair in this.flags_)
  780. {
  781. binary.Write(keyValuePair.Key);
  782. binary.Write(keyValuePair.Value);
  783. }
  784. binary.Write((short)this.havePartsItems_.Count);
  785. foreach (KeyValuePair<string, bool> keyValuePair2 in this.havePartsItems_)
  786. {
  787. binary.Write(keyValuePair2.Key);
  788. binary.Write(keyValuePair2.Value);
  789. }
  790. binary.Write((short)this.haveItems_.Count);
  791. foreach (KeyValuePair<string, bool> keyValuePair3 in this.haveItems_)
  792. {
  793. binary.Write(keyValuePair3.Key);
  794. binary.Write(keyValuePair3.Value);
  795. }
  796. binary.Write((short)this.shopLineups_.Count);
  797. foreach (KeyValuePair<int, ShopItemStatus> keyValuePair4 in this.shopLineups_)
  798. {
  799. binary.Write(keyValuePair4.Key);
  800. binary.Write((int)keyValuePair4.Value);
  801. }
  802. binary.Write((short)this.scheduleSlot.Length);
  803. foreach (ScheduleData scheduleData in this.scheduleSlot)
  804. {
  805. scheduleData.Serialize(binary);
  806. }
  807. binary.Write((short)this.scheduleSlotBackup.Length);
  808. foreach (ScheduleSlotBackup scheduleSlotBackup in this.scheduleSlotBackup)
  809. {
  810. scheduleSlotBackup.Serialize(binary);
  811. }
  812. binary.Write((short)this.nightWorksStates_.Count);
  813. foreach (KeyValuePair<int, NightWorkState> keyValuePair5 in this.nightWorksStates_)
  814. {
  815. binary.Write(keyValuePair5.Key);
  816. keyValuePair5.Value.Serialize(binary);
  817. }
  818. binary.Write((short)this.haveTrophys.Count);
  819. foreach (int value in this.haveTrophys)
  820. {
  821. binary.Write(value);
  822. }
  823. binary.Write((short)this.jobClassOpenFlags.Count);
  824. foreach (int value2 in this.jobClassOpenFlags)
  825. {
  826. binary.Write(value2);
  827. }
  828. binary.Write((short)this.yotogiClassOpenFlags.Count);
  829. foreach (int value3 in this.yotogiClassOpenFlags)
  830. {
  831. binary.Write(value3);
  832. }
  833. binary.Write(3830248615u);
  834. }
  835. public void Deserialize(BinaryReader binary)
  836. {
  837. string a = binary.ReadString();
  838. NDebug.Assert(a == "CM3D2_PLAYER_STATUS", "プレイヤーパラメータのヘッダーが不正です。");
  839. int num = binary.ReadInt32();
  840. this.playerName_ = binary.ReadString();
  841. this.days_ = binary.ReadInt32();
  842. this.totalPurchasePrice_ = binary.ReadInt64();
  843. this.money_ = binary.ReadInt64();
  844. this.casinoCoin_ = binary.ReadInt64();
  845. this.clubName_ = binary.ReadString();
  846. this.clubGrade_ = binary.ReadInt32();
  847. this.baseClubEvaluation_ = binary.ReadInt32();
  848. this.clubGauge_ = binary.ReadInt32();
  849. int num2 = (int)binary.ReadInt16();
  850. this.flags_.Clear();
  851. for (int i = 0; i < num2; i++)
  852. {
  853. string key = binary.ReadString();
  854. int value = binary.ReadInt32();
  855. this.flags_.Add(key, value);
  856. }
  857. num2 = (int)binary.ReadInt16();
  858. this.havePartsItems_.Clear();
  859. for (int j = 0; j < num2; j++)
  860. {
  861. string key2 = binary.ReadString();
  862. bool value2 = binary.ReadBoolean();
  863. this.havePartsItems_.Add(key2, value2);
  864. }
  865. if (204 < num)
  866. {
  867. num2 = (int)binary.ReadInt16();
  868. this.haveItems_.Clear();
  869. for (int k = 0; k < num2; k++)
  870. {
  871. string key3 = binary.ReadString();
  872. bool value3 = binary.ReadBoolean();
  873. this.haveItems_.Add(key3, value3);
  874. }
  875. }
  876. num2 = (int)binary.ReadInt16();
  877. this.shopLineups_.Clear();
  878. for (int l = 0; l < num2; l++)
  879. {
  880. int key4 = binary.ReadInt32();
  881. ShopItemStatus value4 = (ShopItemStatus)binary.ReadInt32();
  882. this.shopLineups_.Add(key4, value4);
  883. }
  884. num2 = (int)binary.ReadInt16();
  885. int slotCnt = num2;
  886. this.scheduleSlot = new ScheduleData[40];
  887. for (int m = 0; m < 40; m++)
  888. {
  889. this.scheduleSlot[m] = new ScheduleData();
  890. }
  891. for (int n = 0; n < num2; n++)
  892. {
  893. this.scheduleSlot[n].Deserialize(binary, num);
  894. }
  895. if (num >= 211)
  896. {
  897. num2 = (int)binary.ReadInt16();
  898. this.scheduleSlotBackup = new ScheduleSlotBackup[num2];
  899. for (int num3 = 0; num3 < num2; num3++)
  900. {
  901. this.scheduleSlotBackup[num3] = new ScheduleSlotBackup();
  902. this.scheduleSlotBackup[num3].Deserialize(binary, num, slotCnt);
  903. }
  904. }
  905. num2 = (int)binary.ReadInt16();
  906. this.nightWorksStates_.Clear();
  907. for (int num4 = 0; num4 < num2; num4++)
  908. {
  909. int key5 = binary.ReadInt32();
  910. NightWorkState nightWorkState = new NightWorkState();
  911. nightWorkState.Deserialize(binary, num);
  912. this.nightWorksStates_.Add(key5, nightWorkState);
  913. }
  914. num2 = (int)binary.ReadInt16();
  915. this.haveTrophys.Clear();
  916. for (int num5 = 0; num5 < num2; num5++)
  917. {
  918. int item = binary.ReadInt32();
  919. this.haveTrophys.Add(item);
  920. }
  921. num2 = (int)binary.ReadInt16();
  922. this.jobClassOpenFlags.Clear();
  923. for (int num6 = 0; num6 < num2; num6++)
  924. {
  925. int item2 = binary.ReadInt32();
  926. this.jobClassOpenFlags.Add(item2);
  927. }
  928. num2 = (int)binary.ReadInt16();
  929. this.yotogiClassOpenFlags.Clear();
  930. for (int num7 = 0; num7 < num2; num7++)
  931. {
  932. int item3 = binary.ReadInt32();
  933. this.yotogiClassOpenFlags.Add(item3);
  934. }
  935. uint num8 = binary.ReadUInt32();
  936. NDebug.Assert(3830248615u == num8, "プレイヤーパラメータのロードに失敗しました");
  937. foreach (string key6 in Status.flagLockPartsItems)
  938. {
  939. if (!this.havePartsItems_.ContainsKey(key6))
  940. {
  941. this.havePartsItems_.Add(key6, false);
  942. }
  943. }
  944. HashSet<string> hashSet = new HashSet<string>();
  945. foreach (KeyValuePair<string, bool> keyValuePair in this.havePartsItems_)
  946. {
  947. if (!Status.flagLockPartsItems.Contains(keyValuePair.Key))
  948. {
  949. hashSet.Add(keyValuePair.Key);
  950. }
  951. }
  952. foreach (string key7 in hashSet)
  953. {
  954. this.havePartsItems_.Remove(key7);
  955. }
  956. this.UpdateingExtraTrophysHaveData();
  957. }
  958. private void UpdateingExtraTrophysHaveData()
  959. {
  960. List<Trophy.Data> allDatas = Trophy.GetAllDatas(true);
  961. foreach (Trophy.Data data in allDatas)
  962. {
  963. if (data.type == Trophy.Data.Type.Extra)
  964. {
  965. this.AddHaveTrophy(data.id);
  966. }
  967. }
  968. }
  969. private static void CreateHaveItemList()
  970. {
  971. if (Status.flagLockPartsItems == null)
  972. {
  973. Status.flagLockPartsItems = new HashSet<string>();
  974. Dictionary<int, Shop.ItemDataBase> item_data_dic = Shop.item_data_dic;
  975. Dictionary<int, Shop.ItemDataGroup> item_data_group_dic = Shop.item_data_group_dic;
  976. foreach (KeyValuePair<int, Shop.ItemDataBase> keyValuePair in item_data_dic)
  977. {
  978. Shop.ItemDataBase value = keyValuePair.Value;
  979. if (!item_data_group_dic.ContainsKey(value.id))
  980. {
  981. for (int i = 0; i < value.item_menu_array.Length; i++)
  982. {
  983. string item = value.item_menu_array[i];
  984. if (!Status.flagLockPartsItems.Contains(item))
  985. {
  986. Status.flagLockPartsItems.Add(item);
  987. }
  988. }
  989. }
  990. }
  991. foreach (KeyValuePair<string[], HashSet<int>> keyValuePair2 in Shop.set_card_list)
  992. {
  993. foreach (string item2 in keyValuePair2.Key)
  994. {
  995. if (!Status.flagLockPartsItems.Contains(item2))
  996. {
  997. Status.flagLockPartsItems.Add(item2);
  998. }
  999. }
  1000. }
  1001. using (AFileBase afileBase = GameUty.FileSystem.FileOpen("scenario_get_item_list.nei"))
  1002. {
  1003. using (CsvParser csvParser = new CsvParser())
  1004. {
  1005. bool condition = csvParser.Open(afileBase);
  1006. NDebug.Assert(condition, "file open error[scenario_get_item_list.nei]");
  1007. for (int k = 0; k < csvParser.max_cell_y; k++)
  1008. {
  1009. if (csvParser.IsCellToExistData(0, k))
  1010. {
  1011. string text = csvParser.GetCellAsString(0, k).ToLower();
  1012. text += ".menu";
  1013. if (!Status.flagLockPartsItems.Contains(text))
  1014. {
  1015. Status.flagLockPartsItems.Add(text);
  1016. }
  1017. }
  1018. }
  1019. }
  1020. }
  1021. }
  1022. }
  1023. public const int InitMaidPoint = 0;
  1024. public const long MoneyMax = 9999999999L;
  1025. public const long CoinMax = 999999L;
  1026. public const int MVPEventDay = 7;
  1027. public const int ScheduleSlotMax = 40;
  1028. public const int ClubGradeMax = 5;
  1029. private const uint SaveDataCheckCode = 3830248615u;
  1030. private static HashSet<string> flagLockPartsItems;
  1031. public ScheduleSlotBackup[] scheduleSlotBackup;
  1032. public ScheduleData[] scheduleSlot;
  1033. private string playerName_;
  1034. private int days_;
  1035. private long totalPurchasePrice_;
  1036. private long money_;
  1037. private long casinoCoin_;
  1038. private string clubName_;
  1039. private int clubGrade_;
  1040. private int baseClubEvaluation_;
  1041. private int clubGauge_;
  1042. private Dictionary<string, int> flags_;
  1043. private Dictionary<string, bool> havePartsItems_;
  1044. private Dictionary<string, bool> haveItems_;
  1045. private Dictionary<int, ShopItemStatus> shopLineups_;
  1046. private Dictionary<int, NightWorkState> nightWorksStates_;
  1047. private HashSet<int> haveTrophys;
  1048. private HashSet<int> jobClassOpenFlags;
  1049. private HashSet<int> yotogiClassOpenFlags;
  1050. private static Dictionary<string, int> jobClassTrophyCheckSet;
  1051. private static Dictionary<string, int> yotogiClassCheckSet;
  1052. }
  1053. }