Status.cs 48 KB

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