Skill.cs 69 KB

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