123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using MaidStatus;
- using UnityEngine;
- using wf;
- namespace PlayerStatus
- {
- public class Status
- {
- public Status()
- {
- Shop.CreateData();
- Trophy.CreateData();
- this.playerName_ = MaidRandomName.GetPlayerName();
- this.clubName_ = "エンパイアクラブ";
- if (Product.isEnglish)
- {
- this.clubName_ = "EmpireClub";
- }
- this.flags_ = new Dictionary<string, int>();
- this.flags = new ReadOnlyDictionary<string, int>(this.flags_);
- this.havePartsItems_ = new Dictionary<string, bool>();
- this.havePartsItems = new ReadOnlyDictionary<string, bool>(this.havePartsItems_);
- this.haveItems_ = new Dictionary<string, bool>();
- this.haveItems = new ReadOnlyDictionary<string, bool>(this.haveItems_);
- this.shopLineups_ = new Dictionary<int, ShopItemStatus>();
- this.shopLineups = new ReadOnlyDictionary<int, ShopItemStatus>(this.shopLineups_);
- this.scheduleSlot = new ScheduleData[40];
- for (int i = 0; i < 40; i++)
- {
- this.scheduleSlot[i] = new ScheduleData();
- }
- this.scheduleSlotBackup = new ScheduleSlotBackup[ScheduleSlotBackup.BackUpMax];
- for (int j = 0; j < ScheduleSlotBackup.BackUpMax; j++)
- {
- this.scheduleSlotBackup[j] = new ScheduleSlotBackup();
- }
- this.nightWorksStates_ = new Dictionary<int, NightWorkState>();
- this.night_works_state_dic = new ReadOnlyDictionary<int, NightWorkState>(this.nightWorksStates_);
- this.haveTrophys = new HashSet<int>();
- this.jobClassOpenFlags = new HashSet<int>();
- this.yotogiClassOpenFlags = new HashSet<int>();
- Status.CreateHaveItemList();
- foreach (string key in Status.flagLockPartsItems)
- {
- this.havePartsItems_.Add(key, false);
- }
- this.UpdateingExtraTrophysHaveData();
- this.clubGrade = 1;
- }
- public bool isOldPlayer
- {
- get
- {
- return this.GetFlag("__isComPlayer") != 0;
- }
- set
- {
- this.SetFlag("__isComPlayer", (!value) ? 0 : 1);
- }
- }
- public string playerName
- {
- get
- {
- return this.playerName_;
- }
- set
- {
- this.playerName_ = ((value != null) ? Status.ConvertString(value, 8) : string.Empty);
- }
- }
- public int days
- {
- get
- {
- return this.days_;
- }
- set
- {
- this.days_ = System.Math.Max(0, value);
- }
- }
- public long totalPurchasePrice
- {
- get
- {
- return this.totalPurchasePrice_;
- }
- set
- {
- this.totalPurchasePrice_ = System.Math.Max(0L, value);
- }
- }
- public long money
- {
- get
- {
- return this.money_;
- }
- set
- {
- this.money_ = wf.Math.RoundMinMax(value, 0L, 9999999999L);
- }
- }
- public string moneyText
- {
- get
- {
- return Utility.ConvertMoneyText(GameMain.Instance.CharacterMgr.status.money);
- }
- }
- public long casinoCoin
- {
- get
- {
- return this.casinoCoin_;
- }
- set
- {
- this.casinoCoin_ = wf.Math.RoundMinMax(value, 0L, 999999L);
- }
- }
- public string clubName
- {
- get
- {
- return this.clubName_;
- }
- set
- {
- this.clubName_ = ((value != null) ? Status.ConvertString(value, 15) : string.Empty);
- }
- }
- public int clubGrade
- {
- get
- {
- return this.clubGrade_;
- }
- set
- {
- this.clubGrade_ = wf.Math.RoundMinMax(value, 1, 5);
- }
- }
- public int clubEvaluation
- {
- get
- {
- return this.baseClubEvaluation;
- }
- }
- public int baseClubEvaluation
- {
- get
- {
- return this.baseClubEvaluation_;
- }
- set
- {
- this.baseClubEvaluation_ = wf.Math.Round3(value);
- }
- }
- public int clubGauge
- {
- get
- {
- return this.clubGauge_;
- }
- set
- {
- this.clubGauge_ = wf.Math.RoundMinMax(value, 0, 100);
- }
- }
- public bool isDaytime
- {
- get
- {
- return this.GetFlag("時間帯") != 3;
- }
- }
- public bool lockUserDraftMaid
- {
- get
- {
- return this.GetFlag("__lockUserDraftMaid") != 0;
- }
- set
- {
- this.SetFlag("__lockUserDraftMaid", (!value) ? 0 : 1);
- }
- }
- public bool lockNTRPlay
- {
- get
- {
- return this.GetFlag("__lockNTRPlay") != 0;
- }
- set
- {
- this.SetFlag("__lockNTRPlay", (!value) ? 0 : 1);
- }
- }
- public int maidPoint
- {
- get
- {
- int num = 0;
- foreach (int id in this.haveTrophys)
- {
- if (Trophy.Contains(id) && Trophy.IsEnabled(id))
- {
- num += Trophy.GetData(id).maidPoint;
- }
- }
- return num;
- }
- }
- public bool isAvailableShop
- {
- get
- {
- return true;
- }
- }
- public bool isAvailableRanking
- {
- get
- {
- return false;
- }
- }
- public bool isAvailableCompetitiveShow
- {
- get
- {
- return true;
- }
- }
- public bool isAvailableDance
- {
- get
- {
- return true;
- }
- }
- public bool isAvailableEmploymentAndBanishment
- {
- get
- {
- return true;
- }
- }
- public bool isAvailableTransfer
- {
- get
- {
- return !string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path) && PluginData.IsEnabled("Legacy") && this.GetFlag("オープニング終了") == 1;
- }
- }
- public bool isAvailableClassChange
- {
- get
- {
- return true;
- }
- }
- public ReadOnlyDictionary<string, int> flags { get; private set; }
- public ReadOnlyDictionary<string, bool> havePartsItems { get; private set; }
- public ReadOnlyDictionary<string, bool> haveItems { get; private set; }
- public ReadOnlyDictionary<int, ShopItemStatus> shopLineups { get; private set; }
- public ReadOnlyDictionary<int, NightWorkState> night_works_state_dic { get; private set; }
- public void SetFlag(string flagName, int value)
- {
- if (!this.flags_.ContainsKey(flagName))
- {
- this.flags_.Add(flagName, value);
- }
- else
- {
- this.flags_[flagName] = value;
- }
- }
- public void AddFlag(string flagName, int value)
- {
- if (!this.flags_.ContainsKey(flagName))
- {
- this.flags_.Add(flagName, value);
- }
- else
- {
- Dictionary<string, int> dictionary;
- (dictionary = this.flags_)[flagName] = dictionary[flagName] + value;
- }
- }
- public int GetFlag(string flagName)
- {
- return (!this.flags_.ContainsKey(flagName)) ? 0 : this.flags_[flagName];
- }
- public bool RemoveFlag(string flagName)
- {
- return this.flags_.ContainsKey(flagName) && this.flags_.Remove(flagName);
- }
- public void AddShopLineup(int shopItemId)
- {
- if (!this.shopLineups_.ContainsKey(shopItemId))
- {
- this.shopLineups_.Add(shopItemId, ShopItemStatus.New);
- }
- }
- public void RemoveShopLineup(int shopItemId)
- {
- if (this.shopLineups_.ContainsKey(shopItemId))
- {
- this.shopLineups_.Remove(shopItemId);
- }
- }
- public void SetShopLineupStatus(int shopItemId, ShopItemStatus status)
- {
- if (this.shopLineups_.ContainsKey(shopItemId))
- {
- this.shopLineups_[shopItemId] = status;
- }
- }
- public bool IsShopLineupItem(int itemId)
- {
- return this.shopLineups_.ContainsKey(itemId);
- }
- public bool AddNightWorksState(NightWorkState data)
- {
- if (this.nightWorksStates_.ContainsKey(data.workId))
- {
- return false;
- }
- this.nightWorksStates_.Add(data.workId, data);
- return true;
- }
- public bool RemoveNightWorksState(int workId)
- {
- if (!this.nightWorksStates_.ContainsKey(workId))
- {
- return false;
- }
- this.nightWorksStates_.Remove(workId);
- return true;
- }
- public NightWorkState GetNightWorksState(int workId)
- {
- if (!this.nightWorksStates_.ContainsKey(workId))
- {
- return null;
- }
- return this.nightWorksStates_[workId];
- }
- public bool IsNightWorksState(int workId)
- {
- return this.nightWorksStates_.ContainsKey(workId);
- }
- public void AddHavePartsItem(string itemName)
- {
- itemName = itemName.ToLower();
- NDebug.Assert(this.havePartsItems_.ContainsKey(itemName), itemName + "の取得設定を変える事はできません");
- this.havePartsItems_[itemName] = true;
- }
- public void RemoveHavePartsItem(string itemName)
- {
- itemName = itemName.ToLower();
- NDebug.Assert(this.havePartsItems_.ContainsKey(itemName), itemName + "の取得設定を変える事はできません");
- this.havePartsItems_[itemName] = false;
- }
- public bool IsHavePartsItem(string itemName)
- {
- itemName = itemName.ToLower();
- return !this.havePartsItems_.ContainsKey(itemName) || this.havePartsItems_[itemName];
- }
- public void AddHaveItem(string itemName)
- {
- itemName = itemName.ToLower();
- if (!this.haveItems_.ContainsKey(itemName))
- {
- this.haveItems_.Add(itemName, true);
- }
- else
- {
- this.haveItems_[itemName] = true;
- }
- }
- public void RemoveHaveItem(string itemName)
- {
- itemName = itemName.ToLower();
- if (this.haveItems_.ContainsKey(itemName))
- {
- this.haveItems_.Remove(itemName);
- }
- this.haveItems_[itemName] = false;
- }
- public bool IsHaveItem(string itemName)
- {
- itemName = itemName.ToLower();
- return this.haveItems_.ContainsKey(itemName) && this.haveItems_[itemName];
- }
- public void AddJobClassOpenFlag(int id)
- {
- if (!this.jobClassOpenFlags.Contains(id))
- {
- this.jobClassOpenFlags.Add(id);
- }
- }
- public void RemoveJobClassOpenFlag(int id)
- {
- if (this.jobClassOpenFlags.Contains(id))
- {
- this.jobClassOpenFlags.Remove(id);
- }
- }
- public bool IsJobClassOpenFlag(int id)
- {
- return this.jobClassOpenFlags.Contains(id);
- }
- public void AddYotogiClassOpenFlag(int id)
- {
- if (!this.yotogiClassOpenFlags.Contains(id))
- {
- this.yotogiClassOpenFlags.Add(id);
- }
- }
- public void RemoveYotogiClassOpenFlag(int id)
- {
- if (this.yotogiClassOpenFlags.Contains(id))
- {
- this.yotogiClassOpenFlags.Remove(id);
- }
- }
- public bool IsYotogiClassOpenFlag(int id)
- {
- return this.yotogiClassOpenFlags.Contains(id);
- }
- public bool AddHaveTrophy(int trophyId)
- {
- bool flag = false;
- if (!Trophy.Contains(trophyId) || !Trophy.IsEnabled(trophyId))
- {
- return false;
- }
- Trophy.Data data = Trophy.GetData(trophyId);
- if (data != null)
- {
- if (!this.haveTrophys.Contains(trophyId))
- {
- this.haveTrophys.Add(trophyId);
- flag = true;
- }
- if (data.lineupIdArray != null)
- {
- foreach (int shopItemId in data.lineupIdArray)
- {
- this.AddShopLineup(shopItemId);
- }
- }
- if (flag && data.type != Trophy.Data.Type.Extra)
- {
- GameObject gameObject = GameObject.Find("SystemUI Root/TrophyAchieveEffect");
- if (gameObject != null)
- {
- TrophyAchieveEffect component = gameObject.GetComponent<TrophyAchieveEffect>();
- if (component != null)
- {
- component.EffectStart(data);
- }
- }
- }
- }
- return flag;
- }
- public bool IsHaveTrophy(int id)
- {
- return this.haveTrophys.Contains(id);
- }
- public bool IsHaveTrophy(int[] ids)
- {
- bool result = true;
- for (int i = 0; i < ids.Length; i++)
- {
- if (!this.IsHaveTrophy(ids[i]))
- {
- result = false;
- break;
- }
- }
- return result;
- }
- public int GetScheduleMaidSetting(Maid checkMaid)
- {
- for (int i = 0; i < this.scheduleSlot.Length; i++)
- {
- if (!string.IsNullOrEmpty(this.scheduleSlot[i].maid_guid))
- {
- if (checkMaid.status.guid == this.scheduleSlot[i].maid_guid)
- {
- return i;
- }
- }
- }
- return -1;
- }
- public Maid GetScheduleSlot(int slotNo)
- {
- NDebug.Assert(0 <= slotNo && slotNo < 40, "error.");
- if (string.IsNullOrEmpty(this.scheduleSlot[slotNo].maid_guid))
- {
- return null;
- }
- CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
- for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
- {
- if (characterMgr.GetStockMaid(i).status.guid == this.scheduleSlot[slotNo].maid_guid)
- {
- return characterMgr.GetStockMaid(i);
- }
- }
- return null;
- }
- public void BackupScheduleSlot(ScheduleSlotBackup.Type type)
- {
- if (type == ScheduleSlotBackup.Type.Max)
- {
- return;
- }
- ScheduleSlotBackup scheduleSlotBackup = this.scheduleSlotBackup[(int)type];
- for (int i = 0; i < this.scheduleSlot.Length; i++)
- {
- Maid maid = this.GetScheduleSlot(i);
- if (maid != null)
- {
- scheduleSlotBackup.slotDataArray[i].maid_guid = maid.status.guid;
- scheduleSlotBackup.slotDataArray[i].noonWorkId = maid.status.noonWorkId;
- scheduleSlotBackup.slotDataArray[i].nightWorkId = maid.status.nightWorkId;
- scheduleSlotBackup.slotDataArray[i].noonCommu = maid.status.noonCommu;
- scheduleSlotBackup.slotDataArray[i].nightCommu = maid.status.nightCommu;
- }
- else
- {
- scheduleSlotBackup.slotDataArray[i].maid_guid = string.Empty;
- }
- }
- }
- public void ApplyScheduleSlotBackup(ScheduleSlotBackup.Type type)
- {
- if (type == ScheduleSlotBackup.Type.Max)
- {
- return;
- }
- ScheduleSlotBackup scheduleSlotBackup = this.scheduleSlotBackup[(int)type];
- int i = 0;
- while (i < this.scheduleSlot.Length)
- {
- if (!(scheduleSlotBackup.slotDataArray[i].maid_guid != string.Empty))
- {
- goto IL_E1;
- }
- ScheduleSlotBackup.Data data = scheduleSlotBackup.slotDataArray[i];
- Maid stockMaid = GameMain.Instance.CharacterMgr.GetStockMaid(data.maid_guid);
- if (!(stockMaid != null))
- {
- goto IL_E1;
- }
- this.scheduleSlot[i].maid_guid = data.maid_guid;
- this.scheduleSlot[i].noon_communication = data.noonCommu;
- this.scheduleSlot[i].night_communication = data.nightCommu;
- stockMaid.status.noonWorkId = data.noonWorkId;
- stockMaid.status.nightWorkId = data.nightWorkId;
- stockMaid.status.noonCommu = data.noonCommu;
- stockMaid.status.nightCommu = data.nightCommu;
- IL_F3:
- i++;
- continue;
- IL_E1:
- this.scheduleSlot[i].maid_guid = string.Empty;
- goto IL_F3;
- }
- }
- public void CheckTrophyMainMenu()
- {
- FacilityManager facilityMgr = GameMain.Instance.FacilityMgr;
- int facilityAchievement = facilityMgr.GetFacilityAchievement<int>("施設総数");
- if (5 <= facilityAchievement)
- {
- this.AddHaveTrophy(1160);
- }
- if (10 <= facilityAchievement)
- {
- this.AddHaveTrophy(1170);
- }
- }
- public void CheckTrophyDayResultAndNightResult()
- {
- FacilityManager facilityMgr = GameMain.Instance.FacilityMgr;
- int facilityAchievement = facilityMgr.GetFacilityAchievement<int>("施設強化回数");
- if (5 <= facilityAchievement)
- {
- this.AddHaveTrophy(1180);
- }
- if (10 <= facilityAchievement)
- {
- this.AddHaveTrophy(1190);
- }
- }
- public void CheckTrophyJobClassAndYotogiClass(Maid checkMaid)
- {
- if (checkMaid == null || checkMaid.status.heroineType == HeroineType.Sub)
- {
- return;
- }
- if (Status.jobClassTrophyCheckSet == null)
- {
- Status.jobClassTrophyCheckSet = new Dictionary<string, int>();
- Status.jobClassTrophyCheckSet.Add("Novice2", 2000);
- Status.jobClassTrophyCheckSet.Add("Concierge", 2010);
- Status.jobClassTrophyCheckSet.Add("Waitress", 2020);
- Status.jobClassTrophyCheckSet.Add("Maitre", 2030);
- Status.jobClassTrophyCheckSet.Add("Bartender", 2040);
- Status.jobClassTrophyCheckSet.Add("Therapist", 2050);
- Status.jobClassTrophyCheckSet.Add("Empire", 2060);
- Status.jobClassTrophyCheckSet.Add("Dealer", 2070);
- Status.jobClassTrophyCheckSet.Add("Healing", 2080);
- Status.jobClassTrophyCheckSet.Add("Night", 2090);
- Status.yotogiClassCheckSet = new Dictionary<string, int>();
- }
- foreach (KeyValuePair<string, int> keyValuePair in Status.jobClassTrophyCheckSet)
- {
- if (checkMaid.status.jobClass.Contains(JobClass.uniqueNameToId(keyValuePair.Key)))
- {
- this.AddHaveTrophy(keyValuePair.Value);
- }
- }
- foreach (KeyValuePair<string, int> keyValuePair2 in Status.yotogiClassCheckSet)
- {
- if (checkMaid.status.jobClass.Contains(YotogiClass.uniqueNameToId(keyValuePair2.Key)))
- {
- this.AddHaveTrophy(keyValuePair2.Value);
- }
- }
- }
- public void CheckTrophyMaidStatus(Maid checkMaid)
- {
- if (checkMaid == null || checkMaid.status.heroineType == HeroineType.Sub)
- {
- return;
- }
- Status status = checkMaid.status;
- if (10 <= status.playCountYotogi)
- {
- this.AddHaveTrophy(140);
- }
- if (30 <= status.playCountYotogi)
- {
- this.AddHaveTrophy(150);
- }
- if (1000 <= status.inyoku)
- {
- this.AddHaveTrophy(1000);
- }
- if (5000 <= status.inyoku)
- {
- this.AddHaveTrophy(1010);
- }
- if (9999 <= status.inyoku)
- {
- this.AddHaveTrophy(1020);
- }
- if (1000 <= status.mvalue)
- {
- this.AddHaveTrophy(1030);
- }
- if (5000 <= status.mvalue)
- {
- this.AddHaveTrophy(1040);
- }
- if (9999 <= status.mvalue)
- {
- this.AddHaveTrophy(1050);
- }
- if (1000 <= status.hentai)
- {
- this.AddHaveTrophy(1060);
- }
- if (5000 <= status.hentai)
- {
- this.AddHaveTrophy(1070);
- }
- if (9999 <= status.hentai)
- {
- this.AddHaveTrophy(1080);
- }
- if (1000 <= status.housi)
- {
- this.AddHaveTrophy(1090);
- }
- if (5000 <= status.housi)
- {
- this.AddHaveTrophy(1100);
- }
- if (9999 <= status.housi)
- {
- this.AddHaveTrophy(1110);
- }
- }
- public void CheckTrophyContractTypeAndrelation()
- {
- int num = 0;
- int num2 = 0;
- int num3 = 0;
- foreach (Maid maid in GameMain.Instance.CharacterMgr.GetStockMaidList())
- {
- if (maid.status.heroineType != HeroineType.Sub)
- {
- if (maid.status.contract == Contract.Free)
- {
- num++;
- }
- else if (maid.status.contract == Contract.Exclusive)
- {
- num2++;
- }
- if (maid.status.relation == Relation.Lover)
- {
- num3++;
- }
- }
- }
- if (1 <= num)
- {
- this.AddHaveTrophy(10);
- }
- if (3 <= num)
- {
- this.AddHaveTrophy(20);
- }
- if (5 <= num)
- {
- this.AddHaveTrophy(30);
- }
- if (1 <= num2)
- {
- this.AddHaveTrophy(40);
- }
- if (3 <= num2)
- {
- this.AddHaveTrophy(50);
- }
- if (5 <= num2)
- {
- this.AddHaveTrophy(60);
- }
- if (1 <= num3)
- {
- this.AddHaveTrophy(70);
- }
- if (3 <= num3)
- {
- this.AddHaveTrophy(80);
- }
- }
- public void Serialize(BinaryWriter binary)
- {
- binary.Write("CM3D2_PLAYER_STATUS");
- binary.Write(1550);
- binary.Write(this.playerName_);
- binary.Write(this.days_);
- binary.Write(this.totalPurchasePrice_);
- binary.Write(this.money_);
- binary.Write(this.casinoCoin_);
- binary.Write(this.clubName_);
- binary.Write(this.clubGrade_);
- binary.Write(this.baseClubEvaluation_);
- binary.Write(this.clubGauge_);
- binary.Write((short)this.flags_.Count);
- foreach (KeyValuePair<string, int> keyValuePair in this.flags_)
- {
- binary.Write(keyValuePair.Key);
- binary.Write(keyValuePair.Value);
- }
- binary.Write((short)this.havePartsItems_.Count);
- foreach (KeyValuePair<string, bool> keyValuePair2 in this.havePartsItems_)
- {
- binary.Write(keyValuePair2.Key);
- binary.Write(keyValuePair2.Value);
- }
- binary.Write((short)this.haveItems_.Count);
- foreach (KeyValuePair<string, bool> keyValuePair3 in this.haveItems_)
- {
- binary.Write(keyValuePair3.Key);
- binary.Write(keyValuePair3.Value);
- }
- binary.Write((short)this.shopLineups_.Count);
- foreach (KeyValuePair<int, ShopItemStatus> keyValuePair4 in this.shopLineups_)
- {
- binary.Write(keyValuePair4.Key);
- binary.Write((int)keyValuePair4.Value);
- }
- binary.Write((short)this.scheduleSlot.Length);
- foreach (ScheduleData scheduleData in this.scheduleSlot)
- {
- scheduleData.Serialize(binary);
- }
- binary.Write((short)this.scheduleSlotBackup.Length);
- foreach (ScheduleSlotBackup scheduleSlotBackup in this.scheduleSlotBackup)
- {
- scheduleSlotBackup.Serialize(binary);
- }
- binary.Write((short)this.nightWorksStates_.Count);
- foreach (KeyValuePair<int, NightWorkState> keyValuePair5 in this.nightWorksStates_)
- {
- binary.Write(keyValuePair5.Key);
- keyValuePair5.Value.Serialize(binary);
- }
- binary.Write((short)this.haveTrophys.Count);
- foreach (int value in this.haveTrophys)
- {
- binary.Write(value);
- }
- binary.Write((short)this.jobClassOpenFlags.Count);
- foreach (int value2 in this.jobClassOpenFlags)
- {
- binary.Write(value2);
- }
- binary.Write((short)this.yotogiClassOpenFlags.Count);
- foreach (int value3 in this.yotogiClassOpenFlags)
- {
- binary.Write(value3);
- }
- binary.Write(1000);
- binary.Write(3830248615U);
- }
- public void Deserialize(BinaryReader binary)
- {
- string a = binary.ReadString();
- NDebug.Assert(a == "CM3D2_PLAYER_STATUS", "プレイヤーパラメータのヘッダーが不正です。");
- int num = binary.ReadInt32();
- this.playerName_ = binary.ReadString();
- this.days_ = binary.ReadInt32();
- this.totalPurchasePrice_ = binary.ReadInt64();
- this.money_ = binary.ReadInt64();
- this.casinoCoin_ = binary.ReadInt64();
- this.clubName_ = binary.ReadString();
- this.clubGrade_ = binary.ReadInt32();
- this.baseClubEvaluation_ = binary.ReadInt32();
- this.clubGauge_ = binary.ReadInt32();
- int num2 = (int)binary.ReadInt16();
- this.flags_.Clear();
- for (int i = 0; i < num2; i++)
- {
- string key = binary.ReadString();
- int value = binary.ReadInt32();
- this.flags_.Add(key, value);
- }
- num2 = (int)binary.ReadInt16();
- this.havePartsItems_.Clear();
- for (int j = 0; j < num2; j++)
- {
- string key2 = binary.ReadString();
- bool value2 = binary.ReadBoolean();
- this.havePartsItems_.Add(key2, value2);
- }
- if (204 < num)
- {
- num2 = (int)binary.ReadInt16();
- this.haveItems_.Clear();
- for (int k = 0; k < num2; k++)
- {
- string key3 = binary.ReadString();
- bool value3 = binary.ReadBoolean();
- this.haveItems_.Add(key3, value3);
- }
- }
- num2 = (int)binary.ReadInt16();
- this.shopLineups_.Clear();
- for (int l = 0; l < num2; l++)
- {
- int key4 = binary.ReadInt32();
- ShopItemStatus value4 = (ShopItemStatus)binary.ReadInt32();
- this.shopLineups_.Add(key4, value4);
- }
- num2 = (int)binary.ReadInt16();
- int slotCnt = num2;
- this.scheduleSlot = new ScheduleData[40];
- for (int m = 0; m < 40; m++)
- {
- this.scheduleSlot[m] = new ScheduleData();
- }
- for (int n = 0; n < num2; n++)
- {
- this.scheduleSlot[n].Deserialize(binary, num);
- }
- if (num >= 211)
- {
- num2 = (int)binary.ReadInt16();
- this.scheduleSlotBackup = new ScheduleSlotBackup[num2];
- for (int num3 = 0; num3 < num2; num3++)
- {
- this.scheduleSlotBackup[num3] = new ScheduleSlotBackup();
- this.scheduleSlotBackup[num3].Deserialize(binary, num, slotCnt);
- }
- }
- num2 = (int)binary.ReadInt16();
- this.nightWorksStates_.Clear();
- for (int num4 = 0; num4 < num2; num4++)
- {
- int key5 = binary.ReadInt32();
- NightWorkState nightWorkState = new NightWorkState();
- nightWorkState.Deserialize(binary, num);
- this.nightWorksStates_.Add(key5, nightWorkState);
- }
- num2 = (int)binary.ReadInt16();
- this.haveTrophys.Clear();
- for (int num5 = 0; num5 < num2; num5++)
- {
- int item = binary.ReadInt32();
- this.haveTrophys.Add(item);
- }
- num2 = (int)binary.ReadInt16();
- this.jobClassOpenFlags.Clear();
- for (int num6 = 0; num6 < num2; num6++)
- {
- int item2 = binary.ReadInt32();
- this.jobClassOpenFlags.Add(item2);
- }
- num2 = (int)binary.ReadInt16();
- this.yotogiClassOpenFlags.Clear();
- for (int num7 = 0; num7 < num2; num7++)
- {
- int item3 = binary.ReadInt32();
- this.yotogiClassOpenFlags.Add(item3);
- }
- if (1540 <= num)
- {
- int num8 = binary.ReadInt32();
- }
- uint num9 = binary.ReadUInt32();
- NDebug.Assert(3830248615U == num9, "プレイヤーパラメータのロードに失敗しました");
- foreach (string key6 in Status.flagLockPartsItems)
- {
- if (!this.havePartsItems_.ContainsKey(key6))
- {
- this.havePartsItems_.Add(key6, false);
- }
- }
- HashSet<string> hashSet = new HashSet<string>();
- foreach (KeyValuePair<string, bool> keyValuePair in this.havePartsItems_)
- {
- if (!Status.flagLockPartsItems.Contains(keyValuePair.Key))
- {
- hashSet.Add(keyValuePair.Key);
- }
- }
- foreach (string key7 in hashSet)
- {
- this.havePartsItems_.Remove(key7);
- }
- this.UpdateingExtraTrophysHaveData();
- }
- private void UpdateingExtraTrophysHaveData()
- {
- List<Trophy.Data> allDatas = Trophy.GetAllDatas(true);
- foreach (Trophy.Data data in allDatas)
- {
- if (data.type == Trophy.Data.Type.Extra)
- {
- this.AddHaveTrophy(data.id);
- }
- }
- }
- private static void CreateHaveItemList()
- {
- if (Status.flagLockPartsItems == null)
- {
- Status.flagLockPartsItems = new HashSet<string>();
- Dictionary<int, Shop.ItemDataBase> item_data_dic = Shop.item_data_dic;
- Dictionary<int, Shop.ItemDataGroup> item_data_group_dic = Shop.item_data_group_dic;
- foreach (KeyValuePair<int, Shop.ItemDataBase> keyValuePair in item_data_dic)
- {
- Shop.ItemDataBase value = keyValuePair.Value;
- if (!item_data_group_dic.ContainsKey(value.id))
- {
- for (int i = 0; i < value.item_menu_array.Length; i++)
- {
- string item = value.item_menu_array[i];
- if (!Status.flagLockPartsItems.Contains(item))
- {
- Status.flagLockPartsItems.Add(item);
- }
- }
- }
- }
- foreach (KeyValuePair<string[], HashSet<int>> keyValuePair2 in Shop.set_card_list)
- {
- foreach (string item2 in keyValuePair2.Key)
- {
- if (!Status.flagLockPartsItems.Contains(item2))
- {
- Status.flagLockPartsItems.Add(item2);
- }
- }
- }
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen("scenario_get_item_list.nei"))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, "file open error[scenario_get_item_list.nei]");
- for (int k = 0; k < csvParser.max_cell_y; k++)
- {
- if (csvParser.IsCellToExistData(0, k))
- {
- string text = csvParser.GetCellAsString(0, k).ToLower();
- text += ".menu";
- if (!Status.flagLockPartsItems.Contains(text))
- {
- Status.flagLockPartsItems.Add(text);
- }
- }
- }
- }
- }
- }
- }
- public const int SaveDataVersion = 1000;
- public const int InitMaidPoint = 0;
- public const long MoneyMax = 9999999999L;
- public const long CoinMax = 999999L;
- public const int MVPEventDay = 7;
- public const int ScheduleSlotMax = 40;
- public const int ClubGradeMax = 5;
- private const uint SaveDataCheckCode = 3830248615U;
- private static HashSet<string> flagLockPartsItems;
- public ScheduleSlotBackup[] scheduleSlotBackup;
- public ScheduleData[] scheduleSlot;
- private string playerName_;
- private int days_;
- private long totalPurchasePrice_;
- private long money_;
- private long casinoCoin_;
- private string clubName_;
- private int clubGrade_;
- private int baseClubEvaluation_;
- private int clubGauge_;
- private Dictionary<string, int> flags_;
- private Dictionary<string, bool> havePartsItems_;
- private Dictionary<string, bool> haveItems_;
- private Dictionary<int, ShopItemStatus> shopLineups_;
- private Dictionary<int, NightWorkState> nightWorksStates_;
- private HashSet<int> haveTrophys;
- private HashSet<int> jobClassOpenFlags;
- private HashSet<int> yotogiClassOpenFlags;
- private static Dictionary<string, int> jobClassTrophyCheckSet;
- private static Dictionary<string, int> yotogiClassCheckSet;
- }
- }
|