Status.cs 47 KB

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