MaidProfile.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  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. if (!Product.VBA)
  199. {
  200. using (AFileBase afileBase4 = GameUty.FileSystem.FileOpen(text))
  201. {
  202. NDebug.Assert(afileBase4.IsValid(), "file open failed.\n" + text);
  203. using (CsvParser csv = new CsvParser())
  204. {
  205. if (!csv.Open(afileBase4))
  206. {
  207. NDebug.Assert("csv open failed.\n" + text, false);
  208. }
  209. Func<MaidProfile.CsvDataBlock, int, bool> line_func9 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  210. {
  211. int num = 1;
  212. if (csv.IsCellToExistData(cur_block.GetOriginalX(num++), line_y))
  213. {
  214. YotogiClass.Data data = YotogiClass.GetData(cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(num - 1), line_y));
  215. if (data.id != status_.selectedJobClass.data.id)
  216. {
  217. return false;
  218. }
  219. }
  220. int[] array = new int[]
  221. {
  222. status_.sexPlayNumberOfPeople,
  223. status_.inyoku,
  224. status_.lovely,
  225. status_.mvalue,
  226. status_.elegance,
  227. status_.hentai,
  228. status_.charm,
  229. status_.housi
  230. };
  231. foreach (int num2 in array)
  232. {
  233. if (csv.IsCellToExistData(cur_block.GetOriginalX(num++), line_y))
  234. {
  235. int cellAsInteger = csv.GetCellAsInteger(cur_block.GetOriginalX(num - 1), line_y);
  236. if (cellAsInteger > num2)
  237. {
  238. return false;
  239. }
  240. }
  241. }
  242. return true;
  243. };
  244. MaidProfile.CsvDataBlock csvDataBlock4 = new MaidProfile.CsvDataBlock(csv, 0);
  245. Func<MaidProfile.CsvDataBlock, int, bool> line_func10 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  246. {
  247. Personal.Data data = Personal.GetData(cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y));
  248. return status_.personal.id == data.id;
  249. };
  250. csvDataBlock4.BlockAnalysis(1, line_func10, success_call_back);
  251. csvDataBlock4.NextBlock();
  252. Func<MaidProfile.CsvDataBlock, int, bool> line_func11 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  253. {
  254. Contract cellAsInteger = (Contract)cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  255. return status_.contract == cellAsInteger;
  256. };
  257. csvDataBlock4.BlockAnalysis(1, line_func11, success_call_back);
  258. csvDataBlock4.NextBlock();
  259. if (!employment && status_.seikeiken == Seikeiken.No_No)
  260. {
  261. Func<MaidProfile.CsvDataBlock, int, bool> line_func12 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  262. {
  263. int num = int.MinValue;
  264. if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  265. {
  266. num = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  267. }
  268. bool flag = num <= status_.inyoku;
  269. if (flag)
  270. {
  271. status_.studyRate = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
  272. }
  273. return flag;
  274. };
  275. csvDataBlock4.BlockAnalysis(1, line_func12, success_call_back);
  276. }
  277. csvDataBlock4.NextBlock();
  278. if (employment && status_.seikeiken == Seikeiken.No_No)
  279. {
  280. csvDataBlock4.BlockAnalysis(1, line_func9, success_call_back);
  281. }
  282. csvDataBlock4.NextBlock();
  283. if (!employment && status_.seikeiken == Seikeiken.Yes_No)
  284. {
  285. Func<MaidProfile.CsvDataBlock, int, bool> line_func13 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  286. {
  287. int num = int.MinValue;
  288. if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  289. {
  290. num = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  291. }
  292. bool flag = num <= status_.sexPlayNumberOfPeople;
  293. if (flag)
  294. {
  295. status_.studyRate = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
  296. }
  297. return flag;
  298. };
  299. csvDataBlock4.BlockAnalysis(1, line_func13, success_call_back);
  300. }
  301. csvDataBlock4.NextBlock();
  302. if (employment && status_.seikeiken == Seikeiken.Yes_No)
  303. {
  304. csvDataBlock4.BlockAnalysis(1, line_func9, success_call_back);
  305. }
  306. csvDataBlock4.NextBlock();
  307. if (!employment && status_.seikeiken == Seikeiken.No_Yes)
  308. {
  309. Func<MaidProfile.CsvDataBlock, int, bool> line_func14 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  310. {
  311. int num = int.MinValue;
  312. if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  313. {
  314. num = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  315. }
  316. bool flag = num <= status_.sexPlayNumberOfPeople;
  317. if (flag)
  318. {
  319. status_.studyRate = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
  320. }
  321. return flag;
  322. };
  323. csvDataBlock4.BlockAnalysis(1, line_func14, success_call_back);
  324. }
  325. csvDataBlock4.NextBlock();
  326. if (employment && status_.seikeiken == Seikeiken.No_Yes)
  327. {
  328. csvDataBlock4.BlockAnalysis(1, line_func9, success_call_back);
  329. }
  330. csvDataBlock4.NextBlock();
  331. if (!employment && status_.seikeiken == Seikeiken.Yes_Yes)
  332. {
  333. Func<MaidProfile.CsvDataBlock, int, bool> line_func15 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  334. {
  335. int num = int.MinValue;
  336. if (csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  337. {
  338. num = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(1), line_y);
  339. }
  340. bool flag = num <= status_.sexPlayNumberOfPeople;
  341. if (flag)
  342. {
  343. status_.studyRate = cur_block.csv.GetCellAsInteger(cur_block.GetOriginalX(2), line_y);
  344. }
  345. return flag;
  346. };
  347. csvDataBlock4.BlockAnalysis(1, line_func15, success_call_back);
  348. }
  349. csvDataBlock4.NextBlock();
  350. if (employment && status_.seikeiken == Seikeiken.Yes_Yes)
  351. {
  352. csvDataBlock4.BlockAnalysis(1, line_func9, success_call_back);
  353. }
  354. }
  355. }
  356. }
  357. text = "profile_comment_5.nei";
  358. using (AFileBase afileBase5 = GameUty.FileSystem.FileOpen(text))
  359. {
  360. NDebug.Assert(afileBase5.IsValid(), "file open failed.\n" + text);
  361. using (CsvParser csv = new CsvParser())
  362. {
  363. if (!csv.Open(afileBase5))
  364. {
  365. NDebug.Assert("csv open failed.\n" + text, false);
  366. }
  367. int comment_no = 0;
  368. MaidProfile.CsvDataBlock csvDataBlock5 = new MaidProfile.CsvDataBlock(csv, 0);
  369. Func<MaidProfile.CsvDataBlock, int, int, bool> success_call_back2 = delegate(MaidProfile.CsvDataBlock succes_block, int x, int y)
  370. {
  371. profileText += succes_block.csv.GetCellAsString(succes_block.GetOriginalX(succes_block.max_x - 3 + comment_no), succes_block.GetOriginalY(y));
  372. return true;
  373. };
  374. Func<MaidProfile.CsvDataBlock, int, bool> line_func16 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  375. {
  376. string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
  377. int id = Propensity.GetData(cellAsString2).id;
  378. if (!status_.propensitys.ContainsKey(id))
  379. {
  380. return false;
  381. }
  382. string cellAsString3 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(2), line_y);
  383. if (cellAsString3 != null)
  384. {
  385. if (!(cellAsString3 == "処女"))
  386. {
  387. if (!(cellAsString3 == "前穴"))
  388. {
  389. if (!(cellAsString3 == "後穴"))
  390. {
  391. if (cellAsString3 == "両穴")
  392. {
  393. if (status_.seikeiken != Seikeiken.Yes_Yes)
  394. {
  395. return false;
  396. }
  397. }
  398. }
  399. else if (status_.seikeiken != Seikeiken.No_Yes)
  400. {
  401. return false;
  402. }
  403. }
  404. else if (status_.seikeiken != Seikeiken.Yes_No)
  405. {
  406. return false;
  407. }
  408. }
  409. else if (status_.seikeiken != Seikeiken.No_No)
  410. {
  411. return false;
  412. }
  413. }
  414. int[] array = new int[]
  415. {
  416. status_.inyoku,
  417. status_.mvalue,
  418. status_.hentai,
  419. status_.housi
  420. };
  421. int num = 3;
  422. foreach (int num2 in array)
  423. {
  424. if (csv.IsCellToExistData(cur_block.GetOriginalX(num++), line_y))
  425. {
  426. int cellAsInteger = csv.GetCellAsInteger(cur_block.GetOriginalX(num - 1), line_y);
  427. if (cellAsInteger > num2)
  428. {
  429. return false;
  430. }
  431. }
  432. }
  433. comment_no = 0;
  434. int cellAsInteger2 = csv.GetCellAsInteger(cur_block.GetOriginalX(num++), line_y);
  435. if (0 < cellAsInteger2)
  436. {
  437. if (cellAsInteger2 > status_.lovely && cellAsInteger2 > status_.elegance && cellAsInteger2 > status_.charm)
  438. {
  439. return false;
  440. }
  441. SortedList<int, string> sortedList = new SortedList<int, string>();
  442. sortedList.Add(status_.lovely, "可憐");
  443. if (!sortedList.ContainsKey(status_.elegance))
  444. {
  445. sortedList.Add(status_.elegance, "気品");
  446. }
  447. if (!sortedList.ContainsKey(status_.charm))
  448. {
  449. sortedList.Add(status_.charm, "魅惑");
  450. }
  451. int num3 = sortedList.Count - 1;
  452. int num4 = 0;
  453. foreach (KeyValuePair<int, string> keyValuePair in sortedList)
  454. {
  455. if (num3 == num4)
  456. {
  457. string value = keyValuePair.Value;
  458. if (value != null)
  459. {
  460. if (!(value == "気品"))
  461. {
  462. if (value == "魅惑")
  463. {
  464. comment_no = 2;
  465. }
  466. }
  467. else
  468. {
  469. comment_no = 1;
  470. }
  471. }
  472. break;
  473. }
  474. num4++;
  475. }
  476. }
  477. return true;
  478. };
  479. csvDataBlock5.BlockAnalysis(1, line_func16, success_call_back2);
  480. }
  481. }
  482. text = "profile_comment_6.nei";
  483. using (AFileBase afileBase6 = GameUty.FileSystem.FileOpen(text))
  484. {
  485. NDebug.Assert(afileBase6.IsValid(), "file open failed.\n" + text);
  486. using (CsvParser csvParser2 = new CsvParser())
  487. {
  488. if (!csvParser2.Open(afileBase6))
  489. {
  490. NDebug.Assert("csv open failed.\n" + text, false);
  491. }
  492. MaidProfile.CsvDataBlock csvDataBlock6 = new MaidProfile.CsvDataBlock(csvParser2, 0);
  493. csvDataBlock6.NextBlock();
  494. Func<MaidProfile.CsvDataBlock, int, bool> line_func17 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  495. {
  496. if (!cur_block.csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  497. {
  498. return true;
  499. }
  500. string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
  501. Feature.Data data = Feature.GetData(cellAsString2);
  502. return status_.features.ContainsKey(data.id);
  503. };
  504. csvDataBlock6.BlockAnalysis(1, line_func17, success_call_back);
  505. }
  506. }
  507. text = "profile_comment_7.nei";
  508. using (AFileBase afileBase7 = GameUty.FileSystem.FileOpen(text))
  509. {
  510. NDebug.Assert(afileBase7.IsValid(), "file open failed.\n" + text);
  511. using (CsvParser csvParser3 = new CsvParser())
  512. {
  513. if (!csvParser3.Open(afileBase7))
  514. {
  515. NDebug.Assert("csv open failed.\n" + text, false);
  516. }
  517. MaidProfile.CsvDataBlock csvDataBlock7 = new MaidProfile.CsvDataBlock(csvParser3, 0);
  518. csvDataBlock7.NextBlock();
  519. Func<MaidProfile.CsvDataBlock, int, bool> line_func18 = delegate(MaidProfile.CsvDataBlock cur_block, int line_y)
  520. {
  521. if (!cur_block.csv.IsCellToExistData(cur_block.GetOriginalX(1), line_y))
  522. {
  523. return true;
  524. }
  525. string cellAsString2 = cur_block.csv.GetCellAsString(cur_block.GetOriginalX(1), line_y);
  526. Feature.Data data = Feature.GetData(cellAsString2);
  527. return status_.features.ContainsKey(data.id);
  528. };
  529. csvDataBlock7.BlockAnalysis(1, line_func18, success_call_back);
  530. csvDataBlock7.NextBlock();
  531. csvDataBlock7.BlockAnalysis(1, line_func18, success_call_back);
  532. csvDataBlock7.NextBlock();
  533. csvDataBlock7.BlockAnalysis(1, line_func18, success_call_back);
  534. }
  535. }
  536. return profileText;
  537. }
  538. public static int UpdateInitPlayNumber(Maid maid)
  539. {
  540. Status status = maid.status;
  541. int result = 0;
  542. if (status.initSeikeiken != Seikeiken.No_No)
  543. {
  544. using (AFileBase afileBase = GameUty.FileSystem.FileOpen("init_keiken_num_setting.nei"))
  545. {
  546. int size = afileBase.GetSize();
  547. NDebug.Assert(afileBase.IsValid(), "file open failed.\ninit_keiken_num_setting.nei");
  548. using (CsvParser csvParser = new CsvParser())
  549. {
  550. if (!csvParser.Open(afileBase))
  551. {
  552. NDebug.Assert("csv open failed.\ninit_keiken_num_setting.nei", false);
  553. }
  554. for (int i = 2; i < csvParser.max_cell_y; i++)
  555. {
  556. if (!csvParser.IsCellToExistData(0, i))
  557. {
  558. break;
  559. }
  560. int num = 0;
  561. string cellAsString = csvParser.GetCellAsString(num++, i);
  562. Seikeiken seikeiken = Seikeiken.Yes_No;
  563. if (cellAsString == "前穴")
  564. {
  565. seikeiken = Seikeiken.Yes_No;
  566. }
  567. else if (cellAsString == "後穴")
  568. {
  569. seikeiken = Seikeiken.No_Yes;
  570. }
  571. else if (cellAsString == "両穴")
  572. {
  573. seikeiken = Seikeiken.Yes_Yes;
  574. }
  575. if (seikeiken == status.initSeikeiken)
  576. {
  577. int cellAsInteger = csvParser.GetCellAsInteger(num++, i);
  578. int cellAsInteger2 = csvParser.GetCellAsInteger(num++, i);
  579. int cellAsInteger3 = csvParser.GetCellAsInteger(num++, i);
  580. if (cellAsInteger2 <= status.inyoku && cellAsInteger3 <= status.hentai)
  581. {
  582. result = cellAsInteger;
  583. break;
  584. }
  585. }
  586. }
  587. }
  588. }
  589. }
  590. return result;
  591. }
  592. private const string FileNameProfileComment = "profile_comment";
  593. private class DataBlock
  594. {
  595. public int GetOriginalX(int x)
  596. {
  597. return this.rect.left + x;
  598. }
  599. public int GetOriginalY(int y)
  600. {
  601. return this.rect.top + y;
  602. }
  603. public int max_x
  604. {
  605. get
  606. {
  607. return this.rect.right - this.rect.left + 1;
  608. }
  609. }
  610. public int max_y
  611. {
  612. get
  613. {
  614. return this.rect.bottom - this.rect.top + 1;
  615. }
  616. }
  617. public PlaneRect<int> rect;
  618. }
  619. private class CsvDataBlock : MaidProfile.DataBlock
  620. {
  621. public CsvDataBlock(CsvParser check_csv, int check_start_y)
  622. {
  623. this.csv_ = check_csv;
  624. this.NextBlock(check_start_y);
  625. }
  626. public bool NextBlock(int check_start_y)
  627. {
  628. this.rect.left = 0;
  629. this.rect.bottom = this.csv_.max_cell_y - 1;
  630. for (int i = check_start_y; i < this.csv_.max_cell_y; i++)
  631. {
  632. if (this.csv_.IsCellToExistData(0, i))
  633. {
  634. this.rect.top = i;
  635. int j;
  636. for (j = 0; j < this.csv_.max_cell_x; j++)
  637. {
  638. if (!this.csv_.IsCellToExistData(j, i))
  639. {
  640. break;
  641. }
  642. }
  643. j--;
  644. this.rect.right = j;
  645. break;
  646. }
  647. }
  648. if (this.rect.right <= 0)
  649. {
  650. this.rect.left = (this.rect.right = (this.rect.top = (this.rect.bottom = 0)));
  651. return false;
  652. }
  653. for (int k = this.rect.top; k < this.csv_.max_cell_y; k++)
  654. {
  655. bool flag = false;
  656. for (int l = 0; l <= this.rect.right; l++)
  657. {
  658. if (this.csv_.IsCellToExistData(l, k))
  659. {
  660. flag = true;
  661. break;
  662. }
  663. }
  664. if (!flag)
  665. {
  666. this.rect.bottom = k - 1;
  667. break;
  668. }
  669. }
  670. for (int m = this.rect.left; m < this.csv_.max_cell_x; m++)
  671. {
  672. for (int n = this.rect.top; n <= this.rect.bottom; n++)
  673. {
  674. if (this.csv_.IsCellToExistData(m, n) && this.rect.right < m - 1)
  675. {
  676. this.rect.right = m - 1;
  677. }
  678. }
  679. }
  680. return true;
  681. }
  682. public void BlockAnalysis(int start_y, Func<MaidProfile.CsvDataBlock, int, bool> line_func, Func<MaidProfile.CsvDataBlock, int, int, bool> success_call_back)
  683. {
  684. for (int i = start_y; i < base.max_y; i++)
  685. {
  686. if (line_func(this, base.GetOriginalY(i)) && success_call_back(this, this.rect.left, i))
  687. {
  688. return;
  689. }
  690. }
  691. }
  692. public bool NextBlock()
  693. {
  694. return this.NextBlock(base.GetOriginalY(base.max_y));
  695. }
  696. public CsvParser csv
  697. {
  698. get
  699. {
  700. return this.csv_;
  701. }
  702. }
  703. private CsvParser csv_;
  704. }
  705. }
  706. }