123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using PlayerStatus;
- using UnityEngine;
- using wf;
- public class Shop
- {
- public static void CreateData()
- {
- if (0 < Shop.item_data_dic_.Count)
- {
- return;
- }
- Shop.sub_category_dressingbutton_enabled_ = new Dictionary<string, bool>();
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen("game_in_shop_category_list.nei"))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, "game_in_shop_category_list.nei\nopen failed.");
- for (int i = 1; i < csvParser.max_cell_y; i++)
- {
- if (csvParser.IsCellToExistData(0, i))
- {
- string cellAsString = csvParser.GetCellAsString(0, i);
- string cellAsString2 = csvParser.GetCellAsString(1, i);
- if (!Shop.sub_category_dressingbutton_enabled_.ContainsKey(cellAsString2))
- {
- Shop.sub_category_dressingbutton_enabled_.Add(cellAsString2, csvParser.GetCellAsString(2, i) == "〇");
- }
- List<string> list = null;
- for (int j = 0; j < Shop.category_name_list_.Count; j++)
- {
- if (Shop.category_name_list_[j].Key == cellAsString)
- {
- list = Shop.category_name_list_[j].Value;
- break;
- }
- }
- if (list == null)
- {
- list = new List<string>();
- Shop.category_name_list_.Add(new KeyValuePair<string, List<string>>(cellAsString, list));
- }
- bool flag = true;
- for (int k = 0; k < list.Count; k++)
- {
- if (list[k] == cellAsString2)
- {
- flag = false;
- break;
- }
- }
- if (flag)
- {
- list.Add(cellAsString2);
- }
- }
- }
- }
- }
- HashSet<int> hashSet = new HashSet<int>();
- CsvCommonIdManager.ReadEnabledIdList(CsvCommonIdManager.FileSystemType.Normal, true, "game_in_shop_itemlist", ref hashSet);
- using (AFileBase afileBase2 = GameUty.FileSystem.FileOpen("game_in_shop_item_setting.nei"))
- {
- using (CsvParser csvParser2 = new CsvParser())
- {
- bool condition2 = csvParser2.Open(afileBase2);
- NDebug.Assert(condition2, "game_in_shop_item_setting.nei\nopen failed.");
- for (int l = 1; l < csvParser2.max_cell_y; l++)
- {
- if (csvParser2.IsCellToExistData(0, l) && hashSet.Contains(csvParser2.GetCellAsInteger(0, l)))
- {
- Shop.ItemData itemData = new Shop.ItemData(csvParser2, l);
- Shop.item_data_dic_.Add(itemData.id, itemData);
- }
- }
- }
- }
- using (AFileBase afileBase3 = GameUty.FileSystem.FileOpen("game_in_shop_item_groups_setting.nei"))
- {
- using (CsvParser csvParser3 = new CsvParser())
- {
- bool condition3 = csvParser3.Open(afileBase3);
- NDebug.Assert(condition3, "game_in_shop_item_groups_setting.nei\nopen failed.");
- for (int m = 1; m < csvParser3.max_cell_y; m++)
- {
- if (csvParser3.IsCellToExistData(0, m) && hashSet.Contains(csvParser3.GetCellAsInteger(0, m)))
- {
- Shop.ItemDataGroup itemDataGroup = new Shop.ItemDataGroup(csvParser3, m);
- Shop.item_data_dic_.Add(itemDataGroup.id, itemDataGroup);
- Shop.item_data_group_dic_.Add(itemDataGroup.id, itemDataGroup);
- }
- }
- }
- }
- if (GameUty.FileSystem.IsExistentFile("game_in_shop_event_item_setting.nei"))
- {
- using (AFileBase afileBase4 = GameUty.FileSystem.FileOpen("game_in_shop_event_item_setting.nei"))
- {
- using (CsvParser csvParser4 = new CsvParser())
- {
- bool condition4 = csvParser4.Open(afileBase4);
- NDebug.Assert(condition4, "game_in_shop_event_item_setting.nei\nopen failed.");
- for (int n = 1; n < csvParser4.max_cell_y; n++)
- {
- if (csvParser4.IsCellToExistData(0, n) && hashSet.Contains(csvParser4.GetCellAsInteger(0, n)))
- {
- Shop.ItemDataEvent itemDataEvent = new Shop.ItemDataEvent(csvParser4, n);
- Shop.item_data_dic_.Add(itemDataEvent.id, itemDataEvent);
- }
- }
- }
- }
- }
- using (AFileBase afileBase5 = GameUty.FileSystem.FileOpen("game_in_shop_setcard_setting.nei"))
- {
- using (CsvParser csvParser5 = new CsvParser())
- {
- bool condition5 = csvParser5.Open(afileBase5);
- NDebug.Assert(condition5, "game_in_shop_setcard_setting.nei\nopen failed.");
- for (int num = 1; num < csvParser5.max_cell_y; num++)
- {
- if (csvParser5.IsCellToExistData(0, num))
- {
- int num2 = 0;
- string cellAsString3 = csvParser5.GetCellAsString(num2++, num);
- string[] array = cellAsString3.Split(new char[]
- {
- ','
- });
- for (int num3 = 0; num3 < array.Length; num3++)
- {
- array[num3] = array[num3].ToLower() + ".menu";
- }
- HashSet<int> hashSet2 = new HashSet<int>();
- while (num2 < csvParser5.max_cell_x)
- {
- if (!csvParser5.IsCellToExistData(num2, num))
- {
- break;
- }
- int num4 = int.Parse(csvParser5.GetCellAsString(num2, num));
- if (!Shop.item_data_dic_.ContainsKey(num4))
- {
- Debug.LogWarning("ショップアイテムID[" + num4 + "]は存在しません");
- hashSet2.Clear();
- break;
- }
- hashSet2.Add(num4);
- num2++;
- }
- if (0 < hashSet2.Count)
- {
- Shop.set_card_list_.Add(new KeyValuePair<string[], HashSet<int>>(array, hashSet2));
- }
- }
- }
- }
- }
- using (AFileBase afileBase6 = GameUty.FileSystem.FileOpen("game_in_shop_bg_setting.nei"))
- {
- using (CsvParser csvParser6 = new CsvParser())
- {
- bool condition6 = csvParser6.Open(afileBase6);
- NDebug.Assert(condition6, "game_in_shop_bg_setting.nei\nopen failed.");
- for (int num5 = 1; num5 < csvParser6.max_cell_y; num5++)
- {
- if (csvParser6.IsCellToExistData(0, num5))
- {
- Shop.BGData bgdata = new Shop.BGData(csvParser6, num5);
- NDebug.Assert(!Shop.bg_data_dic_.ContainsKey(bgdata.id), "ショップ背景設定id[" + bgdata.id + "]は重複しています");
- Shop.bg_data_dic_.Add(bgdata.id, bgdata);
- }
- }
- }
- }
- }
- public static void CheckClubGradeShopLineup(int clubGrade)
- {
- if (Shop.club_grade_datas_ == null)
- {
- Shop.club_grade_datas_ = new List<List<int>>();
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen("game_in_shop_clubgrade_setting.nei"))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, "file open error[game_in_shop_clubgrade_setting.nei]");
- int num = 0;
- for (int i = 1; i < csvParser.max_cell_y; i++)
- {
- if (csvParser.IsCellToExistData(0, i))
- {
- List<int> list = new List<int>();
- int num2 = 1;
- string cellAsString = csvParser.GetCellAsString(num2++, i);
- if (!string.IsNullOrEmpty(cellAsString))
- {
- string[] array = cellAsString.Split(new char[]
- {
- ','
- });
- for (int j = 0; j < array.Length; j++)
- {
- list.Add(int.Parse(array[j].Trim()));
- }
- }
- Shop.club_grade_datas_.Add(list);
- num++;
- }
- }
- }
- }
- }
- Status status = GameMain.Instance.CharacterMgr.status;
- for (int k = 0; k < clubGrade; k++)
- {
- for (int l = 0; l < Shop.club_grade_datas_[k].Count; l++)
- {
- int shopItemId = Shop.club_grade_datas_[k][l];
- status.AddShopLineup(shopItemId);
- }
- }
- }
- public static void CheckBuildingShopLineup()
- {
- if (Shop.building_datas_ == null)
- {
- Shop.building_datas_ = new List<KeyValuePair<List<int>, List<int>>>();
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen("game_in_shop_building_setting.nei"))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, "file open error[game_in_shop_building_setting.nei]");
- int num = 0;
- for (int i = 1; i < csvParser.max_cell_y; i++)
- {
- if (csvParser.IsCellToExistData(0, i))
- {
- List<int> list = new List<int>();
- int num2 = 0;
- string cellAsString = csvParser.GetCellAsString(num2++, i);
- if (!string.IsNullOrEmpty(cellAsString))
- {
- string[] array = cellAsString.Split(new char[]
- {
- ','
- });
- for (int j = 0; j < array.Length; j++)
- {
- list.Add(int.Parse(array[j].Trim()));
- }
- }
- if (list.Count != 0)
- {
- List<int> list2 = new List<int>();
- string cellAsString2 = csvParser.GetCellAsString(num2++, i);
- if (!string.IsNullOrEmpty(cellAsString2))
- {
- string[] array2 = cellAsString2.Split(new char[]
- {
- ','
- });
- for (int k = 0; k < array2.Length; k++)
- {
- list2.Add(int.Parse(array2[k].Trim()));
- }
- }
- Shop.building_datas_.Add(new KeyValuePair<List<int>, List<int>>(list, list2));
- num++;
- }
- }
- }
- }
- }
- }
- FacilityManager facilityMgr = GameMain.Instance.FacilityMgr;
- Status status = GameMain.Instance.CharacterMgr.status;
- foreach (KeyValuePair<List<int>, List<int>> keyValuePair in Shop.building_datas_)
- {
- List<int> key = keyValuePair.Key;
- List<int> value = keyValuePair.Value;
- bool flag = false;
- foreach (int facilityTypeID in key)
- {
- flag |= facilityMgr.IsFacilityBuildFlag(facilityTypeID);
- }
- if (flag)
- {
- foreach (int shopItemId in value)
- {
- status.AddShopLineup(shopItemId);
- }
- }
- }
- }
- public static void CheckGroupItemData()
- {
- Status status = GameMain.Instance.CharacterMgr.status;
- foreach (KeyValuePair<int, Shop.ItemDataGroup> keyValuePair in Shop.item_data_group_dic_)
- {
- if (!status.IsShopLineupItem(keyValuePair.Key))
- {
- List<int> need_id_list = keyValuePair.Value.need_id_list;
- bool flag = true;
- for (int i = 0; i < need_id_list.Count; i++)
- {
- if (!status.IsShopLineupItem(need_id_list[i]))
- {
- flag = false;
- break;
- }
- }
- if (flag)
- {
- status.AddShopLineup(keyValuePair.Key);
- }
- }
- }
- }
- public static void ResetEventItem(int item_id)
- {
- if (!Shop.item_data_dic_.ContainsKey(item_id) || Shop.item_data_dic_[item_id].type != Shop.ItemDataBase.Type.Event)
- {
- Debug.LogWarning("ショップアイテム[" + item_id + "]はイベントアイテムではありません");
- return;
- }
- Shop.ItemDataEvent itemDataEvent = Shop.item_data_dic_[item_id] as Shop.ItemDataEvent;
- if (itemDataEvent.is_have_item)
- {
- itemDataEvent.Reset();
- }
- }
- public static bool BuyEventItem(int item_id, bool free_buy)
- {
- if (!Shop.item_data_dic_.ContainsKey(item_id) || Shop.item_data_dic_[item_id].type != Shop.ItemDataBase.Type.Event)
- {
- Debug.LogWarning("ショップアイテム[" + item_id + "]はイベントアイテムではありません");
- return false;
- }
- Shop.ItemDataEvent itemDataEvent = Shop.item_data_dic_[item_id] as Shop.ItemDataEvent;
- if (itemDataEvent.is_have_item || !itemDataEvent.is_enabled_buy_item)
- {
- return false;
- }
- if (!free_buy)
- {
- long num = GameMain.Instance.CharacterMgr.status.money - (long)itemDataEvent.price;
- if (num < 0L)
- {
- return false;
- }
- GameMain.Instance.CharacterMgr.status.money += (long)(itemDataEvent.price * -1);
- }
- itemDataEvent.ExecBuy();
- return true;
- }
- public static Dictionary<int, Shop.ItemDataBase> item_data_dic
- {
- get
- {
- return Shop.item_data_dic_;
- }
- }
- public static Dictionary<int, Shop.ItemDataGroup> item_data_group_dic
- {
- get
- {
- return Shop.item_data_group_dic_;
- }
- }
- public static List<KeyValuePair<string, List<string>>> category_name_list
- {
- get
- {
- return Shop.category_name_list_;
- }
- }
- public static Dictionary<string, bool> sub_category_dressingbutton_enabled
- {
- get
- {
- return Shop.sub_category_dressingbutton_enabled_;
- }
- }
- public static List<KeyValuePair<string[], HashSet<int>>> set_card_list
- {
- get
- {
- return Shop.set_card_list_;
- }
- }
- public static Dictionary<int, Shop.BGData> bg_data_dic
- {
- get
- {
- return Shop.bg_data_dic_;
- }
- }
- private static Dictionary<int, Shop.ItemDataBase> item_data_dic_ = new Dictionary<int, Shop.ItemDataBase>();
- private static Dictionary<int, Shop.ItemDataGroup> item_data_group_dic_ = new Dictionary<int, Shop.ItemDataGroup>();
- private static List<KeyValuePair<string, List<string>>> category_name_list_ = new List<KeyValuePair<string, List<string>>>();
- private static Dictionary<string, bool> sub_category_dressingbutton_enabled_ = new Dictionary<string, bool>();
- private static List<KeyValuePair<string[], HashSet<int>>> set_card_list_ = new List<KeyValuePair<string[], HashSet<int>>>();
- private static Dictionary<int, Shop.BGData> bg_data_dic_ = new Dictionary<int, Shop.BGData>();
- private static List<List<int>> club_grade_datas_;
- private static List<KeyValuePair<List<int>, List<int>>> building_datas_;
- public abstract class ItemDataBase
- {
- public ItemDataBase(CsvParser csv, int line_y, bool is_event_item_csv)
- {
- int num = 0;
- this.id = csv.GetCellAsInteger(num++, line_y);
- this.valid_bg_id_list = new HashSet<int>();
- string[] array = csv.GetCellAsString(num++, line_y).Split(new char[]
- {
- ','
- });
- for (int i = 0; i < array.Length; i++)
- {
- this.valid_bg_id_list.Add(int.Parse(array[i]));
- }
- this.name = csv.GetCellAsString(num++, line_y);
- this.icon_file = csv.GetCellAsString(num++, line_y) + ".tex";
- this.detail_text = csv.GetCellAsString(num++, line_y);
- this.detail_text = this.detail_text.Replace("《改行》", "\n");
- if (!is_event_item_csv)
- {
- string cellAsString = csv.GetCellAsString(num++, line_y);
- if (!string.IsNullOrEmpty(cellAsString))
- {
- this.SetMaskMode((TBody.MaskMode)Enum.Parse(typeof(TBody.MaskMode), cellAsString));
- }
- else
- {
- this.SetMaskMode(TBody.MaskMode.None);
- }
- this.main_category = csv.GetCellAsString(num++, line_y);
- this.sub_category = csv.GetCellAsString(num++, line_y);
- }
- else
- {
- this.main_category = csv.GetCellAsString(num++, line_y);
- this.sub_category = csv.GetCellAsString(num++, line_y);
- }
- }
- public abstract int price { get; }
- public abstract string[] item_menu_array { get; }
- public abstract string[] trial_wear_item_menu_array { get; }
- public abstract bool is_have_item { get; }
- public abstract bool is_enabled_buy_item { get; }
- public abstract bool enabled_mask_mode { get; }
- public abstract TBody.MaskMode mask_mode { get; }
- public abstract Shop.ItemDataBase.Type type { get; }
- protected abstract void SetMaskMode(TBody.MaskMode setting_mask_mode);
- public readonly int id;
- public readonly HashSet<int> valid_bg_id_list;
- public readonly string name;
- public readonly string main_category;
- public readonly string sub_category;
- public readonly string detail_text;
- public readonly string icon_file;
- public enum Type
- {
- Parts,
- Event
- }
- }
- public class ItemData : Shop.ItemDataBase
- {
- public ItemData(CsvParser csv, int line_y) : base(csv, line_y, false)
- {
- int i = 8;
- this.price_ = csv.GetCellAsInteger(i++, line_y);
- List<string> list = new List<string>();
- while (i < csv.max_cell_x)
- {
- if (csv.IsCellToExistData(i, line_y))
- {
- string cellAsString = csv.GetCellAsString(i, line_y);
- if (!string.IsNullOrEmpty(cellAsString))
- {
- list.Add(cellAsString.ToLower() + ".menu");
- }
- }
- i++;
- }
- this.item_menu_array_ = list.ToArray();
- }
- public override int price
- {
- get
- {
- return this.price_;
- }
- }
- public override string[] item_menu_array
- {
- get
- {
- return this.item_menu_array_;
- }
- }
- public override string[] trial_wear_item_menu_array
- {
- get
- {
- return new string[]
- {
- this.item_menu_array_[0]
- };
- }
- }
- public override bool is_have_item
- {
- get
- {
- Status status = GameMain.Instance.CharacterMgr.status;
- return status.IsShopLineupItem(this.id) && status.shopLineups.Get(this.id) == ShopItemStatus.Purchased;
- }
- }
- public override bool is_enabled_buy_item
- {
- get
- {
- return true;
- }
- }
- public override bool enabled_mask_mode
- {
- get
- {
- return true;
- }
- }
- public override Shop.ItemDataBase.Type type
- {
- get
- {
- return Shop.ItemDataBase.Type.Parts;
- }
- }
- public override TBody.MaskMode mask_mode
- {
- get
- {
- return this.mask_mode_;
- }
- }
- protected override void SetMaskMode(TBody.MaskMode setting_mask_mode)
- {
- this.mask_mode_ = setting_mask_mode;
- }
- protected readonly int price_;
- protected readonly string[] item_menu_array_;
- protected TBody.MaskMode mask_mode_;
- }
- public class ItemDataGroup : Shop.ItemDataBase
- {
- public ItemDataGroup(CsvParser csv, int line_y) : base(csv, line_y, false)
- {
- for (int i = 8; i < csv.max_cell_x; i++)
- {
- if (csv.IsCellToExistData(i, line_y))
- {
- this.need_id_list_.Add(csv.GetCellAsInteger(i, line_y));
- }
- }
- }
- public override int price
- {
- get
- {
- List<Shop.ItemDataBase> notHaveItemData = this.GetNotHaveItemData();
- int num = 0;
- for (int i = 0; i < notHaveItemData.Count; i++)
- {
- num += notHaveItemData[i].price;
- }
- return num;
- }
- }
- public override string[] item_menu_array
- {
- get
- {
- List<Shop.ItemDataBase> notHaveItemData = this.GetNotHaveItemData();
- List<string> list = new List<string>();
- for (int i = 0; i < notHaveItemData.Count; i++)
- {
- string[] item_menu_array = notHaveItemData[i].item_menu_array;
- for (int j = 0; j < item_menu_array.Length; j++)
- {
- list.Add(item_menu_array[j]);
- }
- }
- return list.ToArray();
- }
- }
- public override string[] trial_wear_item_menu_array
- {
- get
- {
- Status status = GameMain.Instance.CharacterMgr.status;
- List<Shop.ItemDataBase> list = new List<Shop.ItemDataBase>();
- for (int i = 0; i < this.need_id_list_.Count; i++)
- {
- list.Add(Shop.item_data_dic[this.need_id_list_[i]]);
- }
- List<string> list2 = new List<string>();
- for (int j = 0; j < list.Count; j++)
- {
- string[] trial_wear_item_menu_array = list[j].trial_wear_item_menu_array;
- for (int k = 0; k < trial_wear_item_menu_array.Length; k++)
- {
- list2.Add(trial_wear_item_menu_array[k]);
- }
- }
- return list2.ToArray();
- }
- }
- public override bool is_have_item
- {
- get
- {
- Status status = GameMain.Instance.CharacterMgr.status;
- return status.IsShopLineupItem(this.id) && (status.shopLineups.Get(this.id) == ShopItemStatus.Purchased || this.GetNotHaveItemData().Count == 0);
- }
- }
- public override bool is_enabled_buy_item
- {
- get
- {
- return true;
- }
- }
- private List<Shop.ItemDataBase> GetNotHaveItemData()
- {
- Status status = GameMain.Instance.CharacterMgr.status;
- List<Shop.ItemDataBase> list = new List<Shop.ItemDataBase>();
- for (int i = 0; i < this.need_id_list_.Count; i++)
- {
- if (status.IsShopLineupItem(this.need_id_list_[i]) && status.shopLineups.Get(this.need_id_list_[i]) != ShopItemStatus.Purchased)
- {
- list.Add(Shop.item_data_dic[this.need_id_list_[i]]);
- }
- }
- return list;
- }
- public override bool enabled_mask_mode
- {
- get
- {
- return true;
- }
- }
- public override Shop.ItemDataBase.Type type
- {
- get
- {
- return Shop.ItemDataBase.Type.Parts;
- }
- }
- public override TBody.MaskMode mask_mode
- {
- get
- {
- return this.mask_mode_;
- }
- }
- public List<int> need_id_list
- {
- get
- {
- return this.need_id_list_;
- }
- }
- protected override void SetMaskMode(TBody.MaskMode setting_mask_mode)
- {
- this.mask_mode_ = setting_mask_mode;
- }
- private List<int> need_id_list_ = new List<int>();
- private TBody.MaskMode mask_mode_;
- }
- public class ItemDataEvent : Shop.ItemDataBase
- {
- public ItemDataEvent(CsvParser csv, int line_y) : base(csv, line_y, true)
- {
- int cell_x = 7;
- this.price_ = csv.GetCellAsInteger(cell_x++, line_y);
- this.target_flag_name_ = csv.GetCellAsString(cell_x++, line_y);
- string cellAsString = csv.GetCellAsString(cell_x++, line_y);
- if (!string.IsNullOrEmpty(cellAsString))
- {
- string[] array = cellAsString.Split(new char[]
- {
- ','
- });
- foreach (string s in array)
- {
- int num = int.Parse(s);
- if (!this.overlap_check_id_list_.Contains(num) && this.id != num)
- {
- this.overlap_check_id_list_.Add(num);
- }
- }
- }
- while (csv.IsCellToExistData(cell_x, line_y))
- {
- cellAsString = csv.GetCellAsString(cell_x++, line_y);
- this.free_text_list_.Add(cellAsString);
- }
- }
- public void ExecBuy()
- {
- GameMain.Instance.CharacterMgr.status.AddHaveItem(this.target_flag_name_);
- }
- public void Reset()
- {
- GameMain.Instance.CharacterMgr.status.RemoveHaveItem(this.target_flag_name_);
- }
- public override int price
- {
- get
- {
- return this.price_;
- }
- }
- public override string[] item_menu_array
- {
- get
- {
- return this.dummy_array_;
- }
- }
- public override string[] trial_wear_item_menu_array
- {
- get
- {
- return this.dummy_array_;
- }
- }
- public override bool is_have_item
- {
- get
- {
- return GameMain.Instance.CharacterMgr.status.IsHaveItem(this.target_flag_name_);
- }
- }
- public override bool is_enabled_buy_item
- {
- get
- {
- foreach (int key in this.overlap_check_id_list_)
- {
- if (Shop.item_data_dic.ContainsKey(key))
- {
- if (Shop.item_data_dic[key].is_have_item)
- {
- return false;
- }
- }
- }
- return true;
- }
- }
- public override bool enabled_mask_mode
- {
- get
- {
- return false;
- }
- }
- public override TBody.MaskMode mask_mode
- {
- get
- {
- return TBody.MaskMode.None;
- }
- }
- protected override void SetMaskMode(TBody.MaskMode setting_mask_mode)
- {
- }
- public override Shop.ItemDataBase.Type type
- {
- get
- {
- return Shop.ItemDataBase.Type.Event;
- }
- }
- public string target_flag_name
- {
- get
- {
- return this.target_flag_name_;
- }
- }
- public List<string> free_text
- {
- get
- {
- return this.free_text_list_;
- }
- }
- private int price_;
- private string target_flag_name_;
- private HashSet<int> overlap_check_id_list_ = new HashSet<int>();
- private string[] dummy_array_ = new string[0];
- private List<string> free_text_list_ = new List<string>();
- }
- public class BGData
- {
- public BGData(CsvParser csv, int line_y)
- {
- int num = 0;
- this.id = csv.GetCellAsInteger(num++, line_y);
- this.bg_prefab_name = csv.GetCellAsString(num++, line_y);
- this.use_stage_data = null;
- string cellAsString = csv.GetCellAsString(num++, line_y);
- if (!string.IsNullOrEmpty(cellAsString) && YotogiStage.IsEnabled(cellAsString))
- {
- this.use_stage_data = YotogiStage.GetData(cellAsString);
- }
- this.plya_bgm_name = csv.GetCellAsString(num++, line_y);
- if (string.IsNullOrEmpty(Path.GetExtension(this.plya_bgm_name)))
- {
- this.plya_bgm_name += ".ogg";
- }
- }
- public void ChangeBg(Maid maid)
- {
- GameMain.Instance.BgMgr.ChangeBg(this.bg_prefab_name);
- YotogiSkillSelectWaitMotion.ApplyEnvSetting(maid, this.use_stage_data);
- }
- public void PlayBGM(float fade_time = 0.5f)
- {
- GameMain.Instance.SoundMgr.PlayBGM(this.plya_bgm_name, fade_time, true);
- }
- public readonly int id;
- public readonly YotogiStage.Data use_stage_data;
- public readonly string bg_prefab_name;
- public readonly string plya_bgm_name;
- }
- }
|