MaidProfile.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. using System;
  2. using System.Collections.Generic;
  3. using MaidStatus;
  4. namespace Edit
  5. {
  6. public static class MaidProfile
  7. {
  8. public static string Create(Maid maid, bool employment)
  9. {
  10. Status status_ = maid.status;
  11. string profileText = string.Empty;
  12. Func<MaidProfile.CsvDataBlock, int, int, bool> success_call_back = delegate(MaidProfile.CsvDataBlock block, int x, int y)
  13. {
  14. profileText += block.csv.GetCellAsString(block.GetOriginalX(block.max_x - 1), block.GetOriginalY(y));
  15. return true;
  16. };
  17. string text = "profile_comment_1.nei";
  18. profileText = string.Empty;
  19. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
  20. {
  21. NDebug.Assert(afileBase.IsValid(), "file open failed.\n" + text);
  22. using (CsvParser csvParser = new CsvParser())
  23. {
  24. if (!csvParser.Open(afileBase))
  25. {
  26. NDebug.Assert("csv open failed.\n" + text, false);
  27. }
  28. MaidProfile.CsvDataBlock csvDataBlock = new MaidProfile.CsvDataBlock(csvParser, 0);
  29. Func<MaidProfile.CsvDataBlock, int, bool> line_func = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  30. {
  31. if (!cur_block.csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  32. {
  33. return true;
  34. }
  35. string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
  36. string cellAsString3 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(2), line_y);
  37. return !status_.partsDic.ContainsKey(cellAsString2) || status_.partsDic[cellAsString2] == cellAsString3;
  38. };
  39. csvDataBlock.BlockAnalysis(1, line_func, success_call_back);
  40. csvDataBlock.NextBlock();
  41. Func<MaidProfile.CsvDataBlock, int, bool> line_func2 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  42. {
  43. if (!cur_block.csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  44. {
  45. return true;
  46. }
  47. string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
  48. return status_.features.ContainsKey(Feature.GetData(cellAsString2).id);
  49. };
  50. csvDataBlock.BlockAnalysis(1, line_func2, success_call_back);
  51. csvDataBlock.NextBlock();
  52. csvDataBlock.BlockAnalysis(1, line_func, success_call_back);
  53. }
  54. }
  55. text = "profile_comment_2.nei";
  56. using (AFileBase afileBase2 = GameUty.FileSystem.FileOpen(text))
  57. {
  58. NDebug.Assert(afileBase2.IsValid(), "file open failed.\n" + text);
  59. using (CsvParser csv = new CsvParser())
  60. {
  61. if (!csv.Open(afileBase2))
  62. {
  63. NDebug.Assert("csv open failed.\n" + text, false);
  64. }
  65. MaidProfile.CsvDataBlock csvDataBlock2 = new MaidProfile.CsvDataBlock(csv, 0);
  66. string cellAsString = csv.GetCellAsString(csvDataBlock2.GetOriginalX(csvDataBlock2.max_x - 1), csvDataBlock2.GetOriginalY(csvDataBlock2.max_y - 1));
  67. profileText += cellAsString.Replace("[n]", string.Empty + status_.body.bust);
  68. csvDataBlock2.NextBlock();
  69. cellAsString = csv.GetCellAsString(csvDataBlock2.GetOriginalX(csvDataBlock2.max_x - 1), csvDataBlock2.GetOriginalY(csvDataBlock2.max_y - 1));
  70. profileText += cellAsString.Replace("[n]", string.Empty + status_.body.waist);
  71. csvDataBlock2.NextBlock();
  72. cellAsString = csv.GetCellAsString(csvDataBlock2.GetOriginalX(csvDataBlock2.max_x - 1), csvDataBlock2.GetOriginalY(csvDataBlock2.max_y - 1));
  73. profileText += cellAsString.Replace("[n]", string.Empty + status_.body.hip);
  74. csvDataBlock2.NextBlock();
  75. Func<MaidProfile.CsvDataBlock, int, bool> line_func3 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  76. {
  77. string cellAsString2 = csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
  78. if (cellAsString2.IndexOf(status_.body.cup) == -1)
  79. {
  80. return false;
  81. }
  82. bool flag = csv.GetCellAsString(cur_block.GetOriginalX(2), line_y) == "○";
  83. return !flag || (maid.Parts != null && 50 <= maid.GetProp(MPN.MuneTare).value);
  84. };
  85. csvDataBlock2.BlockAnalysis(1, line_func3, success_call_back);
  86. csvDataBlock2.NextBlock();
  87. Func<MaidProfile.CsvDataBlock, int, bool> line_func4 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  88. {
  89. int cellAsInteger = csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  90. if (cellAsInteger <= status_.body.waist)
  91. {
  92. return false;
  93. }
  94. int num = int.MinValue;
  95. if (csv.IsCellToExistData(cur_block.GetOriginalX(2), line_y))
  96. {
  97. num = csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
  98. }
  99. int num2 = int.MaxValue;
  100. if (csv.IsCellToExistData(cur_block.GetOriginalX(3), line_y))
  101. {
  102. num2 = csv.GetCellAsInteger(cur_block.GetOriginalX(3), line_y);
  103. }
  104. return num <= status_.body.hip && status_.body.hip <= num2;
  105. };
  106. csvDataBlock2.BlockAnalysis(1, line_func4, success_call_back);
  107. csvDataBlock2.NextBlock();
  108. Func<MaidProfile.CsvDataBlock, int, bool> line_func5 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  109. {
  110. int cellAsInteger = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  111. if (status_.personal.id != Personal.GetData(cellAsInteger).id)
  112. {
  113. return false;
  114. }
  115. if (!cur_block.csv.IsCellToExistData(cur_block.GetOriginalX(2), line_y))
  116. {
  117. return true;
  118. }
  119. string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(2), line_y);
  120. return status_.features.ContainsKey(Feature.GetData(cellAsString2).id);
  121. };
  122. csvDataBlock2.BlockAnalysis(1, line_func5, success_call_back);
  123. csvDataBlock2.NextBlock();
  124. csvDataBlock2.BlockAnalysis(1, line_func5, success_call_back);
  125. }
  126. }
  127. text = "profile_comment_3.nei";
  128. using (AFileBase afileBase3 = GameUty.FileSystem.FileOpen(text))
  129. {
  130. NDebug.Assert(afileBase3.IsValid(), "file open failed.\n" + text);
  131. using (CsvParser csv = new CsvParser())
  132. {
  133. if (!csv.Open(afileBase3))
  134. {
  135. NDebug.Assert("csv open failed.\n" + text, false);
  136. }
  137. MaidProfile.CsvDataBlock csvDataBlock3 = new MaidProfile.CsvDataBlock(csv, 0);
  138. Func<MaidProfile.CsvDataBlock, int, bool> line_func6 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  139. {
  140. int num = int.MinValue;
  141. if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  142. {
  143. num = csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  144. }
  145. int num2 = int.MaxValue;
  146. if (csv.IsCellToExistData(cur_block.GetOriginalX(2), line_y))
  147. {
  148. num2 = csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
  149. }
  150. if (num > status_.body.bust || status_.body.bust > num2)
  151. {
  152. return false;
  153. }
  154. num = int.MinValue;
  155. if (csv.IsCellToExistData(cur_block.GetOriginalX(3), line_y))
  156. {
  157. num = csv.GetCellAsInteger(cur_block.GetOriginalX(3), line_y);
  158. }
  159. num2 = int.MaxValue;
  160. if (csv.IsCellToExistData(cur_block.GetOriginalX(4), line_y))
  161. {
  162. num2 = csv.GetCellAsInteger(cur_block.GetOriginalX(4), line_y);
  163. }
  164. if (num > status_.body.waist || status_.body.waist > num2)
  165. {
  166. return false;
  167. }
  168. num = int.MinValue;
  169. if (csv.IsCellToExistData(cur_block.GetOriginalX(5), line_y))
  170. {
  171. num = csv.GetCellAsInteger(cur_block.GetOriginalX(5), line_y);
  172. }
  173. num2 = int.MaxValue;
  174. if (csv.IsCellToExistData(cur_block.GetOriginalX(6), line_y))
  175. {
  176. num2 = csv.GetCellAsInteger(cur_block.GetOriginalX(6), line_y);
  177. }
  178. return num <= status_.body.hip && status_.body.hip <= num2;
  179. };
  180. csvDataBlock3.BlockAnalysis(1, line_func6, success_call_back);
  181. csvDataBlock3.NextBlock();
  182. Func<MaidProfile.CsvDataBlock, int, bool> line_func7 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  183. {
  184. int cellAsInteger = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  185. return status_.personal.id == Personal.GetData(cellAsInteger).id;
  186. };
  187. csvDataBlock3.BlockAnalysis(1, line_func7, success_call_back);
  188. csvDataBlock3.NextBlock();
  189. Func<MaidProfile.CsvDataBlock, int, bool> line_func8 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  190. {
  191. JobClass.Data data = JobClass.GetData(cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y));
  192. return data.id == status_.selectedJobClass.data.id;
  193. };
  194. csvDataBlock3.BlockAnalysis(1, line_func8, success_call_back);
  195. }
  196. }
  197. text = "profile_comment_4.nei";
  198. using (AFileBase afileBase4 = GameUty.FileSystem.FileOpen(text))
  199. {
  200. NDebug.Assert(afileBase4.IsValid(), "file open failed.\n" + text);
  201. using (CsvParser csv = new CsvParser())
  202. {
  203. if (!csv.Open(afileBase4))
  204. {
  205. NDebug.Assert("csv open failed.\n" + text, false);
  206. }
  207. Func<MaidProfile.CsvDataBlock, int, bool> line_func9 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  208. {
  209. int num = 1;
  210. if (csv.IsCellToExistData(cur_block.GetOriginalX(num++), line_y))
  211. {
  212. YotogiClass.Data data = YotogiClass.GetData(cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(num - 1), line_y));
  213. if (data.id != status_.selectedJobClass.data.id)
  214. {
  215. return false;
  216. }
  217. }
  218. int[] array = new int[]
  219. {
  220. status_.sexPlayNumberOfPeople,
  221. status_.inyoku,
  222. status_.lovely,
  223. status_.mvalue,
  224. status_.elegance,
  225. status_.hentai,
  226. status_.charm,
  227. status_.housi
  228. };
  229. foreach (int num2 in array)
  230. {
  231. if (csv.IsCellToExistData(cur_block.GetOriginalX(num++), line_y))
  232. {
  233. int cellAsInteger = csv.GetCellAsInteger(cur_block.GetOriginalX(num - 1), line_y);
  234. if (cellAsInteger > num2)
  235. {
  236. return false;
  237. }
  238. }
  239. }
  240. return true;
  241. };
  242. MaidProfile.CsvDataBlock csvDataBlock4 = new MaidProfile.CsvDataBlock(csv, 0);
  243. Func<MaidProfile.CsvDataBlock, int, bool> line_func10 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  244. {
  245. Personal.Data data = Personal.GetData(cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y));
  246. return status_.personal.id == data.id;
  247. };
  248. csvDataBlock4.BlockAnalysis(1, line_func10, success_call_back);
  249. csvDataBlock4.NextBlock();
  250. Func<MaidProfile.CsvDataBlock, int, bool> line_func11 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  251. {
  252. Contract cellAsInteger = (Contract)cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  253. return status_.contract == cellAsInteger;
  254. };
  255. csvDataBlock4.BlockAnalysis(1, line_func11, success_call_back);
  256. csvDataBlock4.NextBlock();
  257. if (!employment && status_.seikeiken == Seikeiken.No_No)
  258. {
  259. Func<MaidProfile.CsvDataBlock, int, bool> line_func12 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  260. {
  261. int num = int.MinValue;
  262. if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  263. {
  264. num = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  265. }
  266. bool flag = num <= status_.inyoku;
  267. if (flag)
  268. {
  269. status_.studyRate = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
  270. }
  271. return flag;
  272. };
  273. csvDataBlock4.BlockAnalysis(1, line_func12, success_call_back);
  274. }
  275. csvDataBlock4.NextBlock();
  276. if (employment && status_.seikeiken == Seikeiken.No_No)
  277. {
  278. csvDataBlock4.BlockAnalysis(1, line_func9, success_call_back);
  279. }
  280. csvDataBlock4.NextBlock();
  281. if (!employment && status_.seikeiken == Seikeiken.Yes_No)
  282. {
  283. Func<MaidProfile.CsvDataBlock, int, bool> line_func13 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  284. {
  285. int num = int.MinValue;
  286. if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  287. {
  288. num = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  289. }
  290. bool flag = num <= status_.sexPlayNumberOfPeople;
  291. if (flag)
  292. {
  293. status_.studyRate = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
  294. }
  295. return flag;
  296. };
  297. csvDataBlock4.BlockAnalysis(1, line_func13, success_call_back);
  298. }
  299. csvDataBlock4.NextBlock();
  300. if (employment && status_.seikeiken == Seikeiken.Yes_No)
  301. {
  302. csvDataBlock4.BlockAnalysis(1, line_func9, success_call_back);
  303. }
  304. csvDataBlock4.NextBlock();
  305. if (!employment && status_.seikeiken == Seikeiken.No_Yes)
  306. {
  307. Func<MaidProfile.CsvDataBlock, int, bool> line_func14 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  308. {
  309. int num = int.MinValue;
  310. if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  311. {
  312. num = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  313. }
  314. bool flag = num <= status_.sexPlayNumberOfPeople;
  315. if (flag)
  316. {
  317. status_.studyRate = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
  318. }
  319. return flag;
  320. };
  321. csvDataBlock4.BlockAnalysis(1, line_func14, success_call_back);
  322. }
  323. csvDataBlock4.NextBlock();
  324. if (employment && status_.seikeiken == Seikeiken.No_Yes)
  325. {
  326. csvDataBlock4.BlockAnalysis(1, line_func9, success_call_back);
  327. }
  328. csvDataBlock4.NextBlock();
  329. if (!employment && status_.seikeiken == Seikeiken.Yes_Yes)
  330. {
  331. Func<MaidProfile.CsvDataBlock, int, bool> line_func15 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  332. {
  333. int num = int.MinValue;
  334. if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  335. {
  336. num = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  337. }
  338. bool flag = num <= status_.sexPlayNumberOfPeople;
  339. if (flag)
  340. {
  341. status_.studyRate = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
  342. }
  343. return flag;
  344. };
  345. csvDataBlock4.BlockAnalysis(1, line_func15, success_call_back);
  346. }
  347. csvDataBlock4.NextBlock();
  348. if (employment && status_.seikeiken == Seikeiken.Yes_Yes)
  349. {
  350. csvDataBlock4.BlockAnalysis(1, line_func9, success_call_back);
  351. }
  352. }
  353. }
  354. text = "profile_comment_5.nei";
  355. using (AFileBase afileBase5 = GameUty.FileSystem.FileOpen(text))
  356. {
  357. NDebug.Assert(afileBase5.IsValid(), "file open failed.\n" + text);
  358. using (CsvParser csv = new CsvParser())
  359. {
  360. if (!csv.Open(afileBase5))
  361. {
  362. NDebug.Assert("csv open failed.\n" + text, false);
  363. }
  364. int comment_no = 0;
  365. MaidProfile.CsvDataBlock csvDataBlock5 = new MaidProfile.CsvDataBlock(csv, 0);
  366. Func<MaidProfile.CsvDataBlock, int, int, bool> success_call_back2 = delegate(MaidProfile.CsvDataBlock succes_block, int x, int y)
  367. {
  368. profileText += succes_block.csv.GetCellAsString(succes_block.GetOriginalX(succes_block.max_x - 3 + comment_no), succes_block.GetOriginalY(y));
  369. return true;
  370. };
  371. Func<MaidProfile.CsvDataBlock, int, bool> line_func16 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  372. {
  373. string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
  374. int id = Propensity.GetData(cellAsString2).id;
  375. if (!status_.propensitys.ContainsKey(id))
  376. {
  377. return false;
  378. }
  379. string cellAsString3 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(2), line_y);
  380. if (cellAsString3 != null)
  381. {
  382. if (!(cellAsString3 == "処女"))
  383. {
  384. if (!(cellAsString3 == "前穴"))
  385. {
  386. if (!(cellAsString3 == "後穴"))
  387. {
  388. if (cellAsString3 == "両穴")
  389. {
  390. if (status_.seikeiken != Seikeiken.Yes_Yes)
  391. {
  392. return false;
  393. }
  394. }
  395. }
  396. else if (status_.seikeiken != Seikeiken.No_Yes)
  397. {
  398. return false;
  399. }
  400. }
  401. else if (status_.seikeiken != Seikeiken.Yes_No)
  402. {
  403. return false;
  404. }
  405. }
  406. else if (status_.seikeiken != Seikeiken.No_No)
  407. {
  408. return false;
  409. }
  410. }
  411. int[] array = new int[]
  412. {
  413. status_.inyoku,
  414. status_.mvalue,
  415. status_.hentai,
  416. status_.housi
  417. };
  418. int num = 3;
  419. foreach (int num2 in array)
  420. {
  421. if (csv.IsCellToExistData(cur_block.GetOriginalX(num++), line_y))
  422. {
  423. int cellAsInteger = csv.GetCellAsInteger(cur_block.GetOriginalX(num - 1), line_y);
  424. if (cellAsInteger > num2)
  425. {
  426. return false;
  427. }
  428. }
  429. }
  430. comment_no = 0;
  431. int cellAsInteger2 = csv.GetCellAsInteger(cur_block.GetOriginalX(num++), line_y);
  432. if (0 < cellAsInteger2)
  433. {
  434. if (cellAsInteger2 > status_.lovely && cellAsInteger2 > status_.elegance && cellAsInteger2 > status_.charm)
  435. {
  436. return false;
  437. }
  438. SortedList<int, string> sortedList = new SortedList<int, string>();
  439. sortedList.Add(status_.lovely, "可憐");
  440. if (!sortedList.ContainsKey(status_.elegance))
  441. {
  442. sortedList.Add(status_.elegance, "気品");
  443. }
  444. if (!sortedList.ContainsKey(status_.charm))
  445. {
  446. sortedList.Add(status_.charm, "魅惑");
  447. }
  448. int num3 = sortedList.Count - 1;
  449. int num4 = 0;
  450. foreach (KeyValuePair<int, string> keyValuePair in sortedList)
  451. {
  452. if (num3 == num4)
  453. {
  454. string value = keyValuePair.Value;
  455. if (value != null)
  456. {
  457. if (!(value == "気品"))
  458. {
  459. if (value == "魅惑")
  460. {
  461. comment_no = 2;
  462. }
  463. }
  464. else
  465. {
  466. comment_no = 1;
  467. }
  468. }
  469. break;
  470. }
  471. num4++;
  472. }
  473. }
  474. return true;
  475. };
  476. csvDataBlock5.BlockAnalysis(1, line_func16, success_call_back2);
  477. }
  478. }
  479. text = "profile_comment_6.nei";
  480. using (AFileBase afileBase6 = GameUty.FileSystem.FileOpen(text))
  481. {
  482. NDebug.Assert(afileBase6.IsValid(), "file open failed.\n" + text);
  483. using (CsvParser csvParser2 = new CsvParser())
  484. {
  485. if (!csvParser2.Open(afileBase6))
  486. {
  487. NDebug.Assert("csv open failed.\n" + text, false);
  488. }
  489. MaidProfile.CsvDataBlock csvDataBlock6 = new MaidProfile.CsvDataBlock(csvParser2, 0);
  490. csvDataBlock6.NextBlock();
  491. Func<MaidProfile.CsvDataBlock, int, bool> line_func17 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  492. {
  493. if (!cur_block.csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  494. {
  495. return true;
  496. }
  497. string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
  498. Feature.Data data = Feature.GetData(cellAsString2);
  499. return status_.features.ContainsKey(data.id);
  500. };
  501. csvDataBlock6.BlockAnalysis(1, line_func17, success_call_back);
  502. }
  503. }
  504. text = "profile_comment_7.nei";
  505. using (AFileBase afileBase7 = GameUty.FileSystem.FileOpen(text))
  506. {
  507. NDebug.Assert(afileBase7.IsValid(), "file open failed.\n" + text);
  508. using (CsvParser csvParser3 = new CsvParser())
  509. {
  510. if (!csvParser3.Open(afileBase7))
  511. {
  512. NDebug.Assert("csv open failed.\n" + text, false);
  513. }
  514. MaidProfile.CsvDataBlock csvDataBlock7 = new MaidProfile.CsvDataBlock(csvParser3, 0);
  515. csvDataBlock7.NextBlock();
  516. Func<MaidProfile.CsvDataBlock, int, bool> line_func18 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  517. {
  518. if (!cur_block.csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  519. {
  520. return true;
  521. }
  522. string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
  523. Feature.Data data = Feature.GetData(cellAsString2);
  524. return status_.features.ContainsKey(data.id);
  525. };
  526. csvDataBlock7.BlockAnalysis(1, line_func18, success_call_back);
  527. csvDataBlock7.NextBlock();
  528. csvDataBlock7.BlockAnalysis(1, line_func18, success_call_back);
  529. csvDataBlock7.NextBlock();
  530. csvDataBlock7.BlockAnalysis(1, line_func18, success_call_back);
  531. }
  532. }
  533. return profileText;
  534. }
  535. public static int UpdateInitPlayNumber(Maid maid)
  536. {
  537. Status status = maid.status;
  538. int result = 0;
  539. if (status.initSeikeiken != Seikeiken.No_No)
  540. {
  541. using (AFileBase afileBase = GameUty.FileSystem.FileOpen("init_keiken_num_setting.nei"))
  542. {
  543. int size = afileBase.GetSize();
  544. NDebug.Assert(afileBase.IsValid(), "file open failed.\ninit_keiken_num_setting.nei");
  545. using (CsvParser csvParser = new CsvParser())
  546. {
  547. if (!csvParser.Open(afileBase))
  548. {
  549. NDebug.Assert("csv open failed.\ninit_keiken_num_setting.nei", false);
  550. }
  551. for (int i = 2; i < csvParser.max_cell_y; i++)
  552. {
  553. if (!csvParser.IsCellToExistData(0, i))
  554. {
  555. break;
  556. }
  557. int num = 0;
  558. string cellAsString = csvParser.GetCellAsString(num++, i);
  559. Seikeiken seikeiken = Seikeiken.Yes_No;
  560. if (cellAsString == "前穴")
  561. {
  562. seikeiken = Seikeiken.Yes_No;
  563. }
  564. else if (cellAsString == "後穴")
  565. {
  566. seikeiken = Seikeiken.No_Yes;
  567. }
  568. else if (cellAsString == "両穴")
  569. {
  570. seikeiken = Seikeiken.Yes_Yes;
  571. }
  572. if (seikeiken == status.initSeikeiken)
  573. {
  574. int cellAsInteger = csvParser.GetCellAsInteger(num++, i);
  575. int cellAsInteger2 = csvParser.GetCellAsInteger(num++, i);
  576. int cellAsInteger3 = csvParser.GetCellAsInteger(num++, i);
  577. if (cellAsInteger2 <= status.inyoku && cellAsInteger3 <= status.hentai)
  578. {
  579. result = cellAsInteger;
  580. break;
  581. }
  582. }
  583. }
  584. }
  585. }
  586. }
  587. return result;
  588. }
  589. private const string FileNameProfileComment = "profile_comment";
  590. private class DataBlock
  591. {
  592. public int GetOriginalX(int x)
  593. {
  594. return this.rect.left + x;
  595. }
  596. public int GetOriginalY(int y)
  597. {
  598. return this.rect.top + y;
  599. }
  600. public int max_x
  601. {
  602. get
  603. {
  604. return this.rect.right - this.rect.left + 1;
  605. }
  606. }
  607. public int max_y
  608. {
  609. get
  610. {
  611. return this.rect.bottom - this.rect.top + 1;
  612. }
  613. }
  614. public PlaneRect<int> rect;
  615. }
  616. private class CsvDataBlock : MaidProfile.DataBlock
  617. {
  618. public CsvDataBlock(CsvParser check_csv, int check_start_y)
  619. {
  620. this.csv_ = check_csv;
  621. this.NextBlock(check_start_y);
  622. }
  623. public bool NextBlock(int check_start_y)
  624. {
  625. this.rect.left = 0;
  626. this.rect.bottom = this.csv_.max_cell_y - 1;
  627. for (int i = check_start_y; i < this.csv_.max_cell_y; i++)
  628. {
  629. if (this.csv_.IsCellToExistData(0, i))
  630. {
  631. this.rect.top = i;
  632. int j;
  633. for (j = 0; j < this.csv_.max_cell_x; j++)
  634. {
  635. if (!this.csv_.IsCellToExistData(j, i))
  636. {
  637. break;
  638. }
  639. }
  640. j--;
  641. this.rect.right = j;
  642. break;
  643. }
  644. }
  645. if (this.rect.right <= 0)
  646. {
  647. this.rect.left = (this.rect.right = (this.rect.top = (this.rect.bottom = 0)));
  648. return false;
  649. }
  650. for (int k = this.rect.top; k < this.csv_.max_cell_y; k++)
  651. {
  652. bool flag = false;
  653. for (int l = 0; l <= this.rect.right; l++)
  654. {
  655. if (this.csv_.IsCellToExistData(l, k))
  656. {
  657. flag = true;
  658. break;
  659. }
  660. }
  661. if (!flag)
  662. {
  663. this.rect.bottom = k - 1;
  664. break;
  665. }
  666. }
  667. for (int m = this.rect.left; m < this.csv_.max_cell_x; m++)
  668. {
  669. for (int n = this.rect.top; n <= this.rect.bottom; n++)
  670. {
  671. if (this.csv_.IsCellToExistData(m, n) && this.rect.right < m - 1)
  672. {
  673. this.rect.right = m - 1;
  674. }
  675. }
  676. }
  677. return true;
  678. }
  679. public void BlockAnalysis(int start_y, Func<MaidProfile.CsvDataBlock, int, bool> line_func, Func<MaidProfile.CsvDataBlock, int, int, bool> success_call_back)
  680. {
  681. for (int i = start_y; i < base.max_y; i++)
  682. {
  683. if (line_func(this, base.GetOriginalY(i)) && success_call_back(this, this.rect.left, i))
  684. {
  685. return;
  686. }
  687. }
  688. }
  689. public bool NextBlock()
  690. {
  691. return this.NextBlock(base.GetOriginalY(base.max_y));
  692. }
  693. public CsvParser csv
  694. {
  695. get
  696. {
  697. return this.csv_;
  698. }
  699. }
  700. private CsvParser csv_;
  701. }
  702. }
  703. }