Status.cs 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901
  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 bool isCompatiblePersonality
  689. {
  690. get
  691. {
  692. return this.heroineType == HeroineType.Transfer && this.personal.compatible;
  693. }
  694. }
  695. public static string ConvertString(string str, int maxStrSize = 8)
  696. {
  697. str = Regex.Replace(str, "[\\r\\n\\t\\\\]", string.Empty);
  698. if (str.Length == 0)
  699. {
  700. str = " ";
  701. }
  702. StringInfo stringInfo = new StringInfo(str);
  703. if (maxStrSize < stringInfo.LengthInTextElements)
  704. {
  705. str = stringInfo.SubstringByTextElements(0, maxStrSize);
  706. }
  707. return str;
  708. }
  709. public void Initialize(Maid maid)
  710. {
  711. this.maid = maid;
  712. this.guid = Guid.NewGuid().ToString();
  713. this.creationTime = DateTime.Now.ToString("G", new CultureInfo("ja-JP")).Replace("/", string.Empty);
  714. string text = this.creationTime.Replace(":", string.Empty);
  715. text = text.Replace(" ", string.Empty);
  716. this.creationTimeNum = ulong.Parse(text);
  717. this.employmentDay = GameMain.Instance.CharacterMgr.status.days;
  718. List<JobClass.Data> learnPossibleClassDatas = this.jobClass.GetLearnPossibleClassDatas(true, AbstractClassData.ClassType.Share | AbstractClassData.ClassType.New);
  719. foreach (JobClass.Data data in learnPossibleClassDatas)
  720. {
  721. this.jobClass.Add(data, true, true);
  722. if (this.selectedJobClass == null)
  723. {
  724. this.ChangeJobClass(data);
  725. }
  726. }
  727. List<YotogiClass.Data> learnPossibleClassDatas2 = this.yotogiClass.GetLearnPossibleClassDatas(true, AbstractClassData.ClassType.Share | AbstractClassData.ClassType.New);
  728. foreach (YotogiClass.Data data2 in learnPossibleClassDatas2)
  729. {
  730. this.yotogiClass.Add(data2, true, true);
  731. if (this.selectedYotogiClass == null)
  732. {
  733. this.ChangeYotogiClass(data2);
  734. }
  735. }
  736. List<Skill.Data> learnPossibleSkills = Skill.GetLearnPossibleSkills(this);
  737. foreach (Skill.Data data3 in learnPossibleSkills)
  738. {
  739. this.yotogiSkill.Add(data3.id);
  740. }
  741. int num = 100;
  742. this.baseMaxReason = num;
  743. num = num;
  744. this.baseMaxMind = num;
  745. this.baseMaxHp = num;
  746. this.UpdateClassBonusStatus();
  747. this.sexPlayNumberOfPeople = MaidProfile.UpdateInitPlayNumber(maid);
  748. this.UpdateBodyParam();
  749. this.profileComment = MaidProfile.Create(maid, false);
  750. this.currentHp = this.maxHp;
  751. this.currentMind = this.maxMind;
  752. }
  753. public bool SetPersonal(int personalId)
  754. {
  755. return this.SetPersonal(Personal.GetData(personalId));
  756. }
  757. public bool SetPersonal(Personal.Data data)
  758. {
  759. if (!Personal.IsEnabled(data.id) && !data.oldPersonal)
  760. {
  761. Debug.LogError("性格[" + data.drawName + "]は有効ではないので設定できません");
  762. return false;
  763. }
  764. this.personal_ = data;
  765. if (this.personal_.oldPersonal)
  766. {
  767. this.heroineType = HeroineType.Transfer;
  768. if (this.OldStatus == null)
  769. {
  770. this.OldStatus = new Status(this);
  771. }
  772. }
  773. else if (this.heroineType == HeroineType.Transfer)
  774. {
  775. this.heroineType = HeroineType.Original;
  776. this.OldStatus = null;
  777. }
  778. return true;
  779. }
  780. public void SetSeikeikenFront(bool val)
  781. {
  782. if (val)
  783. {
  784. if (this.seikeiken == Seikeiken.Yes_Yes || this.seikeiken == Seikeiken.Yes_No)
  785. {
  786. return;
  787. }
  788. if (this.seikeiken == Seikeiken.No_No)
  789. {
  790. this.seikeiken = Seikeiken.Yes_No;
  791. }
  792. else
  793. {
  794. this.seikeiken = Seikeiken.Yes_Yes;
  795. }
  796. }
  797. else
  798. {
  799. if (this.seikeiken == Seikeiken.No_No || this.seikeiken == Seikeiken.No_Yes)
  800. {
  801. return;
  802. }
  803. if (this.seikeiken == Seikeiken.Yes_Yes)
  804. {
  805. this.seikeiken = Seikeiken.No_Yes;
  806. }
  807. else
  808. {
  809. this.seikeiken = Seikeiken.No_No;
  810. }
  811. }
  812. }
  813. public void SetSeikeikenBack(bool val)
  814. {
  815. if (val)
  816. {
  817. if (this.seikeiken == Seikeiken.Yes_Yes || this.seikeiken == Seikeiken.No_Yes)
  818. {
  819. return;
  820. }
  821. if (this.seikeiken == Seikeiken.No_No)
  822. {
  823. this.seikeiken = Seikeiken.No_Yes;
  824. }
  825. else
  826. {
  827. this.seikeiken = Seikeiken.Yes_Yes;
  828. }
  829. }
  830. else
  831. {
  832. if (this.seikeiken == Seikeiken.No_No || this.seikeiken == Seikeiken.Yes_No)
  833. {
  834. return;
  835. }
  836. if (this.seikeiken == Seikeiken.Yes_Yes)
  837. {
  838. this.seikeiken = Seikeiken.Yes_No;
  839. }
  840. else
  841. {
  842. this.seikeiken = Seikeiken.No_No;
  843. }
  844. }
  845. }
  846. public bool ChangeJobClass(int jobClassId)
  847. {
  848. return this.ChangeJobClass(JobClass.GetData(jobClassId));
  849. }
  850. public bool ChangeJobClass(JobClass.Data data)
  851. {
  852. if (data == null)
  853. {
  854. return false;
  855. }
  856. if (!JobClass.IsEnabled(data.id))
  857. {
  858. Debug.LogError("ジョブクラス[" + data.drawName + "]は有効ではないので設定できません");
  859. return false;
  860. }
  861. if (!this.jobClass.Contains(data.id))
  862. {
  863. Debug.LogError("ジョブクラス[" + data.drawName + "]は取得していないので設定できません");
  864. return false;
  865. }
  866. this.selectedJobClass = this.jobClass.Get(data.id);
  867. return true;
  868. }
  869. public bool ChangeYotogiClass(int yotogiClassId)
  870. {
  871. return this.ChangeYotogiClass(YotogiClass.GetData(yotogiClassId));
  872. }
  873. public bool ChangeYotogiClass(YotogiClass.Data data)
  874. {
  875. if (data == null)
  876. {
  877. return false;
  878. }
  879. if (!YotogiClass.IsEnabled(data.id))
  880. {
  881. Debug.LogError("夜伽クラス[" + data.drawName + "]は有効ではないので設定できません");
  882. return false;
  883. }
  884. if (!this.yotogiClass.Contains(data.id))
  885. {
  886. Debug.LogError("夜伽クラス[" + data.drawName + "]は取得していないので設定できません");
  887. return false;
  888. }
  889. this.selectedYotogiClass = this.yotogiClass.Get(data.id);
  890. return true;
  891. }
  892. public Feature.Data AddFeature(int featureId)
  893. {
  894. return this.AddFeature(Feature.GetData(featureId));
  895. }
  896. public Feature.Data AddFeature(Feature.Data data)
  897. {
  898. if (data != null && Feature.IsEnabled(data.id) && !this.features_.ContainsKey(data.id))
  899. {
  900. this.features_.Add(data.id, data);
  901. }
  902. return data;
  903. }
  904. public void RemoveFeature(int featureId)
  905. {
  906. this.RemoveFeature(Feature.GetData(featureId));
  907. }
  908. public void RemoveFeature(Feature.Data data)
  909. {
  910. if (data != null && this.features_.ContainsKey(data.id))
  911. {
  912. this.features_.Remove(data.id);
  913. }
  914. }
  915. public Propensity.Data AddPropensity(int propensityId)
  916. {
  917. return this.AddPropensity(Propensity.GetData(propensityId));
  918. }
  919. public Propensity.Data AddPropensity(Propensity.Data data)
  920. {
  921. if (data != null && Propensity.IsEnabled(data.id) && !this.propensitys_.ContainsKey(data.id))
  922. {
  923. this.propensitys_.Add(data.id, data);
  924. }
  925. return data;
  926. }
  927. public void RemovePropensity(int featureId)
  928. {
  929. this.RemovePropensity(Propensity.GetData(featureId));
  930. }
  931. public void RemovePropensity(Propensity.Data data)
  932. {
  933. if (data != null && this.propensitys_.ContainsKey(data.id))
  934. {
  935. this.propensitys_.Remove(data.id);
  936. }
  937. }
  938. public void AddWorkDataPlayCount(int id, int addPlayCount)
  939. {
  940. if (!this.workDatas_.ContainsKey(id))
  941. {
  942. this.workDatas_.Add(id, new WorkData());
  943. }
  944. this.workDatas_[id].playCount += (uint)addPlayCount;
  945. }
  946. public void SetWorkDataLevel(int id, int level)
  947. {
  948. if (!this.workDatas_.ContainsKey(id))
  949. {
  950. this.workDatas_.Add(id, new WorkData());
  951. }
  952. this.workDatas_[id].level = level;
  953. }
  954. public void SetFlag(string flagName, int value)
  955. {
  956. if (!this.flags_.ContainsKey(flagName))
  957. {
  958. this.flags_.Add(flagName, value);
  959. }
  960. else
  961. {
  962. this.flags_[flagName] = value;
  963. }
  964. }
  965. public void AddFlag(string flagName, int value)
  966. {
  967. if (!this.flags_.ContainsKey(flagName))
  968. {
  969. this.flags_.Add(flagName, value);
  970. }
  971. else
  972. {
  973. Dictionary<string, int> dictionary;
  974. (dictionary = this.flags_)[flagName] = dictionary[flagName] + value;
  975. }
  976. }
  977. public int GetFlag(string flagName)
  978. {
  979. return (!this.flags_.ContainsKey(flagName)) ? 0 : this.flags_[flagName];
  980. }
  981. public bool RemoveFlag(string flagName)
  982. {
  983. return this.flags_.ContainsKey(flagName) && this.flags_.Remove(flagName);
  984. }
  985. public void SetEventEndFlag(int id, bool value)
  986. {
  987. if (this.eventEndFlags_.ContainsKey(id))
  988. {
  989. this.eventEndFlags_[id] = value;
  990. }
  991. else
  992. {
  993. this.eventEndFlags_.Add(id, value);
  994. }
  995. }
  996. public void RemoveEventEndFlag(int id)
  997. {
  998. if (this.eventEndFlags_.ContainsKey(id))
  999. {
  1000. this.eventEndFlags_.Remove(id);
  1001. }
  1002. }
  1003. public bool GetEventEndFlag(int id)
  1004. {
  1005. return this.eventEndFlags_.ContainsKey(id) && this.eventEndFlags_[id];
  1006. }
  1007. public BonusStatus GetBonusStatusAsFeatureAndPropensitys()
  1008. {
  1009. BonusStatus result = new BonusStatus();
  1010. foreach (Feature.Data data in this.features.GetValueArray())
  1011. {
  1012. if (data.bonusCorrection != null)
  1013. {
  1014. data.bonusCorrection.ApplyAddBonusStatus(result);
  1015. }
  1016. }
  1017. foreach (Propensity.Data data2 in this.propensitys.GetValueArray())
  1018. {
  1019. if (data2.bonusCorrection != null)
  1020. {
  1021. data2.bonusCorrection.ApplyAddBonusStatus(result);
  1022. }
  1023. }
  1024. return result;
  1025. }
  1026. public void UpdateBodyParam()
  1027. {
  1028. if (this.maid.Parts == null)
  1029. {
  1030. return;
  1031. }
  1032. Func<MPN, float> func = (MPN mpn) => (float)this.maid.GetProp(mpn).value;
  1033. 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;
  1034. float num2 = 55f * func(MPN.RegFat) + 50f * func(MPN.sintyou) * 0.5f + 50f * func(MPN.DouPer) * 0.4f;
  1035. float num3 = 55f * func(MPN.RegMeet) + 50f * func(MPN.sintyou) * 0.5f + 50f * func(MPN.DouPer) * 0.4f;
  1036. float num4 = 10f * func(MPN.UdeScl) * 0.1f;
  1037. float num5 = 5f * func(MPN.ArmL) + 5f * func(MPN.sintyou) * 1f + 5f * func(MPN.UdeScl) * 0.5f;
  1038. float num6 = 70f * func(MPN.Hara) + 50f * func(MPN.sintyou) * 0.7f + 50f * func(MPN.west) * func(MPN.Hara) * 0.005f;
  1039. float num7 = 10f * func(MPN.MuneL) * 2f;
  1040. float num8 = num7 * func(MPN.MuneTare) * 0.005f;
  1041. 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;
  1042. float num10 = 10f * func(MPN.koshi) + 7f * func(MPN.koshi) * func(MPN.sintyou) * 0.04f;
  1043. float num11 = 4f * func(MPN.kata);
  1044. float num12 = 38000f + num2 + num3 + num4 + num5 + num6 + num7 + num8 + num9 + num10 + num11;
  1045. this.body.height = (int)(num / 10f);
  1046. this.body.weight = (int)(num12 / 1000f);
  1047. float num13 = 70f + func(MPN.MuneL) * 0.31f + func(MPN.west) * 0.02f;
  1048. num13 -= 5f * (func(MPN.MuneS) / 100f);
  1049. this.body.bust = (int)num13;
  1050. this.body.waist = (int)(40f + func(MPN.west) * 0.25f + func(MPN.Hara) * 0.35f);
  1051. this.body.hip = (int)(65f + func(MPN.koshi) * 0.3f + func(MPN.RegFat) * 0.025f + func(MPN.RegMeet) * 0.025f);
  1052. if (num13 < 80f)
  1053. {
  1054. this.body.cup = "A";
  1055. }
  1056. else if (110f <= num13)
  1057. {
  1058. this.body.cup = "N";
  1059. }
  1060. else
  1061. {
  1062. char[] array = new char[]
  1063. {
  1064. 'B',
  1065. 'C',
  1066. 'D',
  1067. 'E',
  1068. 'F',
  1069. 'G',
  1070. 'H',
  1071. 'I',
  1072. 'J',
  1073. 'K',
  1074. 'L',
  1075. 'M'
  1076. };
  1077. this.body.cup = array[(int)((num13 - 80f) / 2.5f)].ToString();
  1078. }
  1079. }
  1080. public void UpdateClassBonusStatus()
  1081. {
  1082. this.bonusStatus.Clear();
  1083. if (this.heroineType == HeroineType.Sub)
  1084. {
  1085. return;
  1086. }
  1087. foreach (KeyValuePair<int, ClassData<JobClass.Data>> keyValuePair in this.jobClass.GetAllDatas())
  1088. {
  1089. ClassData<JobClass.Data> value = keyValuePair.Value;
  1090. value.data.levelBonuss[value.level - 1].ApplyAddBonusStatus(this.bonusStatus);
  1091. }
  1092. }
  1093. public void Serialize(BinaryWriter binary)
  1094. {
  1095. binary.Write("CM3D2_MAID_STATUS");
  1096. binary.Write(1150);
  1097. binary.Write(this.guid);
  1098. binary.Write(this.creationTime);
  1099. binary.Write((short)this.heroineType);
  1100. if (this.heroineType == HeroineType.Sub)
  1101. {
  1102. binary.Write(this.subCharaData.id);
  1103. }
  1104. binary.Write(this.mainChara);
  1105. binary.Write(this.employmentDay_);
  1106. binary.Write(this.lastName);
  1107. binary.Write(this.firstName);
  1108. binary.Write(this.profileComment);
  1109. binary.Write(this.freeComment);
  1110. binary.Write((short)this.initSeikeiken);
  1111. binary.Write((short)this.seikeiken);
  1112. binary.Write(this.personal_.id);
  1113. binary.Write((short)this.contract);
  1114. this.body.Serialize(binary);
  1115. binary.Write((short)this.relation_);
  1116. binary.Write(this.playCountYotogi_);
  1117. binary.Write(this.playCountNightWork_);
  1118. binary.Write(this.likability_);
  1119. binary.Write(this.studyRate_);
  1120. binary.Write(this.maxHp_);
  1121. binary.Write(this.currentHp_);
  1122. binary.Write(this.maxMind_);
  1123. binary.Write(this.currentMind_);
  1124. binary.Write(this.maxReason_);
  1125. binary.Write(this.currentReason_);
  1126. binary.Write(this.reception_);
  1127. binary.Write(this.care_);
  1128. binary.Write(this.lovely_);
  1129. binary.Write(this.elegance_);
  1130. binary.Write(this.charm_);
  1131. binary.Write(this.cooking_);
  1132. binary.Write(this.vocal_);
  1133. binary.Write(this.dance_);
  1134. binary.Write(this.appealPoint_);
  1135. binary.Write(this.inyoku_);
  1136. binary.Write(this.m_value_);
  1137. binary.Write(this.hentai_);
  1138. binary.Write(this.housi_);
  1139. binary.Write(this.teachRate_);
  1140. binary.Write(this.sexPlayNumberOfPeople_);
  1141. binary.Write(this.popularRank_);
  1142. binary.Write(this.sales_);
  1143. binary.Write(this.totalSales_);
  1144. binary.Write(this.evaluation_);
  1145. binary.Write(this.totalEvaluation_);
  1146. binary.Write(this.leader);
  1147. binary.Write(this.isFirstNameCall);
  1148. binary.Write(this.enabledYotogiStatusLock);
  1149. binary.Write((short)this.eyePartsTab);
  1150. binary.Write(this.noonWorkId);
  1151. binary.Write(this.nightWorkId);
  1152. binary.Write(this.noonCommu);
  1153. binary.Write(this.nightCommu);
  1154. binary.Write((short)this.features_.Count);
  1155. foreach (KeyValuePair<int, Feature.Data> keyValuePair in this.features_)
  1156. {
  1157. binary.Write(keyValuePair.Key);
  1158. }
  1159. binary.Write((short)this.propensitys_.Count);
  1160. foreach (KeyValuePair<int, Propensity.Data> keyValuePair2 in this.propensitys_)
  1161. {
  1162. binary.Write(keyValuePair2.Key);
  1163. }
  1164. this.jobClass.Serialize(binary);
  1165. this.yotogiClass.Serialize(binary);
  1166. this.yotogiSkill.Serialize(binary);
  1167. binary.Write((short)this.workDatas_.Count);
  1168. foreach (KeyValuePair<int, WorkData> keyValuePair3 in this.workDatas_)
  1169. {
  1170. binary.Write(keyValuePair3.Key);
  1171. keyValuePair3.Value.Serialize(binary);
  1172. }
  1173. binary.Write((short)this.flags_.Count);
  1174. foreach (KeyValuePair<string, int> keyValuePair4 in this.flags_)
  1175. {
  1176. binary.Write(keyValuePair4.Key);
  1177. binary.Write(keyValuePair4.Value);
  1178. }
  1179. binary.Write((short)this.eventEndFlags_.Count);
  1180. foreach (KeyValuePair<int, bool> keyValuePair5 in this.eventEndFlags_)
  1181. {
  1182. binary.Write(keyValuePair5.Key);
  1183. binary.Write(keyValuePair5.Value);
  1184. }
  1185. binary.Write((short)this.partsDic.Count);
  1186. foreach (KeyValuePair<string, string> keyValuePair6 in this.partsDic)
  1187. {
  1188. binary.Write(keyValuePair6.Key);
  1189. binary.Write(keyValuePair6.Value);
  1190. }
  1191. binary.Write(this.OldStatus != null);
  1192. if (this.OldStatus != null)
  1193. {
  1194. this.OldStatus.Serialize(binary);
  1195. }
  1196. binary.Write(this.selectedJobClass != null);
  1197. if (this.selectedJobClass != null)
  1198. {
  1199. binary.Write(this.selectedJobClass.data.id);
  1200. }
  1201. binary.Write(this.selectedYotogiClass != null);
  1202. if (this.selectedYotogiClass != null)
  1203. {
  1204. binary.Write(this.selectedYotogiClass.data.id);
  1205. }
  1206. binary.Write(2177629204u);
  1207. }
  1208. public void Deserialize(BinaryReader binary)
  1209. {
  1210. string a = binary.ReadString();
  1211. NDebug.Assert(a == "CM3D2_MAID_STATUS", "メイドパラメータのヘッダーが不正です。");
  1212. this.OldStatus = null;
  1213. int num = binary.ReadInt32();
  1214. this.guid = binary.ReadString();
  1215. this.creationTime = binary.ReadString();
  1216. string text = this.creationTime.Replace(":", string.Empty);
  1217. text = text.Replace(" ", string.Empty);
  1218. this.creationTimeNum = ulong.Parse(text);
  1219. this.heroineType = (HeroineType)binary.ReadInt16();
  1220. if (this.heroineType == HeroineType.Sub)
  1221. {
  1222. int id = binary.ReadInt32();
  1223. this.subCharaData = SubMaid.GetData(id);
  1224. }
  1225. if (205 < num)
  1226. {
  1227. this.mainChara = binary.ReadBoolean();
  1228. }
  1229. this.employmentDay_ = binary.ReadInt32();
  1230. this.lastName = binary.ReadString();
  1231. this.firstName = binary.ReadString();
  1232. this.profileComment = binary.ReadString();
  1233. this.freeComment = binary.ReadString();
  1234. this.initSeikeiken = (Seikeiken)binary.ReadInt16();
  1235. this.seikeiken = (Seikeiken)binary.ReadInt16();
  1236. int num2 = binary.ReadInt32();
  1237. if (Personal.IsEnabled(num2))
  1238. {
  1239. this.SetPersonal(num2);
  1240. }
  1241. else
  1242. {
  1243. Debug.LogWarning(this.fullNameJpStyle + " : ロードされたデータの性格[" + Personal.GetData(num2).drawName + "]は有効ではないので初期性格に強制変更しました");
  1244. this.SetPersonal(Personal.GetData("Muku"));
  1245. }
  1246. if (207 < num)
  1247. {
  1248. this.contract = (Contract)binary.ReadInt16();
  1249. }
  1250. this.body.Deserialize(binary, num);
  1251. this.relation_ = (Relation)binary.ReadInt16();
  1252. if (num < 215)
  1253. {
  1254. binary.ReadInt16();
  1255. }
  1256. this.playCountYotogi_ = binary.ReadUInt16();
  1257. this.playCountNightWork_ = binary.ReadUInt16();
  1258. this.likability_ = binary.ReadUInt16();
  1259. this.studyRate_ = binary.ReadUInt16();
  1260. this.maxHp_ = binary.ReadUInt16();
  1261. this.currentHp_ = binary.ReadUInt16();
  1262. this.maxMind_ = binary.ReadUInt16();
  1263. this.currentMind_ = binary.ReadUInt16();
  1264. if (211 < num)
  1265. {
  1266. this.maxReason_ = binary.ReadUInt16();
  1267. this.currentReason_ = binary.ReadUInt16();
  1268. }
  1269. this.reception_ = binary.ReadUInt16();
  1270. this.care_ = binary.ReadUInt16();
  1271. this.lovely_ = binary.ReadUInt16();
  1272. this.elegance_ = binary.ReadUInt16();
  1273. this.charm_ = binary.ReadUInt16();
  1274. this.cooking_ = binary.ReadUInt16();
  1275. this.vocal_ = binary.ReadUInt16();
  1276. this.dance_ = binary.ReadUInt16();
  1277. this.appealPoint_ = binary.ReadUInt16();
  1278. this.inyoku_ = binary.ReadUInt16();
  1279. this.m_value_ = binary.ReadUInt16();
  1280. this.hentai_ = binary.ReadUInt16();
  1281. this.housi_ = binary.ReadUInt16();
  1282. this.teachRate_ = binary.ReadUInt16();
  1283. this.sexPlayNumberOfPeople_ = binary.ReadUInt16();
  1284. this.popularRank_ = binary.ReadUInt16();
  1285. this.sales_ = binary.ReadInt64();
  1286. this.totalSales_ = binary.ReadInt64();
  1287. if (207 < num)
  1288. {
  1289. this.evaluation_ = binary.ReadUInt16();
  1290. this.totalEvaluation_ = binary.ReadInt64();
  1291. }
  1292. this.leader = binary.ReadBoolean();
  1293. this.isFirstNameCall = binary.ReadBoolean();
  1294. if (202 < num)
  1295. {
  1296. this.enabledYotogiStatusLock = binary.ReadBoolean();
  1297. }
  1298. this.eyePartsTab = (EyePartsTab)binary.ReadInt16();
  1299. this.noonWorkId = binary.ReadInt32();
  1300. this.nightWorkId = binary.ReadInt32();
  1301. this.noonCommu = binary.ReadBoolean();
  1302. this.nightCommu = binary.ReadBoolean();
  1303. int num3 = (int)binary.ReadInt16();
  1304. this.features_.Clear();
  1305. for (int i = 0; i < num3; i++)
  1306. {
  1307. int num4 = binary.ReadInt32();
  1308. if (Feature.IsEnabled(num4))
  1309. {
  1310. this.features_.Add(num4, Feature.GetData(num4));
  1311. }
  1312. }
  1313. num3 = (int)binary.ReadInt16();
  1314. this.propensitys_.Clear();
  1315. for (int j = 0; j < num3; j++)
  1316. {
  1317. int num5 = binary.ReadInt32();
  1318. if (Propensity.IsEnabled(num5))
  1319. {
  1320. this.propensitys_.Add(num5, Propensity.GetData(num5));
  1321. }
  1322. }
  1323. this.jobClass.Deserialize(binary, num);
  1324. this.yotogiClass.Deserialize(binary, num);
  1325. this.UpdateClassBonusStatus();
  1326. if (211 >= num)
  1327. {
  1328. num3 = (int)binary.ReadInt16();
  1329. for (int k = 0; k < num3; k++)
  1330. {
  1331. binary.ReadInt32();
  1332. binary.ReadUInt32();
  1333. binary.ReadUInt16();
  1334. binary.ReadInt32();
  1335. binary.ReadInt32();
  1336. binary.ReadInt32();
  1337. binary.ReadInt32();
  1338. }
  1339. }
  1340. else
  1341. {
  1342. this.yotogiSkill.Deserialize(binary, num);
  1343. }
  1344. num3 = (int)binary.ReadInt16();
  1345. this.workDatas_.Clear();
  1346. for (int l = 0; l < num3; l++)
  1347. {
  1348. int key = binary.ReadInt32();
  1349. WorkData workData = new WorkData();
  1350. workData.Deserialize(binary, num);
  1351. this.workDatas_.Add(key, workData);
  1352. }
  1353. num3 = (int)binary.ReadInt16();
  1354. this.flags_.Clear();
  1355. for (int m = 0; m < num3; m++)
  1356. {
  1357. string key2 = binary.ReadString();
  1358. int value = binary.ReadInt32();
  1359. this.flags_.Add(key2, value);
  1360. }
  1361. if (205 < num)
  1362. {
  1363. num3 = (int)binary.ReadInt16();
  1364. this.eventEndFlags_.Clear();
  1365. for (int n = 0; n < num3; n++)
  1366. {
  1367. int key3 = binary.ReadInt32();
  1368. bool value2 = binary.ReadBoolean();
  1369. this.eventEndFlags_.Add(key3, value2);
  1370. }
  1371. }
  1372. num3 = (int)binary.ReadInt16();
  1373. this.partsDic.Clear();
  1374. for (int num6 = 0; num6 < num3; num6++)
  1375. {
  1376. string key4 = binary.ReadString();
  1377. string value3 = binary.ReadString();
  1378. this.partsDic.Add(key4, value3);
  1379. }
  1380. if (207 < num)
  1381. {
  1382. bool flag = binary.ReadBoolean();
  1383. if (flag)
  1384. {
  1385. this.OldStatus = new Status(this);
  1386. this.OldStatus.Deserialize(binary, num);
  1387. }
  1388. }
  1389. this.selectedJobClass = null;
  1390. if (binary.ReadBoolean())
  1391. {
  1392. int id2 = binary.ReadInt32();
  1393. if (this.jobClass.Contains(id2))
  1394. {
  1395. this.selectedJobClass = this.jobClass.Get(id2);
  1396. }
  1397. }
  1398. if (this.selectedJobClass == null)
  1399. {
  1400. ClassData<JobClass.Data>[] valueArray = this.jobClass.datas.GetValueArray();
  1401. int num7 = 0;
  1402. if (num7 < valueArray.Length)
  1403. {
  1404. ClassData<JobClass.Data> selectedJobClass = valueArray[num7];
  1405. this.selectedJobClass = selectedJobClass;
  1406. }
  1407. }
  1408. this.selectedYotogiClass = null;
  1409. if (binary.ReadBoolean())
  1410. {
  1411. int id3 = binary.ReadInt32();
  1412. if (this.yotogiClass.Contains(id3))
  1413. {
  1414. this.selectedYotogiClass = this.yotogiClass.Get(id3);
  1415. }
  1416. }
  1417. if (this.selectedYotogiClass == null)
  1418. {
  1419. ClassData<YotogiClass.Data>[] valueArray2 = this.yotogiClass.datas.GetValueArray();
  1420. int num8 = 0;
  1421. if (num8 < valueArray2.Length)
  1422. {
  1423. ClassData<YotogiClass.Data> selectedYotogiClass = valueArray2[num8];
  1424. this.selectedYotogiClass = selectedYotogiClass;
  1425. }
  1426. }
  1427. uint num9 = binary.ReadUInt32();
  1428. NDebug.Assert(2177629204u == num9, "メイドパラメータのロードに失敗しました");
  1429. if (num <= 1050)
  1430. {
  1431. YotogiClass.Data data = YotogiClass.GetData("Kokuhakuplay");
  1432. if (this.yotogiClass.Get(data) != null && this.contract != Contract.Free)
  1433. {
  1434. this.yotogiClass.Remove(data, true);
  1435. }
  1436. List<int> list = new List<int>();
  1437. foreach (YotogiSkillData yotogiSkillData in this.yotogiSkill.datas.GetValueArray())
  1438. {
  1439. YotogiClass.Data yotogi_class = yotogiSkillData.data.getcondition_data.yotogi_class;
  1440. if (yotogi_class != null && !this.yotogiClass.Contains(yotogi_class) && yotogi_class.learnConditions.requestContracts.Count != 0 && !yotogi_class.learnConditions.requestContracts.Contains(this.contract))
  1441. {
  1442. list.Add(yotogiSkillData.id);
  1443. }
  1444. }
  1445. foreach (int skillId in list)
  1446. {
  1447. this.yotogiSkill.Remove(skillId);
  1448. }
  1449. }
  1450. }
  1451. public void Deserialize(StatusReader oldStatusReader, bool convertYotogiSkill)
  1452. {
  1453. Func<int, int> func = (int value) => (int)System.Math.Floor((double)((float)value * 0.3f));
  1454. this.OldStatus = new Status(this);
  1455. this.creationTimeNum = oldStatusReader.creationTimeNum;
  1456. this.guid = oldStatusReader.guid;
  1457. this.heroineType = HeroineType.Transfer;
  1458. this.mainChara = false;
  1459. this.employmentDay = GameMain.Instance.CharacterMgr.status.days;
  1460. this.lastName = oldStatusReader.lastName;
  1461. this.firstName = oldStatusReader.firstName;
  1462. this.freeComment = oldStatusReader.freeComment;
  1463. this.initSeikeiken = oldStatusReader.initSeikeiken;
  1464. this.seikeiken = oldStatusReader.seikeiken;
  1465. string uniqueName = oldStatusReader.personal.ToString();
  1466. this.SetPersonal(Personal.GetData(uniqueName));
  1467. this.contract = oldStatusReader.contract;
  1468. this.body.height = oldStatusReader.body.height;
  1469. this.body.weight = oldStatusReader.body.weight;
  1470. this.body.bust = oldStatusReader.body.bust;
  1471. this.body.waist = oldStatusReader.body.waist;
  1472. this.body.hip = oldStatusReader.body.hip;
  1473. this.body.cup = oldStatusReader.body.cup;
  1474. if (oldStatusReader.relation == Relation.Tonus || oldStatusReader.relation == Relation.Contact)
  1475. {
  1476. this.relation_ = Relation.Contact;
  1477. }
  1478. else if (oldStatusReader.relation == Relation.Trust)
  1479. {
  1480. this.relation_ = Relation.Trust;
  1481. }
  1482. else
  1483. {
  1484. this.relation_ = Relation.Lover;
  1485. }
  1486. this.playCountYotogi = oldStatusReader.playCountYotogi;
  1487. this.playCountNightWork = oldStatusReader.playCountNightWork;
  1488. this.likability = oldStatusReader.likability;
  1489. this.studyRate = oldStatusReader.studyRate;
  1490. int num = 100;
  1491. this.baseMaxHp = num;
  1492. this.currentHp = num;
  1493. num = 100;
  1494. this.baseMaxMind = num;
  1495. this.currentMind = num;
  1496. this.baseReception = func(oldStatusReader.reception);
  1497. this.baseCare = func(oldStatusReader.care);
  1498. this.baseLovely = func(oldStatusReader.care);
  1499. this.baseElegance = func(oldStatusReader.elegance);
  1500. this.baseCharm = func(oldStatusReader.charm);
  1501. num = 0;
  1502. this.baseAppealPoint = num;
  1503. num = num;
  1504. this.baseDance = num;
  1505. num = num;
  1506. this.baseVocal = num;
  1507. this.baseCooking = num;
  1508. this.baseInyoku = func(oldStatusReader.inyoku);
  1509. this.baseMvalue = func(oldStatusReader.mvalue);
  1510. this.baseHentai = func(oldStatusReader.hentai);
  1511. this.baseHousi = func(oldStatusReader.housi);
  1512. this.baseTeachRate = func(oldStatusReader.teachRate);
  1513. this.sexPlayNumberOfPeople = oldStatusReader.sexPlayNumberOfPeople;
  1514. this.popularRank = 0;
  1515. num = 0;
  1516. this.evaluation = num;
  1517. this.sales = (long)num;
  1518. this.totalSales = oldStatusReader.totalSales;
  1519. this.totalEvaluations = oldStatusReader.totalEvaluations;
  1520. this.leader = false;
  1521. this.isFirstNameCall = oldStatusReader.isFirstNameCall;
  1522. this.eyePartsTab = EyePartsTab.LR;
  1523. this.noonWorkId = (this.nightWorkId = 0);
  1524. this.noonCommu = (this.nightCommu = false);
  1525. this.features_.Clear();
  1526. this.propensitys_.Clear();
  1527. this.jobClass.Clear();
  1528. this.yotogiClass.Clear();
  1529. this.yotogiSkill.Clear();
  1530. this.workDatas_.Clear();
  1531. this.flags_.Clear();
  1532. this.eventEndFlags_.Clear();
  1533. this.selectedJobClass = null;
  1534. AbstractClassData.ClassType classTypeFlags = AbstractClassData.ClassType.Share | AbstractClassData.ClassType.New | AbstractClassData.ClassType.Old;
  1535. List<JobClass.Data> learnPossibleClassDatas = this.jobClass.GetLearnPossibleClassDatas(true, classTypeFlags);
  1536. foreach (JobClass.Data data in learnPossibleClassDatas)
  1537. {
  1538. if (GameMain.Instance.CharacterMgr.status.IsJobClassOpenFlag(data.id))
  1539. {
  1540. this.jobClass.Add(data, false, false);
  1541. }
  1542. }
  1543. List<YotogiClass.Data> learnPossibleClassDatas2 = this.yotogiClass.GetLearnPossibleClassDatas(true, classTypeFlags);
  1544. foreach (YotogiClass.Data data2 in learnPossibleClassDatas2)
  1545. {
  1546. if (GameMain.Instance.CharacterMgr.status.IsYotogiClassOpenFlag(data2.id))
  1547. {
  1548. this.yotogiClass.Add(data2, false, false);
  1549. }
  1550. }
  1551. foreach (StatusReader.ClassData classData in oldStatusReader.maidClassDatas)
  1552. {
  1553. if (classData.isHave && JobClass.IsEnabled(classData.classId) && !this.jobClass.Contains(classData.classId))
  1554. {
  1555. ClassData<JobClass.Data> classData2 = this.jobClass.Add(classData.classId, false, false);
  1556. if (classData2 != null)
  1557. {
  1558. classData2.expSystem.SetLevel(classData.level);
  1559. }
  1560. }
  1561. }
  1562. foreach (StatusReader.ClassData classData3 in oldStatusReader.yotogiClassDatas)
  1563. {
  1564. if (classData3.isHave && YotogiClass.IsEnabled(classData3.classId) && !this.yotogiClass.Contains(classData3.classId))
  1565. {
  1566. ClassData<YotogiClass.Data> classData4 = this.yotogiClass.Add(classData3.classId, false, false);
  1567. if (classData4 != null)
  1568. {
  1569. classData4.expSystem.SetLevel(classData3.level);
  1570. }
  1571. }
  1572. }
  1573. if (oldStatusReader.selectedMaidClass != null && this.jobClass.Contains(oldStatusReader.selectedMaidClass.classId))
  1574. {
  1575. this.selectedJobClass = this.jobClass.Get(oldStatusReader.selectedMaidClass.classId);
  1576. }
  1577. if (this.selectedJobClass == null)
  1578. {
  1579. ClassData<JobClass.Data>[] valueArray = this.jobClass.oldDatas.GetValueArray();
  1580. int num2 = 0;
  1581. if (num2 < valueArray.Length)
  1582. {
  1583. ClassData<JobClass.Data> selectedJobClass = valueArray[num2];
  1584. this.selectedJobClass = selectedJobClass;
  1585. }
  1586. }
  1587. if (convertYotogiSkill)
  1588. {
  1589. List<Skill.Data> learnPossibleSkills = Skill.GetLearnPossibleSkills(this);
  1590. foreach (Skill.Data data3 in learnPossibleSkills)
  1591. {
  1592. this.yotogiSkill.Add(data3.id);
  1593. }
  1594. foreach (KeyValuePair<int, StatusReader.SkillData> keyValuePair in oldStatusReader.yotogiSkillDatas)
  1595. {
  1596. int id = keyValuePair.Value.id;
  1597. int level = keyValuePair.Value.level;
  1598. uint playCount = keyValuePair.Value.playCount;
  1599. if (!this.yotogiSkill.Contains(id) && Skill.Old.Contains(id))
  1600. {
  1601. this.yotogiSkill.Add(id);
  1602. }
  1603. YotogiSkillData yotogiSkillData = this.yotogiSkill.Get(id);
  1604. if (yotogiSkillData != null && yotogiSkillData.oldData != null)
  1605. {
  1606. yotogiSkillData.expSystem.SetLevel(level);
  1607. yotogiSkillData.playCount = playCount;
  1608. }
  1609. }
  1610. }
  1611. foreach (KeyValuePair<int, StatusReader.WorkData> keyValuePair2 in oldStatusReader.workDatas)
  1612. {
  1613. this.workDatas_.Add(keyValuePair2.Key, keyValuePair2.Value.toNewWorkData());
  1614. }
  1615. foreach (int num3 in oldStatusReader.features)
  1616. {
  1617. StatusReader.Feature feature = (StatusReader.Feature)num3;
  1618. string uniqueName2 = feature.ToString();
  1619. this.AddFeature(Feature.GetData(uniqueName2));
  1620. }
  1621. this.OldStatus.employmentElapsedDay = oldStatusReader.employmentElapsedDay;
  1622. this.OldStatus.relation = oldStatusReader.relation;
  1623. Dictionary<StatusReader.Propensity, string> dictionary = new Dictionary<StatusReader.Propensity, string>();
  1624. dictionary.Add(StatusReader.Propensity.淫乱, "敏感体質");
  1625. dictionary.Add(StatusReader.Propensity.変態, "変態の素質");
  1626. dictionary.Add(StatusReader.Propensity.飲精好き, "ごっくん大好き");
  1627. dictionary.Add(StatusReader.Propensity.奉仕好き, "桃色泡姫");
  1628. dictionary.Add(StatusReader.Propensity.M女, "ドMの素質");
  1629. dictionary.Add(StatusReader.Propensity.中出し好き, "中出し大好き");
  1630. foreach (int num4 in oldStatusReader.propensitys)
  1631. {
  1632. StatusReader.Propensity key = (StatusReader.Propensity)num4;
  1633. if (dictionary.ContainsKey(key))
  1634. {
  1635. this.AddPropensity(Propensity.GetData(dictionary[key]));
  1636. }
  1637. }
  1638. if (1000 <= oldStatusReader.sexual.curi)
  1639. {
  1640. this.AddPropensity(Propensity.GetData("敏感なクリトリス"));
  1641. }
  1642. this.partsDic = new Dictionary<string, string>(oldStatusReader.partsDic);
  1643. this.OldStatus.isMarriage = (oldStatusReader.flags.ContainsKey("_maid_param_marriage_flag") && oldStatusReader.flags["_maid_param_marriage_flag"] != 0);
  1644. this.OldStatus.isNewWife = (oldStatusReader.flags.ContainsKey("_maid_param_newwife_flag") && oldStatusReader.flags["_maid_param_newwife_flag"] != 0);
  1645. foreach (KeyValuePair<string, int> keyValuePair3 in oldStatusReader.flags)
  1646. {
  1647. this.OldStatus.AddFlag(keyValuePair3.Key, keyValuePair3.Value);
  1648. }
  1649. if (!GameMain.Instance.CharacterMgr.status.isOldPlayer)
  1650. {
  1651. this.likability = 0;
  1652. this.relation_ = Relation.Contact;
  1653. this.OldStatus.isMarriage = false;
  1654. this.OldStatus.isNewWife = false;
  1655. }
  1656. this.profileComment = MaidProfile.Create(this.maid, true);
  1657. }
  1658. public const int MaidPointUpStatus = 20;
  1659. public const int NullID = -2147483648;
  1660. private const uint SaveDataCheckCode = 2177629204u;
  1661. public HeroineType heroineType;
  1662. public bool mainChara;
  1663. public SubMaid.Data subCharaData;
  1664. public string profileComment;
  1665. public Seikeiken initSeikeiken;
  1666. public Seikeiken seikeiken;
  1667. public Contract contract;
  1668. public BodyData body;
  1669. public int noonWorkId;
  1670. public int nightWorkId;
  1671. public bool noonCommu;
  1672. public bool nightCommu;
  1673. public bool leader;
  1674. public bool isFirstNameCall;
  1675. public bool enabledYotogiStatusLock;
  1676. public EyePartsTab eyePartsTab;
  1677. private Dictionary<int, Feature.Data> features_;
  1678. private Dictionary<int, Propensity.Data> propensitys_;
  1679. private BonusStatus bonusStatus;
  1680. private string freeComment_;
  1681. private Personal.Data personal_;
  1682. private int employmentDay_;
  1683. private string lastName_ = string.Empty;
  1684. private string firstName_ = string.Empty;
  1685. private Relation relation_;
  1686. private ushort playCountYotogi_;
  1687. private ushort playCountNightWork_;
  1688. private ushort likability_;
  1689. private ushort studyRate_;
  1690. private int currentExcite_;
  1691. private int currentSensual_;
  1692. private ushort maxHp_;
  1693. private ushort currentHp_;
  1694. private ushort maxMind_;
  1695. private ushort currentMind_;
  1696. private ushort maxReason_;
  1697. private ushort currentReason_;
  1698. private ushort reception_;
  1699. private ushort care_;
  1700. private ushort lovely_;
  1701. private ushort elegance_;
  1702. private ushort charm_;
  1703. private ushort cooking_;
  1704. private ushort vocal_;
  1705. private ushort dance_;
  1706. private ushort appealPoint_;
  1707. private ushort inyoku_;
  1708. private ushort m_value_;
  1709. private ushort hentai_;
  1710. private ushort housi_;
  1711. private ushort teachRate_;
  1712. private ushort sexPlayNumberOfPeople_;
  1713. private ushort popularRank_;
  1714. private long sales_;
  1715. private long totalSales_;
  1716. private ushort evaluation_;
  1717. private long totalEvaluation_;
  1718. private Dictionary<int, WorkData> workDatas_;
  1719. private Dictionary<string, int> flags_;
  1720. private Dictionary<int, bool> eventEndFlags_;
  1721. }
  1722. }