YotogiOld.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. using System;
  2. using System.Collections.Generic;
  3. using MaidStatus;
  4. using UnityEngine;
  5. using wf;
  6. using Yotogis;
  7. public class YotogiOld
  8. {
  9. public static void CreateData()
  10. {
  11. if (YotogiOld.stage_data_list_ != null)
  12. {
  13. return;
  14. }
  15. Dictionary<YotogiOld.Stage, string> enabled_stage_dic = new Dictionary<YotogiOld.Stage, string>();
  16. Action<string> action = delegate(string file_name)
  17. {
  18. file_name += ".nei";
  19. if (!GameUty.FileSystemOld.IsExistentFile(file_name))
  20. {
  21. return;
  22. }
  23. using (AFileBase afileBase = GameUty.FileSystemOld.FileOpen(file_name))
  24. {
  25. using (CsvParser csvParser = new CsvParser())
  26. {
  27. bool condition = csvParser.Open(afileBase);
  28. NDebug.Assert(condition, file_name + "\nopen failed.");
  29. for (int j = 1; j < csvParser.max_cell_y; j++)
  30. {
  31. if (csvParser.IsCellToExistData(0, j))
  32. {
  33. string cellAsString = csvParser.GetCellAsString(0, j);
  34. string cellAsString2 = csvParser.GetCellAsString(1, j);
  35. YotogiOld.Stage stage = YotogiOld.Stage.MAX;
  36. try
  37. {
  38. stage = (YotogiOld.Stage)Enum.Parse(typeof(YotogiOld.Stage), cellAsString);
  39. }
  40. catch
  41. {
  42. NDebug.Assert(cellAsString + " enum error", false);
  43. }
  44. if (stage != YotogiOld.Stage.MAX && !enabled_stage_dic.ContainsKey(stage))
  45. {
  46. enabled_stage_dic.Add(stage, cellAsString2);
  47. }
  48. }
  49. }
  50. }
  51. }
  52. };
  53. action("yotogi_stage_list");
  54. for (int i = 0; i < GameUty.PathListOld.Count; i++)
  55. {
  56. action("yotogi_stage_list_" + GameUty.PathListOld[i]);
  57. }
  58. HashSet<int> enabled_vr_stage_set = new HashSet<int>();
  59. CsvCommonIdManager.ReadEnabledIdList(GameUty.FileSystemOld, GameUty.PathListOld, "vr_yotogi_stage_enabled_list", ref enabled_vr_stage_set);
  60. Func<string, bool, Dictionary<YotogiOld.Stage, YotogiOld.StageData>> func = delegate(string file_name, bool is_vr_csv)
  61. {
  62. Dictionary<YotogiOld.Stage, YotogiOld.StageData> dictionary = new Dictionary<YotogiOld.Stage, YotogiOld.StageData>();
  63. file_name += ".nei";
  64. if (!GameUty.FileSystemOld.IsExistentFile(file_name))
  65. {
  66. return dictionary;
  67. }
  68. using (AFileBase afileBase = GameUty.FileSystemOld.FileOpen(file_name))
  69. {
  70. using (CsvParser csvParser = new CsvParser())
  71. {
  72. bool condition = csvParser.Open(afileBase);
  73. NDebug.Assert(condition, file_name + "\nopen failed.");
  74. for (int j = 1; j < csvParser.max_cell_y; j++)
  75. {
  76. if (csvParser.IsCellToExistData(0, j))
  77. {
  78. YotogiOld.StageData stageData = new YotogiOld.StageData(csvParser, j, is_vr_csv);
  79. bool flag;
  80. if (!is_vr_csv)
  81. {
  82. flag = enabled_stage_dic.ContainsKey(stageData.stage);
  83. }
  84. else
  85. {
  86. flag = enabled_vr_stage_set.Contains(stageData.sort_id);
  87. }
  88. if (flag)
  89. {
  90. if (!is_vr_csv)
  91. {
  92. stageData.SetPrefabName(enabled_stage_dic[stageData.stage]);
  93. }
  94. dictionary.Add(stageData.stage, stageData);
  95. }
  96. }
  97. }
  98. }
  99. }
  100. return dictionary;
  101. };
  102. YotogiOld.stage_data_list_ = func("yotogi_stage_setting", false);
  103. YotogiOld.vr_stage_data_list_ = func("vr_yotogi_stage_setting", true);
  104. }
  105. public static Skill.Old.Data GetSkillData(int skill_id)
  106. {
  107. Skill.Old.Data data = Skill.Old.Get(skill_id);
  108. NDebug.Assert(data != null, "夜伽スキルID[" + skill_id.ToString() + "]のスキルを見つける事ができませんでした");
  109. return data;
  110. }
  111. public static bool IsSkillData(int skill_id)
  112. {
  113. return Skill.Old.Contains(skill_id);
  114. }
  115. public static YotogiOld.VRSkillData GetVRSkillData(int id)
  116. {
  117. foreach (YotogiOld.VRSkillData vrskillData in YotogiOld.vr_skill_data_dic_)
  118. {
  119. Skill.Old.Data skill = vrskillData.skill;
  120. if (skill.id == id)
  121. {
  122. return vrskillData;
  123. }
  124. }
  125. return null;
  126. }
  127. public static List<YotogiOld.VRSkillData> GetVRSkillDataList(YotogiOld.Stage stage, int spot_no)
  128. {
  129. if (spot_no < 0)
  130. {
  131. return null;
  132. }
  133. List<YotogiOld.VRSkillData> list = new List<YotogiOld.VRSkillData>();
  134. foreach (YotogiOld.VRSkillData vrskillData in YotogiOld.vr_skill_data_dic_)
  135. {
  136. if (vrskillData.stage_data_dic.ContainsKey(stage) && vrskillData.stage_data_dic[stage].enabled_stage && spot_no < vrskillData.stage_data_dic[stage].enabled_spot.Length && vrskillData.stage_data_dic[stage].enabled_spot[spot_no])
  137. {
  138. list.Add(vrskillData);
  139. }
  140. }
  141. return list;
  142. }
  143. public static SortedDictionary<int, Skill.Old.Data> GetCategorySkillDataList(YotogiOld.Category category)
  144. {
  145. return Skill.Old.skill_data_list[(int)category];
  146. }
  147. public static List<KeyValuePair<YotogiOld.StageData, bool>> GetPlayableStageList(int grade_id, Dictionary<string, int> check_flag_dic)
  148. {
  149. List<KeyValuePair<YotogiOld.StageData, bool>> list = new List<KeyValuePair<YotogiOld.StageData, bool>>();
  150. for (int i = 0; i < 28; i++)
  151. {
  152. YotogiOld.Stage key = (YotogiOld.Stage)i;
  153. if (YotogiOld.stage_data_list_.ContainsKey(key))
  154. {
  155. bool value;
  156. if (string.IsNullOrEmpty(YotogiOld.stage_data_list_[key].need_flag))
  157. {
  158. value = (YotogiOld.stage_data_list_[key].need_grade <= grade_id);
  159. }
  160. else
  161. {
  162. value = (check_flag_dic == null || (check_flag_dic.Count > 0 && check_flag_dic.ContainsKey(YotogiOld.stage_data_list_[key].need_flag) && 1 <= check_flag_dic[YotogiOld.stage_data_list_[key].need_flag]));
  163. }
  164. list.Add(new KeyValuePair<YotogiOld.StageData, bool>(YotogiOld.stage_data_list_[key], value));
  165. }
  166. }
  167. list.Sort((KeyValuePair<YotogiOld.StageData, bool> a, KeyValuePair<YotogiOld.StageData, bool> b) => a.Key.sort_id - b.Key.sort_id);
  168. return list;
  169. }
  170. public static YotogiOld.StageData GetStageData(string bg_prefab_name)
  171. {
  172. YotogiOld.StageData result = null;
  173. foreach (KeyValuePair<YotogiOld.Stage, YotogiOld.StageData> keyValuePair in YotogiOld.stage_data_list_)
  174. {
  175. if (keyValuePair.Value.prefab_name == bg_prefab_name || keyValuePair.Value.prefab_name_night == bg_prefab_name)
  176. {
  177. result = keyValuePair.Value;
  178. break;
  179. }
  180. }
  181. return result;
  182. }
  183. public static SortedDictionary<int, Skill.Old.Data>[] skill_data_list
  184. {
  185. get
  186. {
  187. return Skill.Old.skill_data_list;
  188. }
  189. }
  190. public static Dictionary<YotogiOld.Stage, YotogiOld.StageData> stage_data_list
  191. {
  192. get
  193. {
  194. return YotogiOld.stage_data_list_;
  195. }
  196. }
  197. public static List<YotogiOld.VRSkillData> vr_skill_data_dic
  198. {
  199. get
  200. {
  201. return YotogiOld.vr_skill_data_dic_;
  202. }
  203. }
  204. public static Dictionary<YotogiOld.Stage, YotogiOld.StageData> vr_stage_data_list
  205. {
  206. get
  207. {
  208. return YotogiOld.vr_stage_data_list_;
  209. }
  210. }
  211. public const int kSkillMaxSlot = 7;
  212. private static List<YotogiOld.VRSkillData> vr_skill_data_dic_;
  213. private static Dictionary<YotogiOld.Stage, YotogiOld.StageData> stage_data_list_;
  214. private static Dictionary<YotogiOld.Stage, YotogiOld.StageData> vr_stage_data_list_;
  215. public enum SexualType
  216. {
  217. Null,
  218. Mouth,
  219. Throat,
  220. Nipple,
  221. Front,
  222. Back,
  223. Curi
  224. }
  225. public enum ExcitementStatus
  226. {
  227. Minus,
  228. Small,
  229. Medium,
  230. Large
  231. }
  232. public enum SkillCommandType
  233. {
  234. 挿入,
  235. 継続,
  236. 単発,
  237. 単発_挿入,
  238. 絶頂,
  239. 止める
  240. }
  241. public enum RCType
  242. {
  243. RCNull,
  244. RC_1,
  245. RC0,
  246. RC1,
  247. RC2
  248. }
  249. public enum RRCType
  250. {
  251. RRCNull,
  252. RRC_4,
  253. RRC_3,
  254. RRC_2,
  255. RRC_1,
  256. RRC1,
  257. RRC2,
  258. RRC3,
  259. RRC4,
  260. RRC5,
  261. RRC6,
  262. RRC7,
  263. RRC8,
  264. RRC9,
  265. RRC10
  266. }
  267. public enum RRType
  268. {
  269. RRNull,
  270. RR_2,
  271. RR_1,
  272. RR1,
  273. RR2,
  274. RR3,
  275. RR4,
  276. RR5,
  277. RR6
  278. }
  279. public enum Category
  280. {
  281. 淫欲,
  282. 変態,
  283. 奉仕,
  284. M性,
  285. 交換,
  286. 乱交,
  287. 詰られ,
  288. ハ\u30FCレム,
  289. 百合,
  290. MAX
  291. }
  292. public enum Stage
  293. {
  294. サロン,
  295. 主人公の部屋,
  296. プレイル\u30FCム,
  297. プ\u30FCル,
  298. 初代バスル\u30FCム,
  299. SMル\u30FCム,
  300. プレイル\u30FCム2,
  301. 中庭,
  302. 大浴場,
  303. メイド部屋,
  304. 花魁風プレイル\u30FCム,
  305. 新ペントハウス,
  306. 屋外,
  307. 地下室,
  308. ロッカ\u30FCル\u30FCム,
  309. トイレ,
  310. 電車,
  311. 教室,
  312. ハネム\u30FCンル\u30FCム,
  313. 南国,
  314. 和風旅館,
  315. コスプレ会場,
  316. プライベ\u30FCトル\u30FCム,
  317. 海,
  318. 畑,
  319. ヴィラ,
  320. ベットル\u30FCム,
  321. 露天風呂,
  322. MAX
  323. }
  324. public class StageData
  325. {
  326. public StageData(CsvParser csv, int csv_y, bool vr_stage)
  327. {
  328. int cell_x = 0;
  329. if (!vr_stage)
  330. {
  331. string cellAsString = csv.GetCellAsString(cell_x++, csv_y);
  332. bool flag = true;
  333. foreach (char c in cellAsString)
  334. {
  335. if ((c < '0' || c > '9') && c != ' ' && c != '-')
  336. {
  337. flag = false;
  338. break;
  339. }
  340. }
  341. if (flag)
  342. {
  343. this.need_flag = string.Empty;
  344. this.need_grade = int.Parse(cellAsString);
  345. }
  346. else
  347. {
  348. this.need_flag = cellAsString;
  349. this.need_grade = 0;
  350. }
  351. this.sort_id = csv.GetCellAsInteger(cell_x++, csv_y);
  352. this.draw_name = csv.GetCellAsString(cell_x++, csv_y);
  353. this.stage_name = csv.GetCellAsString(cell_x++, csv_y);
  354. string text2 = this.stage_name;
  355. try
  356. {
  357. this.stage = (YotogiOld.Stage)Enum.Parse(typeof(YotogiOld.Stage), text2);
  358. }
  359. catch (ArgumentException)
  360. {
  361. NDebug.Assert("Yotogi.Stage\nenum parse error.[" + text2 + "]", false);
  362. }
  363. this.thumbnail_name = csv.GetCellAsString(cell_x++, csv_y);
  364. this.bgm_file = csv.GetCellAsString(cell_x++, csv_y) + ".ogg";
  365. string cellAsString2 = csv.GetCellAsString(cell_x++, csv_y);
  366. string[] array = cellAsString2.Split(new char[]
  367. {
  368. ','
  369. });
  370. NDebug.Assert(array.Length == 6, "ステージカメラ設定が不正です\nLine : " + csv_y.ToString());
  371. this.camera_data.stage_select_camera_center = new Vector3(float.Parse(array[0]), float.Parse(array[1]), float.Parse(array[2]));
  372. this.camera_data.stage_select_camera_radius = float.Parse(array[3]);
  373. this.camera_data.stage_select_camera_rotate = new Vector2(float.Parse(array[4]), float.Parse(array[5]));
  374. cellAsString2 = csv.GetCellAsString(cell_x++, csv_y);
  375. array = cellAsString2.Split(new char[]
  376. {
  377. ','
  378. });
  379. NDebug.Assert(array.Length == 6, "カス子位置情報が不正です\nLine : " + csv_y.ToString());
  380. this.camera_data.skill_select_chara_pos = new Vector3(float.Parse(array[0]), float.Parse(array[1]), float.Parse(array[2]));
  381. this.camera_data.skill_select_chara_rotate = new Vector3(float.Parse(array[3]), float.Parse(array[4]), float.Parse(array[5]));
  382. cellAsString2 = csv.GetCellAsString(cell_x++, csv_y);
  383. array = cellAsString2.Split(new char[]
  384. {
  385. ','
  386. });
  387. NDebug.Assert(array.Length == 2, "スキル選択時カメラデータが不正です\nLine : " + csv_y.ToString());
  388. this.camera_data.skill_select_camera_rotate = new Vector2(float.Parse(array[0]), float.Parse(array[1]));
  389. string cellAsString3 = csv.GetCellAsString(cell_x++, csv_y);
  390. string[] array2 = cellAsString3.Split(new char[]
  391. {
  392. ','
  393. });
  394. NDebug.Assert(array2.Length == 4, "スキル選択時ライトデータが不正です\nLine : " + csv_y.ToString());
  395. this.camera_data.skill_select_light_pos = new Vector3(float.Parse(array2[0]), float.Parse(array2[1]), float.Parse(array2[2]));
  396. this.camera_data.skill_select_light_intensity = float.Parse(array2[3]);
  397. }
  398. else
  399. {
  400. this.sort_id = csv.GetCellAsInteger(cell_x++, csv_y);
  401. this.draw_name = csv.GetCellAsString(cell_x++, csv_y);
  402. this.stage_name = csv.GetCellAsString(cell_x++, csv_y);
  403. string text3 = this.stage_name;
  404. try
  405. {
  406. this.stage = (YotogiOld.Stage)Enum.Parse(typeof(YotogiOld.Stage), text3);
  407. }
  408. catch (ArgumentException)
  409. {
  410. NDebug.Assert("Yotogi.Stage\nenum parse error.[" + text3 + "]", false);
  411. }
  412. string[] array3 = csv.GetCellAsString(cell_x++, csv_y).Split(new char[]
  413. {
  414. ','
  415. });
  416. this.prefab_name_ = array3[0];
  417. this.prefab_name_night_ = array3[1];
  418. array3 = csv.GetCellAsString(cell_x++, csv_y).Split(new char[]
  419. {
  420. ','
  421. });
  422. this.bgm_file = array3[0];
  423. this.bgm_file_night = array3[0];
  424. array3 = csv.GetCellAsString(cell_x++, csv_y).Split(new char[]
  425. {
  426. ','
  427. });
  428. this.thumbnail_name = array3[0];
  429. this.thumbnail_name_night = array3[1];
  430. List<string[]> list = new List<string[]>();
  431. while (csv.IsCellToExistData(cell_x, csv_y))
  432. {
  433. list.Add(csv.GetCellAsString(cell_x++, csv_y).Split(new char[]
  434. {
  435. ','
  436. }));
  437. }
  438. this.spot_data = new YotogiOld.StageData.SpotData[list.Count];
  439. for (int j = 0; j < list.Count; j++)
  440. {
  441. YotogiOld.StageData.SpotData spotData = default(YotogiOld.StageData.SpotData);
  442. spotData.name = list[j][0];
  443. spotData.thumbnail_name_daytime = list[j][1];
  444. spotData.thumbnail_name_night = list[j][2];
  445. this.spot_data[j] = spotData;
  446. }
  447. }
  448. }
  449. public void SetPrefabName(string set_prefab_name)
  450. {
  451. this.prefab_name_ = set_prefab_name;
  452. }
  453. public string prefab_name
  454. {
  455. get
  456. {
  457. return this.prefab_name_;
  458. }
  459. }
  460. public string prefab_name_night
  461. {
  462. get
  463. {
  464. return this.prefab_name_night_;
  465. }
  466. }
  467. public readonly int sort_id;
  468. public readonly string draw_name;
  469. public readonly YotogiOld.Stage stage;
  470. public readonly string stage_name;
  471. public readonly int need_grade;
  472. public readonly string need_flag;
  473. public readonly string thumbnail_name;
  474. public readonly string thumbnail_name_night;
  475. public readonly string bgm_file;
  476. public readonly string bgm_file_night;
  477. public readonly YotogiOld.StageData.CameraData camera_data = default(YotogiOld.StageData.CameraData);
  478. public readonly YotogiOld.StageData.SpotData[] spot_data;
  479. private string prefab_name_;
  480. private string prefab_name_night_;
  481. public struct CameraData
  482. {
  483. public Vector3 stage_select_camera_center;
  484. public Vector2 stage_select_camera_rotate;
  485. public float stage_select_camera_radius;
  486. public Vector3 skill_select_chara_pos;
  487. public Vector3 skill_select_chara_rotate;
  488. public Vector2 skill_select_camera_rotate;
  489. public Vector3 skill_select_light_pos;
  490. public float skill_select_light_intensity;
  491. }
  492. public struct SpotData
  493. {
  494. public string name;
  495. public string thumbnail_name_daytime;
  496. public string thumbnail_name_night;
  497. }
  498. }
  499. public class VRSkillData
  500. {
  501. public Skill.Old.Data skill;
  502. public Dictionary<YotogiOld.Stage, YotogiOld.VRSkillData.StageData> stage_data_dic;
  503. public class StageData
  504. {
  505. public YotogiOld.Stage stage;
  506. public string ft_file_name;
  507. public bool[] enabled_spot;
  508. public bool enabled_stage;
  509. }
  510. }
  511. public struct SkillDataPair
  512. {
  513. public static YotogiOld.SkillDataPair Create(Maid maid, int skill_id)
  514. {
  515. YotogiOld.SkillDataPair result;
  516. result.maid = maid;
  517. result.base_data = YotogiOld.GetSkillData(skill_id);
  518. result.param = maid.status.yotogiSkill.Get(skill_id);
  519. return result;
  520. }
  521. public static YotogiOld.SkillDataPair CreateBaseDataOnly(Maid maid, Skill.Old.Data base_data)
  522. {
  523. YotogiOld.SkillDataPair result;
  524. result.maid = maid;
  525. result.base_data = base_data;
  526. result.param = null;
  527. return result;
  528. }
  529. public static YotogiOld.SkillDataPair Create(Maid maid, Skill.Old.Data base_data)
  530. {
  531. YotogiOld.SkillDataPair result;
  532. result.maid = maid;
  533. result.base_data = base_data;
  534. result.param = maid.status.yotogiSkill.Get(base_data.id);
  535. return result;
  536. }
  537. public static YotogiOld.SkillDataPair Create(Maid maid, YotogiSkillData param)
  538. {
  539. YotogiOld.SkillDataPair result;
  540. result.maid = maid;
  541. result.base_data = YotogiOld.GetSkillData(param.id);
  542. result.param = param;
  543. return result;
  544. }
  545. public Skill.Old.Data base_data;
  546. public YotogiSkillData param;
  547. public Maid maid;
  548. }
  549. }