123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615 |
- using System;
- using System.Collections.Generic;
- using MaidStatus;
- using UnityEngine;
- using wf;
- using Yotogis;
- public class YotogiOld
- {
- public static void CreateData()
- {
- if (YotogiOld.stage_data_list_ != null)
- {
- return;
- }
- Dictionary<YotogiOld.Stage, string> enabled_stage_dic = new Dictionary<YotogiOld.Stage, string>();
- Action<string> action = delegate(string file_name)
- {
- file_name += ".nei";
- if (!GameUty.FileSystemOld.IsExistentFile(file_name))
- {
- return;
- }
- using (AFileBase afileBase = GameUty.FileSystemOld.FileOpen(file_name))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, file_name + "\nopen failed.");
- for (int j = 1; j < csvParser.max_cell_y; j++)
- {
- if (csvParser.IsCellToExistData(0, j))
- {
- string cellAsString = csvParser.GetCellAsString(0, j);
- string cellAsString2 = csvParser.GetCellAsString(1, j);
- YotogiOld.Stage stage = YotogiOld.Stage.MAX;
- try
- {
- stage = (YotogiOld.Stage)Enum.Parse(typeof(YotogiOld.Stage), cellAsString);
- }
- catch
- {
- NDebug.Assert(cellAsString + " enum error", false);
- }
- if (stage != YotogiOld.Stage.MAX && !enabled_stage_dic.ContainsKey(stage))
- {
- enabled_stage_dic.Add(stage, cellAsString2);
- }
- }
- }
- }
- }
- };
- action("yotogi_stage_list");
- for (int i = 0; i < GameUty.PathListOld.Count; i++)
- {
- action("yotogi_stage_list_" + GameUty.PathListOld[i]);
- }
- HashSet<int> enabled_vr_stage_set = new HashSet<int>();
- CsvCommonIdManager.ReadEnabledIdList(GameUty.FileSystemOld, GameUty.PathListOld, "vr_yotogi_stage_enabled_list", ref enabled_vr_stage_set);
- Func<string, bool, Dictionary<YotogiOld.Stage, YotogiOld.StageData>> func = delegate(string file_name, bool is_vr_csv)
- {
- Dictionary<YotogiOld.Stage, YotogiOld.StageData> dictionary = new Dictionary<YotogiOld.Stage, YotogiOld.StageData>();
- file_name += ".nei";
- if (!GameUty.FileSystemOld.IsExistentFile(file_name))
- {
- return dictionary;
- }
- using (AFileBase afileBase = GameUty.FileSystemOld.FileOpen(file_name))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, file_name + "\nopen failed.");
- for (int j = 1; j < csvParser.max_cell_y; j++)
- {
- if (csvParser.IsCellToExistData(0, j))
- {
- YotogiOld.StageData stageData = new YotogiOld.StageData(csvParser, j, is_vr_csv);
- bool flag;
- if (!is_vr_csv)
- {
- flag = enabled_stage_dic.ContainsKey(stageData.stage);
- }
- else
- {
- flag = enabled_vr_stage_set.Contains(stageData.sort_id);
- }
- if (flag)
- {
- if (!is_vr_csv)
- {
- stageData.SetPrefabName(enabled_stage_dic[stageData.stage]);
- }
- dictionary.Add(stageData.stage, stageData);
- }
- }
- }
- }
- }
- return dictionary;
- };
- YotogiOld.stage_data_list_ = func("yotogi_stage_setting", false);
- YotogiOld.vr_stage_data_list_ = func("vr_yotogi_stage_setting", true);
- }
- public static Skill.Old.Data GetSkillData(int skill_id)
- {
- Skill.Old.Data data = Skill.Old.Get(skill_id);
- NDebug.Assert(data != null, "夜伽スキルID[" + skill_id.ToString() + "]のスキルを見つける事ができませんでした");
- return data;
- }
- public static bool IsSkillData(int skill_id)
- {
- return Skill.Old.Contains(skill_id);
- }
- public static YotogiOld.VRSkillData GetVRSkillData(int id)
- {
- foreach (YotogiOld.VRSkillData vrskillData in YotogiOld.vr_skill_data_dic_)
- {
- Skill.Old.Data skill = vrskillData.skill;
- if (skill.id == id)
- {
- return vrskillData;
- }
- }
- return null;
- }
- public static List<YotogiOld.VRSkillData> GetVRSkillDataList(YotogiOld.Stage stage, int spot_no)
- {
- if (spot_no < 0)
- {
- return null;
- }
- List<YotogiOld.VRSkillData> list = new List<YotogiOld.VRSkillData>();
- foreach (YotogiOld.VRSkillData vrskillData in YotogiOld.vr_skill_data_dic_)
- {
- 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])
- {
- list.Add(vrskillData);
- }
- }
- return list;
- }
- public static SortedDictionary<int, Skill.Old.Data> GetCategorySkillDataList(YotogiOld.Category category)
- {
- return Skill.Old.skill_data_list[(int)category];
- }
- public static List<KeyValuePair<YotogiOld.StageData, bool>> GetPlayableStageList(int grade_id, Dictionary<string, int> check_flag_dic)
- {
- List<KeyValuePair<YotogiOld.StageData, bool>> list = new List<KeyValuePair<YotogiOld.StageData, bool>>();
- for (int i = 0; i < 28; i++)
- {
- YotogiOld.Stage key = (YotogiOld.Stage)i;
- if (YotogiOld.stage_data_list_.ContainsKey(key))
- {
- bool value;
- if (string.IsNullOrEmpty(YotogiOld.stage_data_list_[key].need_flag))
- {
- value = (YotogiOld.stage_data_list_[key].need_grade <= grade_id);
- }
- else
- {
- 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]));
- }
- list.Add(new KeyValuePair<YotogiOld.StageData, bool>(YotogiOld.stage_data_list_[key], value));
- }
- }
- list.Sort((KeyValuePair<YotogiOld.StageData, bool> a, KeyValuePair<YotogiOld.StageData, bool> b) => a.Key.sort_id - b.Key.sort_id);
- return list;
- }
- public static YotogiOld.StageData GetStageData(string bg_prefab_name)
- {
- YotogiOld.StageData result = null;
- foreach (KeyValuePair<YotogiOld.Stage, YotogiOld.StageData> keyValuePair in YotogiOld.stage_data_list_)
- {
- if (keyValuePair.Value.prefab_name == bg_prefab_name || keyValuePair.Value.prefab_name_night == bg_prefab_name)
- {
- result = keyValuePair.Value;
- break;
- }
- }
- return result;
- }
- public static SortedDictionary<int, Skill.Old.Data>[] skill_data_list
- {
- get
- {
- return Skill.Old.skill_data_list;
- }
- }
- public static Dictionary<YotogiOld.Stage, YotogiOld.StageData> stage_data_list
- {
- get
- {
- return YotogiOld.stage_data_list_;
- }
- }
- public static List<YotogiOld.VRSkillData> vr_skill_data_dic
- {
- get
- {
- return YotogiOld.vr_skill_data_dic_;
- }
- }
- public static Dictionary<YotogiOld.Stage, YotogiOld.StageData> vr_stage_data_list
- {
- get
- {
- return YotogiOld.vr_stage_data_list_;
- }
- }
- public const int kSkillMaxSlot = 7;
- private static List<YotogiOld.VRSkillData> vr_skill_data_dic_;
- private static Dictionary<YotogiOld.Stage, YotogiOld.StageData> stage_data_list_;
- private static Dictionary<YotogiOld.Stage, YotogiOld.StageData> vr_stage_data_list_;
- public enum SexualType
- {
- Null,
- Mouth,
- Throat,
- Nipple,
- Front,
- Back,
- Curi
- }
- public enum ExcitementStatus
- {
- Minus,
- Small,
- Medium,
- Large
- }
- public enum SkillCommandType
- {
- 挿入,
- 継続,
- 単発,
- 単発_挿入,
- 絶頂,
- 止める
- }
- public enum RCType
- {
- RCNull,
- RC_1,
- RC0,
- RC1,
- RC2
- }
- public enum RRCType
- {
- RRCNull,
- RRC_4,
- RRC_3,
- RRC_2,
- RRC_1,
- RRC1,
- RRC2,
- RRC3,
- RRC4,
- RRC5,
- RRC6,
- RRC7,
- RRC8,
- RRC9,
- RRC10
- }
- public enum RRType
- {
- RRNull,
- RR_2,
- RR_1,
- RR1,
- RR2,
- RR3,
- RR4,
- RR5,
- RR6
- }
- public enum Category
- {
- 淫欲,
- 変態,
- 奉仕,
- M性,
- 交換,
- 乱交,
- 詰られ,
- ハ\u30FCレム,
- 百合,
- MAX
- }
- public enum Stage
- {
- サロン,
- 主人公の部屋,
- プレイル\u30FCム,
- プ\u30FCル,
- 初代バスル\u30FCム,
- SMル\u30FCム,
- プレイル\u30FCム2,
- 中庭,
- 大浴場,
- メイド部屋,
- 花魁風プレイル\u30FCム,
- 新ペントハウス,
- 屋外,
- 地下室,
- ロッカ\u30FCル\u30FCム,
- トイレ,
- 電車,
- 教室,
- ハネム\u30FCンル\u30FCム,
- 南国,
- 和風旅館,
- コスプレ会場,
- プライベ\u30FCトル\u30FCム,
- 海,
- 畑,
- ヴィラ,
- ベットル\u30FCム,
- 露天風呂,
- MAX
- }
- public class StageData
- {
- public StageData(CsvParser csv, int csv_y, bool vr_stage)
- {
- int cell_x = 0;
- if (!vr_stage)
- {
- string cellAsString = csv.GetCellAsString(cell_x++, csv_y);
- bool flag = true;
- foreach (char c in cellAsString)
- {
- if ((c < '0' || c > '9') && c != ' ' && c != '-')
- {
- flag = false;
- break;
- }
- }
- if (flag)
- {
- this.need_flag = string.Empty;
- this.need_grade = int.Parse(cellAsString);
- }
- else
- {
- this.need_flag = cellAsString;
- this.need_grade = 0;
- }
- this.sort_id = csv.GetCellAsInteger(cell_x++, csv_y);
- this.draw_name = csv.GetCellAsString(cell_x++, csv_y);
- this.stage_name = csv.GetCellAsString(cell_x++, csv_y);
- string text2 = this.stage_name;
- try
- {
- this.stage = (YotogiOld.Stage)Enum.Parse(typeof(YotogiOld.Stage), text2);
- }
- catch (ArgumentException)
- {
- NDebug.Assert("Yotogi.Stage\nenum parse error.[" + text2 + "]", false);
- }
- this.thumbnail_name = csv.GetCellAsString(cell_x++, csv_y);
- this.bgm_file = csv.GetCellAsString(cell_x++, csv_y) + ".ogg";
- string cellAsString2 = csv.GetCellAsString(cell_x++, csv_y);
- string[] array = cellAsString2.Split(new char[]
- {
- ','
- });
- NDebug.Assert(array.Length == 6, "ステージカメラ設定が不正です\nLine : " + csv_y.ToString());
- this.camera_data.stage_select_camera_center = new Vector3(float.Parse(array[0]), float.Parse(array[1]), float.Parse(array[2]));
- this.camera_data.stage_select_camera_radius = float.Parse(array[3]);
- this.camera_data.stage_select_camera_rotate = new Vector2(float.Parse(array[4]), float.Parse(array[5]));
- cellAsString2 = csv.GetCellAsString(cell_x++, csv_y);
- array = cellAsString2.Split(new char[]
- {
- ','
- });
- NDebug.Assert(array.Length == 6, "カス子位置情報が不正です\nLine : " + csv_y.ToString());
- this.camera_data.skill_select_chara_pos = new Vector3(float.Parse(array[0]), float.Parse(array[1]), float.Parse(array[2]));
- this.camera_data.skill_select_chara_rotate = new Vector3(float.Parse(array[3]), float.Parse(array[4]), float.Parse(array[5]));
- cellAsString2 = csv.GetCellAsString(cell_x++, csv_y);
- array = cellAsString2.Split(new char[]
- {
- ','
- });
- NDebug.Assert(array.Length == 2, "スキル選択時カメラデータが不正です\nLine : " + csv_y.ToString());
- this.camera_data.skill_select_camera_rotate = new Vector2(float.Parse(array[0]), float.Parse(array[1]));
- string cellAsString3 = csv.GetCellAsString(cell_x++, csv_y);
- string[] array2 = cellAsString3.Split(new char[]
- {
- ','
- });
- NDebug.Assert(array2.Length == 4, "スキル選択時ライトデータが不正です\nLine : " + csv_y.ToString());
- this.camera_data.skill_select_light_pos = new Vector3(float.Parse(array2[0]), float.Parse(array2[1]), float.Parse(array2[2]));
- this.camera_data.skill_select_light_intensity = float.Parse(array2[3]);
- }
- else
- {
- this.sort_id = csv.GetCellAsInteger(cell_x++, csv_y);
- this.draw_name = csv.GetCellAsString(cell_x++, csv_y);
- this.stage_name = csv.GetCellAsString(cell_x++, csv_y);
- string text3 = this.stage_name;
- try
- {
- this.stage = (YotogiOld.Stage)Enum.Parse(typeof(YotogiOld.Stage), text3);
- }
- catch (ArgumentException)
- {
- NDebug.Assert("Yotogi.Stage\nenum parse error.[" + text3 + "]", false);
- }
- string[] array3 = csv.GetCellAsString(cell_x++, csv_y).Split(new char[]
- {
- ','
- });
- this.prefab_name_ = array3[0];
- this.prefab_name_night_ = array3[1];
- array3 = csv.GetCellAsString(cell_x++, csv_y).Split(new char[]
- {
- ','
- });
- this.bgm_file = array3[0];
- this.bgm_file_night = array3[0];
- array3 = csv.GetCellAsString(cell_x++, csv_y).Split(new char[]
- {
- ','
- });
- this.thumbnail_name = array3[0];
- this.thumbnail_name_night = array3[1];
- List<string[]> list = new List<string[]>();
- while (csv.IsCellToExistData(cell_x, csv_y))
- {
- list.Add(csv.GetCellAsString(cell_x++, csv_y).Split(new char[]
- {
- ','
- }));
- }
- this.spot_data = new YotogiOld.StageData.SpotData[list.Count];
- for (int j = 0; j < list.Count; j++)
- {
- YotogiOld.StageData.SpotData spotData = default(YotogiOld.StageData.SpotData);
- spotData.name = list[j][0];
- spotData.thumbnail_name_daytime = list[j][1];
- spotData.thumbnail_name_night = list[j][2];
- this.spot_data[j] = spotData;
- }
- }
- }
- public void SetPrefabName(string set_prefab_name)
- {
- this.prefab_name_ = set_prefab_name;
- }
- public string prefab_name
- {
- get
- {
- return this.prefab_name_;
- }
- }
- public string prefab_name_night
- {
- get
- {
- return this.prefab_name_night_;
- }
- }
- public readonly int sort_id;
- public readonly string draw_name;
- public readonly YotogiOld.Stage stage;
- public readonly string stage_name;
- public readonly int need_grade;
- public readonly string need_flag;
- public readonly string thumbnail_name;
- public readonly string thumbnail_name_night;
- public readonly string bgm_file;
- public readonly string bgm_file_night;
- public readonly YotogiOld.StageData.CameraData camera_data = default(YotogiOld.StageData.CameraData);
- public readonly YotogiOld.StageData.SpotData[] spot_data;
- private string prefab_name_;
- private string prefab_name_night_;
- public struct CameraData
- {
- public Vector3 stage_select_camera_center;
- public Vector2 stage_select_camera_rotate;
- public float stage_select_camera_radius;
- public Vector3 skill_select_chara_pos;
- public Vector3 skill_select_chara_rotate;
- public Vector2 skill_select_camera_rotate;
- public Vector3 skill_select_light_pos;
- public float skill_select_light_intensity;
- }
- public struct SpotData
- {
- public string name;
- public string thumbnail_name_daytime;
- public string thumbnail_name_night;
- }
- }
- public class VRSkillData
- {
- public Skill.Old.Data skill;
- public Dictionary<YotogiOld.Stage, YotogiOld.VRSkillData.StageData> stage_data_dic;
- public class StageData
- {
- public YotogiOld.Stage stage;
- public string ft_file_name;
- public bool[] enabled_spot;
- public bool enabled_stage;
- }
- }
- public struct SkillDataPair
- {
- public static YotogiOld.SkillDataPair Create(Maid maid, int skill_id)
- {
- YotogiOld.SkillDataPair result;
- result.maid = maid;
- result.base_data = YotogiOld.GetSkillData(skill_id);
- result.param = maid.status.yotogiSkill.Get(skill_id);
- return result;
- }
- public static YotogiOld.SkillDataPair CreateBaseDataOnly(Maid maid, Skill.Old.Data base_data)
- {
- YotogiOld.SkillDataPair result;
- result.maid = maid;
- result.base_data = base_data;
- result.param = null;
- return result;
- }
- public static YotogiOld.SkillDataPair Create(Maid maid, Skill.Old.Data base_data)
- {
- YotogiOld.SkillDataPair result;
- result.maid = maid;
- result.base_data = base_data;
- result.param = maid.status.yotogiSkill.Get(base_data.id);
- return result;
- }
- public static YotogiOld.SkillDataPair Create(Maid maid, YotogiSkillData param)
- {
- YotogiOld.SkillDataPair result;
- result.maid = maid;
- result.base_data = YotogiOld.GetSkillData(param.id);
- result.param = param;
- return result;
- }
- public Skill.Old.Data base_data;
- public YotogiSkillData param;
- public Maid maid;
- }
- }
|