Skill.cs 73 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365
  1. using System;
  2. using System.Collections.Generic;
  3. using MaidStatus;
  4. using MaidStatus.Old;
  5. using UnityEngine;
  6. using wf;
  7. namespace Yotogis
  8. {
  9. public static class Skill
  10. {
  11. public static void CreateData()
  12. {
  13. if (Skill.skill_data_id_list_ != null)
  14. {
  15. return;
  16. }
  17. Skill.enabledSkillIds = new HashSet<int>();
  18. CsvCommonIdManager.ReadEnabledIdList(CsvCommonIdManager.FileSystemType.Normal, true, "yotogi_skill_enabled_list", ref Skill.enabledSkillIds);
  19. Dictionary<int, int[]> dictionary = new Dictionary<int, int[]>();
  20. using (AFileBase afileBase = GameUty.FileSystem.FileOpen("yotogi_skill_command_data.nei"))
  21. {
  22. using (CsvParser csvParser = new CsvParser())
  23. {
  24. bool condition = csvParser.Open(afileBase);
  25. NDebug.Assert(condition, "yotogi_skill_command_data.nei\nopen failed.");
  26. for (int i = 0; i < csvParser.max_cell_y; i++)
  27. {
  28. if (csvParser.IsCellToExistData(0, i))
  29. {
  30. NDebug.Assert(csvParser.IsCellToExistData(0, i + 1), "[2.1]yotogi_skill_command_data.nei\n" + csvParser.GetCellAsString(0, i) + "のスキルID設定がありません");
  31. int cellAsInteger = csvParser.GetCellAsInteger(0, i + 1);
  32. if (Skill.enabledSkillIds.Contains(cellAsInteger))
  33. {
  34. NDebug.Assert(!dictionary.ContainsKey(cellAsInteger), "コマンド設定\n" + cellAsInteger + "のスキルID設定が重複しています");
  35. Dictionary<int, int[]> dictionary2 = dictionary;
  36. int key = cellAsInteger;
  37. int[] array = new int[2];
  38. array[0] = i;
  39. dictionary2.Add(key, array);
  40. }
  41. i++;
  42. }
  43. }
  44. }
  45. }
  46. using (AFileBase afileBase2 = GameUty.FileSystem.FileOpen("yotogi_skill_command_status.nei"))
  47. {
  48. using (CsvParser csvParser2 = new CsvParser())
  49. {
  50. bool condition2 = csvParser2.Open(afileBase2);
  51. NDebug.Assert(condition2, "yotogi_skill_command_status.nei\nopen failed.");
  52. string str = string.Empty;
  53. for (int j = 0; j < csvParser2.max_cell_y; j++)
  54. {
  55. if (csvParser2.IsCellToExistData(0, j))
  56. {
  57. NDebug.Assert(csvParser2.IsCellToExistData(0, j + 1), "[2.1]yotogi_skill_command_status.nei\n" + csvParser2.GetCellAsString(0, j) + "のスキルID設定がありません");
  58. if (Skill.enabledSkillIds.Contains(csvParser2.GetCellAsInteger(0, j + 1)))
  59. {
  60. int cellAsInteger2 = csvParser2.GetCellAsInteger(0, j + 1);
  61. str = csvParser2.GetCellAsString(0, j);
  62. NDebug.Assert(dictionary.ContainsKey(cellAsInteger2), str + "の情報は見つかりませんでした");
  63. dictionary[cellAsInteger2][1] = j;
  64. }
  65. j++;
  66. }
  67. }
  68. }
  69. }
  70. Skill.skill_data_id_list_ = new SortedDictionary<int, Skill.Data>[8];
  71. for (int k = 0; k < Skill.skill_data_id_list_.Length; k++)
  72. {
  73. Skill.skill_data_id_list_[k] = new SortedDictionary<int, Skill.Data>();
  74. }
  75. HashSet<int> hashSet = new HashSet<int>();
  76. using (AFileBase afileBase3 = GameUty.FileSystem.FileOpen("yotogi_skill_acquisition.nei"))
  77. {
  78. using (CsvParser csvParser3 = new CsvParser())
  79. {
  80. bool condition3 = csvParser3.Open(afileBase3);
  81. NDebug.Assert(condition3, "yotogi_skill_acquisition.nei\nopen failed.");
  82. using (AFileBase afileBase4 = GameUty.FileSystem.FileOpen("yotogi_skill_list.nei"))
  83. {
  84. using (CsvParser csvParser4 = new CsvParser())
  85. {
  86. condition3 = csvParser4.Open(afileBase4);
  87. NDebug.Assert(condition3, "yotogi_skill_list.nei\nopen failed.");
  88. for (int l = 1; l < csvParser4.max_cell_y; l++)
  89. {
  90. if (Skill.enabledSkillIds.Contains(csvParser4.GetCellAsInteger(0, l)))
  91. {
  92. Skill.Data data = new Skill.Data(csvParser4, csvParser3, l, dictionary);
  93. if (!hashSet.Add(data.id))
  94. {
  95. NDebug.Assert("夜伽スキルID[" + data.id.ToString() + "]はすでに登録されています", false);
  96. }
  97. else
  98. {
  99. Skill.skill_data_id_list_[(int)data.category].Add(data.id, data);
  100. }
  101. }
  102. }
  103. }
  104. }
  105. }
  106. }
  107. Skill.Old.CreateData();
  108. foreach (SortedDictionary<int, Skill.Data> sortedDictionary in Skill.skill_data_id_list_)
  109. {
  110. foreach (KeyValuePair<int, Skill.Data> keyValuePair in sortedDictionary)
  111. {
  112. Skill.Data value = keyValuePair.Value;
  113. Skill.Old.Data data2 = Skill.Old.Get(value.id);
  114. if (data2 != null)
  115. {
  116. value.SetOldSkillData(data2);
  117. data2.SetNewSkillData(value);
  118. }
  119. if (0 <= value.connect_faint_skill_id)
  120. {
  121. value.SetConnectFaintSkill(Skill.Get(value.connect_faint_skill_id));
  122. }
  123. }
  124. }
  125. }
  126. public static bool Contains(int id)
  127. {
  128. foreach (SortedDictionary<int, Skill.Data> sortedDictionary in Skill.skill_data_id_list_)
  129. {
  130. if (sortedDictionary.ContainsKey(id))
  131. {
  132. return true;
  133. }
  134. }
  135. return false;
  136. }
  137. public static Skill.Data Get(int id)
  138. {
  139. foreach (SortedDictionary<int, Skill.Data> sortedDictionary in Skill.skill_data_id_list_)
  140. {
  141. if (sortedDictionary.ContainsKey(id))
  142. {
  143. return sortedDictionary[id];
  144. }
  145. }
  146. return null;
  147. }
  148. public static List<Skill.Data> GetLearnPossibleSkills(MaidStatus.Status status)
  149. {
  150. List<Skill.Data> list = new List<Skill.Data>();
  151. ReadOnlySortedDictionary<int, YotogiSkillData> datas = status.yotogiSkill.datas;
  152. for (int i = 0; i < Skill.skill_data_id_list_.Length; i++)
  153. {
  154. foreach (KeyValuePair<int, Skill.Data> keyValuePair in Skill.skill_data_id_list_[i])
  155. {
  156. if (!datas.ContainsKey(keyValuePair.Key) && keyValuePair.Value.IsCheckGetSkill(status, false))
  157. {
  158. list.Add(keyValuePair.Value);
  159. }
  160. }
  161. }
  162. return list;
  163. }
  164. public static SortedDictionary<int, Skill.Data> GetCategorySkillDataList(Yotogi.Category category)
  165. {
  166. return Skill.skill_data_id_list_[(int)category];
  167. }
  168. public static SortedDictionary<int, Skill.Data>[] skill_data_list
  169. {
  170. get
  171. {
  172. return Skill.skill_data_id_list_;
  173. }
  174. }
  175. private static HashSet<int> enabledSkillIds;
  176. private static SortedDictionary<int, Skill.Data>[] skill_data_id_list_;
  177. public static class Old
  178. {
  179. public static int ConvertId(int id)
  180. {
  181. if (id != 12700)
  182. {
  183. if (id != 12710)
  184. {
  185. if (id != 12720)
  186. {
  187. if (id != 12730)
  188. {
  189. if (id != 12740)
  190. {
  191. if (id != 12750)
  192. {
  193. if (id == 12760)
  194. {
  195. id = 12795;
  196. }
  197. }
  198. else
  199. {
  200. id = 12790;
  201. }
  202. }
  203. else
  204. {
  205. id = 12785;
  206. }
  207. }
  208. else
  209. {
  210. id = 12780;
  211. }
  212. }
  213. else
  214. {
  215. id = 12775;
  216. }
  217. }
  218. else
  219. {
  220. id = 12770;
  221. }
  222. }
  223. else
  224. {
  225. id = 12765;
  226. }
  227. return id;
  228. }
  229. public static void CreateData()
  230. {
  231. if (Skill.Old.skill_data_id_list_ != null)
  232. {
  233. return;
  234. }
  235. AFileSystemBase fileSystem = GameUty.FileSystemOld;
  236. List<string> pathListOld = GameUty.PathListOld;
  237. if (!GameUty.IsEnabledCompatibilityMode)
  238. {
  239. Skill.Old.skill_data_id_list_ = new SortedDictionary<int, Skill.Old.Data>[0];
  240. return;
  241. }
  242. HashSet<int> enabled_id_list = new HashSet<int>();
  243. Action<string> action = delegate(string file_name)
  244. {
  245. file_name += ".nei";
  246. if (!fileSystem.IsExistentFile(file_name))
  247. {
  248. return;
  249. }
  250. using (AFileBase afileBase5 = fileSystem.FileOpen(file_name))
  251. {
  252. using (CsvParser csvParser5 = new CsvParser())
  253. {
  254. bool condition4 = csvParser5.Open(afileBase5);
  255. NDebug.Assert(condition4, file_name + "\nopen failed.");
  256. for (int num2 = 1; num2 < csvParser5.max_cell_y; num2++)
  257. {
  258. if (csvParser5.IsCellToExistData(0, num2))
  259. {
  260. int item = Skill.Old.ConvertId(csvParser5.GetCellAsInteger(0, num2));
  261. if (!enabled_id_list.Contains(item))
  262. {
  263. enabled_id_list.Add(item);
  264. }
  265. }
  266. }
  267. }
  268. }
  269. };
  270. action("yotogi_skil_list");
  271. for (int i = 0; i < pathListOld.Count; i++)
  272. {
  273. action("yotogi_skil_list_" + pathListOld[i]);
  274. }
  275. Dictionary<int, int[]> dictionary = new Dictionary<int, int[]>();
  276. using (AFileBase afileBase = fileSystem.FileOpen("yotogi_skil_command_data.nei"))
  277. {
  278. using (CsvParser csvParser = new CsvParser())
  279. {
  280. bool condition = csvParser.Open(afileBase);
  281. NDebug.Assert(condition, "yotogi_skil_command_data.nei\nopen failed.");
  282. for (int j = 0; j < csvParser.max_cell_y; j++)
  283. {
  284. if (csvParser.IsCellToExistData(0, j))
  285. {
  286. NDebug.Assert(csvParser.IsCellToExistData(0, j + 1), "[2.0]yotogi_skil_command_data.nei\n" + csvParser.GetCellAsString(0, j) + "のスキルID設定がありません");
  287. int num = Skill.Old.ConvertId(csvParser.GetCellAsInteger(0, j + 1));
  288. if (enabled_id_list.Contains(num))
  289. {
  290. NDebug.Assert(!dictionary.ContainsKey(num), "コマンド設定\n" + num + "のスキルID設定が重複しています");
  291. Dictionary<int, int[]> dictionary2 = dictionary;
  292. int key = num;
  293. int[] array = new int[2];
  294. array[0] = j;
  295. dictionary2.Add(key, array);
  296. }
  297. j++;
  298. }
  299. }
  300. }
  301. }
  302. using (AFileBase afileBase2 = fileSystem.FileOpen("yotogi_skil_command_status.nei"))
  303. {
  304. using (CsvParser csvParser2 = new CsvParser())
  305. {
  306. bool condition2 = csvParser2.Open(afileBase2);
  307. NDebug.Assert(condition2, "yotogi_skil_command_status.nei\nopen failed.");
  308. string str = string.Empty;
  309. for (int k = 0; k < csvParser2.max_cell_y; k++)
  310. {
  311. if (csvParser2.IsCellToExistData(0, k))
  312. {
  313. NDebug.Assert(csvParser2.IsCellToExistData(0, k + 1), "[2.0]yotogi_skil_command_status.nei\n" + csvParser2.GetCellAsString(0, k) + "のスキルID設定がありません");
  314. if (enabled_id_list.Contains(Skill.Old.ConvertId(csvParser2.GetCellAsInteger(0, k + 1))))
  315. {
  316. int key2 = Skill.Old.ConvertId(csvParser2.GetCellAsInteger(0, k + 1));
  317. str = csvParser2.GetCellAsString(0, k);
  318. NDebug.Assert(dictionary.ContainsKey(key2), str + "の情報は見つかりませんでした");
  319. dictionary[key2][1] = k;
  320. }
  321. k++;
  322. }
  323. }
  324. }
  325. }
  326. Skill.Old.skill_data_id_list_ = new SortedDictionary<int, Skill.Old.Data>[9];
  327. for (int l = 0; l < Skill.Old.skill_data_id_list_.Length; l++)
  328. {
  329. Skill.Old.skill_data_id_list_[l] = new SortedDictionary<int, Skill.Old.Data>();
  330. }
  331. HashSet<int> hashSet = new HashSet<int>();
  332. using (AFileBase afileBase3 = fileSystem.FileOpen("yotogi_skil_acquisition.nei"))
  333. {
  334. using (CsvParser csvParser3 = new CsvParser())
  335. {
  336. bool condition3 = csvParser3.Open(afileBase3);
  337. NDebug.Assert(condition3, "yotogi_skil_acquisition.nei\nopen failed.");
  338. using (AFileBase afileBase4 = fileSystem.FileOpen("yotogi_skil_detail.nei"))
  339. {
  340. using (CsvParser csvParser4 = new CsvParser())
  341. {
  342. condition3 = csvParser4.Open(afileBase4);
  343. NDebug.Assert(condition3, "yotogi_skil_detail.nei\nopen failed.");
  344. for (int m = 1; m < csvParser4.max_cell_y; m++)
  345. {
  346. if (enabled_id_list.Contains(Skill.Old.ConvertId(csvParser4.GetCellAsInteger(0, m))))
  347. {
  348. Skill.Old.Data data = new Skill.Old.Data(csvParser4, csvParser3, m, dictionary);
  349. if (!hashSet.Add(data.id))
  350. {
  351. NDebug.Assert("夜伽スキルID[" + data.id.ToString() + "]はすでに登録されています", false);
  352. }
  353. else
  354. {
  355. Skill.Old.skill_data_id_list_[(int)data.category].Add(data.id, data);
  356. }
  357. }
  358. }
  359. }
  360. }
  361. }
  362. }
  363. Dictionary<YotogiOld.Stage, string> enabled_stage_dic = new Dictionary<YotogiOld.Stage, string>();
  364. Action<string> action2 = delegate(string file_name)
  365. {
  366. file_name += ".nei";
  367. if (!fileSystem.IsExistentFile(file_name))
  368. {
  369. return;
  370. }
  371. using (AFileBase afileBase5 = fileSystem.FileOpen(file_name))
  372. {
  373. using (CsvParser csvParser5 = new CsvParser())
  374. {
  375. bool condition4 = csvParser5.Open(afileBase5);
  376. NDebug.Assert(condition4, file_name + "\nopen failed.");
  377. for (int num2 = 1; num2 < csvParser5.max_cell_y; num2++)
  378. {
  379. if (csvParser5.IsCellToExistData(0, num2))
  380. {
  381. string cellAsString = csvParser5.GetCellAsString(0, num2);
  382. string cellAsString2 = csvParser5.GetCellAsString(1, num2);
  383. YotogiOld.Stage stage = YotogiOld.Stage.MAX;
  384. try
  385. {
  386. stage = (YotogiOld.Stage)Enum.Parse(typeof(YotogiOld.Stage), cellAsString);
  387. }
  388. catch
  389. {
  390. NDebug.Assert(cellAsString + " enum error", false);
  391. }
  392. if (stage != YotogiOld.Stage.MAX && !enabled_stage_dic.ContainsKey(stage))
  393. {
  394. enabled_stage_dic.Add(stage, cellAsString2);
  395. }
  396. }
  397. }
  398. }
  399. }
  400. };
  401. action2("yotogi_stage_list");
  402. for (int n = 0; n < pathListOld.Count; n++)
  403. {
  404. action2("yotogi_stage_list_" + pathListOld[n]);
  405. }
  406. }
  407. public static bool Contains(int id)
  408. {
  409. foreach (SortedDictionary<int, Skill.Old.Data> sortedDictionary in Skill.Old.skill_data_id_list_)
  410. {
  411. if (sortedDictionary.ContainsKey(id))
  412. {
  413. return true;
  414. }
  415. }
  416. return false;
  417. }
  418. public static Skill.Old.Data Get(int id)
  419. {
  420. foreach (SortedDictionary<int, Skill.Old.Data> sortedDictionary in Skill.Old.skill_data_id_list_)
  421. {
  422. if (sortedDictionary.ContainsKey(id))
  423. {
  424. return sortedDictionary[id];
  425. }
  426. }
  427. return null;
  428. }
  429. public static List<Skill.Old.Data> GetLearnPossibleSkills(MaidStatus.Status status)
  430. {
  431. List<Skill.Old.Data> list = new List<Skill.Old.Data>();
  432. ReadOnlySortedDictionary<int, YotogiSkillData> oldDatas = status.yotogiSkill.oldDatas;
  433. for (int i = 0; i < Skill.Old.skill_data_id_list_.Length; i++)
  434. {
  435. foreach (KeyValuePair<int, Skill.Old.Data> keyValuePair in Skill.Old.skill_data_id_list_[i])
  436. {
  437. if (!oldDatas.ContainsKey(keyValuePair.Key) && keyValuePair.Value.IsCheckGetSkill(status, false))
  438. {
  439. list.Add(keyValuePair.Value);
  440. }
  441. }
  442. }
  443. return list;
  444. }
  445. public static SortedDictionary<int, Skill.Old.Data> GetCategorySkillDataList(YotogiOld.Category category)
  446. {
  447. return Skill.Old.skill_data_id_list_[(int)category];
  448. }
  449. public static SortedDictionary<int, Skill.Old.Data>[] skill_data_list
  450. {
  451. get
  452. {
  453. return Skill.Old.skill_data_id_list_;
  454. }
  455. }
  456. private static SortedDictionary<int, Skill.Old.Data>[] skill_data_id_list_;
  457. public class Data
  458. {
  459. public Data(CsvParser csv, CsvParser csv_acq, int y, Dictionary<int, int[]> command_data_cell_dic)
  460. {
  461. int num = 0;
  462. int cellAsInteger = csv.GetCellAsInteger(num++, y);
  463. this.id = Skill.Old.ConvertId(cellAsInteger);
  464. num++;
  465. string cellAsString = csv.GetCellAsString(num++, y);
  466. try
  467. {
  468. this.category = (YotogiOld.Category)Enum.Parse(typeof(YotogiOld.Category), cellAsString);
  469. }
  470. catch (ArgumentException)
  471. {
  472. NDebug.Assert("Yotogi.Category\nenum parse error.[" + cellAsString + "]", false);
  473. }
  474. this.name = csv.GetCellAsString(num++, y);
  475. this.icon_file_name = csv.GetCellAsString(num++, y);
  476. this.start_call_file = csv.GetCellAsString(num++, y);
  477. if (!string.IsNullOrEmpty(this.start_call_file))
  478. {
  479. this.start_call_file += ".ks";
  480. }
  481. this.start_call_file2 = csv.GetCellAsString(num++, y);
  482. if (!string.IsNullOrEmpty(this.start_call_file2))
  483. {
  484. this.start_call_file2 += ".ks";
  485. }
  486. this.exec_need_hp = csv.GetCellAsInteger(num++, y);
  487. this.add_yotogi_class_exp = csv.GetCellAsInteger(num++, y);
  488. int cellAsInteger2 = csv.GetCellAsInteger(num++, y);
  489. int cellAsInteger3 = csv.GetCellAsInteger(num++, y);
  490. this.skill_exp_table = new int[3];
  491. this.skill_exp_table[1] = cellAsInteger2;
  492. this.skill_exp_table[2] = cellAsInteger3;
  493. cellAsString = csv.GetCellAsString(num++, y);
  494. if (string.IsNullOrEmpty(cellAsString) || cellAsString == "×")
  495. {
  496. this.ban_id_array = null;
  497. }
  498. else if (cellAsString == "○")
  499. {
  500. this.ban_id_array = new int[1];
  501. this.ban_id_array[0] = this.id;
  502. }
  503. else
  504. {
  505. string[] array = cellAsString.Split(new char[]
  506. {
  507. ','
  508. });
  509. this.ban_id_array = new int[array.Length];
  510. for (int i = 0; i < this.ban_id_array.Length; i++)
  511. {
  512. this.ban_id_array[i] = int.Parse(array[i]);
  513. }
  514. }
  515. this.player_num = csv.GetCellAsInteger(num++, y);
  516. if (this.player_num <= 0)
  517. {
  518. this.player_num = 1;
  519. }
  520. this.exec_seikeiken = new Dictionary<Seikeiken, bool>();
  521. Seikeiken[] array2 = new Seikeiken[]
  522. {
  523. Seikeiken.No_No,
  524. Seikeiken.Yes_No,
  525. Seikeiken.No_Yes,
  526. Seikeiken.Yes_Yes
  527. };
  528. for (int j = 0; j < array2.Length; j++)
  529. {
  530. if (csv.GetCellAsString(num++, y) == "○")
  531. {
  532. this.exec_seikeiken.Add(array2[j], true);
  533. }
  534. }
  535. for (int k = 0; k < 5; k++)
  536. {
  537. num++;
  538. }
  539. this.drunk_skill = (csv.GetCellAsString(num++, y) == "○");
  540. this.osioki_skill = (csv.GetCellAsString(num++, y) == "○");
  541. this.propensity_type = null;
  542. string cellAsString2 = csv.GetCellAsString(num++, y);
  543. if (!string.IsNullOrEmpty(cellAsString2))
  544. {
  545. this.propensity_type = Propensity.GetData(cellAsString2);
  546. }
  547. this.exec_stage = new Dictionary<YotogiOld.Stage, bool>();
  548. while (csv.max_cell_x > num)
  549. {
  550. string cellAsString3 = csv.GetCellAsString(num, 0);
  551. string cellAsString4 = csv.GetCellAsString(num++, y);
  552. if (string.IsNullOrEmpty(cellAsString3))
  553. {
  554. IL_3C3:
  555. NDebug.Assert(command_data_cell_dic.ContainsKey(this.id), this.name + "の情報は見つかりませんでした");
  556. int[] array3 = command_data_cell_dic[this.id];
  557. this.command_basic_cell_y = array3[0];
  558. this.command_status_cell_y = array3[1];
  559. num = 0;
  560. int num2 = Skill.Old.ConvertId(csv_acq.GetCellAsInteger(num++, y));
  561. num++;
  562. NDebug.Assert(num2 == this.id, "スキル取得条件とスキル詳細のIDラインが一致していません");
  563. this.getcondition_data = new Skill.Old.Data.GetConditionData();
  564. this.getcondition_data.seikeiken = new bool[4];
  565. for (int l = 0; l < this.getcondition_data.seikeiken.Length; l++)
  566. {
  567. this.getcondition_data.seikeiken[l] = (csv_acq.GetCellAsString(num++, y) == "○");
  568. }
  569. this.getcondition_data.inyoku = csv_acq.GetCellAsInteger(num++, y);
  570. this.getcondition_data.m_value = csv_acq.GetCellAsInteger(num++, y);
  571. this.getcondition_data.hentai = csv_acq.GetCellAsInteger(num++, y);
  572. this.getcondition_data.housi = csv_acq.GetCellAsInteger(num++, y);
  573. this.getcondition_data.lovely = csv_acq.GetCellAsInteger(num++, y);
  574. this.getcondition_data.elegance = csv_acq.GetCellAsInteger(num++, y);
  575. this.getcondition_data.charm = csv_acq.GetCellAsInteger(num++, y);
  576. num += 2;
  577. if (csv_acq.IsCellToExistData(num, y) && csv_acq.IsCellToExistData(1, y))
  578. {
  579. this.getcondition_data.yotogi_class = ((cellAsInteger != this.id) ? YotogiClass.GetData(csv_acq.GetCellAsString(num++, y) + "_old") : YotogiClass.GetData(csv_acq.GetCellAsString(num++, y)));
  580. this.getcondition_data.yotogi_class_level = csv_acq.GetCellAsInteger(num++, y);
  581. }
  582. else
  583. {
  584. num += 2;
  585. }
  586. this.getcondition_data.marriage = (csv_acq.GetCellAsString(num++, y) == "○");
  587. this.getcondition_data.requestPersonals = new MaidStatus.Old.Personal[0];
  588. string cellAsString5 = csv_acq.GetCellAsString(num++, y);
  589. if (!string.IsNullOrEmpty(cellAsString5))
  590. {
  591. string[] array4 = cellAsString5.Split(new char[]
  592. {
  593. ','
  594. });
  595. List<MaidStatus.Old.Personal> list = new List<MaidStatus.Old.Personal>();
  596. foreach (string text in array4)
  597. {
  598. try
  599. {
  600. MaidStatus.Old.Personal item = (MaidStatus.Old.Personal)Enum.Parse(typeof(MaidStatus.Old.Personal), text);
  601. list.Add(item);
  602. }
  603. catch (Exception)
  604. {
  605. Debug.LogWarning("Yotogi.SkillData::token_textのenum変換に失敗しました:" + text);
  606. }
  607. }
  608. if (0 < list.Count)
  609. {
  610. this.getcondition_data.requestPersonals = list.ToArray();
  611. }
  612. }
  613. return;
  614. }
  615. if (cellAsString4 == "○")
  616. {
  617. YotogiOld.Stage key = YotogiOld.Stage.サロン;
  618. try
  619. {
  620. key = (YotogiOld.Stage)Enum.Parse(typeof(YotogiOld.Stage), cellAsString3);
  621. }
  622. catch
  623. {
  624. NDebug.Assert("Yotogi.Stage - enum parse error.[" + cellAsString3 + "]", false);
  625. }
  626. this.exec_stage.Add(key, true);
  627. }
  628. }
  629. goto IL_3C3;
  630. }
  631. public void SetNewSkillData(Skill.Data data)
  632. {
  633. this.newData = data;
  634. }
  635. public bool IsExecMaid(MaidStatus.Status maid_status)
  636. {
  637. if (!this.IsExecRelation(maid_status.relation) || !this.IsExecSeikeiken(maid_status.seikeiken))
  638. {
  639. return false;
  640. }
  641. if (this.drunk_skill)
  642. {
  643. if (maid_status.OldStatus.condition != Condition.Drunk)
  644. {
  645. return false;
  646. }
  647. }
  648. else if (this.osioki_skill)
  649. {
  650. if (maid_status.OldStatus.condition != Condition.Osioki)
  651. {
  652. return false;
  653. }
  654. }
  655. else
  656. {
  657. if (maid_status.OldStatus.condition != Condition.Null)
  658. {
  659. return false;
  660. }
  661. if (0 < this.getcondition_data.yotogi_class_level && !YotogiClass.IsEnabled(this.getcondition_data.yotogi_class.id))
  662. {
  663. return false;
  664. }
  665. }
  666. return true;
  667. }
  668. public bool IsExecMaidForFreeMode(MaidStatus.Status maid_status)
  669. {
  670. return this.IsExecRelation(maid_status.relation) && this.IsExecSeikeiken(maid_status.seikeiken) && (0 >= this.getcondition_data.yotogi_class_level || YotogiClass.IsEnabled(this.getcondition_data.yotogi_class.id));
  671. }
  672. public bool IsExecRelation(MaidStatus.Relation check_condition)
  673. {
  674. return true;
  675. }
  676. public bool IsExecSeikeiken(Seikeiken check_seikeiken)
  677. {
  678. return this.exec_seikeiken.ContainsKey(check_seikeiken);
  679. }
  680. public bool IsExecPersonal(MaidStatus.Old.Personal personal)
  681. {
  682. if (this.getcondition_data.requestPersonals.Length == 0)
  683. {
  684. return true;
  685. }
  686. foreach (MaidStatus.Old.Personal personal2 in this.getcondition_data.requestPersonals)
  687. {
  688. if (personal2 == personal)
  689. {
  690. return true;
  691. }
  692. }
  693. return false;
  694. }
  695. public bool IsCheckGetSkill(MaidStatus.Status status, bool is_seikeiken_check)
  696. {
  697. if (is_seikeiken_check && !this.getcondition_data.seikeiken[(int)status.seikeiken])
  698. {
  699. return false;
  700. }
  701. if (this.getcondition_data.marriage && (status.OldStatus == null || !status.OldStatus.isMarriage))
  702. {
  703. return false;
  704. }
  705. if (status.inyoku < this.getcondition_data.inyoku)
  706. {
  707. return false;
  708. }
  709. if (status.mvalue < this.getcondition_data.m_value)
  710. {
  711. return false;
  712. }
  713. if (status.hentai < this.getcondition_data.hentai)
  714. {
  715. return false;
  716. }
  717. if (status.housi < this.getcondition_data.housi)
  718. {
  719. return false;
  720. }
  721. if (status.lovely < this.getcondition_data.lovely)
  722. {
  723. return false;
  724. }
  725. if (status.elegance < this.getcondition_data.elegance)
  726. {
  727. return false;
  728. }
  729. if (status.charm < this.getcondition_data.charm)
  730. {
  731. return false;
  732. }
  733. if (this.getcondition_data.requestPersonals.Length != 0)
  734. {
  735. bool flag = false;
  736. foreach (MaidStatus.Old.Personal personal in this.getcondition_data.requestPersonals)
  737. {
  738. flag |= (personal.ToString() == status.personal.uniqueName);
  739. }
  740. if (!flag)
  741. {
  742. return false;
  743. }
  744. }
  745. if (0 < this.getcondition_data.yotogi_class_level)
  746. {
  747. if (!status.yotogiClass.Contains(this.getcondition_data.yotogi_class.id))
  748. {
  749. return false;
  750. }
  751. ClassData<YotogiClass.Data> classData = status.yotogiClass.Get(this.getcondition_data.yotogi_class.id);
  752. if (classData.level < this.getcondition_data.yotogi_class_level)
  753. {
  754. return false;
  755. }
  756. }
  757. return true;
  758. }
  759. public bool IsExecStage(YotogiOld.Stage check_stage)
  760. {
  761. return this.exec_stage.ContainsKey(check_stage);
  762. }
  763. public Skill.Old.Data.Command command
  764. {
  765. get
  766. {
  767. if (this.command_ != null)
  768. {
  769. return this.command_;
  770. }
  771. using (AFileBase afileBase = GameUty.FileSystemOld.FileOpen("yotogi_skil_command_data.nei"))
  772. {
  773. using (CsvParser csvParser = new CsvParser())
  774. {
  775. csvParser.Open(afileBase);
  776. using (AFileBase afileBase2 = GameUty.FileSystemOld.FileOpen("yotogi_skil_command_status.nei"))
  777. {
  778. using (CsvParser csvParser2 = new CsvParser())
  779. {
  780. csvParser2.Open(afileBase2);
  781. this.command_ = new Skill.Old.Data.Command(this, csvParser, csvParser2);
  782. }
  783. }
  784. }
  785. }
  786. return this.command_;
  787. }
  788. }
  789. public Skill.Data newData { get; private set; }
  790. public bool isShareSkill
  791. {
  792. get
  793. {
  794. return this.newData != null;
  795. }
  796. }
  797. public readonly YotogiOld.Category category;
  798. public readonly int id;
  799. public readonly string name;
  800. public readonly string icon_file_name;
  801. public readonly string start_call_file;
  802. public readonly string start_call_file2;
  803. public readonly int exec_need_hp;
  804. public readonly int add_yotogi_class_exp;
  805. public readonly Propensity.Data propensity_type;
  806. public readonly int[] skill_exp_table;
  807. public readonly int[] ban_id_array;
  808. public readonly Dictionary<Seikeiken, bool> exec_seikeiken;
  809. public readonly Dictionary<YotogiOld.Stage, bool> exec_stage;
  810. public readonly bool drunk_skill;
  811. public readonly bool osioki_skill;
  812. public readonly int player_num;
  813. public readonly int command_basic_cell_x;
  814. public readonly int command_basic_cell_y;
  815. public readonly int command_status_cell_x;
  816. public readonly int command_status_cell_y;
  817. public readonly Skill.Old.Data.GetConditionData getcondition_data;
  818. private Skill.Old.Data.Command command_;
  819. public class Command
  820. {
  821. public Command(Skill.Old.Data parent_skill, CsvParser setting_csv, CsvParser status_csv)
  822. {
  823. this.skill = parent_skill;
  824. int num = this.skill.command_basic_cell_x + 1;
  825. int num2 = this.skill.command_basic_cell_y + 1;
  826. int num3 = 0;
  827. while (setting_csv.IsCellToExistData(num + 1, num2 + num3))
  828. {
  829. num3++;
  830. }
  831. NDebug.Assert(0 < num3, setting_csv.GetCellAsString(num - 1, num2 - 1) + "のコマンド設定は不正です");
  832. this.data = new Skill.Old.Data.Command.Data[num3];
  833. for (int i = 0; i < this.data.Length; i++)
  834. {
  835. this.data[i] = new Skill.Old.Data.Command.Data(this.skill, setting_csv, status_csv, i + 1);
  836. }
  837. }
  838. public readonly Skill.Old.Data skill;
  839. public readonly Skill.Old.Data.Command.Data[] data;
  840. public class Data
  841. {
  842. public Data(Skill.Old.Data parent_skill, CsvParser setting_csv, CsvParser status_csv, int no)
  843. {
  844. this.basic = new Skill.Old.Data.Command.Data.Basic(parent_skill, setting_csv, parent_skill.command_basic_cell_x + 1, parent_skill.command_basic_cell_y + no);
  845. this.status = new Skill.Old.Data.Command.Data.Status(this.basic, status_csv, parent_skill.command_status_cell_x + 1, parent_skill.command_status_cell_y + no);
  846. }
  847. public bool EvalExpression()
  848. {
  849. if (string.IsNullOrEmpty(this.basic.expression))
  850. {
  851. return true;
  852. }
  853. bool result = false;
  854. using (TJSVariant tjsvariant = new TJSVariant())
  855. {
  856. GameMain.Instance.ScriptMgr.EvalScript(this.basic.expression, tjsvariant);
  857. result = tjsvariant.AsBool();
  858. }
  859. return result;
  860. }
  861. public readonly Skill.Old.Data.Command.Data.Basic basic;
  862. public readonly Skill.Old.Data.Command.Data.Status status;
  863. public class Basic
  864. {
  865. public Basic(Skill.Old.Data parent_skill, CsvParser setting_csv, int cell_x, int cell_y)
  866. {
  867. this.skill_id = parent_skill.id;
  868. this.id = cell_y;
  869. if (setting_csv.IsCellToExistData(cell_x, cell_y))
  870. {
  871. this.group_name = setting_csv.GetCellAsString(cell_x++, cell_y);
  872. }
  873. else
  874. {
  875. int num = cell_y;
  876. for (;;)
  877. {
  878. num--;
  879. if (num < 0)
  880. {
  881. break;
  882. }
  883. if (setting_csv.IsCellToExistData(cell_x, num))
  884. {
  885. goto Block_3;
  886. }
  887. }
  888. goto IL_7E;
  889. Block_3:
  890. this.group_name = setting_csv.GetCellAsString(cell_x++, num);
  891. IL_7E:
  892. NDebug.Assert(this.group_name != string.Empty, "表示グループの特定に失敗しました");
  893. }
  894. this.name = setting_csv.GetCellAsString(cell_x++, cell_y);
  895. string cellAsString = setting_csv.GetCellAsString(cell_x++, cell_y);
  896. this.command_type = (YotogiOld.SkillCommandType)Enum.Parse(typeof(YotogiOld.SkillCommandType), cellAsString);
  897. this.request_skill_lv = setting_csv.GetCellAsInteger(cell_x++, cell_y);
  898. this.normal_file = setting_csv.GetCellAsString(cell_x++, cell_y) + ".ks";
  899. this.insert_file = setting_csv.GetCellAsString(cell_x++, cell_y) + ".ks";
  900. this.rc_file = setting_csv.GetCellAsString(cell_x++, cell_y) + ".ks";
  901. this.rrc_file = setting_csv.GetCellAsString(cell_x++, cell_y) + ".ks";
  902. this.rr_file = setting_csv.GetCellAsString(cell_x++, cell_y) + ".ks";
  903. if (this.command_type == YotogiOld.SkillCommandType.挿入)
  904. {
  905. NDebug.Assert(this.insert_file != string.Empty && this.rc_file != string.Empty && this.rr_file != string.Empty, this.name + "\n挿入系のファイル指定が不正です");
  906. }
  907. else
  908. {
  909. NDebug.Assert(this.normal_file != string.Empty, this.name + "\n通常ファイル指定が不正です");
  910. }
  911. this.ref_maid_no = setting_csv.GetCellAsInteger(cell_x++, cell_y);
  912. string cellAsString2 = setting_csv.GetCellAsString(cell_x++, cell_y);
  913. this.sexual_type = YotogiOld.SexualType.Null;
  914. if (cellAsString2 != string.Empty)
  915. {
  916. try
  917. {
  918. this.sexual_type = (YotogiOld.SexualType)Enum.Parse(typeof(YotogiOld.SexualType), cellAsString2);
  919. }
  920. catch (ArgumentException)
  921. {
  922. NDebug.Assert("enum parse error.[" + cellAsString2 + "]", false);
  923. }
  924. }
  925. this.seikan_arousal_file = setting_csv.GetCellAsString(cell_x++, cell_y);
  926. if (this.sexual_type != YotogiOld.SexualType.Null)
  927. {
  928. NDebug.Assert(this.seikan_arousal_file != string.Empty, this.name + "\n性感帯ファイル指定が不正です");
  929. }
  930. this.propensity_sabun = null;
  931. cellAsString = setting_csv.GetCellAsString(cell_x++, cell_y);
  932. if (cellAsString != string.Empty)
  933. {
  934. this.propensity_sabun = Propensity.GetData(cellAsString);
  935. this.propensity_arousal_file = setting_csv.GetCellAsString(cell_x++, cell_y);
  936. NDebug.Assert(this.propensity_arousal_file != string.Empty, this.name + "\n性癖ファイル指定が不正です");
  937. }
  938. else
  939. {
  940. cell_x++;
  941. }
  942. this.insert_release = !(setting_csv.GetCellAsString(cell_x++, cell_y) == "○");
  943. this.request_insert = (setting_csv.GetCellAsString(cell_x++, cell_y) == "○");
  944. if (this.command_type != YotogiOld.SkillCommandType.単発 && this.command_type != YotogiOld.SkillCommandType.単発_挿入)
  945. {
  946. this.request_insert = true;
  947. }
  948. if (setting_csv.IsCellToExistData(cell_x++, cell_y))
  949. {
  950. this.expression = setting_csv.GetCellAsString(cell_x - 1, cell_y);
  951. }
  952. else
  953. {
  954. this.expression = string.Empty;
  955. }
  956. this.active_command = !string.IsNullOrEmpty(this.expression);
  957. }
  958. public readonly int skill_id;
  959. public readonly int id;
  960. public readonly string name;
  961. public readonly string group_name;
  962. public readonly YotogiOld.SkillCommandType command_type;
  963. public readonly int request_skill_lv;
  964. public readonly string normal_file;
  965. public readonly string insert_file;
  966. public readonly string rc_file;
  967. public readonly string rrc_file;
  968. public readonly string rr_file;
  969. public readonly int ref_maid_no;
  970. public readonly YotogiOld.SexualType sexual_type;
  971. public readonly string seikan_arousal_file;
  972. public readonly Propensity.Data propensity_sabun;
  973. public readonly string propensity_arousal_file;
  974. public readonly bool insert_release;
  975. public readonly bool request_insert;
  976. public readonly bool active_command;
  977. public readonly string expression;
  978. }
  979. public class Status
  980. {
  981. public Status(Skill.Old.Data.Command.Data.Basic basic_data, CsvParser stats_csv, int cell_x, int cell_y)
  982. {
  983. cell_x++;
  984. string cellAsString = stats_csv.GetCellAsString(cell_x++, cell_y);
  985. NDebug.Assert(cellAsString == basic_data.name, string.Concat(new object[]
  986. {
  987. "エラー\nスキルID[",
  988. basic_data.skill_id,
  989. "]スキル名[",
  990. basic_data.group_name,
  991. "]\nコマンド名[",
  992. basic_data.name,
  993. "]のはずが[",
  994. cellAsString,
  995. "]でした。コマンドの名前が不一致です"
  996. }));
  997. this.excitement = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  998. this.mind = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  999. this.reason = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1000. this.skill_exp = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1001. this.inyoku = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1002. this.m_value = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1003. this.hentai = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1004. this.housi = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1005. this.frustration = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1006. this.lovely = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1007. this.elegance = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1008. this.charm = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1009. this.reception = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1010. this.teach_rate = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1011. this.sexual_mouth = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1012. this.sexual_throat = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1013. this.sexual_nipple = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1014. this.sexual_front = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1015. this.sexual_back = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1016. this.sexual_curi = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  1017. }
  1018. public readonly int excitement;
  1019. public readonly int mind;
  1020. public readonly int reason;
  1021. public readonly int skill_exp;
  1022. public readonly int inyoku;
  1023. public readonly int m_value;
  1024. public readonly int hentai;
  1025. public readonly int housi;
  1026. public readonly int frustration;
  1027. public readonly int lovely;
  1028. public readonly int elegance;
  1029. public readonly int charm;
  1030. public readonly int reception;
  1031. public readonly int teach_rate;
  1032. public readonly int sexual_mouth;
  1033. public readonly int sexual_throat;
  1034. public readonly int sexual_nipple;
  1035. public readonly int sexual_front;
  1036. public readonly int sexual_back;
  1037. public readonly int sexual_curi;
  1038. }
  1039. }
  1040. }
  1041. public class GetConditionData : SkillAcquisitionCondition
  1042. {
  1043. public override List<KeyValuePair<string[], bool>> CreateConditionTextAndStaturResults(MaidStatus.Status status)
  1044. {
  1045. List<KeyValuePair<string[], bool>> list = base.CreateConditionTextAndStaturResults(status);
  1046. if (this.marriage)
  1047. {
  1048. bool value = false;
  1049. if (status != null && status.OldStatus != null && status.OldStatus.isMarriage)
  1050. {
  1051. value = true;
  1052. }
  1053. list.Add(new KeyValuePair<string[], bool>(new string[]
  1054. {
  1055. "結婚済み"
  1056. }, value));
  1057. }
  1058. return list;
  1059. }
  1060. public bool marriage;
  1061. public MaidStatus.Old.Personal[] requestPersonals;
  1062. }
  1063. }
  1064. }
  1065. public class Data
  1066. {
  1067. public Data(CsvParser csv, CsvParser csv_acq, int y, Dictionary<int, int[]> command_data_cell_dic)
  1068. {
  1069. int num = 0;
  1070. this.id = csv.GetCellAsInteger(num++, y);
  1071. num++;
  1072. this.sortId = csv.GetCellAsInteger(num++, y);
  1073. string cellAsString = csv.GetCellAsString(num++, y);
  1074. try
  1075. {
  1076. this.category = (Yotogi.Category)Enum.Parse(typeof(Yotogi.Category), cellAsString);
  1077. }
  1078. catch (ArgumentException)
  1079. {
  1080. NDebug.Assert("Yotogi.Category\nenum parse error.[" + cellAsString + "]", false);
  1081. }
  1082. this.name = csv.GetCellAsString(num++, y);
  1083. this.icon_file_name = csv.GetCellAsString(num++, y);
  1084. num++;
  1085. this.start_call_file = csv.GetCellAsString(num++, y);
  1086. if (!string.IsNullOrEmpty(this.start_call_file))
  1087. {
  1088. this.start_call_file += ".ks";
  1089. }
  1090. this.start_call_file2 = csv.GetCellAsString(num++, y);
  1091. if (!string.IsNullOrEmpty(this.start_call_file2))
  1092. {
  1093. this.start_call_file2 += ".ks";
  1094. }
  1095. this.exec_need_hp = csv.GetCellAsInteger(num++, y);
  1096. this.add_yotogi_class_exp = csv.GetCellAsInteger(num++, y);
  1097. int cellAsInteger = csv.GetCellAsInteger(num++, y);
  1098. int cellAsInteger2 = csv.GetCellAsInteger(num++, y);
  1099. this.skill_exp_table = new int[3];
  1100. this.skill_exp_table[1] = cellAsInteger;
  1101. this.skill_exp_table[2] = cellAsInteger2;
  1102. cellAsString = csv.GetCellAsString(num++, y);
  1103. if (string.IsNullOrEmpty(cellAsString) || cellAsString == "×")
  1104. {
  1105. this.ban_id_array = null;
  1106. }
  1107. else if (cellAsString == "〇")
  1108. {
  1109. this.ban_id_array = new int[1];
  1110. this.ban_id_array[0] = this.id;
  1111. }
  1112. else
  1113. {
  1114. string[] array = cellAsString.Split(new char[]
  1115. {
  1116. ','
  1117. });
  1118. this.ban_id_array = new int[array.Length];
  1119. for (int i = 0; i < this.ban_id_array.Length; i++)
  1120. {
  1121. this.ban_id_array[i] = int.Parse(array[i]);
  1122. }
  1123. }
  1124. this.player_num = csv.GetCellAsInteger(num++, y);
  1125. if (this.player_num <= 0)
  1126. {
  1127. this.player_num = 1;
  1128. }
  1129. CharacterMgr.CreateNpcData();
  1130. this.npcmaid_setting = new CharacterMgr.NpcData[0];
  1131. if (csv.IsCellToExistData(num, y))
  1132. {
  1133. cellAsString = csv.GetCellAsString(num++, y);
  1134. string[] array2 = cellAsString.Split(new char[]
  1135. {
  1136. ','
  1137. });
  1138. List<CharacterMgr.NpcData> list = new List<CharacterMgr.NpcData>();
  1139. for (int j = 0; j < array2.Length; j++)
  1140. {
  1141. if (CharacterMgr.npcDatas.ContainsKey(array2[j].Trim()))
  1142. {
  1143. list.Add(CharacterMgr.npcDatas[array2[j].Trim()]);
  1144. }
  1145. }
  1146. this.npcmaid_setting = list.ToArray();
  1147. }
  1148. else
  1149. {
  1150. num++;
  1151. }
  1152. cellAsString = csv.GetCellAsString(num++, y);
  1153. string[] array3 = cellAsString.Split(new char[]
  1154. {
  1155. ','
  1156. });
  1157. this.man_setting = new KeyValuePair<int, string>[array3.Length];
  1158. for (int k = 0; k < array3.Length; k++)
  1159. {
  1160. string text = array3[k];
  1161. int key = 0;
  1162. string value = string.Empty;
  1163. if (0 <= text.IndexOf("="))
  1164. {
  1165. string[] array4 = text.Split(new char[]
  1166. {
  1167. '='
  1168. });
  1169. key = 1;
  1170. try
  1171. {
  1172. key = int.Parse(array4[0]);
  1173. }
  1174. catch (Exception)
  1175. {
  1176. }
  1177. value = array4[1];
  1178. }
  1179. else
  1180. {
  1181. try
  1182. {
  1183. key = int.Parse(text);
  1184. }
  1185. catch (Exception)
  1186. {
  1187. }
  1188. }
  1189. this.man_setting[k] = new KeyValuePair<int, string>(key, value);
  1190. }
  1191. this.recollectionHaremLockPersonalIds = new HashSet<int>();
  1192. if (csv.IsCellToExistData(num, y))
  1193. {
  1194. cellAsString = csv.GetCellAsString(num++, y);
  1195. string[] array5 = cellAsString.Split(new char[]
  1196. {
  1197. ','
  1198. });
  1199. for (int l = 0; l < array5.Length; l++)
  1200. {
  1201. if (MaidStatus.Personal.Contains(array5[l].Trim()))
  1202. {
  1203. MaidStatus.Personal.Data data = MaidStatus.Personal.GetData(array5[l].Trim());
  1204. if (!this.recollectionHaremLockPersonalIds.Contains(data.id))
  1205. {
  1206. this.recollectionHaremLockPersonalIds.Add(data.id);
  1207. }
  1208. }
  1209. }
  1210. }
  1211. else
  1212. {
  1213. num++;
  1214. }
  1215. this.exec_seikeiken = new Dictionary<Seikeiken, bool>();
  1216. Seikeiken[] array6 = new Seikeiken[]
  1217. {
  1218. Seikeiken.No_No,
  1219. Seikeiken.Yes_No,
  1220. Seikeiken.No_Yes,
  1221. Seikeiken.Yes_Yes
  1222. };
  1223. for (int m = 0; m < array6.Length; m++)
  1224. {
  1225. cellAsString = csv.GetCellAsString(num++, y);
  1226. if (cellAsString == "〇")
  1227. {
  1228. this.exec_seikeiken.Add(array6[m], true);
  1229. }
  1230. }
  1231. this.exec_relation = new Dictionary<MaidStatus.Relation, bool>();
  1232. MaidStatus.Relation[] array7 = new MaidStatus.Relation[]
  1233. {
  1234. MaidStatus.Relation.Contact,
  1235. MaidStatus.Relation.Trust,
  1236. MaidStatus.Relation.Lover
  1237. };
  1238. for (int n = 0; n < array7.Length; n++)
  1239. {
  1240. cellAsString = csv.GetCellAsString(num++, y);
  1241. if (cellAsString == "〇")
  1242. {
  1243. this.exec_relation.Add(array7[n], true);
  1244. }
  1245. }
  1246. this.exec_contract = new Dictionary<Contract, bool>();
  1247. cellAsString = csv.GetCellAsString(num++, y);
  1248. if (string.IsNullOrEmpty(cellAsString))
  1249. {
  1250. Contract[] array8 = new Contract[]
  1251. {
  1252. Contract.Trainee,
  1253. Contract.Free,
  1254. Contract.Exclusive
  1255. };
  1256. for (int num2 = 0; num2 < array8.Length; num2++)
  1257. {
  1258. this.exec_contract.Add(array8[num2], true);
  1259. }
  1260. }
  1261. else
  1262. {
  1263. Contract contract = (Contract)Enum.Parse(typeof(Contract), cellAsString);
  1264. Contract[] array9 = new Contract[]
  1265. {
  1266. Contract.Trainee,
  1267. Contract.Free,
  1268. Contract.Exclusive
  1269. };
  1270. for (int num3 = 0; num3 < array9.Length; num3++)
  1271. {
  1272. this.exec_contract.Add(array9[num3], array9[num3] == contract);
  1273. }
  1274. }
  1275. cellAsString = csv.GetCellAsString(num++, y);
  1276. if (string.IsNullOrEmpty(cellAsString))
  1277. {
  1278. this.specialConditionType = Skill.Data.SpecialConditionType.Null;
  1279. }
  1280. else if (cellAsString.IndexOf("|") != -1)
  1281. {
  1282. string[] array10 = cellAsString.Split(new char[]
  1283. {
  1284. '|'
  1285. });
  1286. NDebug.Assert(array10.Length == 2, string.Concat(new object[]
  1287. {
  1288. "夜伽スキルID[",
  1289. this.id,
  1290. "] 名前[",
  1291. this.name,
  1292. "]の特殊状態指定が正しくありません。|でのSplitに失敗しました"
  1293. }));
  1294. int num4 = 0;
  1295. bool flag = int.TryParse(array10[0], out num4);
  1296. NDebug.Assert(flag && num4 == 9, string.Concat(new object[]
  1297. {
  1298. "夜伽スキルID[",
  1299. this.id,
  1300. "] 名前[",
  1301. this.name,
  1302. "]の特殊状態指定が正しくありません。textList[0]のParseに失敗"
  1303. }));
  1304. this.specialConditionType = (Skill.Data.SpecialConditionType)num4;
  1305. this.customRecollectionCategoryName = array10[1].Trim();
  1306. NDebug.Assert(!string.IsNullOrEmpty(this.customRecollectionCategoryName), string.Concat(new object[]
  1307. {
  1308. "夜伽スキルID[",
  1309. this.id,
  1310. "] 名前[",
  1311. this.name,
  1312. "]の特殊状態指定が正しくありません。textList[1]が空です"
  1313. }));
  1314. }
  1315. else
  1316. {
  1317. int num5 = 0;
  1318. bool condition = int.TryParse(cellAsString, out num5);
  1319. NDebug.Assert(condition, string.Concat(new object[]
  1320. {
  1321. "夜伽スキルID[",
  1322. this.id,
  1323. "] 名前[",
  1324. this.name,
  1325. "]の特殊状態指定が正しくありません。数字指定のみ受け付けます"
  1326. }));
  1327. this.specialConditionType = (Skill.Data.SpecialConditionType)num5;
  1328. NDebug.Assert(this.specialConditionType != Skill.Data.SpecialConditionType.OnlyRecollect, string.Concat(new object[]
  1329. {
  1330. "夜伽スキルID[",
  1331. this.id,
  1332. "] 名前[",
  1333. this.name,
  1334. "]の特殊状態指定が正しくありません。回想オンリーのものには必ず|でカテゴリー名を記述してください"
  1335. }));
  1336. }
  1337. if (csv.IsCellToExistData(num++, y))
  1338. {
  1339. this.connect_faint_skill_id = csv.GetCellAsInteger(num - 1, y);
  1340. }
  1341. else
  1342. {
  1343. this.connect_faint_skill_id = -1;
  1344. }
  1345. this.playable_stageid_list = new HashSet<int>();
  1346. while (csv.max_cell_x > num)
  1347. {
  1348. string cellAsString2 = csv.GetCellAsString(num, 0);
  1349. string cellAsString3 = csv.GetCellAsString(num++, y);
  1350. if (string.IsNullOrEmpty(cellAsString2))
  1351. {
  1352. IL_87F:
  1353. NDebug.Assert(command_data_cell_dic.ContainsKey(this.id), this.name + "の情報は見つかりませんでした");
  1354. int[] array11 = command_data_cell_dic[this.id];
  1355. this.command_basic_cell_y = array11[0];
  1356. this.command_status_cell_y = array11[1];
  1357. num = 0;
  1358. int cellAsInteger3 = csv_acq.GetCellAsInteger(num++, y);
  1359. num++;
  1360. NDebug.Assert(cellAsInteger3 == this.id, "スキル取得条件とスキル詳細のIDラインが一致していません");
  1361. this.getcondition_data = new Skill.Data.GetConditionData();
  1362. this.getcondition_data.seikeiken = new bool[4];
  1363. for (int num6 = 0; num6 < this.getcondition_data.seikeiken.Length; num6++)
  1364. {
  1365. this.getcondition_data.seikeiken[num6] = (csv_acq.GetCellAsString(num++, y) == "〇");
  1366. }
  1367. this.getcondition_data.inyoku = csv_acq.GetCellAsInteger(num++, y);
  1368. this.getcondition_data.m_value = csv_acq.GetCellAsInteger(num++, y);
  1369. this.getcondition_data.hentai = csv_acq.GetCellAsInteger(num++, y);
  1370. this.getcondition_data.housi = csv_acq.GetCellAsInteger(num++, y);
  1371. this.getcondition_data.lovely = csv_acq.GetCellAsInteger(num++, y);
  1372. this.getcondition_data.elegance = csv_acq.GetCellAsInteger(num++, y);
  1373. this.getcondition_data.charm = csv_acq.GetCellAsInteger(num++, y);
  1374. this.getcondition_data.requestPersonals = new MaidStatus.Personal.Data[0];
  1375. string cellAsString4 = csv_acq.GetCellAsString(num++, y);
  1376. if (!string.IsNullOrEmpty(cellAsString4))
  1377. {
  1378. string[] array12 = cellAsString4.Split(new char[]
  1379. {
  1380. ','
  1381. });
  1382. this.getcondition_data.requestPersonals = new MaidStatus.Personal.Data[array12.Length];
  1383. for (int num7 = 0; num7 < array12.Length; num7++)
  1384. {
  1385. this.getcondition_data.requestPersonals[num7] = MaidStatus.Personal.GetData(array12[num7].Trim());
  1386. }
  1387. }
  1388. if (csv_acq.IsCellToExistData(num, y) && csv_acq.IsCellToExistData(1, y))
  1389. {
  1390. string cellAsString5 = csv_acq.GetCellAsString(num++, y);
  1391. this.getcondition_data.maid_class = JobClass.GetData(cellAsString5);
  1392. this.getcondition_data.maid_class_level = csv_acq.GetCellAsInteger(num++, y);
  1393. }
  1394. else
  1395. {
  1396. num += 2;
  1397. }
  1398. if (csv_acq.IsCellToExistData(num, y) && csv_acq.IsCellToExistData(1, y))
  1399. {
  1400. string cellAsString6 = csv_acq.GetCellAsString(num++, y);
  1401. this.getcondition_data.yotogi_class = YotogiClass.GetData(cellAsString6);
  1402. this.getcondition_data.yotogi_class_level = csv_acq.GetCellAsInteger(num++, y);
  1403. }
  1404. else
  1405. {
  1406. num += 2;
  1407. }
  1408. string cellAsString7 = csv_acq.GetCellAsString(num++, y);
  1409. this.getcondition_data.requestMarried = (cellAsString7 == "〇");
  1410. string cellAsString8 = csv_acq.GetCellAsString(num++, y);
  1411. this.getcondition_data.requestSlave = (cellAsString8 == "〇");
  1412. this.getcondition_data.rejectPersonals = new MaidStatus.Personal.Data[0];
  1413. string cellAsString9 = csv_acq.GetCellAsString(num++, y);
  1414. if (!string.IsNullOrEmpty(cellAsString9))
  1415. {
  1416. string[] array13 = cellAsString9.Split(new char[]
  1417. {
  1418. ','
  1419. });
  1420. this.getcondition_data.rejectPersonals = new MaidStatus.Personal.Data[array13.Length];
  1421. for (int num8 = 0; num8 < array13.Length; num8++)
  1422. {
  1423. this.getcondition_data.rejectPersonals[num8] = MaidStatus.Personal.GetData(array13[num8].Trim());
  1424. }
  1425. }
  1426. return;
  1427. }
  1428. if (cellAsString3 == "〇")
  1429. {
  1430. this.playable_stageid_list.Add(YotogiStage.uniqueNameToId(cellAsString2));
  1431. }
  1432. }
  1433. goto IL_87F;
  1434. }
  1435. public void SetOldSkillData(Skill.Old.Data data)
  1436. {
  1437. this.oldData = data;
  1438. }
  1439. public void SetConnectFaintSkill(Skill.Data data)
  1440. {
  1441. this.connect_faint_skill = data;
  1442. }
  1443. public bool IsExecMaid(MaidStatus.Status maid_status)
  1444. {
  1445. return this.IsExecRelation(maid_status.relation) && this.IsExecSeikeiken(maid_status.seikeiken) && this.IsExecContract(maid_status.contract) && this.IsExecStatus(maid_status) && (this.getcondition_data.maid_class == null || JobClass.IsEnabled(this.getcondition_data.maid_class.id)) && (this.getcondition_data.yotogi_class == null || YotogiClass.IsEnabled(this.getcondition_data.yotogi_class.id));
  1446. }
  1447. public bool IsExecRelation(MaidStatus.Relation check_condition)
  1448. {
  1449. return this.exec_relation.ContainsKey(check_condition);
  1450. }
  1451. public bool IsExecSeikeiken(Seikeiken check_seikeiken)
  1452. {
  1453. return this.exec_seikeiken.ContainsKey(check_seikeiken);
  1454. }
  1455. public bool IsExecContract(Contract check_contract)
  1456. {
  1457. return this.exec_contract.ContainsKey(check_contract);
  1458. }
  1459. public bool IsExecStatus(MaidStatus.Status status)
  1460. {
  1461. return status != null && (!this.getcondition_data.requestMarried || status.specialRelation == SpecialRelation.Married) && (!this.getcondition_data.requestSlave || status.additionalRelation == AdditionalRelation.Slave);
  1462. }
  1463. public bool IsExecPersonal(MaidStatus.Personal.Data personal_data)
  1464. {
  1465. if (personal_data == null)
  1466. {
  1467. return false;
  1468. }
  1469. if (this.getcondition_data.requestPersonals.Length == 0 && this.getcondition_data.rejectPersonals.Length == 0)
  1470. {
  1471. return true;
  1472. }
  1473. if (personal_data != null)
  1474. {
  1475. foreach (MaidStatus.Personal.Data data in this.getcondition_data.rejectPersonals)
  1476. {
  1477. if (data.id == personal_data.id)
  1478. {
  1479. return false;
  1480. }
  1481. }
  1482. }
  1483. if (this.getcondition_data.requestPersonals.Length == 0)
  1484. {
  1485. return true;
  1486. }
  1487. if (personal_data != null)
  1488. {
  1489. foreach (MaidStatus.Personal.Data data2 in this.getcondition_data.requestPersonals)
  1490. {
  1491. if (data2.id == personal_data.id)
  1492. {
  1493. return true;
  1494. }
  1495. }
  1496. }
  1497. return false;
  1498. }
  1499. public bool IsCheckGetSkill(MaidStatus.Status status, bool is_seikeiken_check)
  1500. {
  1501. if (is_seikeiken_check && !this.getcondition_data.seikeiken[(int)status.seikeiken])
  1502. {
  1503. return false;
  1504. }
  1505. if (status.inyoku < this.getcondition_data.inyoku)
  1506. {
  1507. return false;
  1508. }
  1509. if (status.mvalue < this.getcondition_data.m_value)
  1510. {
  1511. return false;
  1512. }
  1513. if (status.hentai < this.getcondition_data.hentai)
  1514. {
  1515. return false;
  1516. }
  1517. if (status.housi < this.getcondition_data.housi)
  1518. {
  1519. return false;
  1520. }
  1521. if (status.lovely < this.getcondition_data.lovely)
  1522. {
  1523. return false;
  1524. }
  1525. if (status.elegance < this.getcondition_data.elegance)
  1526. {
  1527. return false;
  1528. }
  1529. if (status.charm < this.getcondition_data.charm)
  1530. {
  1531. return false;
  1532. }
  1533. if (this.getcondition_data.requestMarried && status.specialRelation != SpecialRelation.Married)
  1534. {
  1535. return false;
  1536. }
  1537. if (this.getcondition_data.requestSlave && status.additionalRelation != AdditionalRelation.Slave)
  1538. {
  1539. return false;
  1540. }
  1541. if (this.getcondition_data.requestPersonals.Length != 0)
  1542. {
  1543. bool flag = false;
  1544. foreach (MaidStatus.Personal.Data data in this.getcondition_data.requestPersonals)
  1545. {
  1546. flag |= (data.id == status.personal.id);
  1547. }
  1548. if (!flag)
  1549. {
  1550. return false;
  1551. }
  1552. }
  1553. if (this.getcondition_data.rejectPersonals.Length != 0)
  1554. {
  1555. foreach (MaidStatus.Personal.Data data2 in this.getcondition_data.rejectPersonals)
  1556. {
  1557. if (data2.id == status.personal.id)
  1558. {
  1559. return false;
  1560. }
  1561. }
  1562. }
  1563. if (this.getcondition_data.maid_class != null)
  1564. {
  1565. if (!status.jobClass.Contains(this.getcondition_data.maid_class.id))
  1566. {
  1567. return false;
  1568. }
  1569. ClassData<JobClass.Data> classData = status.jobClass.Get(this.getcondition_data.maid_class.id);
  1570. if (classData.level < this.getcondition_data.maid_class_level)
  1571. {
  1572. return false;
  1573. }
  1574. }
  1575. else if (this.getcondition_data.yotogi_class != null)
  1576. {
  1577. if (!status.yotogiClass.Contains(this.getcondition_data.yotogi_class.id))
  1578. {
  1579. return false;
  1580. }
  1581. ClassData<YotogiClass.Data> classData2 = status.yotogiClass.Get(this.getcondition_data.yotogi_class.id);
  1582. if (classData2.level < this.getcondition_data.yotogi_class_level || !classData2.data.learnConditions.CheckSpecialConditions(status))
  1583. {
  1584. return false;
  1585. }
  1586. }
  1587. return true;
  1588. }
  1589. public bool IsExecStage(YotogiStage.Data stageData)
  1590. {
  1591. return this.playable_stageid_list.Contains(stageData.id);
  1592. }
  1593. public bool IsResultDisplay(bool lockNTRPlay)
  1594. {
  1595. switch (this.specialConditionType)
  1596. {
  1597. case Skill.Data.SpecialConditionType.Faint:
  1598. case Skill.Data.SpecialConditionType.NewType:
  1599. case Skill.Data.SpecialConditionType.GP01Recollect:
  1600. case Skill.Data.SpecialConditionType.GP02Recollect:
  1601. case Skill.Data.SpecialConditionType.OnlyRecollect:
  1602. return false;
  1603. }
  1604. return !lockNTRPlay || (this.category != Yotogi.Category.交換 && this.category != Yotogi.Category.乱交);
  1605. }
  1606. public bool IsSkillListDisplay(bool lockNTRPlay)
  1607. {
  1608. return this.specialConditionType != Skill.Data.SpecialConditionType.Faint && this.specialConditionType != Skill.Data.SpecialConditionType.NewType && this.specialConditionType != Skill.Data.SpecialConditionType.GP01Recollect && this.specialConditionType != Skill.Data.SpecialConditionType.GP02Recollect && this.specialConditionType != Skill.Data.SpecialConditionType.OnlyRecollect && (!lockNTRPlay || (this.category != Yotogi.Category.交換 && this.category != Yotogi.Category.乱交));
  1609. }
  1610. public Skill.Data.Command command
  1611. {
  1612. get
  1613. {
  1614. if (this.command_ != null)
  1615. {
  1616. return this.command_;
  1617. }
  1618. using (AFileBase afileBase = GameUty.FileSystem.FileOpen("yotogi_skill_command_data.nei"))
  1619. {
  1620. using (CsvParser csvParser = new CsvParser())
  1621. {
  1622. csvParser.Open(afileBase);
  1623. using (AFileBase afileBase2 = GameUty.FileSystem.FileOpen("yotogi_skill_command_status.nei"))
  1624. {
  1625. using (CsvParser csvParser2 = new CsvParser())
  1626. {
  1627. csvParser2.Open(afileBase2);
  1628. this.command_ = new Skill.Data.Command(this, csvParser, csvParser2);
  1629. }
  1630. }
  1631. }
  1632. }
  1633. return this.command_;
  1634. }
  1635. }
  1636. public int user_player_num
  1637. {
  1638. get
  1639. {
  1640. return (this.npcmaid_setting != null && this.npcmaid_setting.Length != 0) ? (this.player_num - this.npcmaid_setting.Length) : this.player_num;
  1641. }
  1642. }
  1643. public Skill.Old.Data oldData { get; private set; }
  1644. public bool isShareSkill
  1645. {
  1646. get
  1647. {
  1648. return this.oldData != null;
  1649. }
  1650. }
  1651. public Skill.Data connect_faint_skill { get; private set; }
  1652. public string termName
  1653. {
  1654. get
  1655. {
  1656. return "YotogiSkillName/" + this.name;
  1657. }
  1658. }
  1659. public readonly Yotogi.Category category;
  1660. public readonly int id;
  1661. public readonly int sortId;
  1662. public readonly Skill.Data.SpecialConditionType specialConditionType;
  1663. public readonly string customRecollectionCategoryName;
  1664. public readonly string name;
  1665. public readonly string icon_file_name;
  1666. public readonly string start_call_file;
  1667. public readonly string start_call_file2;
  1668. public readonly int exec_need_hp;
  1669. public readonly int add_yotogi_class_exp;
  1670. public readonly int[] skill_exp_table;
  1671. public readonly int[] ban_id_array;
  1672. public readonly Dictionary<Seikeiken, bool> exec_seikeiken;
  1673. public readonly Dictionary<MaidStatus.Relation, bool> exec_relation;
  1674. public readonly Dictionary<Contract, bool> exec_contract;
  1675. public readonly HashSet<int> playable_stageid_list;
  1676. public readonly int player_num;
  1677. public readonly CharacterMgr.NpcData[] npcmaid_setting;
  1678. public readonly HashSet<int> recollectionHaremLockPersonalIds;
  1679. public readonly KeyValuePair<int, string>[] man_setting;
  1680. public readonly int command_basic_cell_x;
  1681. public readonly int command_basic_cell_y;
  1682. public readonly int command_status_cell_x;
  1683. public readonly int command_status_cell_y;
  1684. public readonly Skill.Data.GetConditionData getcondition_data;
  1685. public readonly int connect_faint_skill_id;
  1686. private Skill.Data.Command command_;
  1687. public class Command
  1688. {
  1689. public Command(Skill.Data parent_skill, CsvParser setting_csv, CsvParser status_csv)
  1690. {
  1691. this.skill = parent_skill;
  1692. int num = this.skill.command_basic_cell_x + 1;
  1693. int num2 = this.skill.command_basic_cell_y + 1;
  1694. int num3 = 0;
  1695. while (setting_csv.IsCellToExistData(num + 1, num2 + num3))
  1696. {
  1697. num3++;
  1698. }
  1699. NDebug.Assert(0 < num3, setting_csv.GetCellAsString(num - 1, num2 - 1) + "のコマンド設定は不正です");
  1700. this.data = new Skill.Data.Command.Data[num3];
  1701. for (int i = 0; i < this.data.Length; i++)
  1702. {
  1703. this.data[i] = new Skill.Data.Command.Data(this.skill, setting_csv, status_csv, i + 1);
  1704. }
  1705. this.commandCoundId = -1;
  1706. for (int j = 0; j < this.data.Length; j++)
  1707. {
  1708. if (!string.IsNullOrEmpty(this.data[j].basic.executionConditionCommandExecCount.Key))
  1709. {
  1710. string key = this.data[j].basic.executionConditionCommandExecCount.Key;
  1711. foreach (Skill.Data.Command.Data data in this.data)
  1712. {
  1713. if (data.basic.name == key)
  1714. {
  1715. this.commandCoundId = data.basic.id;
  1716. break;
  1717. }
  1718. }
  1719. }
  1720. }
  1721. }
  1722. public static Color bonusTargetTextColor = Color.red;
  1723. public readonly Skill.Data skill;
  1724. public readonly Skill.Data.Command.Data[] data;
  1725. public readonly int commandCoundId;
  1726. public class Data
  1727. {
  1728. public Data(Skill.Data parent_skill, CsvParser setting_csv, CsvParser status_csv, int no)
  1729. {
  1730. this.basic = new Skill.Data.Command.Data.Basic(parent_skill, setting_csv, parent_skill.command_basic_cell_x + 1, parent_skill.command_basic_cell_y + no);
  1731. this.status = new Skill.Data.Command.Data.Status(this.basic, status_csv, parent_skill.command_status_cell_x + 1, parent_skill.command_status_cell_y + no);
  1732. }
  1733. public bool EvalExpression(Maid maid)
  1734. {
  1735. if (maid == null)
  1736. {
  1737. return false;
  1738. }
  1739. if (this.basic.executionConditionParameters != null && !this.basic.executionConditionParameters.GreaterThanOrEqualToStatus(maid.status))
  1740. {
  1741. return false;
  1742. }
  1743. if (this.basic.request_propensity != null && 0 < this.basic.request_propensity.Count)
  1744. {
  1745. foreach (int key in this.basic.request_propensity)
  1746. {
  1747. if (!maid.status.propensitys.ContainsKey(key))
  1748. {
  1749. return false;
  1750. }
  1751. }
  1752. }
  1753. if (!string.IsNullOrEmpty(this.basic.executionConditionCommandExecCount.Key))
  1754. {
  1755. int value = this.basic.executionConditionCommandExecCount.Value;
  1756. YotogiSkillData yotogiSkillData = maid.status.yotogiSkill.Get(this.basic.skill_id);
  1757. if (yotogiSkillData == null || yotogiSkillData.commandCount < value)
  1758. {
  1759. return false;
  1760. }
  1761. }
  1762. return true;
  1763. }
  1764. public bool EvalExpressionForFreeMode(Maid maid)
  1765. {
  1766. if (maid == null)
  1767. {
  1768. return false;
  1769. }
  1770. if (this.basic.request_propensity != null && 0 < this.basic.request_propensity.Count)
  1771. {
  1772. foreach (int key in this.basic.request_propensity)
  1773. {
  1774. if (!maid.status.propensitys.ContainsKey(key))
  1775. {
  1776. return false;
  1777. }
  1778. }
  1779. }
  1780. return this.basic.executionConditionParameters == null || !this.basic.executionConditionParameters.dataPacks.ContainsKey(ParametersPack.StatusType.興奮) || this.basic.executionConditionParameters.dataPacks[ParametersPack.StatusType.興奮] <= maid.status.currentExcite;
  1781. }
  1782. public readonly Skill.Data.Command.Data.Basic basic;
  1783. public readonly Skill.Data.Command.Data.Status status;
  1784. public class CallFile
  1785. {
  1786. public CallFile(string normal, string insert, string rc, string rrc, string rr, string propensity_arousal_file, string adv_hook_file)
  1787. {
  1788. this.normal = normal;
  1789. this.insert = insert;
  1790. this.rc = rc;
  1791. this.rrc = rrc;
  1792. this.rr = rr;
  1793. this.propensity_arousal_file = propensity_arousal_file;
  1794. this.adv_hook_file = adv_hook_file;
  1795. }
  1796. public readonly string normal;
  1797. public readonly string insert;
  1798. public readonly string rc;
  1799. public readonly string rrc;
  1800. public readonly string rr;
  1801. public readonly string propensity_arousal_file;
  1802. public readonly string adv_hook_file;
  1803. }
  1804. public class Basic
  1805. {
  1806. public Basic(Skill.Data parent_skill, CsvParser setting_csv, int cell_x, int cell_y)
  1807. {
  1808. this.skill = parent_skill;
  1809. this.skill_id = parent_skill.id;
  1810. if (Skill.Data.Command.Data.Basic.colorSetDictionary == null)
  1811. {
  1812. Skill.Data.Command.Data.Basic.colorSetDictionary = new Dictionary<string, Color>();
  1813. Skill.Data.Command.Data.Basic.colorSetDictionary.Add("cyan", Color.cyan);
  1814. Skill.Data.Command.Data.Basic.colorSetDictionary.Add("green", Color.green);
  1815. Skill.Data.Command.Data.Basic.colorSetDictionary.Add("red", Color.red);
  1816. Skill.Data.Command.Data.Basic.colorSetDictionary.Add("black", Color.black);
  1817. Skill.Data.Command.Data.Basic.colorSetDictionary.Add("yellow", Color.yellow);
  1818. Skill.Data.Command.Data.Basic.colorSetDictionary.Add("blue", Color.blue);
  1819. Skill.Data.Command.Data.Basic.colorSetDictionary.Add("magenta", Color.magenta);
  1820. Skill.Data.Command.Data.Basic.colorSetDictionary.Add("gray", Color.gray);
  1821. Skill.Data.Command.Data.Basic.colorSetDictionary.Add("white", Color.white);
  1822. Skill.Data.Command.Data.Basic.colorSetDictionary.Add("grey", Color.grey);
  1823. }
  1824. this.id = cell_y;
  1825. if (setting_csv.IsCellToExistData(cell_x, cell_y))
  1826. {
  1827. this.group_name = setting_csv.GetCellAsString(cell_x++, cell_y);
  1828. }
  1829. else
  1830. {
  1831. int num = cell_y;
  1832. for (;;)
  1833. {
  1834. num--;
  1835. if (num < 0)
  1836. {
  1837. break;
  1838. }
  1839. if (setting_csv.IsCellToExistData(cell_x, num))
  1840. {
  1841. goto Block_4;
  1842. }
  1843. }
  1844. goto IL_161;
  1845. Block_4:
  1846. this.group_name = setting_csv.GetCellAsString(cell_x++, num);
  1847. IL_161:
  1848. NDebug.Assert(this.group_name != string.Empty, "表示グループの特定に失敗しました");
  1849. }
  1850. this.name = setting_csv.GetCellAsString(cell_x++, cell_y);
  1851. string text = setting_csv.GetCellAsString(cell_x++, cell_y);
  1852. this.command_type = (Yotogi.SkillCommandType)Enum.Parse(typeof(Yotogi.SkillCommandType), text);
  1853. this.attribute_type = setting_csv.GetCellAsString(cell_x++, cell_y);
  1854. text = setting_csv.GetCellAsString(cell_x++, cell_y).ToLower();
  1855. if (string.IsNullOrEmpty(text))
  1856. {
  1857. this.color = Color.black;
  1858. }
  1859. else if (0 <= text.IndexOf(","))
  1860. {
  1861. this.color = Parse.Color(text);
  1862. }
  1863. else if (Skill.Data.Command.Data.Basic.colorSetDictionary.ContainsKey(text))
  1864. {
  1865. this.color = Skill.Data.Command.Data.Basic.colorSetDictionary[text];
  1866. }
  1867. else
  1868. {
  1869. NDebug.Assert(string.Concat(new string[]
  1870. {
  1871. "夜伽スキル[",
  1872. this.group_name,
  1873. "]のコマンド[",
  1874. this.name,
  1875. "]の色設定がおかしいです\n指定された色文字[",
  1876. text,
  1877. "]"
  1878. }), false);
  1879. }
  1880. this.isStopParticleBreathe = (setting_csv.GetCellAsString(cell_x++, cell_y) == "〇");
  1881. this.isStopParticleLoveLiquid = (setting_csv.GetCellAsString(cell_x++, cell_y) == "〇");
  1882. this.isEstrusTriggerCommand = (setting_csv.GetCellAsString(cell_x++, cell_y) == "〇");
  1883. this.request_skill_lv = setting_csv.GetCellAsInteger(cell_x++, cell_y);
  1884. string text2 = setting_csv.GetCellAsString(cell_x++, cell_y);
  1885. string text3 = setting_csv.GetCellAsString(cell_x++, cell_y);
  1886. string text4 = setting_csv.GetCellAsString(cell_x++, cell_y);
  1887. string text5 = setting_csv.GetCellAsString(cell_x++, cell_y);
  1888. string text6 = setting_csv.GetCellAsString(cell_x++, cell_y);
  1889. if (!string.IsNullOrEmpty(text2))
  1890. {
  1891. text2 += ".ks";
  1892. }
  1893. if (!string.IsNullOrEmpty(text3))
  1894. {
  1895. text3 += ".ks";
  1896. }
  1897. if (!string.IsNullOrEmpty(text4))
  1898. {
  1899. text4 += ".ks";
  1900. }
  1901. if (!string.IsNullOrEmpty(text5))
  1902. {
  1903. text5 += ".ks";
  1904. }
  1905. if (!string.IsNullOrEmpty(text6))
  1906. {
  1907. text6 += ".ks";
  1908. }
  1909. this.ref_maid_no = setting_csv.GetCellAsInteger(cell_x++, cell_y);
  1910. this.ng_propensity = null;
  1911. text = setting_csv.GetCellAsString(cell_x++, cell_y);
  1912. if (text != string.Empty)
  1913. {
  1914. this.ng_propensity = Propensity.GetData(text);
  1915. }
  1916. string text7 = string.Empty;
  1917. this.learning_propensity = null;
  1918. text = setting_csv.GetCellAsString(cell_x++, cell_y);
  1919. if (text != string.Empty)
  1920. {
  1921. this.learning_propensity = Propensity.GetData(text);
  1922. text7 = setting_csv.GetCellAsString(cell_x++, cell_y);
  1923. if (!string.IsNullOrEmpty(text7))
  1924. {
  1925. text7 += ".ks";
  1926. }
  1927. }
  1928. else
  1929. {
  1930. cell_x++;
  1931. }
  1932. string text8 = setting_csv.GetCellAsString(cell_x++, cell_y);
  1933. if (!string.IsNullOrEmpty(text8))
  1934. {
  1935. text8 += ".ks";
  1936. }
  1937. this.request_insert = (setting_csv.GetCellAsString(cell_x++, cell_y) == "〇");
  1938. if (this.command_type != Yotogi.SkillCommandType.単発 && this.command_type != Yotogi.SkillCommandType.単発_挿入)
  1939. {
  1940. this.request_insert = true;
  1941. }
  1942. this.call_file = new Skill.Data.Command.Data.CallFile(text2, text3, text4, text5, text6, text7, text8);
  1943. this.ecxecConditionTexts = new string[0];
  1944. cell_x++;
  1945. this.request_propensity = new HashSet<int>();
  1946. this.executionConditionParameters = null;
  1947. if (setting_csv.IsCellToExistData(cell_x++, cell_y))
  1948. {
  1949. this.executionConditionParameters = new ParametersPack();
  1950. string cellAsString = setting_csv.GetCellAsString(cell_x - 1, cell_y);
  1951. string[] array = cellAsString.Split(new char[]
  1952. {
  1953. ','
  1954. });
  1955. foreach (string text9 in array)
  1956. {
  1957. if (text9.Trim().Split(new char[]
  1958. {
  1959. '|'
  1960. }).Length == 1)
  1961. {
  1962. bool flag = Propensity.Contains(text9);
  1963. if (flag && !this.request_propensity.Contains(Propensity.GetData(text9).id))
  1964. {
  1965. this.request_propensity.Add(Propensity.GetData(text9).id);
  1966. }
  1967. }
  1968. else
  1969. {
  1970. bool flag2 = text9.Trim().Split(new char[]
  1971. {
  1972. '|'
  1973. }).Length == 2;
  1974. if (flag2)
  1975. {
  1976. this.executionConditionParameters.Parse(text9.Trim().Replace("|", "="), ',');
  1977. }
  1978. }
  1979. }
  1980. }
  1981. if (setting_csv.IsCellToExistData(cell_x++, cell_y))
  1982. {
  1983. }
  1984. }
  1985. public bool isPropensityCommand
  1986. {
  1987. get
  1988. {
  1989. return this.learning_propensity != null && string.IsNullOrEmpty(this.call_file.propensity_arousal_file);
  1990. }
  1991. }
  1992. public bool isAcquisitionPropensityCommand
  1993. {
  1994. get
  1995. {
  1996. return this.learning_propensity != null && !string.IsNullOrEmpty(this.call_file.propensity_arousal_file);
  1997. }
  1998. }
  1999. public string termName
  2000. {
  2001. get
  2002. {
  2003. return "YotogiSkillCommand/" + this.name;
  2004. }
  2005. }
  2006. public string termGroupName
  2007. {
  2008. get
  2009. {
  2010. return this.skill.termName;
  2011. }
  2012. }
  2013. public readonly Skill.Data skill;
  2014. public readonly int skill_id;
  2015. public readonly int id;
  2016. public readonly string name;
  2017. public readonly string group_name;
  2018. public readonly Yotogi.SkillCommandType command_type;
  2019. public readonly string attribute_type;
  2020. public readonly Color color;
  2021. public readonly int request_skill_lv;
  2022. public readonly Skill.Data.Command.Data.CallFile call_file;
  2023. public readonly int ref_maid_no;
  2024. public readonly Propensity.Data ng_propensity;
  2025. public readonly Propensity.Data learning_propensity;
  2026. public readonly bool request_insert;
  2027. public readonly HashSet<int> request_propensity;
  2028. public readonly ParametersPack executionConditionParameters;
  2029. public readonly KeyValuePair<string, int> executionConditionCommandExecCount;
  2030. public readonly string[] ecxecConditionTexts;
  2031. public readonly bool isEstrusTriggerCommand;
  2032. public readonly bool isStopParticleBreathe;
  2033. public readonly bool isStopParticleLoveLiquid;
  2034. private static Dictionary<string, Color> colorSetDictionary;
  2035. }
  2036. public class Status
  2037. {
  2038. public Status(Skill.Data.Command.Data.Basic basic_data, CsvParser stats_csv, int cell_x, int cell_y)
  2039. {
  2040. cell_x++;
  2041. string cellAsString = stats_csv.GetCellAsString(cell_x++, cell_y);
  2042. if (string.IsNullOrEmpty(cellAsString))
  2043. {
  2044. NDebug.Assert(basic_data.skill.name + "の[" + basic_data.name + "]コマンドのステータス設定がありません", false);
  2045. }
  2046. NDebug.Assert(cellAsString == basic_data.name, string.Concat(new object[]
  2047. {
  2048. "エラー\nスキルID[",
  2049. basic_data.skill_id,
  2050. "]スキル名[",
  2051. basic_data.group_name,
  2052. "]\nコマンド名[",
  2053. basic_data.name,
  2054. "]のはずが[",
  2055. cellAsString,
  2056. "]でした。コマンドの名前が不一致です"
  2057. }));
  2058. if (stats_csv.IsCellToExistData(cell_x, cell_y) && stats_csv.IsCellToExistData(cell_x + 1, cell_y))
  2059. {
  2060. NDebug.Assert(basic_data.skill.name + "の[" + basic_data.name + "]コマンドのボーナス興奮値設定が不正です\n以上、以下二つデータを入れる事はできません", false);
  2061. }
  2062. this.bonusExcitementUpLine = int.MaxValue;
  2063. this.bonusExcitementDownLine = int.MinValue;
  2064. if (stats_csv.IsCellToExistData(cell_x, cell_y))
  2065. {
  2066. this.bonusExcitementUpLine = stats_csv.GetCellAsInteger(cell_x, cell_y);
  2067. }
  2068. cell_x++;
  2069. if (stats_csv.IsCellToExistData(cell_x, cell_y))
  2070. {
  2071. this.bonusExcitementDownLine = stats_csv.GetCellAsInteger(cell_x, cell_y);
  2072. }
  2073. cell_x++;
  2074. this.excitement = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2075. this.mind = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2076. this.sensual = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2077. this.cost_sensual = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2078. this.skill_exp = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2079. this.inyoku = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2080. this.m_value = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2081. this.hentai = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2082. this.housi = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2083. this.lovely = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2084. this.elegance = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2085. this.charm = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2086. this.reception = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2087. this.teach_rate = stats_csv.GetCellAsInteger(cell_x++, cell_y);
  2088. }
  2089. public readonly int bonusExcitementUpLine;
  2090. public readonly int bonusExcitementDownLine;
  2091. public readonly int excitement;
  2092. public readonly int mind;
  2093. public readonly int sensual;
  2094. public readonly int cost_sensual;
  2095. public readonly int skill_exp;
  2096. public readonly int inyoku;
  2097. public readonly int m_value;
  2098. public readonly int hentai;
  2099. public readonly int housi;
  2100. public readonly int lovely;
  2101. public readonly int elegance;
  2102. public readonly int charm;
  2103. public readonly int reception;
  2104. public readonly int teach_rate;
  2105. }
  2106. }
  2107. }
  2108. public enum SpecialConditionType
  2109. {
  2110. Null,
  2111. Drunk,
  2112. Mask,
  2113. Drug,
  2114. Faint,
  2115. Confess,
  2116. NewType,
  2117. GP01Recollect,
  2118. GP02Recollect,
  2119. OnlyRecollect
  2120. }
  2121. public class GetConditionData : SkillAcquisitionCondition
  2122. {
  2123. public override List<KeyValuePair<string[], bool>> CreateConditionTextAndStaturResults(MaidStatus.Status status)
  2124. {
  2125. List<KeyValuePair<string[], bool>> list = base.CreateConditionTextAndStaturResults(status);
  2126. if (this.maid_class != null)
  2127. {
  2128. bool value = false;
  2129. if (status != null && status.jobClass.Contains(this.maid_class.id) && this.maid_class_level <= status.jobClass.Get(this.maid_class.id).level)
  2130. {
  2131. value = true;
  2132. }
  2133. list.Add(new KeyValuePair<string[], bool>(new string[]
  2134. {
  2135. this.maid_class.drawName + " Lv{0}",
  2136. this.maid_class_level.ToString()
  2137. }, value));
  2138. }
  2139. return list;
  2140. }
  2141. public MaidStatus.Personal.Data[] requestPersonals;
  2142. public JobClass.Data maid_class;
  2143. public int maid_class_level;
  2144. public MaidStatus.Personal.Data[] rejectPersonals;
  2145. }
  2146. }
  2147. }
  2148. }