Status.cs 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.IO;
  5. using System.Text.RegularExpressions;
  6. using Edit;
  7. using MaidStatus.CsvData;
  8. using MaidStatus.Old;
  9. using UnityEngine;
  10. using wf;
  11. using Yotogis;
  12. namespace MaidStatus
  13. {
  14. public class Status
  15. {
  16. public Status()
  17. {
  18. Feature.CreateData();
  19. Propensity.CreateData();
  20. YotogiClass.CreateData();
  21. JobClass.CreateData();
  22. Personal.CreateData();
  23. SubMaid.CreateData();
  24. this.body = new BodyData();
  25. this.features_ = new Dictionary<int, Feature.Data>();
  26. this.features = new ReadOnlyDictionary<int, Feature.Data>(this.features_);
  27. this.propensitys_ = new Dictionary<int, Propensity.Data>();
  28. this.propensitys = new ReadOnlyDictionary<int, Propensity.Data>(this.propensitys_);
  29. this.jobClass = new JobClassSystem(this);
  30. this.yotogiClass = new YotogiClassSystem(this);
  31. this.yotogiSkill = new YotogiSkillSystem(this);
  32. this.workDatas_ = new Dictionary<int, WorkData>();
  33. this.workDatas = new ReadOnlyDictionary<int, WorkData>(this.workDatas_);
  34. this.flags_ = new Dictionary<string, int>();
  35. this.flags = new ReadOnlyDictionary<string, int>(this.flags_);
  36. this.eventEndFlags_ = new Dictionary<int, bool>();
  37. this.eventEndFlags = new ReadOnlyDictionary<int, bool>(this.eventEndFlags_);
  38. this.partsDic = new Dictionary<string, string>();
  39. this.bonusStatus = new BonusStatus();
  40. this.SetPersonal(Personal.GetData("Muku"));
  41. this.heroineType = HeroineType.Original;
  42. this.mainChara = false;
  43. this.subCharaData = null;
  44. this.firstName = MaidRandomName.GetFirstName();
  45. this.lastName = MaidRandomName.GetLastName();
  46. this.isFirstNameCall = true;
  47. this.enabledYotogiStatusLock = false;
  48. string empty = string.Empty;
  49. this.freeComment = empty;
  50. this.profileComment = empty;
  51. }
  52. public string guid { get; private set; }
  53. public string creationTime { get; private set; }
  54. public ulong creationTimeNum { get; private set; }
  55. public Maid maid { get; private set; }
  56. public SubMaid.Data.CharacterStatus subCharaStatus
  57. {
  58. get
  59. {
  60. return (this.subCharaData != null) ? ((!GameMain.Instance.CharacterMgr.status.lockUserDraftMaid || this.subCharaData.secondStatus == null) ? this.subCharaData.status : this.subCharaData.secondStatus) : null;
  61. }
  62. }
  63. public int employmentDay
  64. {
  65. get
  66. {
  67. return this.employmentDay_;
  68. }
  69. set
  70. {
  71. this.employmentDay_ = wf.Math.Round5(value);
  72. }
  73. }
  74. public int employmentElapsedDay
  75. {
  76. get
  77. {
  78. int num = GameMain.Instance.CharacterMgr.status.days - this.employmentDay_;
  79. num += ((this.OldStatus != null) ? this.OldStatus.employmentElapsedDay : 0);
  80. return wf.Math.Round5(num);
  81. }
  82. }
  83. public string lastName
  84. {
  85. get
  86. {
  87. return this.lastName_;
  88. }
  89. set
  90. {
  91. this.lastName_ = ((value != null) ? Status.ConvertString(value, 8) : string.Empty);
  92. }
  93. }
  94. public string firstName
  95. {
  96. get
  97. {
  98. return this.firstName_;
  99. }
  100. set
  101. {
  102. this.firstName_ = ((value != null) ? Status.ConvertString(value, 8) : string.Empty);
  103. }
  104. }
  105. public string fullNameJpStyle
  106. {
  107. get
  108. {
  109. return this.lastName + " " + this.firstName;
  110. }
  111. }
  112. public string fullNameEnStyle
  113. {
  114. get
  115. {
  116. return this.firstName + " " + this.lastName;
  117. }
  118. }
  119. public string freeComment
  120. {
  121. get
  122. {
  123. return this.freeComment_;
  124. }
  125. set
  126. {
  127. this.freeComment_ = ((value != null) ? Status.ConvertString(value, 308) : string.Empty);
  128. }
  129. }
  130. public Personal.Data personal
  131. {
  132. get
  133. {
  134. return this.personal_;
  135. }
  136. }
  137. public ClassData<JobClass.Data> selectedJobClass { get; private set; }
  138. public ClassData<YotogiClass.Data> selectedYotogiClass { get; private set; }
  139. public Relation relation
  140. {
  141. get
  142. {
  143. return this.relation_;
  144. }
  145. set
  146. {
  147. this.relation_ = value;
  148. if (this.OldStatus != null)
  149. {
  150. if (value == Relation.Contact && this.OldStatus.relation != Relation.Contact)
  151. {
  152. this.OldStatus.relation = Relation.Contact;
  153. }
  154. else if (value == Relation.Trust && this.OldStatus.relation != Relation.Trust)
  155. {
  156. this.OldStatus.relation = Relation.Trust;
  157. }
  158. else if (value == Relation.Lover && this.OldStatus.relation != Relation.Lover)
  159. {
  160. this.OldStatus.relation = Relation.Lover;
  161. }
  162. }
  163. }
  164. }
  165. public string conditionText
  166. {
  167. get
  168. {
  169. return Title.Get(this);
  170. }
  171. }
  172. public int playCountYotogi
  173. {
  174. get
  175. {
  176. return (int)this.playCountYotogi_;
  177. }
  178. set
  179. {
  180. this.playCountYotogi_ = (ushort)wf.Math.Round4(value);
  181. }
  182. }
  183. public int playCountNightWork
  184. {
  185. get
  186. {
  187. return (int)this.playCountNightWork_;
  188. }
  189. set
  190. {
  191. this.playCountNightWork_ = (ushort)wf.Math.Round4(value);
  192. }
  193. }
  194. public int likability
  195. {
  196. get
  197. {
  198. return (int)this.likability_;
  199. }
  200. set
  201. {
  202. this.likability_ = (ushort)wf.Math.Round3(value);
  203. }
  204. }
  205. public int studyRate
  206. {
  207. get
  208. {
  209. return (int)this.studyRate_;
  210. }
  211. set
  212. {
  213. this.studyRate_ = (ushort)wf.Math.RoundMinMax(value, 0, 1000);
  214. }
  215. }
  216. public int currentExcite
  217. {
  218. get
  219. {
  220. return this.currentExcite_;
  221. }
  222. set
  223. {
  224. this.currentExcite_ = wf.Math.RoundMinMax(value, -100, 300);
  225. }
  226. }
  227. public int currentSensual
  228. {
  229. get
  230. {
  231. return this.currentSensual_;
  232. }
  233. set
  234. {
  235. this.currentSensual_ = wf.Math.RoundMinMax(value, 0, 300);
  236. }
  237. }
  238. public int maxHp
  239. {
  240. get
  241. {
  242. return wf.Math.Round3((int)this.maxHp_ + this.bonusStatus.hp);
  243. }
  244. }
  245. public int baseMaxHp
  246. {
  247. get
  248. {
  249. return (int)this.maxHp_;
  250. }
  251. set
  252. {
  253. this.maxHp_ = (ushort)wf.Math.Round3(value);
  254. }
  255. }
  256. public int currentHp
  257. {
  258. get
  259. {
  260. return (int)this.currentHp_;
  261. }
  262. set
  263. {
  264. this.currentHp_ = (ushort)wf.Math.RoundMinMax(value, 0, this.maxHp);
  265. }
  266. }
  267. public int maxMind
  268. {
  269. get
  270. {
  271. return wf.Math.Round3((int)this.maxMind_ + this.bonusStatus.mind);
  272. }
  273. }
  274. public int baseMaxMind
  275. {
  276. get
  277. {
  278. return (int)this.maxMind_;
  279. }
  280. set
  281. {
  282. this.maxMind_ = (ushort)wf.Math.Round3(value);
  283. }
  284. }
  285. public int currentMind
  286. {
  287. get
  288. {
  289. return (int)this.currentMind_;
  290. }
  291. set
  292. {
  293. this.currentMind_ = (ushort)wf.Math.RoundMinMax(value, 0, this.maxMind);
  294. }
  295. }
  296. public int maxReason
  297. {
  298. get
  299. {
  300. return wf.Math.Round3((int)this.maxReason_ + this.bonusStatus.reason);
  301. }
  302. }
  303. public int baseMaxReason
  304. {
  305. get
  306. {
  307. return (int)this.maxReason_;
  308. }
  309. set
  310. {
  311. this.maxReason_ = (ushort)wf.Math.Round3(value);
  312. }
  313. }
  314. public int currentReason
  315. {
  316. get
  317. {
  318. return (int)this.currentReason_;
  319. }
  320. set
  321. {
  322. this.currentReason_ = (ushort)wf.Math.RoundMinMax(value, 0, this.maxReason);
  323. }
  324. }
  325. public int reception
  326. {
  327. get
  328. {
  329. return wf.Math.Round4((int)this.reception_ + this.bonusStatus.reception);
  330. }
  331. }
  332. public int baseReception
  333. {
  334. get
  335. {
  336. return (int)this.reception_;
  337. }
  338. set
  339. {
  340. this.reception_ = (ushort)wf.Math.Round4(value);
  341. }
  342. }
  343. public int care
  344. {
  345. get
  346. {
  347. return wf.Math.Round4((int)this.care_ + this.bonusStatus.care);
  348. }
  349. }
  350. public int baseCare
  351. {
  352. get
  353. {
  354. return (int)this.care_;
  355. }
  356. set
  357. {
  358. this.care_ = (ushort)wf.Math.Round4(value);
  359. }
  360. }
  361. public int lovely
  362. {
  363. get
  364. {
  365. return wf.Math.Round4((int)this.lovely_ + this.bonusStatus.lovely);
  366. }
  367. }
  368. public int baseLovely
  369. {
  370. get
  371. {
  372. return (int)this.lovely_;
  373. }
  374. set
  375. {
  376. this.lovely_ = (ushort)wf.Math.Round4(value);
  377. }
  378. }
  379. public int elegance
  380. {
  381. get
  382. {
  383. return wf.Math.Round4((int)this.elegance_ + this.bonusStatus.elegance);
  384. }
  385. }
  386. public int baseElegance
  387. {
  388. get
  389. {
  390. return (int)this.elegance_;
  391. }
  392. set
  393. {
  394. this.elegance_ = (ushort)wf.Math.Round4(value);
  395. }
  396. }
  397. public int charm
  398. {
  399. get
  400. {
  401. return wf.Math.Round4((int)this.charm_ + this.bonusStatus.charm);
  402. }
  403. }
  404. public int baseCharm
  405. {
  406. get
  407. {
  408. return (int)this.charm_;
  409. }
  410. set
  411. {
  412. this.charm_ = (ushort)wf.Math.Round4(value);
  413. }
  414. }
  415. public int cooking
  416. {
  417. get
  418. {
  419. return wf.Math.Round4((int)this.cooking_ + this.bonusStatus.charm);
  420. }
  421. }
  422. public int baseCooking
  423. {
  424. get
  425. {
  426. return (int)this.cooking_;
  427. }
  428. set
  429. {
  430. this.cooking_ = (ushort)wf.Math.Round4(value);
  431. }
  432. }
  433. public int vocal
  434. {
  435. get
  436. {
  437. return wf.Math.Round4((int)this.vocal_ + this.bonusStatus.vocal);
  438. }
  439. }
  440. public int baseVocal
  441. {
  442. get
  443. {
  444. return (int)this.vocal_;
  445. }
  446. set
  447. {
  448. this.vocal_ = (ushort)wf.Math.Round4(value);
  449. }
  450. }
  451. public int dance
  452. {
  453. get
  454. {
  455. return wf.Math.Round4((int)this.dance_ + this.bonusStatus.dance);
  456. }
  457. }
  458. public int baseDance
  459. {
  460. get
  461. {
  462. return (int)this.dance_;
  463. }
  464. set
  465. {
  466. this.dance_ = (ushort)wf.Math.Round4(value);
  467. }
  468. }
  469. public int appealPoint
  470. {
  471. get
  472. {
  473. return wf.Math.RoundMinMax((int)this.appealPoint_ + this.bonusStatus.appealPoint, 0, this.maxAppealPoint);
  474. }
  475. }
  476. public int baseAppealPoint
  477. {
  478. get
  479. {
  480. return (int)this.appealPoint_;
  481. }
  482. set
  483. {
  484. this.appealPoint_ = (ushort)wf.Math.RoundMinMax(value, 0, this.maxAppealPoint);
  485. }
  486. }
  487. public int maxAppealPoint
  488. {
  489. get
  490. {
  491. return 200 + wf.Math.Round4(this.dance) / 1000 * 200;
  492. }
  493. }
  494. public int inyoku
  495. {
  496. get
  497. {
  498. return wf.Math.Round4((int)this.inyoku_ + this.bonusStatus.inyoku);
  499. }
  500. }
  501. public int baseInyoku
  502. {
  503. get
  504. {
  505. return (int)this.inyoku_;
  506. }
  507. set
  508. {
  509. this.inyoku_ = (ushort)wf.Math.Round4(value);
  510. }
  511. }
  512. public int mvalue
  513. {
  514. get
  515. {
  516. return wf.Math.Round4((int)this.m_value_ + this.bonusStatus.mvalue);
  517. }
  518. }
  519. public int baseMvalue
  520. {
  521. get
  522. {
  523. return (int)this.m_value_;
  524. }
  525. set
  526. {
  527. this.m_value_ = (ushort)wf.Math.Round4(value);
  528. }
  529. }
  530. public int hentai
  531. {
  532. get
  533. {
  534. return wf.Math.Round4((int)this.hentai_ + this.bonusStatus.hentai);
  535. }
  536. }
  537. public int baseHentai
  538. {
  539. get
  540. {
  541. return (int)this.hentai_;
  542. }
  543. set
  544. {
  545. this.hentai_ = (ushort)wf.Math.Round4(value);
  546. }
  547. }
  548. public int housi
  549. {
  550. get
  551. {
  552. return wf.Math.Round4((int)this.housi_ + this.bonusStatus.housi);
  553. }
  554. }
  555. public int baseHousi
  556. {
  557. get
  558. {
  559. return (int)this.housi_;
  560. }
  561. set
  562. {
  563. this.housi_ = (ushort)wf.Math.Round4(value);
  564. }
  565. }
  566. public int teachRate
  567. {
  568. get
  569. {
  570. return wf.Math.Round4((int)this.teachRate_ + this.bonusStatus.teachRate);
  571. }
  572. }
  573. public int baseTeachRate
  574. {
  575. get
  576. {
  577. return (int)this.teachRate_;
  578. }
  579. set
  580. {
  581. this.teachRate_ = (ushort)wf.Math.Round4(value);
  582. }
  583. }
  584. public int sexPlayNumberOfPeople
  585. {
  586. get
  587. {
  588. return (int)this.sexPlayNumberOfPeople_;
  589. }
  590. set
  591. {
  592. this.sexPlayNumberOfPeople_ = (ushort)wf.Math.Round3(value);
  593. }
  594. }
  595. public int popularRank
  596. {
  597. get
  598. {
  599. return (int)this.popularRank_;
  600. }
  601. set
  602. {
  603. this.popularRank_ = (ushort)wf.Math.Round3(value);
  604. }
  605. }
  606. public int evaluation
  607. {
  608. get
  609. {
  610. return (int)this.evaluation_;
  611. }
  612. set
  613. {
  614. this.evaluation_ = (ushort)wf.Math.Round4(value);
  615. }
  616. }
  617. public long totalEvaluations
  618. {
  619. get
  620. {
  621. return this.totalEvaluation_;
  622. }
  623. set
  624. {
  625. this.totalEvaluation_ = System.Math.Min(System.Math.Max(value, 0L), 9999999999L);
  626. }
  627. }
  628. public long sales
  629. {
  630. get
  631. {
  632. return this.sales_;
  633. }
  634. set
  635. {
  636. this.sales_ = System.Math.Min(System.Math.Max(value, 0L), 9999999999L);
  637. }
  638. }
  639. public long totalSales
  640. {
  641. get
  642. {
  643. return this.totalSales_;
  644. }
  645. set
  646. {
  647. this.totalSales_ = System.Math.Min(System.Math.Max(value, 0L), 9999999999L);
  648. }
  649. }
  650. public int inranGap
  651. {
  652. get
  653. {
  654. return this.inyoku + this.lovely;
  655. }
  656. }
  657. public int mValueGap
  658. {
  659. get
  660. {
  661. return this.mvalue + this.elegance;
  662. }
  663. }
  664. public int hentaiGap
  665. {
  666. get
  667. {
  668. return this.hentai + this.charm;
  669. }
  670. }
  671. public int banishmentPrice
  672. {
  673. get
  674. {
  675. return 10000;
  676. }
  677. }
  678. public ReadOnlyDictionary<int, Feature.Data> features { get; private set; }
  679. public ReadOnlyDictionary<int, Propensity.Data> propensitys { get; private set; }
  680. public JobClassSystem jobClass { get; private set; }
  681. public YotogiClassSystem yotogiClass { get; private set; }
  682. public YotogiSkillSystem yotogiSkill { get; private set; }
  683. public ReadOnlyDictionary<int, WorkData> workDatas { get; private set; }
  684. public ReadOnlyDictionary<string, int> flags { get; private set; }
  685. public ReadOnlyDictionary<int, bool> eventEndFlags { get; private set; }
  686. public Dictionary<string, string> partsDic { get; private set; }
  687. public Status OldStatus { get; private set; }
  688. public static string ConvertString(string str, int maxStrSize = 8)
  689. {
  690. str = Regex.Replace(str, "[\\r\\n\\t\\\\]", string.Empty);
  691. if (str.Length == 0)
  692. {
  693. str = " ";
  694. }
  695. StringInfo stringInfo = new StringInfo(str);
  696. if (maxStrSize < stringInfo.LengthInTextElements)
  697. {
  698. str = stringInfo.SubstringByTextElements(0, maxStrSize);
  699. }
  700. return str;
  701. }
  702. public void Initialize(Maid maid)
  703. {
  704. this.maid = maid;
  705. this.guid = Guid.NewGuid().ToString();
  706. this.creationTime = DateTime.Now.ToString("G", new CultureInfo("ja-JP")).Replace("/", string.Empty);
  707. string text = this.creationTime.Replace(":", string.Empty);
  708. text = text.Replace(" ", string.Empty);
  709. this.creationTimeNum = ulong.Parse(text);
  710. this.employmentDay = GameMain.Instance.CharacterMgr.status.days;
  711. List<JobClass.Data> learnPossibleClassDatas = this.jobClass.GetLearnPossibleClassDatas(true, AbstractClassData.ClassType.Share | AbstractClassData.ClassType.New);
  712. foreach (JobClass.Data data in learnPossibleClassDatas)
  713. {
  714. this.jobClass.Add(data, true, true);
  715. if (this.selectedJobClass == null)
  716. {
  717. this.ChangeJobClass(data);
  718. }
  719. }
  720. List<YotogiClass.Data> learnPossibleClassDatas2 = this.yotogiClass.GetLearnPossibleClassDatas(true, AbstractClassData.ClassType.Share | AbstractClassData.ClassType.New);
  721. foreach (YotogiClass.Data data2 in learnPossibleClassDatas2)
  722. {
  723. this.yotogiClass.Add(data2, true, true);
  724. if (this.selectedYotogiClass == null)
  725. {
  726. this.ChangeYotogiClass(data2);
  727. }
  728. }
  729. List<Skill.Data> learnPossibleSkills = Skill.GetLearnPossibleSkills(this);
  730. foreach (Skill.Data data3 in learnPossibleSkills)
  731. {
  732. this.yotogiSkill.Add(data3.id);
  733. }
  734. int num = 100;
  735. this.baseMaxReason = num;
  736. num = num;
  737. this.baseMaxMind = num;
  738. this.baseMaxHp = num;
  739. this.UpdateClassBonusStatus();
  740. this.sexPlayNumberOfPeople = MaidProfile.UpdateInitPlayNumber(maid);
  741. this.UpdateBodyParam();
  742. this.profileComment = MaidProfile.Create(maid, false);
  743. this.currentHp = this.maxHp;
  744. this.currentMind = this.maxMind;
  745. }
  746. public bool SetPersonal(int personalId)
  747. {
  748. return this.SetPersonal(Personal.GetData(personalId));
  749. }
  750. public bool SetPersonal(Personal.Data data)
  751. {
  752. if (!Personal.IsEnabled(data.id) && !data.oldPersonal)
  753. {
  754. Debug.LogError("性格[" + data.drawName + "]は有効ではないので設定できません");
  755. return false;
  756. }
  757. this.personal_ = data;
  758. if (this.personal_.oldPersonal)
  759. {
  760. this.heroineType = HeroineType.Transfer;
  761. if (this.OldStatus == null)
  762. {
  763. this.OldStatus = new Status(this);
  764. }
  765. }
  766. else if (this.heroineType == HeroineType.Transfer)
  767. {
  768. this.heroineType = HeroineType.Original;
  769. this.OldStatus = null;
  770. }
  771. return true;
  772. }
  773. public void SetSeikeikenFront(bool val)
  774. {
  775. if (val)
  776. {
  777. if (this.seikeiken == Seikeiken.Yes_Yes || this.seikeiken == Seikeiken.Yes_No)
  778. {
  779. return;
  780. }
  781. if (this.seikeiken == Seikeiken.No_No)
  782. {
  783. this.seikeiken = Seikeiken.Yes_No;
  784. }
  785. else
  786. {
  787. this.seikeiken = Seikeiken.Yes_Yes;
  788. }
  789. }
  790. else
  791. {
  792. if (this.seikeiken == Seikeiken.No_No || this.seikeiken == Seikeiken.No_Yes)
  793. {
  794. return;
  795. }
  796. if (this.seikeiken == Seikeiken.Yes_Yes)
  797. {
  798. this.seikeiken = Seikeiken.No_Yes;
  799. }
  800. else
  801. {
  802. this.seikeiken = Seikeiken.No_No;
  803. }
  804. }
  805. }
  806. public void SetSeikeikenBack(bool val)
  807. {
  808. if (val)
  809. {
  810. if (this.seikeiken == Seikeiken.Yes_Yes || this.seikeiken == Seikeiken.No_Yes)
  811. {
  812. return;
  813. }
  814. if (this.seikeiken == Seikeiken.No_No)
  815. {
  816. this.seikeiken = Seikeiken.No_Yes;
  817. }
  818. else
  819. {
  820. this.seikeiken = Seikeiken.Yes_Yes;
  821. }
  822. }
  823. else
  824. {
  825. if (this.seikeiken == Seikeiken.No_No || this.seikeiken == Seikeiken.Yes_No)
  826. {
  827. return;
  828. }
  829. if (this.seikeiken == Seikeiken.Yes_Yes)
  830. {
  831. this.seikeiken = Seikeiken.Yes_No;
  832. }
  833. else
  834. {
  835. this.seikeiken = Seikeiken.No_No;
  836. }
  837. }
  838. }
  839. public bool ChangeJobClass(int jobClassId)
  840. {
  841. return this.ChangeJobClass(JobClass.GetData(jobClassId));
  842. }
  843. public bool ChangeJobClass(JobClass.Data data)
  844. {
  845. if (data == null)
  846. {
  847. return false;
  848. }
  849. if (!JobClass.IsEnabled(data.id))
  850. {
  851. Debug.LogError("ジョブクラス[" + data.drawName + "]は有効ではないので設定できません");
  852. return false;
  853. }
  854. if (!this.jobClass.Contains(data.id))
  855. {
  856. Debug.LogError("ジョブクラス[" + data.drawName + "]は取得していないので設定できません");
  857. return false;
  858. }
  859. this.selectedJobClass = this.jobClass.Get(data.id);
  860. return true;
  861. }
  862. public bool ChangeYotogiClass(int yotogiClassId)
  863. {
  864. return this.ChangeYotogiClass(YotogiClass.GetData(yotogiClassId));
  865. }
  866. public bool ChangeYotogiClass(YotogiClass.Data data)
  867. {
  868. if (data == null)
  869. {
  870. return false;
  871. }
  872. if (!YotogiClass.IsEnabled(data.id))
  873. {
  874. Debug.LogError("夜伽クラス[" + data.drawName + "]は有効ではないので設定できません");
  875. return false;
  876. }
  877. if (!this.yotogiClass.Contains(data.id))
  878. {
  879. Debug.LogError("夜伽クラス[" + data.drawName + "]は取得していないので設定できません");
  880. return false;
  881. }
  882. this.selectedYotogiClass = this.yotogiClass.Get(data.id);
  883. return true;
  884. }
  885. public Feature.Data AddFeature(int featureId)
  886. {
  887. return this.AddFeature(Feature.GetData(featureId));
  888. }
  889. public Feature.Data AddFeature(Feature.Data data)
  890. {
  891. if (data != null && Feature.IsEnabled(data.id) && !this.features_.ContainsKey(data.id))
  892. {
  893. this.features_.Add(data.id, data);
  894. }
  895. return data;
  896. }
  897. public void RemoveFeature(int featureId)
  898. {
  899. this.RemoveFeature(Feature.GetData(featureId));
  900. }
  901. public void RemoveFeature(Feature.Data data)
  902. {
  903. if (data != null && this.features_.ContainsKey(data.id))
  904. {
  905. this.features_.Remove(data.id);
  906. }
  907. }
  908. public Propensity.Data AddPropensity(int propensityId)
  909. {
  910. return this.AddPropensity(Propensity.GetData(propensityId));
  911. }
  912. public Propensity.Data AddPropensity(Propensity.Data data)
  913. {
  914. if (data != null && Propensity.IsEnabled(data.id) && !this.propensitys_.ContainsKey(data.id))
  915. {
  916. this.propensitys_.Add(data.id, data);
  917. }
  918. return data;
  919. }
  920. public void RemovePropensity(int featureId)
  921. {
  922. this.RemovePropensity(Propensity.GetData(featureId));
  923. }
  924. public void RemovePropensity(Propensity.Data data)
  925. {
  926. if (data != null && this.propensitys_.ContainsKey(data.id))
  927. {
  928. this.propensitys_.Remove(data.id);
  929. }
  930. }
  931. public void AddWorkDataPlayCount(int id, int addPlayCount)
  932. {
  933. if (!this.workDatas_.ContainsKey(id))
  934. {
  935. this.workDatas_.Add(id, new WorkData());
  936. }
  937. this.workDatas_[id].playCount += (uint)addPlayCount;
  938. }
  939. public void SetWorkDataLevel(int id, int level)
  940. {
  941. if (!this.workDatas_.ContainsKey(id))
  942. {
  943. this.workDatas_.Add(id, new WorkData());
  944. }
  945. this.workDatas_[id].level = level;
  946. }
  947. public void SetFlag(string flagName, int value)
  948. {
  949. if (!this.flags_.ContainsKey(flagName))
  950. {
  951. this.flags_.Add(flagName, value);
  952. }
  953. else
  954. {
  955. this.flags_[flagName] = value;
  956. }
  957. }
  958. public void AddFlag(string flagName, int value)
  959. {
  960. if (!this.flags_.ContainsKey(flagName))
  961. {
  962. this.flags_.Add(flagName, value);
  963. }
  964. else
  965. {
  966. Dictionary<string, int> dictionary;
  967. (dictionary = this.flags_)[flagName] = dictionary[flagName] + value;
  968. }
  969. }
  970. public int GetFlag(string flagName)
  971. {
  972. return (!this.flags_.ContainsKey(flagName)) ? 0 : this.flags_[flagName];
  973. }
  974. public bool RemoveFlag(string flagName)
  975. {
  976. return this.flags_.ContainsKey(flagName) && this.flags_.Remove(flagName);
  977. }
  978. public void SetEventEndFlag(int id, bool value)
  979. {
  980. if (this.eventEndFlags_.ContainsKey(id))
  981. {
  982. this.eventEndFlags_[id] = value;
  983. }
  984. else
  985. {
  986. this.eventEndFlags_.Add(id, value);
  987. }
  988. }
  989. public void RemoveEventEndFlag(int id)
  990. {
  991. if (this.eventEndFlags_.ContainsKey(id))
  992. {
  993. this.eventEndFlags_.Remove(id);
  994. }
  995. }
  996. public bool GetEventEndFlag(int id)
  997. {
  998. return this.eventEndFlags_.ContainsKey(id) && this.eventEndFlags_[id];
  999. }
  1000. public BonusStatus GetBonusStatusAsFeatureAndPropensitys()
  1001. {
  1002. BonusStatus result = new BonusStatus();
  1003. foreach (Feature.Data data in this.features.GetValueArray())
  1004. {
  1005. if (data.bonusCorrection != null)
  1006. {
  1007. data.bonusCorrection.ApplyAddBonusStatus(result);
  1008. }
  1009. }
  1010. foreach (Propensity.Data data2 in this.propensitys.GetValueArray())
  1011. {
  1012. if (data2.bonusCorrection != null)
  1013. {
  1014. data2.bonusCorrection.ApplyAddBonusStatus(result);
  1015. }
  1016. }
  1017. return result;
  1018. }
  1019. public void UpdateBodyParam()
  1020. {
  1021. if (this.maid.Parts == null)
  1022. {
  1023. return;
  1024. }
  1025. Func<MPN, float> func = (MPN mpn) => (float)this.maid.GetProp(mpn).value;
  1026. float num = 1340f + func(MPN.sintyou) * 4f + func(MPN.DouPer) * (1f + func(MPN.sintyou) * 0.005f) + func(MPN.KubiScl) * 0.5f + func(MPN.HeadY) * 0.5f;
  1027. float num2 = 55f * func(MPN.RegFat) + 50f * func(MPN.sintyou) * 0.5f + 50f * func(MPN.DouPer) * 0.4f;
  1028. float num3 = 55f * func(MPN.RegMeet) + 50f * func(MPN.sintyou) * 0.5f + 50f * func(MPN.DouPer) * 0.4f;
  1029. float num4 = 10f * func(MPN.UdeScl) * 0.1f;
  1030. float num5 = 5f * func(MPN.ArmL) + 5f * func(MPN.sintyou) * 1f + 5f * func(MPN.UdeScl) * 0.5f;
  1031. float num6 = 70f * func(MPN.Hara) + 50f * func(MPN.sintyou) * 0.7f + 50f * func(MPN.west) * func(MPN.Hara) * 0.005f;
  1032. float num7 = 10f * func(MPN.MuneL) * 2f;
  1033. float num8 = num7 * func(MPN.MuneTare) * 0.005f;
  1034. float num9 = 20f * func(MPN.west) * 0.5f + 15f * func(MPN.west) * func(MPN.sintyou) * 0.02f + 15f * func(MPN.west) * func(MPN.DouPer) * 0.01f;
  1035. float num10 = 10f * func(MPN.koshi) + 7f * func(MPN.koshi) * func(MPN.sintyou) * 0.04f;
  1036. float num11 = 4f * func(MPN.kata);
  1037. float num12 = 38000f + num2 + num3 + num4 + num5 + num6 + num7 + num8 + num9 + num10 + num11;
  1038. this.body.height = (int)(num / 10f);
  1039. this.body.weight = (int)(num12 / 1000f);
  1040. float num13 = 70f + func(MPN.MuneL) * 0.31f + func(MPN.west) * 0.02f;
  1041. num13 -= 5f * (func(MPN.MuneS) / 100f);
  1042. this.body.bust = (int)num13;
  1043. this.body.waist = (int)(40f + func(MPN.west) * 0.25f + func(MPN.Hara) * 0.35f);
  1044. this.body.hip = (int)(65f + func(MPN.koshi) * 0.3f + func(MPN.RegFat) * 0.025f + func(MPN.RegMeet) * 0.025f);
  1045. if (num13 < 80f)
  1046. {
  1047. this.body.cup = "A";
  1048. }
  1049. else if (110f <= num13)
  1050. {
  1051. this.body.cup = "N";
  1052. }
  1053. else
  1054. {
  1055. char[] array = new char[]
  1056. {
  1057. 'B',
  1058. 'C',
  1059. 'D',
  1060. 'E',
  1061. 'F',
  1062. 'G',
  1063. 'H',
  1064. 'I',
  1065. 'J',
  1066. 'K',
  1067. 'L',
  1068. 'M'
  1069. };
  1070. this.body.cup = array[(int)((num13 - 80f) / 2.5f)].ToString();
  1071. }
  1072. }
  1073. public void UpdateClassBonusStatus()
  1074. {
  1075. this.bonusStatus.Clear();
  1076. if (this.heroineType == HeroineType.Sub)
  1077. {
  1078. return;
  1079. }
  1080. foreach (KeyValuePair<int, ClassData<JobClass.Data>> keyValuePair in this.jobClass.GetAllDatas())
  1081. {
  1082. ClassData<JobClass.Data> value = keyValuePair.Value;
  1083. value.data.levelBonuss[value.level - 1].ApplyAddBonusStatus(this.bonusStatus);
  1084. }
  1085. }
  1086. public void Serialize(BinaryWriter binary)
  1087. {
  1088. binary.Write("CM3D2_MAID_STATUS");
  1089. binary.Write(1140);
  1090. binary.Write(this.guid);
  1091. binary.Write(this.creationTime);
  1092. binary.Write((short)this.heroineType);
  1093. if (this.heroineType == HeroineType.Sub)
  1094. {
  1095. binary.Write(this.subCharaData.id);
  1096. }
  1097. binary.Write(this.mainChara);
  1098. binary.Write(this.employmentDay_);
  1099. binary.Write(this.lastName);
  1100. binary.Write(this.firstName);
  1101. binary.Write(this.profileComment);
  1102. binary.Write(this.freeComment);
  1103. binary.Write((short)this.initSeikeiken);
  1104. binary.Write((short)this.seikeiken);
  1105. binary.Write(this.personal_.id);
  1106. binary.Write((short)this.contract);
  1107. this.body.Serialize(binary);
  1108. binary.Write((short)this.relation_);
  1109. binary.Write(this.playCountYotogi_);
  1110. binary.Write(this.playCountNightWork_);
  1111. binary.Write(this.likability_);
  1112. binary.Write(this.studyRate_);
  1113. binary.Write(this.maxHp_);
  1114. binary.Write(this.currentHp_);
  1115. binary.Write(this.maxMind_);
  1116. binary.Write(this.currentMind_);
  1117. binary.Write(this.maxReason_);
  1118. binary.Write(this.currentReason_);
  1119. binary.Write(this.reception_);
  1120. binary.Write(this.care_);
  1121. binary.Write(this.lovely_);
  1122. binary.Write(this.elegance_);
  1123. binary.Write(this.charm_);
  1124. binary.Write(this.cooking_);
  1125. binary.Write(this.vocal_);
  1126. binary.Write(this.dance_);
  1127. binary.Write(this.appealPoint_);
  1128. binary.Write(this.inyoku_);
  1129. binary.Write(this.m_value_);
  1130. binary.Write(this.hentai_);
  1131. binary.Write(this.housi_);
  1132. binary.Write(this.teachRate_);
  1133. binary.Write(this.sexPlayNumberOfPeople_);
  1134. binary.Write(this.popularRank_);
  1135. binary.Write(this.sales_);
  1136. binary.Write(this.totalSales_);
  1137. binary.Write(this.evaluation_);
  1138. binary.Write(this.totalEvaluation_);
  1139. binary.Write(this.leader);
  1140. binary.Write(this.isFirstNameCall);
  1141. binary.Write(this.enabledYotogiStatusLock);
  1142. binary.Write((short)this.eyePartsTab);
  1143. binary.Write(this.noonWorkId);
  1144. binary.Write(this.nightWorkId);
  1145. binary.Write(this.noonCommu);
  1146. binary.Write(this.nightCommu);
  1147. binary.Write((short)this.features_.Count);
  1148. foreach (KeyValuePair<int, Feature.Data> keyValuePair in this.features_)
  1149. {
  1150. binary.Write(keyValuePair.Key);
  1151. }
  1152. binary.Write((short)this.propensitys_.Count);
  1153. foreach (KeyValuePair<int, Propensity.Data> keyValuePair2 in this.propensitys_)
  1154. {
  1155. binary.Write(keyValuePair2.Key);
  1156. }
  1157. this.jobClass.Serialize(binary);
  1158. this.yotogiClass.Serialize(binary);
  1159. this.yotogiSkill.Serialize(binary);
  1160. binary.Write((short)this.workDatas_.Count);
  1161. foreach (KeyValuePair<int, WorkData> keyValuePair3 in this.workDatas_)
  1162. {
  1163. binary.Write(keyValuePair3.Key);
  1164. keyValuePair3.Value.Serialize(binary);
  1165. }
  1166. binary.Write((short)this.flags_.Count);
  1167. foreach (KeyValuePair<string, int> keyValuePair4 in this.flags_)
  1168. {
  1169. binary.Write(keyValuePair4.Key);
  1170. binary.Write(keyValuePair4.Value);
  1171. }
  1172. binary.Write((short)this.eventEndFlags_.Count);
  1173. foreach (KeyValuePair<int, bool> keyValuePair5 in this.eventEndFlags_)
  1174. {
  1175. binary.Write(keyValuePair5.Key);
  1176. binary.Write(keyValuePair5.Value);
  1177. }
  1178. binary.Write((short)this.partsDic.Count);
  1179. foreach (KeyValuePair<string, string> keyValuePair6 in this.partsDic)
  1180. {
  1181. binary.Write(keyValuePair6.Key);
  1182. binary.Write(keyValuePair6.Value);
  1183. }
  1184. binary.Write(this.OldStatus != null);
  1185. if (this.OldStatus != null)
  1186. {
  1187. this.OldStatus.Serialize(binary);
  1188. }
  1189. binary.Write(this.selectedJobClass != null);
  1190. if (this.selectedJobClass != null)
  1191. {
  1192. binary.Write(this.selectedJobClass.data.id);
  1193. }
  1194. binary.Write(this.selectedYotogiClass != null);
  1195. if (this.selectedYotogiClass != null)
  1196. {
  1197. binary.Write(this.selectedYotogiClass.data.id);
  1198. }
  1199. binary.Write(2177629204u);
  1200. }
  1201. public void Deserialize(BinaryReader binary)
  1202. {
  1203. string a = binary.ReadString();
  1204. NDebug.Assert(a == "CM3D2_MAID_STATUS", "メイドパラメータのヘッダーが不正です。");
  1205. this.OldStatus = null;
  1206. int num = binary.ReadInt32();
  1207. this.guid = binary.ReadString();
  1208. this.creationTime = binary.ReadString();
  1209. string text = this.creationTime.Replace(":", string.Empty);
  1210. text = text.Replace(" ", string.Empty);
  1211. this.creationTimeNum = ulong.Parse(text);
  1212. this.heroineType = (HeroineType)binary.ReadInt16();
  1213. if (this.heroineType == HeroineType.Sub)
  1214. {
  1215. int id = binary.ReadInt32();
  1216. this.subCharaData = SubMaid.GetData(id);
  1217. }
  1218. if (205 < num)
  1219. {
  1220. this.mainChara = binary.ReadBoolean();
  1221. }
  1222. this.employmentDay_ = binary.ReadInt32();
  1223. this.lastName = binary.ReadString();
  1224. this.firstName = binary.ReadString();
  1225. this.profileComment = binary.ReadString();
  1226. this.freeComment = binary.ReadString();
  1227. this.initSeikeiken = (Seikeiken)binary.ReadInt16();
  1228. this.seikeiken = (Seikeiken)binary.ReadInt16();
  1229. int num2 = binary.ReadInt32();
  1230. if (Personal.IsEnabled(num2))
  1231. {
  1232. this.SetPersonal(num2);
  1233. }
  1234. else
  1235. {
  1236. Debug.LogWarning(this.fullNameJpStyle + " : ロードされたデータの性格[" + Personal.GetData(num2).drawName + "]は有効ではないので初期性格に強制変更しました");
  1237. this.SetPersonal(Personal.GetData("Muku"));
  1238. }
  1239. if (207 < num)
  1240. {
  1241. this.contract = (Contract)binary.ReadInt16();
  1242. }
  1243. this.body.Deserialize(binary, num);
  1244. this.relation_ = (Relation)binary.ReadInt16();
  1245. if (num < 215)
  1246. {
  1247. binary.ReadInt16();
  1248. }
  1249. this.playCountYotogi_ = binary.ReadUInt16();
  1250. this.playCountNightWork_ = binary.ReadUInt16();
  1251. this.likability_ = binary.ReadUInt16();
  1252. this.studyRate_ = binary.ReadUInt16();
  1253. this.maxHp_ = binary.ReadUInt16();
  1254. this.currentHp_ = binary.ReadUInt16();
  1255. this.maxMind_ = binary.ReadUInt16();
  1256. this.currentMind_ = binary.ReadUInt16();
  1257. if (211 < num)
  1258. {
  1259. this.maxReason_ = binary.ReadUInt16();
  1260. this.currentReason_ = binary.ReadUInt16();
  1261. }
  1262. this.reception_ = binary.ReadUInt16();
  1263. this.care_ = binary.ReadUInt16();
  1264. this.lovely_ = binary.ReadUInt16();
  1265. this.elegance_ = binary.ReadUInt16();
  1266. this.charm_ = binary.ReadUInt16();
  1267. this.cooking_ = binary.ReadUInt16();
  1268. this.vocal_ = binary.ReadUInt16();
  1269. this.dance_ = binary.ReadUInt16();
  1270. this.appealPoint_ = binary.ReadUInt16();
  1271. this.inyoku_ = binary.ReadUInt16();
  1272. this.m_value_ = binary.ReadUInt16();
  1273. this.hentai_ = binary.ReadUInt16();
  1274. this.housi_ = binary.ReadUInt16();
  1275. this.teachRate_ = binary.ReadUInt16();
  1276. this.sexPlayNumberOfPeople_ = binary.ReadUInt16();
  1277. this.popularRank_ = binary.ReadUInt16();
  1278. this.sales_ = binary.ReadInt64();
  1279. this.totalSales_ = binary.ReadInt64();
  1280. if (207 < num)
  1281. {
  1282. this.evaluation_ = binary.ReadUInt16();
  1283. this.totalEvaluation_ = binary.ReadInt64();
  1284. }
  1285. this.leader = binary.ReadBoolean();
  1286. this.isFirstNameCall = binary.ReadBoolean();
  1287. if (202 < num)
  1288. {
  1289. this.enabledYotogiStatusLock = binary.ReadBoolean();
  1290. }
  1291. this.eyePartsTab = (EyePartsTab)binary.ReadInt16();
  1292. this.noonWorkId = binary.ReadInt32();
  1293. this.nightWorkId = binary.ReadInt32();
  1294. this.noonCommu = binary.ReadBoolean();
  1295. this.nightCommu = binary.ReadBoolean();
  1296. int num3 = (int)binary.ReadInt16();
  1297. this.features_.Clear();
  1298. for (int i = 0; i < num3; i++)
  1299. {
  1300. int num4 = binary.ReadInt32();
  1301. if (Feature.IsEnabled(num4))
  1302. {
  1303. this.features_.Add(num4, Feature.GetData(num4));
  1304. }
  1305. }
  1306. num3 = (int)binary.ReadInt16();
  1307. this.propensitys_.Clear();
  1308. for (int j = 0; j < num3; j++)
  1309. {
  1310. int num5 = binary.ReadInt32();
  1311. if (Propensity.IsEnabled(num5))
  1312. {
  1313. this.propensitys_.Add(num5, Propensity.GetData(num5));
  1314. }
  1315. }
  1316. this.jobClass.Deserialize(binary, num);
  1317. this.yotogiClass.Deserialize(binary, num);
  1318. this.UpdateClassBonusStatus();
  1319. if (211 >= num)
  1320. {
  1321. num3 = (int)binary.ReadInt16();
  1322. for (int k = 0; k < num3; k++)
  1323. {
  1324. binary.ReadInt32();
  1325. binary.ReadUInt32();
  1326. binary.ReadUInt16();
  1327. binary.ReadInt32();
  1328. binary.ReadInt32();
  1329. binary.ReadInt32();
  1330. binary.ReadInt32();
  1331. }
  1332. }
  1333. else
  1334. {
  1335. this.yotogiSkill.Deserialize(binary, num);
  1336. }
  1337. num3 = (int)binary.ReadInt16();
  1338. this.workDatas_.Clear();
  1339. for (int l = 0; l < num3; l++)
  1340. {
  1341. int key = binary.ReadInt32();
  1342. WorkData workData = new WorkData();
  1343. workData.Deserialize(binary, num);
  1344. this.workDatas_.Add(key, workData);
  1345. }
  1346. num3 = (int)binary.ReadInt16();
  1347. this.flags_.Clear();
  1348. for (int m = 0; m < num3; m++)
  1349. {
  1350. string key2 = binary.ReadString();
  1351. int value = binary.ReadInt32();
  1352. this.flags_.Add(key2, value);
  1353. }
  1354. if (205 < num)
  1355. {
  1356. num3 = (int)binary.ReadInt16();
  1357. this.eventEndFlags_.Clear();
  1358. for (int n = 0; n < num3; n++)
  1359. {
  1360. int key3 = binary.ReadInt32();
  1361. bool value2 = binary.ReadBoolean();
  1362. this.eventEndFlags_.Add(key3, value2);
  1363. }
  1364. }
  1365. num3 = (int)binary.ReadInt16();
  1366. this.partsDic.Clear();
  1367. for (int num6 = 0; num6 < num3; num6++)
  1368. {
  1369. string key4 = binary.ReadString();
  1370. string value3 = binary.ReadString();
  1371. this.partsDic.Add(key4, value3);
  1372. }
  1373. if (207 < num)
  1374. {
  1375. bool flag = binary.ReadBoolean();
  1376. if (flag)
  1377. {
  1378. this.OldStatus = new Status(this);
  1379. this.OldStatus.Deserialize(binary, num);
  1380. }
  1381. }
  1382. this.selectedJobClass = null;
  1383. if (binary.ReadBoolean())
  1384. {
  1385. int id2 = binary.ReadInt32();
  1386. if (this.jobClass.Contains(id2))
  1387. {
  1388. this.selectedJobClass = this.jobClass.Get(id2);
  1389. }
  1390. }
  1391. if (this.selectedJobClass == null)
  1392. {
  1393. ClassData<JobClass.Data>[] valueArray = this.jobClass.datas.GetValueArray();
  1394. int num7 = 0;
  1395. if (num7 < valueArray.Length)
  1396. {
  1397. ClassData<JobClass.Data> selectedJobClass = valueArray[num7];
  1398. this.selectedJobClass = selectedJobClass;
  1399. }
  1400. }
  1401. this.selectedYotogiClass = null;
  1402. if (binary.ReadBoolean())
  1403. {
  1404. int id3 = binary.ReadInt32();
  1405. if (this.yotogiClass.Contains(id3))
  1406. {
  1407. this.selectedYotogiClass = this.yotogiClass.Get(id3);
  1408. }
  1409. }
  1410. if (this.selectedYotogiClass == null)
  1411. {
  1412. ClassData<YotogiClass.Data>[] valueArray2 = this.yotogiClass.datas.GetValueArray();
  1413. int num8 = 0;
  1414. if (num8 < valueArray2.Length)
  1415. {
  1416. ClassData<YotogiClass.Data> selectedYotogiClass = valueArray2[num8];
  1417. this.selectedYotogiClass = selectedYotogiClass;
  1418. }
  1419. }
  1420. uint num9 = binary.ReadUInt32();
  1421. NDebug.Assert(2177629204u == num9, "メイドパラメータのロードに失敗しました");
  1422. if (num <= 1050)
  1423. {
  1424. YotogiClass.Data data = YotogiClass.GetData("Kokuhakuplay");
  1425. if (this.yotogiClass.Get(data) != null && this.contract != Contract.Free)
  1426. {
  1427. this.yotogiClass.Remove(data, true);
  1428. }
  1429. List<int> list = new List<int>();
  1430. foreach (YotogiSkillData yotogiSkillData in this.yotogiSkill.datas.GetValueArray())
  1431. {
  1432. YotogiClass.Data yotogi_class = yotogiSkillData.data.getcondition_data.yotogi_class;
  1433. if (yotogi_class != null && !this.yotogiClass.Contains(yotogi_class) && yotogi_class.learnConditions.requestContracts.Count != 0 && !yotogi_class.learnConditions.requestContracts.Contains(this.contract))
  1434. {
  1435. list.Add(yotogiSkillData.id);
  1436. }
  1437. }
  1438. foreach (int skillId in list)
  1439. {
  1440. this.yotogiSkill.Remove(skillId);
  1441. }
  1442. }
  1443. }
  1444. public void Deserialize(StatusReader oldStatusReader, bool convertYotogiSkill)
  1445. {
  1446. Func<int, int> func = (int value) => (int)System.Math.Floor((double)((float)value * 0.3f));
  1447. this.OldStatus = new Status(this);
  1448. this.creationTimeNum = oldStatusReader.creationTimeNum;
  1449. this.guid = oldStatusReader.guid;
  1450. this.heroineType = HeroineType.Transfer;
  1451. this.mainChara = false;
  1452. this.employmentDay = GameMain.Instance.CharacterMgr.status.days;
  1453. this.lastName = oldStatusReader.lastName;
  1454. this.firstName = oldStatusReader.firstName;
  1455. this.freeComment = oldStatusReader.freeComment;
  1456. this.initSeikeiken = oldStatusReader.initSeikeiken;
  1457. this.seikeiken = oldStatusReader.seikeiken;
  1458. string uniqueName = oldStatusReader.personal.ToString();
  1459. this.SetPersonal(Personal.GetData(uniqueName));
  1460. this.contract = oldStatusReader.contract;
  1461. this.body.height = oldStatusReader.body.height;
  1462. this.body.weight = oldStatusReader.body.weight;
  1463. this.body.bust = oldStatusReader.body.bust;
  1464. this.body.waist = oldStatusReader.body.waist;
  1465. this.body.hip = oldStatusReader.body.hip;
  1466. this.body.cup = oldStatusReader.body.cup;
  1467. if (oldStatusReader.relation == Relation.Tonus || oldStatusReader.relation == Relation.Contact)
  1468. {
  1469. this.relation_ = Relation.Contact;
  1470. }
  1471. else if (oldStatusReader.relation == Relation.Trust)
  1472. {
  1473. this.relation_ = Relation.Trust;
  1474. }
  1475. else
  1476. {
  1477. this.relation_ = Relation.Lover;
  1478. }
  1479. this.playCountYotogi = oldStatusReader.playCountYotogi;
  1480. this.playCountNightWork = oldStatusReader.playCountNightWork;
  1481. this.likability = oldStatusReader.likability;
  1482. this.studyRate = oldStatusReader.studyRate;
  1483. int num = 100;
  1484. this.baseMaxHp = num;
  1485. this.currentHp = num;
  1486. num = 100;
  1487. this.baseMaxMind = num;
  1488. this.currentMind = num;
  1489. this.baseReception = func(oldStatusReader.reception);
  1490. this.baseCare = func(oldStatusReader.care);
  1491. this.baseLovely = func(oldStatusReader.care);
  1492. this.baseElegance = func(oldStatusReader.elegance);
  1493. this.baseCharm = func(oldStatusReader.charm);
  1494. num = 0;
  1495. this.baseAppealPoint = num;
  1496. num = num;
  1497. this.baseDance = num;
  1498. num = num;
  1499. this.baseVocal = num;
  1500. this.baseCooking = num;
  1501. this.baseInyoku = func(oldStatusReader.inyoku);
  1502. this.baseMvalue = func(oldStatusReader.mvalue);
  1503. this.baseHentai = func(oldStatusReader.hentai);
  1504. this.baseHousi = func(oldStatusReader.housi);
  1505. this.baseTeachRate = func(oldStatusReader.teachRate);
  1506. this.sexPlayNumberOfPeople = oldStatusReader.sexPlayNumberOfPeople;
  1507. this.popularRank = 0;
  1508. num = 0;
  1509. this.evaluation = num;
  1510. this.sales = (long)num;
  1511. this.totalSales = oldStatusReader.totalSales;
  1512. this.totalEvaluations = oldStatusReader.totalEvaluations;
  1513. this.leader = false;
  1514. this.isFirstNameCall = oldStatusReader.isFirstNameCall;
  1515. this.eyePartsTab = EyePartsTab.LR;
  1516. this.noonWorkId = (this.nightWorkId = 0);
  1517. this.noonCommu = (this.nightCommu = false);
  1518. this.features_.Clear();
  1519. this.propensitys_.Clear();
  1520. this.jobClass.Clear();
  1521. this.yotogiClass.Clear();
  1522. this.yotogiSkill.Clear();
  1523. this.workDatas_.Clear();
  1524. this.flags_.Clear();
  1525. this.eventEndFlags_.Clear();
  1526. this.selectedJobClass = null;
  1527. AbstractClassData.ClassType classTypeFlags = AbstractClassData.ClassType.Share | AbstractClassData.ClassType.New | AbstractClassData.ClassType.Old;
  1528. List<JobClass.Data> learnPossibleClassDatas = this.jobClass.GetLearnPossibleClassDatas(true, classTypeFlags);
  1529. foreach (JobClass.Data data in learnPossibleClassDatas)
  1530. {
  1531. if (GameMain.Instance.CharacterMgr.status.IsJobClassOpenFlag(data.id))
  1532. {
  1533. this.jobClass.Add(data, false, false);
  1534. }
  1535. }
  1536. List<YotogiClass.Data> learnPossibleClassDatas2 = this.yotogiClass.GetLearnPossibleClassDatas(true, classTypeFlags);
  1537. foreach (YotogiClass.Data data2 in learnPossibleClassDatas2)
  1538. {
  1539. if (GameMain.Instance.CharacterMgr.status.IsYotogiClassOpenFlag(data2.id))
  1540. {
  1541. this.yotogiClass.Add(data2, false, false);
  1542. }
  1543. }
  1544. foreach (StatusReader.ClassData classData in oldStatusReader.maidClassDatas)
  1545. {
  1546. if (classData.isHave && JobClass.IsEnabled(classData.classId) && !this.jobClass.Contains(classData.classId))
  1547. {
  1548. ClassData<JobClass.Data> classData2 = this.jobClass.Add(classData.classId, false, false);
  1549. if (classData2 != null)
  1550. {
  1551. classData2.expSystem.SetLevel(classData.level);
  1552. }
  1553. }
  1554. }
  1555. foreach (StatusReader.ClassData classData3 in oldStatusReader.yotogiClassDatas)
  1556. {
  1557. if (classData3.isHave && YotogiClass.IsEnabled(classData3.classId) && !this.yotogiClass.Contains(classData3.classId))
  1558. {
  1559. ClassData<YotogiClass.Data> classData4 = this.yotogiClass.Add(classData3.classId, false, false);
  1560. if (classData4 != null)
  1561. {
  1562. classData4.expSystem.SetLevel(classData3.level);
  1563. }
  1564. }
  1565. }
  1566. if (oldStatusReader.selectedMaidClass != null && this.jobClass.Contains(oldStatusReader.selectedMaidClass.classId))
  1567. {
  1568. this.selectedJobClass = this.jobClass.Get(oldStatusReader.selectedMaidClass.classId);
  1569. }
  1570. if (this.selectedJobClass == null)
  1571. {
  1572. ClassData<JobClass.Data>[] valueArray = this.jobClass.oldDatas.GetValueArray();
  1573. int num2 = 0;
  1574. if (num2 < valueArray.Length)
  1575. {
  1576. ClassData<JobClass.Data> selectedJobClass = valueArray[num2];
  1577. this.selectedJobClass = selectedJobClass;
  1578. }
  1579. }
  1580. if (convertYotogiSkill)
  1581. {
  1582. List<Skill.Data> learnPossibleSkills = Skill.GetLearnPossibleSkills(this);
  1583. foreach (Skill.Data data3 in learnPossibleSkills)
  1584. {
  1585. this.yotogiSkill.Add(data3.id);
  1586. }
  1587. foreach (KeyValuePair<int, StatusReader.SkillData> keyValuePair in oldStatusReader.yotogiSkillDatas)
  1588. {
  1589. int id = keyValuePair.Value.id;
  1590. int level = keyValuePair.Value.level;
  1591. uint playCount = keyValuePair.Value.playCount;
  1592. if (!this.yotogiSkill.Contains(id) && Skill.Old.Contains(id))
  1593. {
  1594. this.yotogiSkill.Add(id);
  1595. }
  1596. YotogiSkillData yotogiSkillData = this.yotogiSkill.Get(id);
  1597. if (yotogiSkillData != null && yotogiSkillData.oldData != null)
  1598. {
  1599. yotogiSkillData.expSystem.SetLevel(level);
  1600. yotogiSkillData.playCount = playCount;
  1601. }
  1602. }
  1603. }
  1604. foreach (KeyValuePair<int, StatusReader.WorkData> keyValuePair2 in oldStatusReader.workDatas)
  1605. {
  1606. this.workDatas_.Add(keyValuePair2.Key, keyValuePair2.Value.toNewWorkData());
  1607. }
  1608. foreach (int num3 in oldStatusReader.features)
  1609. {
  1610. StatusReader.Feature feature = (StatusReader.Feature)num3;
  1611. string uniqueName2 = feature.ToString();
  1612. this.AddFeature(Feature.GetData(uniqueName2));
  1613. }
  1614. this.OldStatus.employmentElapsedDay = oldStatusReader.employmentElapsedDay;
  1615. this.OldStatus.relation = oldStatusReader.relation;
  1616. Dictionary<StatusReader.Propensity, string> dictionary = new Dictionary<StatusReader.Propensity, string>();
  1617. dictionary.Add(StatusReader.Propensity.淫乱, "敏感体質");
  1618. dictionary.Add(StatusReader.Propensity.変態, "変態の素質");
  1619. dictionary.Add(StatusReader.Propensity.飲精好き, "ごっくん大好き");
  1620. dictionary.Add(StatusReader.Propensity.奉仕好き, "桃色泡姫");
  1621. dictionary.Add(StatusReader.Propensity.M女, "ドMの素質");
  1622. dictionary.Add(StatusReader.Propensity.中出し好き, "中出し大好き");
  1623. foreach (int num4 in oldStatusReader.propensitys)
  1624. {
  1625. StatusReader.Propensity key = (StatusReader.Propensity)num4;
  1626. if (dictionary.ContainsKey(key))
  1627. {
  1628. this.AddPropensity(Propensity.GetData(dictionary[key]));
  1629. }
  1630. }
  1631. if (1000 <= oldStatusReader.sexual.curi)
  1632. {
  1633. this.AddPropensity(Propensity.GetData("敏感なクリトリス"));
  1634. }
  1635. this.partsDic = new Dictionary<string, string>(oldStatusReader.partsDic);
  1636. this.OldStatus.isMarriage = (oldStatusReader.flags.ContainsKey("_maid_param_marriage_flag") && oldStatusReader.flags["_maid_param_marriage_flag"] != 0);
  1637. this.OldStatus.isNewWife = (oldStatusReader.flags.ContainsKey("_maid_param_newwife_flag") && oldStatusReader.flags["_maid_param_newwife_flag"] != 0);
  1638. foreach (KeyValuePair<string, int> keyValuePair3 in oldStatusReader.flags)
  1639. {
  1640. this.OldStatus.AddFlag(keyValuePair3.Key, keyValuePair3.Value);
  1641. }
  1642. if (!GameMain.Instance.CharacterMgr.status.isOldPlayer)
  1643. {
  1644. this.likability = 0;
  1645. this.relation_ = Relation.Contact;
  1646. this.OldStatus.isMarriage = false;
  1647. this.OldStatus.isNewWife = false;
  1648. }
  1649. this.profileComment = MaidProfile.Create(this.maid, true);
  1650. }
  1651. public const int MaidPointUpStatus = 20;
  1652. public const int NullID = -2147483648;
  1653. private const uint SaveDataCheckCode = 2177629204u;
  1654. public HeroineType heroineType;
  1655. public bool mainChara;
  1656. public SubMaid.Data subCharaData;
  1657. public string profileComment;
  1658. public Seikeiken initSeikeiken;
  1659. public Seikeiken seikeiken;
  1660. public Contract contract;
  1661. public BodyData body;
  1662. public int noonWorkId;
  1663. public int nightWorkId;
  1664. public bool noonCommu;
  1665. public bool nightCommu;
  1666. public bool leader;
  1667. public bool isFirstNameCall;
  1668. public bool enabledYotogiStatusLock;
  1669. public EyePartsTab eyePartsTab;
  1670. private Dictionary<int, Feature.Data> features_;
  1671. private Dictionary<int, Propensity.Data> propensitys_;
  1672. private BonusStatus bonusStatus;
  1673. private string freeComment_;
  1674. private Personal.Data personal_;
  1675. private int employmentDay_;
  1676. private string lastName_ = string.Empty;
  1677. private string firstName_ = string.Empty;
  1678. private Relation relation_;
  1679. private ushort playCountYotogi_;
  1680. private ushort playCountNightWork_;
  1681. private ushort likability_;
  1682. private ushort studyRate_;
  1683. private int currentExcite_;
  1684. private int currentSensual_;
  1685. private ushort maxHp_;
  1686. private ushort currentHp_;
  1687. private ushort maxMind_;
  1688. private ushort currentMind_;
  1689. private ushort maxReason_;
  1690. private ushort currentReason_;
  1691. private ushort reception_;
  1692. private ushort care_;
  1693. private ushort lovely_;
  1694. private ushort elegance_;
  1695. private ushort charm_;
  1696. private ushort cooking_;
  1697. private ushort vocal_;
  1698. private ushort dance_;
  1699. private ushort appealPoint_;
  1700. private ushort inyoku_;
  1701. private ushort m_value_;
  1702. private ushort hentai_;
  1703. private ushort housi_;
  1704. private ushort teachRate_;
  1705. private ushort sexPlayNumberOfPeople_;
  1706. private ushort popularRank_;
  1707. private long sales_;
  1708. private long totalSales_;
  1709. private ushort evaluation_;
  1710. private long totalEvaluation_;
  1711. private Dictionary<int, WorkData> workDatas_;
  1712. private Dictionary<string, int> flags_;
  1713. private Dictionary<int, bool> eventEndFlags_;
  1714. }
  1715. }