Status.cs 48 KB

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