ScenarioData.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using MaidStatus;
  6. using UnityEngine;
  7. [Serializable]
  8. public class ScenarioData
  9. {
  10. public ScenarioData(CsvParser csv, int cy)
  11. {
  12. ScenarioData $this = this;
  13. Action<ScenarioData.PlayableCondition, int> action = delegate(ScenarioData.PlayableCondition condition, int cx)
  14. {
  15. if (csv.IsCellToExistData(cx, cy) && !$this.m_PlayableData.ContainsKey(condition))
  16. {
  17. $this.m_PlayableData.Add(condition, new ScenarioData.PlayableData(csv.GetCellAsString(cx, cy), condition));
  18. }
  19. };
  20. for (int i = 0; i < csv.max_cell_x; i++)
  21. {
  22. switch (i)
  23. {
  24. case 0:
  25. this.ID = csv.GetCellAsInteger(i, cy);
  26. break;
  27. case 1:
  28. this.Title = csv.GetCellAsString(i, cy);
  29. break;
  30. case 2:
  31. this.EventContents = csv.GetCellAsString(i, cy);
  32. break;
  33. case 3:
  34. action(ScenarioData.PlayableCondition.好感度, i);
  35. break;
  36. case 4:
  37. action(ScenarioData.PlayableCondition.時間帯, i);
  38. break;
  39. case 5:
  40. action(ScenarioData.PlayableCondition.シナリオ, i);
  41. break;
  42. case 6:
  43. action(ScenarioData.PlayableCondition.属性, i);
  44. break;
  45. case 7:
  46. action(ScenarioData.PlayableCondition.パラメ\u30FCタ, i);
  47. break;
  48. case 8:
  49. action(ScenarioData.PlayableCondition.性癖, i);
  50. break;
  51. case 9:
  52. action(ScenarioData.PlayableCondition.ジョブクラス, i);
  53. break;
  54. case 10:
  55. action(ScenarioData.PlayableCondition.夜伽クラス, i);
  56. break;
  57. case 11:
  58. action(ScenarioData.PlayableCondition.関係, i);
  59. break;
  60. case 12:
  61. action(ScenarioData.PlayableCondition.アイテム, i);
  62. break;
  63. case 13:
  64. action(ScenarioData.PlayableCondition.施設, i);
  65. break;
  66. case 14:
  67. action(ScenarioData.PlayableCondition.NTRブロック, i);
  68. break;
  69. case 15:
  70. this.IconName = csv.GetCellAsString(i, cy);
  71. break;
  72. case 16:
  73. this.ScenarioScript = csv.GetCellAsString(i, cy);
  74. break;
  75. case 17:
  76. {
  77. string cellAsString = csv.GetCellAsString(i, cy);
  78. if (!string.IsNullOrEmpty(cellAsString))
  79. {
  80. this.ScriptLabel = ((cellAsString.IndexOf("*") < 0) ? ("*" + cellAsString) : cellAsString);
  81. }
  82. break;
  83. }
  84. case 18:
  85. this.EventMaidNum = ((!csv.IsCellToExistData(i, cy)) ? 0 : csv.GetCellAsInteger(i, cy));
  86. break;
  87. case 19:
  88. this.IsImportant = (csv.GetCellAsString(i, cy) == "重要");
  89. break;
  90. case 20:
  91. this.IsOncePlayOnly = !csv.IsCellToExistData(i, cy);
  92. break;
  93. case 21:
  94. this.Notification = csv.GetCellAsString(i, cy);
  95. break;
  96. case 22:
  97. this.ConditionText = csv.GetCellAsString(i, cy).Replace("\n", "&").Split(new char[]
  98. {
  99. '&'
  100. });
  101. break;
  102. }
  103. }
  104. this.CheckPlayableCondition(false);
  105. }
  106. public ScenarioData()
  107. {
  108. }
  109. public bool IsOncePlayed { get; private set; }
  110. public bool IsPlayable
  111. {
  112. get
  113. {
  114. return (!this.IsOncePlayOnly || !this.IsOncePlayed) && (this.ConditionCount == 0 || this.CheckPlayableCondition(false));
  115. }
  116. }
  117. public bool ImportantPlayable
  118. {
  119. get
  120. {
  121. return (!this.IsOncePlayOnly || !this.IsOncePlayed) && this.IsImportant && this.CheckPlayableCondition(true);
  122. }
  123. }
  124. private bool m_ContainsConditionScenario
  125. {
  126. get
  127. {
  128. return this.m_PlayableData.ContainsKey(ScenarioData.PlayableCondition.シナリオ);
  129. }
  130. }
  131. public int ConditionCount
  132. {
  133. get
  134. {
  135. return this.m_PlayableData.Count;
  136. }
  137. }
  138. public int EventMaidCount
  139. {
  140. get
  141. {
  142. return this.m_EventMaid.Count;
  143. }
  144. }
  145. public bool NotPlayAgain
  146. {
  147. get
  148. {
  149. return this.IsOncePlayOnly && this.IsOncePlayed;
  150. }
  151. }
  152. public string NotLineTitle
  153. {
  154. get
  155. {
  156. return this.Title.Replace("\n", string.Empty);
  157. }
  158. }
  159. public bool IsFixedMaid { get; private set; }
  160. public static bool operator true(ScenarioData data)
  161. {
  162. return data != null;
  163. }
  164. public static bool operator false(ScenarioData data)
  165. {
  166. return data == null;
  167. }
  168. public static bool operator !(ScenarioData data)
  169. {
  170. return data == null;
  171. }
  172. private bool CheckPlayableCondition(bool update_important = false)
  173. {
  174. bool flag = false;
  175. this.m_EventMaid.Clear();
  176. if (this.m_PlayableData == null)
  177. {
  178. return false;
  179. }
  180. this.m_ExistMaidUpdate = false;
  181. bool flag2 = true;
  182. bool flag3 = false;
  183. foreach (ScenarioData.PlayableCondition playableCondition in this.m_PlayableData.Keys)
  184. {
  185. if (!update_important || playableCondition != ScenarioData.PlayableCondition.時間帯)
  186. {
  187. List<Maid> before = new List<Maid>(this.m_EventMaid);
  188. flag = this.CheckPlayableCondition(playableCondition, true);
  189. if (!flag)
  190. {
  191. break;
  192. }
  193. if (!flag2 && flag3 && this.m_ExistMaidUpdate)
  194. {
  195. this.m_EventMaid = (from e in this.m_EventMaid
  196. where before.Contains(e)
  197. select e).ToList<Maid>();
  198. if (this.m_EventMaid.Count == 0)
  199. {
  200. flag = false;
  201. break;
  202. }
  203. }
  204. flag2 = false;
  205. if (!flag3)
  206. {
  207. flag3 = (this.m_EventMaid.Count > 0);
  208. if (this.m_ExistMaidUpdate && this.EventMaidCount == 0)
  209. {
  210. flag = false;
  211. break;
  212. }
  213. }
  214. }
  215. }
  216. flag &= this.IsEnoughEventMaid();
  217. return flag;
  218. }
  219. public bool CheckPlayableCondition(ScenarioData.PlayableCondition condition, bool maid_update = true)
  220. {
  221. if (!this.m_PlayableData.ContainsKey(condition))
  222. {
  223. return false;
  224. }
  225. ScenarioData.PlayableData playableData = this.m_PlayableData[condition];
  226. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  227. FacilityManager facilityMgr = GameMain.Instance.FacilityMgr;
  228. bool and_operator = playableData.StringData.IndexOf("&") >= 0;
  229. bool flag = playableData.StringData.IndexOf("|") >= 0;
  230. char c = ',';
  231. if (and_operator && flag)
  232. {
  233. Debug.LogError("条件演算子が混在してます");
  234. }
  235. else if (and_operator)
  236. {
  237. c = '&';
  238. }
  239. else if (flag)
  240. {
  241. c = '|';
  242. }
  243. bool isOk = and_operator;
  244. Action<bool> set_ok = delegate(bool set_val)
  245. {
  246. if (and_operator)
  247. {
  248. isOk = (isOk && set_val);
  249. }
  250. else
  251. {
  252. isOk = (isOk || set_val);
  253. }
  254. };
  255. Action<Maid> add_maid = delegate(Maid maid)
  256. {
  257. if (maid_update)
  258. {
  259. this.AddEventMaid(maid);
  260. }
  261. set_ok(true);
  262. };
  263. Action<Maid> remove_maid = delegate(Maid maid)
  264. {
  265. if (and_operator && this.m_EventMaid.Contains(maid))
  266. {
  267. set_ok(false);
  268. }
  269. if (maid_update)
  270. {
  271. this.RemoveEventMaid(maid, false);
  272. }
  273. };
  274. Action<Maid, bool> action = delegate(Maid maid, bool check_ok)
  275. {
  276. if (check_ok)
  277. {
  278. add_maid(maid);
  279. }
  280. else
  281. {
  282. remove_maid(maid);
  283. }
  284. };
  285. bool maid_check = false;
  286. Action action2 = delegate()
  287. {
  288. if (!maid_check && maid_update)
  289. {
  290. this.m_EventMaid.Clear();
  291. }
  292. this.m_ExistMaidUpdate = true;
  293. maid_check = true;
  294. };
  295. foreach (string text in playableData.StringData.Split(new char[]
  296. {
  297. c
  298. }))
  299. {
  300. switch (condition)
  301. {
  302. case ScenarioData.PlayableCondition.好感度:
  303. {
  304. int num = int.Parse(text);
  305. action2();
  306. for (int j = 0; j < characterMgr.GetStockMaidCount(); j++)
  307. {
  308. Maid stockMaid = characterMgr.GetStockMaid(j);
  309. action(stockMaid, stockMaid.status.likability >= num);
  310. }
  311. break;
  312. }
  313. case ScenarioData.PlayableCondition.時間帯:
  314. if (text == "昼")
  315. {
  316. set_ok(characterMgr.status.isDaytime);
  317. }
  318. else
  319. {
  320. set_ok(!characterMgr.status.isDaytime);
  321. }
  322. break;
  323. case ScenarioData.PlayableCondition.属性:
  324. {
  325. string[] array2 = text.Split(new char[]
  326. {
  327. '.'
  328. });
  329. action2();
  330. for (int k = 0; k < characterMgr.GetStockMaidCount(); k++)
  331. {
  332. Maid stockMaid2 = characterMgr.GetStockMaid(k);
  333. if (text.IndexOf("NPCキャラ") >= 0)
  334. {
  335. this.IsFixedMaid = true;
  336. if (stockMaid2.status.heroineType == HeroineType.Sub && stockMaid2.status.subCharaData.uniqueName == array2[1])
  337. {
  338. add_maid(stockMaid2);
  339. }
  340. }
  341. else if (text.IndexOf("NPC以外") >= 0)
  342. {
  343. action(stockMaid2, stockMaid2.status.heroineType != HeroineType.Sub);
  344. }
  345. else if (text.IndexOf("移籍") >= 0)
  346. {
  347. if (stockMaid2.status.heroineType == HeroineType.Transfer)
  348. {
  349. if (text != null)
  350. {
  351. if (text == "移籍メイド")
  352. {
  353. add_maid(stockMaid2);
  354. goto IL_43F;
  355. }
  356. if (text == "雇用移籍メイド")
  357. {
  358. action(stockMaid2, !stockMaid2.status.mainChara);
  359. goto IL_43F;
  360. }
  361. }
  362. string convertPersonal = GameMain.Instance.ScenarioSelectMgr.GetConvertPersonal(stockMaid2);
  363. if (text.IndexOf("固定") >= 0)
  364. {
  365. this.IsFixedMaid = true;
  366. if (text == "固定移籍メイド")
  367. {
  368. action(stockMaid2, stockMaid2.status.mainChara && ScenarioData.m_MainMaidList.Contains(convertPersonal));
  369. }
  370. else
  371. {
  372. action(stockMaid2, stockMaid2.status.mainChara && text == "固定移籍" + convertPersonal);
  373. }
  374. }
  375. else if (GameMain.Instance.ScenarioSelectMgr.ExistConvertData(convertPersonal))
  376. {
  377. action(stockMaid2, "移籍" + convertPersonal == text);
  378. }
  379. }
  380. IL_43F:;
  381. }
  382. else if (stockMaid2.status.heroineType == HeroineType.Original)
  383. {
  384. if (text != null)
  385. {
  386. if (text == "オリジナルメイド")
  387. {
  388. add_maid(stockMaid2);
  389. goto IL_57F;
  390. }
  391. if (text == "雇用メイド")
  392. {
  393. action(stockMaid2, !stockMaid2.status.mainChara);
  394. goto IL_57F;
  395. }
  396. }
  397. string convertPersonal2 = GameMain.Instance.ScenarioSelectMgr.GetConvertPersonal(stockMaid2);
  398. if (text.IndexOf("固定") >= 0)
  399. {
  400. this.IsFixedMaid = true;
  401. if (text == "固定メイド")
  402. {
  403. action(stockMaid2, stockMaid2.status.mainChara && ScenarioData.m_MainMaidList.Contains(convertPersonal2));
  404. }
  405. else
  406. {
  407. action(stockMaid2, stockMaid2.status.mainChara && text == "固定" + convertPersonal2);
  408. }
  409. }
  410. else if (GameMain.Instance.ScenarioSelectMgr.ExistConvertData(convertPersonal2))
  411. {
  412. action(stockMaid2, convertPersonal2 == text);
  413. }
  414. }
  415. IL_57F:;
  416. }
  417. break;
  418. }
  419. case ScenarioData.PlayableCondition.シナリオ:
  420. {
  421. int id = -1;
  422. ScenarioData scenarioData;
  423. if (int.TryParse(text, out id))
  424. {
  425. scenarioData = GameMain.Instance.ScenarioSelectMgr.GetScenarioData(id);
  426. }
  427. else
  428. {
  429. scenarioData = GameMain.Instance.ScenarioSelectMgr.GetScenarioData(text);
  430. }
  431. if (scenarioData != null)
  432. {
  433. action2();
  434. for (int l = 0; l < characterMgr.GetStockMaidCount(); l++)
  435. {
  436. Maid stockMaid3 = characterMgr.GetStockMaid(l);
  437. action(stockMaid3, scenarioData.IsOncePlayed && stockMaid3.status.GetEventEndFlag(scenarioData.ID));
  438. }
  439. }
  440. else if (text.IndexOf("シナリオフラグ") >= 0)
  441. {
  442. set_ok(characterMgr.status.GetFlag(text.Split(new char[]
  443. {
  444. ':'
  445. })[1]) == 1);
  446. }
  447. else if (text.IndexOf("メイドフラグ") >= 0)
  448. {
  449. action2();
  450. for (int m = 0; m < characterMgr.GetStockMaidCount(); m++)
  451. {
  452. Maid stockMaid4 = characterMgr.GetStockMaid(m);
  453. action(stockMaid4, stockMaid4.status.GetFlag(text.Split(new char[]
  454. {
  455. ':'
  456. })[1]) == 1);
  457. }
  458. }
  459. break;
  460. }
  461. case ScenarioData.PlayableCondition.パラメ\u30FCタ:
  462. {
  463. action2();
  464. ParametersPack parametersPack = new ParametersPack();
  465. for (int n = 0; n < characterMgr.GetStockMaidCount(); n++)
  466. {
  467. Maid stockMaid5 = characterMgr.GetStockMaid(n);
  468. parametersPack.Clear();
  469. parametersPack.Parse(text, ',');
  470. action(stockMaid5, parametersPack.GreaterThanOrEqualToStatus(stockMaid5.status));
  471. }
  472. break;
  473. }
  474. case ScenarioData.PlayableCondition.性癖:
  475. action2();
  476. for (int num2 = 0; num2 < characterMgr.GetStockMaidCount(); num2++)
  477. {
  478. Maid stockMaid6 = characterMgr.GetStockMaid(num2);
  479. Propensity.Data[] valueArray = stockMaid6.status.propensitys.GetValueArray();
  480. bool flag2 = false;
  481. for (int num3 = 0; num3 < valueArray.Count<Propensity.Data>(); num3++)
  482. {
  483. if (valueArray[num3].drawName == text)
  484. {
  485. flag2 = true;
  486. add_maid(stockMaid6);
  487. break;
  488. }
  489. }
  490. if (!flag2)
  491. {
  492. remove_maid(stockMaid6);
  493. }
  494. }
  495. break;
  496. case ScenarioData.PlayableCondition.ジョブクラス:
  497. action2();
  498. for (int num4 = 0; num4 < characterMgr.GetStockMaidCount(); num4++)
  499. {
  500. Maid stockMaid7 = characterMgr.GetStockMaid(num4);
  501. SortedDictionary<int, ClassData<JobClass.Data>> allDatas = stockMaid7.status.jobClass.GetAllDatas();
  502. bool flag3 = false;
  503. for (int num5 = 0; num5 < allDatas.Count<KeyValuePair<int, ClassData<JobClass.Data>>>(); num5++)
  504. {
  505. if (allDatas[num5].data.drawName == text)
  506. {
  507. flag3 = true;
  508. add_maid(stockMaid7);
  509. break;
  510. }
  511. }
  512. if (!flag3)
  513. {
  514. remove_maid(stockMaid7);
  515. }
  516. }
  517. break;
  518. case ScenarioData.PlayableCondition.夜伽クラス:
  519. action2();
  520. for (int num6 = 0; num6 < characterMgr.GetStockMaidCount(); num6++)
  521. {
  522. Maid stockMaid8 = characterMgr.GetStockMaid(num6);
  523. SortedDictionary<int, ClassData<YotogiClass.Data>> allDatas2 = stockMaid8.status.yotogiClass.GetAllDatas();
  524. bool flag4 = false;
  525. for (int num7 = 0; num7 < allDatas2.Count<KeyValuePair<int, ClassData<YotogiClass.Data>>>(); num7++)
  526. {
  527. if (allDatas2[num7].data.drawName == text)
  528. {
  529. flag4 = true;
  530. add_maid(stockMaid8);
  531. break;
  532. }
  533. }
  534. if (!flag4)
  535. {
  536. remove_maid(stockMaid8);
  537. }
  538. }
  539. break;
  540. case ScenarioData.PlayableCondition.関係:
  541. action2();
  542. for (int num8 = 0; num8 < characterMgr.GetStockMaidCount(); num8++)
  543. {
  544. Maid stockMaid9 = characterMgr.GetStockMaid(num8);
  545. action(stockMaid9, EnumConvert.GetString(stockMaid9.status.relation) == text);
  546. }
  547. break;
  548. case ScenarioData.PlayableCondition.アイテム:
  549. {
  550. int facilityPowerUpMaterialID = FacilityDataTable.GetFacilityPowerUpMaterialID(text);
  551. set_ok(facilityMgr.GetFacilityPowerUpItemEnable(facilityPowerUpMaterialID));
  552. break;
  553. }
  554. case ScenarioData.PlayableCondition.施設:
  555. {
  556. string[] array3 = text.Replace("Lv", " ").Split(new char[]
  557. {
  558. ' '
  559. });
  560. int facilityTypeID = -1;
  561. if (!int.TryParse(array3[0], out facilityTypeID))
  562. {
  563. facilityTypeID = FacilityDataTable.GetFacilityTypeID(array3[0]);
  564. }
  565. if (array3.Count<string>() > 1)
  566. {
  567. set_ok(facilityMgr.IsExistTypeFacility(facilityTypeID) && facilityMgr.GetFacilityLevel(facilityTypeID) >= int.Parse(array3[1]));
  568. }
  569. else
  570. {
  571. set_ok(facilityMgr.IsExistTypeFacility(facilityTypeID));
  572. }
  573. break;
  574. }
  575. case ScenarioData.PlayableCondition.NTRブロック:
  576. if (text == "○")
  577. {
  578. set_ok(GameMain.Instance.CharacterMgr.status.lockNTRPlay);
  579. }
  580. else
  581. {
  582. set_ok(!GameMain.Instance.CharacterMgr.status.lockNTRPlay);
  583. }
  584. break;
  585. }
  586. }
  587. return isOk;
  588. }
  589. public bool IsEnoughEventMaid()
  590. {
  591. if (!this.IsFixedMaid)
  592. {
  593. return this.EventMaidNum <= this.m_EventMaid.Count;
  594. }
  595. return this.m_EventMaid.Count != 0;
  596. }
  597. public Maid GetEventMaid(int no)
  598. {
  599. return this.m_EventMaid[no];
  600. }
  601. public List<Maid> GetEventMaidList()
  602. {
  603. return this.m_EventMaid;
  604. }
  605. public bool ExistEventMaid(Maid maid)
  606. {
  607. return this.m_EventMaid.Contains(maid);
  608. }
  609. public void AddEventMaid(Maid maid)
  610. {
  611. if (!this.m_EventMaid.Contains(maid) && !maid.status.GetEventEndFlag(this.ID))
  612. {
  613. this.m_EventMaid.Add(maid);
  614. }
  615. }
  616. public void RemoveEventMaid(List<Maid> maid_list, bool not_again = false)
  617. {
  618. foreach (Maid maid in maid_list)
  619. {
  620. this.RemoveEventMaid(maid, not_again);
  621. }
  622. }
  623. public void RemoveEventMaid(Maid maid, bool not_again = false)
  624. {
  625. if (this.m_EventMaid.Contains(maid))
  626. {
  627. this.m_EventMaid.Remove(maid);
  628. if (not_again)
  629. {
  630. maid.status.SetEventEndFlag(this.ID, true);
  631. }
  632. }
  633. }
  634. public void ScenarioPlay(List<Maid> maid_list)
  635. {
  636. if (!this.IsFixedMaid)
  637. {
  638. for (int i = 0; i < maid_list.Count; i++)
  639. {
  640. GameMain.Instance.CharacterMgr.SetActiveMaid(maid_list[i], i);
  641. }
  642. }
  643. this.RemoveEventMaid(maid_list, this.m_NotMaidAgain);
  644. this.IsOncePlayed = true;
  645. }
  646. public ScenarioData.PlayableData[] GetPlayableDataArray()
  647. {
  648. return this.m_PlayableData.Values.ToArray<ScenarioData.PlayableData>();
  649. }
  650. public ScenarioData.PlayableData GetPlayableData(int index)
  651. {
  652. return this.m_PlayableData.Values.ElementAt(index);
  653. }
  654. public ScenarioData.PlayableData GetPlayableData(ScenarioData.PlayableCondition condition)
  655. {
  656. return (!this.m_PlayableData.ContainsKey(condition)) ? null : this.m_PlayableData[condition];
  657. }
  658. public void Serialize(BinaryWriter writer)
  659. {
  660. writer.Write(this.IsOncePlayed);
  661. }
  662. public void Deserialize(BinaryReader reader)
  663. {
  664. try
  665. {
  666. this.IsOncePlayed = reader.ReadBoolean();
  667. if (GameMain.Instance.ScenarioSelectMgr.nSaveVer >= 1f)
  668. {
  669. if (GameMain.Instance.ScenarioSelectMgr.nSaveVer < 1.2f)
  670. {
  671. reader.ReadInt32();
  672. }
  673. }
  674. else
  675. {
  676. reader.ReadBoolean();
  677. }
  678. if (GameMain.Instance.ScenarioSelectMgr.nSaveVer >= 1.1f && GameMain.Instance.ScenarioSelectMgr.nSaveVer < 1.3f)
  679. {
  680. reader.ReadBoolean();
  681. }
  682. }
  683. catch
  684. {
  685. if (GameMain.Instance.ScenarioSelectMgr.DeserializeFiled)
  686. {
  687. Debug.Log("ScenarioSelectMgr.cs:前のバージョンのデータです(2017/10/24より前)");
  688. }
  689. else
  690. {
  691. Debug.LogError("ScenarioSelectMgr.cs:読み込みエラー");
  692. }
  693. }
  694. }
  695. public void Recet()
  696. {
  697. this.IsOncePlayed = false;
  698. }
  699. private static string[] m_MainMaidList = new string[]
  700. {
  701. "無垢",
  702. "真面目",
  703. "凜デレ",
  704. "純真",
  705. "クーデレ",
  706. "ツンデレ"
  707. };
  708. public readonly int ID;
  709. public readonly Dictionary<ScenarioData.PlayableCondition, ScenarioData.PlayableData> m_PlayableData = new Dictionary<ScenarioData.PlayableCondition, ScenarioData.PlayableData>();
  710. public readonly string Title;
  711. public readonly string EventContents;
  712. public readonly string ScenarioScript;
  713. public readonly string ScriptLabel;
  714. public readonly int EventMaidNum;
  715. public readonly string IconName;
  716. public readonly bool IsImportant;
  717. public readonly bool IsOncePlayOnly;
  718. public readonly string[] ConditionText;
  719. public readonly string Notification;
  720. private List<Maid> m_EventMaid = new List<Maid>();
  721. private bool m_NotMaidAgain = true;
  722. private bool m_ExistMaidUpdate;
  723. public enum PlayableCondition
  724. {
  725. 好感度,
  726. 時間帯,
  727. 属性,
  728. シナリオ,
  729. パラメ\u30FCタ,
  730. 性癖,
  731. ジョブクラス,
  732. 夜伽クラス,
  733. 関係,
  734. アイテム,
  735. 施設,
  736. NTRブロック,
  737. MAX
  738. }
  739. public class PlayableData
  740. {
  741. public PlayableData(string data, ScenarioData.PlayableCondition condition)
  742. {
  743. this.Condition = condition;
  744. this.StringData = data.Replace('.', '.').Replace(',', ',').Replace(',', '&');
  745. }
  746. public string[] StrdataArray
  747. {
  748. get
  749. {
  750. return this.StringData.Split(new char[]
  751. {
  752. ','
  753. });
  754. }
  755. }
  756. public readonly string StringData;
  757. public readonly ScenarioData.PlayableCondition Condition;
  758. }
  759. }