DataBase.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using MaidStatus;
  5. using UnityEngine;
  6. using wf;
  7. namespace PrivateMaidMode
  8. {
  9. public static class DataBase
  10. {
  11. public static int Count
  12. {
  13. get
  14. {
  15. DataBase.CreateData();
  16. return DataBase.commonIdManager.idMap.Count;
  17. }
  18. }
  19. public static bool Contains(int id)
  20. {
  21. return DataBase.commonIdManager.idMap.ContainsKey(id);
  22. }
  23. public static DataBase.Data GetData(int id)
  24. {
  25. DataBase.CreateData();
  26. NDebug.Assert(DataBase.basicDatas.ContainsKey(id), "プライベートメイドモード\nID[" + id + "]のデータは存在しません");
  27. return DataBase.basicDatas[id];
  28. }
  29. public static bool IsEnabled(int id)
  30. {
  31. DataBase.CreateData();
  32. return DataBase.commonIdManager.enabledIdList.Contains(id);
  33. }
  34. public static List<DataBase.Data> GetAllDatas(bool onlyEnabled)
  35. {
  36. DataBase.CreateData();
  37. List<DataBase.Data> list = new List<DataBase.Data>();
  38. foreach (KeyValuePair<int, KeyValuePair<string, string>> keyValuePair in DataBase.commonIdManager.idMap)
  39. {
  40. if (!onlyEnabled || DataBase.commonIdManager.enabledIdList.Contains(keyValuePair.Key))
  41. {
  42. list.Add(DataBase.basicDatas[keyValuePair.Key]);
  43. }
  44. }
  45. return list;
  46. }
  47. public static List<DataBase.BG> GetAllBGDatas()
  48. {
  49. DataBase.CreateData();
  50. return new List<DataBase.BG>(DataBase.bgDatas.Values);
  51. }
  52. public static DataBase.BG GetBGData(string uniqueNameBG)
  53. {
  54. DataBase.CreateData();
  55. foreach (KeyValuePair<string, DataBase.BG> keyValuePair in DataBase.bgDatas)
  56. {
  57. if (keyValuePair.Key == uniqueNameBG)
  58. {
  59. return keyValuePair.Value;
  60. }
  61. }
  62. return null;
  63. }
  64. public static void CreateData()
  65. {
  66. if (DataBase.commonIdManager != null)
  67. {
  68. return;
  69. }
  70. DataBase.commonIdManager = new CsvCommonIdManager("private_maidmode_group", "プライベートメイドモード", CsvCommonIdManager.Type.IdOnly, null);
  71. DataBase.basicDatas = new Dictionary<int, DataBase.Data>();
  72. string[] array = new string[]
  73. {
  74. "list"
  75. };
  76. KeyValuePair<AFileBase, CsvParser>[] array2 = new KeyValuePair<AFileBase, CsvParser>[array.Length];
  77. for (int i = 0; i < array2.Length; i++)
  78. {
  79. string text = "private_maidmode_group_" + array[i] + ".nei";
  80. AFileBase afileBase = GameUty.FileSystem.FileOpen(text);
  81. CsvParser csvParser = new CsvParser();
  82. bool condition = csvParser.Open(afileBase);
  83. NDebug.Assert(condition, text + "\nopen failed.");
  84. array2[i] = new KeyValuePair<AFileBase, CsvParser>(afileBase, csvParser);
  85. }
  86. Dictionary<string, List<List<DataBase.BG.Event.PointData.Information[]>>> eventInfoDatabase = DataBase.LoadPointInformation();
  87. Dictionary<string, DataBase.BG.Event[]> dictionary = new Dictionary<string, DataBase.BG.Event[]>();
  88. using (AFileBase afileBase2 = GameUty.FileSystem.FileOpen("private_maidmode_event_list.nei"))
  89. {
  90. using (CsvParser csvParser2 = new CsvParser())
  91. {
  92. csvParser2.Open(afileBase2);
  93. NDebug.Assert(csvParser2.IsValid(), "private_maidmode_event_list.nei\nopen failed.");
  94. for (int j = 1; j < csvParser2.max_cell_y; j++)
  95. {
  96. string key;
  97. DataBase.BG.Event @event = new DataBase.BG.Event(eventInfoDatabase, j, csvParser2, ref key);
  98. if (!dictionary.ContainsKey(key))
  99. {
  100. dictionary.Add(key, new DataBase.BG.Event[2]);
  101. }
  102. dictionary[key][(!@event.isNoon) ? 1 : 0] = @event;
  103. }
  104. }
  105. }
  106. Dictionary<string, List<DataBase.BG.Location>> dictionary2 = new Dictionary<string, List<DataBase.BG.Location>>();
  107. foreach (KeyValuePair<int, KeyValuePair<string, string>> keyValuePair in DataBase.commonIdManager.idMap)
  108. {
  109. int key2 = keyValuePair.Key;
  110. string key3;
  111. DataBase.BG.Location item = new DataBase.BG.Location(key2, array2[0].Value, ref key3);
  112. if (!dictionary2.ContainsKey(key3))
  113. {
  114. dictionary2.Add(key3, new List<DataBase.BG.Location>());
  115. }
  116. List<DataBase.BG.Location> list = dictionary2[key3];
  117. list.Add(item);
  118. }
  119. Dictionary<string, DataBase.BG> dictionary3 = new Dictionary<string, DataBase.BG>();
  120. using (AFileBase afileBase3 = GameUty.FileSystem.FileOpen("private_maidmode_bg_list.nei"))
  121. {
  122. using (CsvParser csvParser3 = new CsvParser())
  123. {
  124. csvParser3.Open(afileBase3);
  125. NDebug.Assert(csvParser3.IsValid(), "private_maidmode_bg_list.nei\nopen failed.");
  126. for (int k = 1; k < csvParser3.max_cell_y; k++)
  127. {
  128. DataBase.BG bg = new DataBase.BG(k, csvParser3, dictionary2, dictionary);
  129. dictionary3.Add(bg.uniqueName, bg);
  130. }
  131. }
  132. }
  133. DataBase.bgDatas = dictionary3;
  134. foreach (KeyValuePair<int, KeyValuePair<string, string>> keyValuePair2 in DataBase.commonIdManager.idMap)
  135. {
  136. int key4 = keyValuePair2.Key;
  137. DataBase.Data value = new DataBase.Data(key4, array2[0].Value, dictionary3);
  138. DataBase.basicDatas.Add(key4, value);
  139. }
  140. foreach (KeyValuePair<AFileBase, CsvParser> keyValuePair3 in array2)
  141. {
  142. keyValuePair3.Value.Dispose();
  143. keyValuePair3.Key.Dispose();
  144. }
  145. }
  146. private static Dictionary<string, List<List<DataBase.BG.Event.PointData.Information[]>>> LoadPointInformation()
  147. {
  148. Dictionary<string, List<List<DataBase.BG.Event.PointData.Information[]>>> dictionary = new Dictionary<string, List<List<DataBase.BG.Event.PointData.Information[]>>>();
  149. Dictionary<int, DataBase.BG.Event.PointData.Information> dictionary2 = new Dictionary<int, DataBase.BG.Event.PointData.Information>();
  150. using (AFileBase afileBase = GameUty.FileSystem.FileOpen("private_maidmode_eventinformation_list.nei"))
  151. {
  152. using (CsvParser csvParser = new CsvParser())
  153. {
  154. csvParser.Open(afileBase);
  155. NDebug.Assert(csvParser.IsValid(), "private_maidmode_eventinformation_list.nei\nopen failed.");
  156. for (int i = 1; i < csvParser.max_cell_y; i++)
  157. {
  158. int num = 0;
  159. int cellAsInteger = csvParser.GetCellAsInteger(num++, i);
  160. string cellAsString = csvParser.GetCellAsString(num++, i);
  161. string cellAsString2 = csvParser.GetCellAsString(num++, i);
  162. string a = csvParser.GetCellAsString(num++, i).ToLower();
  163. DataBase.BG.Event.PointData.Information.IconType iconType = DataBase.BG.Event.PointData.Information.IconType.Normal;
  164. if (a == "h")
  165. {
  166. iconType = DataBase.BG.Event.PointData.Information.IconType.H;
  167. }
  168. else if (a == "n")
  169. {
  170. iconType = DataBase.BG.Event.PointData.Information.IconType.NTR;
  171. }
  172. if (dictionary2.ContainsKey(cellAsInteger))
  173. {
  174. NDebug.Assert("csv parse error.\nprivate_maidmode_eventinformation_list.nei", false);
  175. }
  176. dictionary2.Add(cellAsInteger, new DataBase.BG.Event.PointData.Information(cellAsString, new List<string>(cellAsString2.Split(new char[]
  177. {
  178. '|'
  179. })), iconType));
  180. }
  181. }
  182. }
  183. using (AFileBase afileBase2 = GameUty.FileSystem.FileOpen("private_maidmode_eventlink_list.nei"))
  184. {
  185. using (CsvParser csvParser2 = new CsvParser())
  186. {
  187. csvParser2.Open(afileBase2);
  188. NDebug.Assert(csvParser2.IsValid(), "private_maidmode_eventlink_list.nei\nopen failed.");
  189. for (int j = 1; j < csvParser2.max_cell_y; j++)
  190. {
  191. int cell_x = 0;
  192. string cellAsString3 = csvParser2.GetCellAsString(cell_x++, j);
  193. string cellAsString4 = csvParser2.GetCellAsString(cell_x++, j);
  194. while (csvParser2.IsCellToExistData(cell_x, j))
  195. {
  196. string cellAsString5 = csvParser2.GetCellAsString(cell_x++, j);
  197. List<int> list = new List<int>();
  198. if (!string.IsNullOrEmpty(cellAsString5))
  199. {
  200. foreach (string s in cellAsString5.Split(new char[]
  201. {
  202. '/'
  203. }))
  204. {
  205. int item = 0;
  206. if (int.TryParse(s, out item))
  207. {
  208. list.Add(item);
  209. }
  210. else
  211. {
  212. NDebug.Assert("csv parse error.\nprivate_maidmode_eventlink_list.nei", false);
  213. }
  214. }
  215. }
  216. if (!dictionary.ContainsKey(cellAsString3))
  217. {
  218. dictionary.Add(cellAsString3, new List<List<DataBase.BG.Event.PointData.Information[]>>());
  219. for (int l = 0; l < 2; l++)
  220. {
  221. dictionary[cellAsString3].Add(new List<DataBase.BG.Event.PointData.Information[]>());
  222. }
  223. }
  224. List<DataBase.BG.Event.PointData.Information> list2 = new List<DataBase.BG.Event.PointData.Information>();
  225. foreach (int key in list)
  226. {
  227. if (!dictionary2.ContainsKey(key))
  228. {
  229. NDebug.Assert("csv parse error.\nprivate_maidmode_eventlink_list.nei", false);
  230. }
  231. list2.Add(dictionary2[key]);
  232. }
  233. dictionary[cellAsString3][(!(cellAsString4 == "昼")) ? 1 : 0].Add(list2.ToArray());
  234. }
  235. }
  236. }
  237. }
  238. return dictionary;
  239. }
  240. private const string csvTopCommonName = "private_maidmode_group";
  241. private const string typeNameForErrorLog = "プライベートメイドモード";
  242. private const string bgDefineFileName = "private_maidmode_bg_list.nei";
  243. private const string eventDefineFileName = "private_maidmode_event_list.nei";
  244. private const string eventLinkFileName = "private_maidmode_eventlink_list.nei";
  245. private const string eventInformationFileName = "private_maidmode_eventinformation_list.nei";
  246. private static CsvCommonIdManager commonIdManager;
  247. private static Dictionary<int, DataBase.Data> basicDatas;
  248. private static Dictionary<string, DataBase.BG> bgDatas;
  249. public class BG
  250. {
  251. public BG(int lineY, CsvParser basicCsv, Dictionary<string, List<DataBase.BG.Location>> locationList, Dictionary<string, DataBase.BG.Event[]> eventList)
  252. {
  253. if (!basicCsv.IsCellToExistData(0, lineY))
  254. {
  255. return;
  256. }
  257. int num = 0;
  258. this.uniqueName = basicCsv.GetCellAsString(num++, lineY);
  259. this.drawName = basicCsv.GetCellAsString(num++, lineY);
  260. string cellAsString = basicCsv.GetCellAsString(num++, lineY);
  261. List<int> list = new List<int>();
  262. if (!string.IsNullOrEmpty(cellAsString))
  263. {
  264. foreach (string text in cellAsString.Split(new char[]
  265. {
  266. ','
  267. }))
  268. {
  269. int minValue = int.MinValue;
  270. if (int.TryParse(text.Trim(), out minValue))
  271. {
  272. list.Add(minValue);
  273. }
  274. }
  275. }
  276. this.requestFacilityId = list.ToArray();
  277. this.prefabName = new string[2];
  278. this.prefabName[0] = basicCsv.GetCellAsString(num++, lineY);
  279. this.prefabName[1] = basicCsv.GetCellAsString(num++, lineY);
  280. if (locationList != null && locationList.ContainsKey(this.uniqueName))
  281. {
  282. this.locations = locationList[this.uniqueName].ToArray();
  283. foreach (DataBase.BG.Location location in this.locations)
  284. {
  285. if (location != null)
  286. {
  287. location.SetParentBg(this);
  288. }
  289. }
  290. }
  291. if (eventList != null && eventList.ContainsKey(this.uniqueName) && eventList[this.uniqueName] != null)
  292. {
  293. this.events = eventList[this.uniqueName];
  294. foreach (DataBase.BG.Event @event in this.events)
  295. {
  296. if (@event != null)
  297. {
  298. @event.SetParentBg(this);
  299. }
  300. }
  301. }
  302. }
  303. public bool enabled
  304. {
  305. get
  306. {
  307. if (this.requestFacilityId == null || this.requestFacilityId.Length <= 0)
  308. {
  309. return true;
  310. }
  311. FacilityManager facilityManager = (!(GameMain.Instance != null)) ? null : GameMain.Instance.FacilityMgr;
  312. if (facilityManager != null)
  313. {
  314. foreach (int facilityTypeID in this.requestFacilityId)
  315. {
  316. Facility[] array2;
  317. if (facilityManager.IsExistTypeFacility(facilityTypeID, out array2))
  318. {
  319. return true;
  320. }
  321. }
  322. }
  323. return false;
  324. }
  325. }
  326. public string drawNameTerm
  327. {
  328. get
  329. {
  330. return string.Empty;
  331. }
  332. }
  333. public DataBase.BG.Location GetLocation(string locationName)
  334. {
  335. foreach (DataBase.BG.Location location in this.locations)
  336. {
  337. if (location != null && location.drawName == locationName)
  338. {
  339. return location;
  340. }
  341. }
  342. return null;
  343. }
  344. public DataBase.BG.Event GetEvent(bool isNoon)
  345. {
  346. return (this.events != null && this.events.Length != 0) ? this.events[(!isNoon) ? 1 : 0] : null;
  347. }
  348. public void Apply(bool isNoon)
  349. {
  350. if (GameMain.Instance != null && GameMain.Instance.BgMgr != null)
  351. {
  352. GameMain.Instance.BgMgr.ChangeBg(this.prefabName[(!isNoon) ? 1 : 0]);
  353. }
  354. }
  355. public readonly string uniqueName;
  356. public readonly string drawName;
  357. public readonly int[] requestFacilityId;
  358. public readonly string[] prefabName;
  359. public readonly DataBase.BG.Location[] locations;
  360. public readonly DataBase.BG.Event[] events;
  361. public class Location
  362. {
  363. public Location(int uniqueId, CsvParser basicCsv, out string uniqueBgName)
  364. {
  365. uniqueBgName = string.Empty;
  366. for (int i = 1; i < basicCsv.max_cell_y; i++)
  367. {
  368. if (basicCsv.IsCellToExistData(0, i) && basicCsv.GetCellAsInteger(0, i) == uniqueId)
  369. {
  370. int num = 1;
  371. uniqueBgName = basicCsv.GetCellAsString(num++, i);
  372. this.drawName = basicCsv.GetCellAsString(num++, i);
  373. this.fileName = basicCsv.GetCellAsString(num++, i);
  374. if (!Path.HasExtension(this.fileName))
  375. {
  376. this.fileName += ".ks";
  377. }
  378. this.labelName = basicCsv.GetCellAsString(num++, i);
  379. break;
  380. }
  381. }
  382. }
  383. public DataBase.BG parentBg { get; private set; }
  384. public string drawNameTerm
  385. {
  386. get
  387. {
  388. return string.Empty;
  389. }
  390. }
  391. public void SetParentBg(DataBase.BG parentBg)
  392. {
  393. this.parentBg = parentBg;
  394. }
  395. public bool LoadScript()
  396. {
  397. if (!string.IsNullOrEmpty(this.labelName) && GameMain.Instance != null && GameMain.Instance.ScriptMgr != null)
  398. {
  399. ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
  400. scriptMgr.tmp_kag.LoadScriptFile(this.fileName, this.labelName);
  401. scriptMgr.tmp_kag.enabled = true;
  402. scriptMgr.tmp_kag.Exec();
  403. scriptMgr.tmp_kag.enabled = false;
  404. return true;
  405. }
  406. return false;
  407. }
  408. public readonly string drawName;
  409. public readonly string fileName;
  410. public readonly string labelName;
  411. }
  412. public class Event
  413. {
  414. public Event(Dictionary<string, List<List<DataBase.BG.Event.PointData.Information[]>>> eventInfoDatabase, int lineY, CsvParser basicCsv, out string uniqueBgName)
  415. {
  416. uniqueBgName = string.Empty;
  417. if (!basicCsv.IsCellToExistData(0, lineY))
  418. {
  419. return;
  420. }
  421. int num = 0;
  422. uniqueBgName = basicCsv.GetCellAsString(num++, lineY);
  423. this.isNoon = (basicCsv.GetCellAsString(num++, lineY) == "昼");
  424. this.hitPrefabPath = basicCsv.GetCellAsString(num++, lineY);
  425. this.eventScriptFile = basicCsv.GetCellAsString(num++, lineY);
  426. if (!Path.HasExtension(this.eventScriptFile))
  427. {
  428. this.eventScriptFile += ".ks";
  429. }
  430. if (!eventInfoDatabase.ContainsKey(uniqueBgName))
  431. {
  432. NDebug.Assert(this.ToString() + "生成エラー", false);
  433. }
  434. List<DataBase.BG.Event.PointData.Information[]> list = eventInfoDatabase[uniqueBgName][(!this.isNoon) ? 1 : 0];
  435. List<DataBase.BG.Event.PointData> list2 = new List<DataBase.BG.Event.PointData>();
  436. for (int i = num; i < basicCsv.max_cell_x; i++)
  437. {
  438. int num2 = i - num + 1;
  439. string text = basicCsv.GetCellAsString(i, lineY);
  440. if (!string.IsNullOrEmpty(text))
  441. {
  442. List<string> list3 = new List<string>();
  443. if (text.IndexOf("|") != -1)
  444. {
  445. string[] array = text.Split(new char[]
  446. {
  447. '|'
  448. });
  449. text = array[0];
  450. string text2 = array[1];
  451. foreach (string text3 in text2.Split(new char[]
  452. {
  453. ','
  454. }))
  455. {
  456. list3.Add(text3.Trim());
  457. }
  458. }
  459. List<string> list4 = new List<string>();
  460. foreach (string text4 in text.Split(new char[]
  461. {
  462. '/'
  463. }))
  464. {
  465. list4.Add(text4.Trim());
  466. }
  467. DataBase.BG.Event.PointData.Information[] array4 = (list.Count > num2 - 1) ? list[num2 - 1] : null;
  468. if (array4 == null || list4.Count != array4.Length)
  469. {
  470. NDebug.Assert(this.ToString() + "生成エラー2", false);
  471. }
  472. list2.Add(new DataBase.BG.Event.PointData(num2, list4, list3, new List<DataBase.BG.Event.PointData.Information>(array4)));
  473. }
  474. }
  475. this.eventPointList = list2.ToArray();
  476. }
  477. public DataBase.BG parentBg { get; private set; }
  478. public bool IsExec(Maid maid, int pointNo)
  479. {
  480. Status maidStatus = (!(maid != null)) ? null : maid.status;
  481. return this.IsExec(maidStatus, pointNo);
  482. }
  483. public bool IsExec(Status maidStatus, int pointNo)
  484. {
  485. DataBase.BG.Event.PointData eventData = this.GetEventData(pointNo);
  486. return eventData.IsExec(maidStatus);
  487. }
  488. public bool IsFinishedReadingFile(Maid maid, DataBase.BG.Event.PointData pointData, int index)
  489. {
  490. string file_name = this.eventScriptFile;
  491. file_name = ScriptManager.ReplacePersonal(maid, this.eventScriptFile);
  492. return GameMain.Instance.ScriptMgr.adv_kag.kag.GetRecordLabel(file_name, pointData.labelList[index]);
  493. }
  494. public GameObject InstantiateHitPrefab(GameObject parent)
  495. {
  496. GameObject result;
  497. try
  498. {
  499. result = Utility.CreatePrefab(parent, this.hitPrefabPath, true);
  500. }
  501. catch (Exception exception)
  502. {
  503. Debug.LogException(exception);
  504. result = null;
  505. }
  506. return result;
  507. }
  508. public DataBase.BG.Event.PointData GetEventData(int pointNo)
  509. {
  510. if (this.eventPointList != null)
  511. {
  512. foreach (DataBase.BG.Event.PointData pointData in this.eventPointList)
  513. {
  514. if (pointData != null && pointData.no == pointNo)
  515. {
  516. return pointData;
  517. }
  518. }
  519. }
  520. return null;
  521. }
  522. public bool ContainsEvent(int pointNo)
  523. {
  524. return this.GetEventData(pointNo) != null;
  525. }
  526. public bool LoadScript(Maid maid, int pointNo)
  527. {
  528. DataBase.BG.Event.PointData eventData = this.GetEventData(pointNo);
  529. if (eventData != null && GameMain.Instance != null && GameMain.Instance.ScriptMgr != null)
  530. {
  531. ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
  532. string str = this.eventScriptFile;
  533. if (maid != null)
  534. {
  535. str = ScriptManager.ReplacePersonal(maid, this.eventScriptFile);
  536. }
  537. int nextScenarioIndex = this.GetNextScenarioIndex(maid, eventData);
  538. GameMain.Instance.ScriptMgr.EvalScript("global.__private_maid_mode_adv_file = '" + str + "';");
  539. GameMain.Instance.ScriptMgr.EvalScript("global.__private_maid_mode_adv_label = '" + eventData.labelList[nextScenarioIndex++] + "';");
  540. this.SetScenarioIndex(maid, eventData, nextScenarioIndex);
  541. scriptMgr.LoadAdvScenarioScript("private_maid_mode_adv_call.ks", "*ADVスタート");
  542. scriptMgr.adv_kag.Exec();
  543. return true;
  544. }
  545. return false;
  546. }
  547. public int GetNextScenarioIndex(Maid maid, DataBase.BG.Event.PointData pointData)
  548. {
  549. int num = maid.status.GetFlag("__private_maid_mode_scenario_index_" + pointData.no.ToString());
  550. if (pointData.labelList.Count <= num)
  551. {
  552. num = 0;
  553. }
  554. return num;
  555. }
  556. public void SetParentBg(DataBase.BG parentBg)
  557. {
  558. this.parentBg = parentBg;
  559. }
  560. private void SetScenarioIndex(Maid maid, DataBase.BG.Event.PointData pointData, int scenarioIndex)
  561. {
  562. maid.status.SetFlag("__private_maid_mode_scenario_index_" + pointData.no.ToString(), scenarioIndex);
  563. }
  564. public readonly bool isNoon;
  565. public readonly string hitPrefabPath;
  566. public readonly string eventScriptFile;
  567. public readonly DataBase.BG.Event.PointData[] eventPointList;
  568. public class PointData
  569. {
  570. public PointData(int no, List<string> labelList, List<string> checkMaidFlag, List<DataBase.BG.Event.PointData.Information> information)
  571. {
  572. this.no = no;
  573. this.labelList = labelList;
  574. this.checkMaidFlag = checkMaidFlag;
  575. this.information = information;
  576. }
  577. public bool IsExec(Maid maid)
  578. {
  579. return (!(maid != null)) ? this.IsExec(null) : this.IsExec(maid.status);
  580. }
  581. public bool IsExec(Status maidStatus)
  582. {
  583. if (this.checkMaidFlag.Count <= 0)
  584. {
  585. return true;
  586. }
  587. if (maidStatus == null)
  588. {
  589. return false;
  590. }
  591. foreach (string flagName in this.checkMaidFlag)
  592. {
  593. if (maidStatus.GetFlag(flagName) <= 0)
  594. {
  595. return false;
  596. }
  597. }
  598. return true;
  599. }
  600. public readonly int no;
  601. public readonly List<string> labelList;
  602. public readonly List<string> checkMaidFlag;
  603. public readonly List<DataBase.BG.Event.PointData.Information> information;
  604. public class Information
  605. {
  606. public Information(string title, List<string> conditions, DataBase.BG.Event.PointData.Information.IconType iconType)
  607. {
  608. this.title = title;
  609. this.conditions = conditions;
  610. this.iconType = iconType;
  611. }
  612. public string titleTerm
  613. {
  614. get
  615. {
  616. return this.title;
  617. }
  618. }
  619. public readonly DataBase.BG.Event.PointData pointData;
  620. public readonly string title;
  621. public readonly List<string> conditions;
  622. public readonly DataBase.BG.Event.PointData.Information.IconType iconType;
  623. public enum IconType
  624. {
  625. Normal,
  626. H,
  627. NTR
  628. }
  629. }
  630. }
  631. }
  632. }
  633. public class Data
  634. {
  635. public Data(int uniqueId, CsvParser basicCsv, Dictionary<string, DataBase.BG> bgDataList)
  636. {
  637. for (int i = 1; i < basicCsv.max_cell_y; i++)
  638. {
  639. if (basicCsv.IsCellToExistData(0, i) && basicCsv.GetCellAsInteger(0, i) == uniqueId)
  640. {
  641. int num = 1;
  642. this.id = uniqueId;
  643. string cellAsString = basicCsv.GetCellAsString(num++, i);
  644. this.bgData = bgDataList[cellAsString];
  645. string cellAsString2 = basicCsv.GetCellAsString(num++, i);
  646. this.locationData = this.bgData.GetLocation(cellAsString2);
  647. break;
  648. }
  649. }
  650. }
  651. public readonly int id;
  652. public readonly DataBase.BG bgData;
  653. public readonly DataBase.BG.Location locationData;
  654. }
  655. }
  656. }