12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151 |
- 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(1480);
- 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(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);
- }
- uint num8 = binary.ReadUInt32();
- NDebug.Assert(3830248615U == num8, "プレイヤーパラメータのロードに失敗しました");
- 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 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;
- }
- }
|