Status.cs 45 KB

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