MaidProfile.cs 25 KB

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