1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147 |
- 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_ = "エンパイアクラブ";
- 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(1130);
- 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;
- }
- }
|