예제 #1
0
        public bool Equals(SaveFileIV other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Name.Equals(other.Name) &&
                   TimeStamp.Equals(other.TimeStamp) &&
                   SaveVersion.Equals(other.SaveVersion) &&
                   SaveSizeInBytes.Equals(other.SaveSizeInBytes) &&
                   ScriptSpaceSize.Equals(other.ScriptSpaceSize) &&
                   SimpleVars.Equals(other.SimpleVars) &&
                   PlayerInfo.Equals(other.PlayerInfo) &&
                   ExtraContent.Equals(other.ExtraContent) &&
                   Scripts.Equals(other.Scripts) &&
                   Garages.Equals(other.Garages) &&
                   GameLogic.Equals(other.GameLogic) &&
                   Paths.Equals(other.Paths) &&
                   Pickups.Equals(other.Pickups) &&
                   RestartPoints.Equals(other.RestartPoints) &&
                   RadarBlips.Equals(other.RadarBlips) &&
                   Zones.Equals(other.Zones) &&
                   GangData.Equals(other.GangData) &&
                   CarGenerators.Equals(other.CarGenerators) &&
                   Stats.Equals(other.Stats) &&
                   IplStore.Equals(other.IplStore) &&
                   StuntJumps.Equals(other.StuntJumps) &&
                   Radio.Equals(other.Radio) &&
                   Objects.Equals(other.Objects) &&
                   Relationships.Equals(other.Relationships) &&
                   Inventory.Equals(other.Inventory) &&
                   UnusedPools.Equals(other.UnusedPools) &&
                   UnusedPhoneInfo.Equals(other.UnusedPhoneInfo) &&
                   UnusedAudioScript.Equals(other.UnusedAudioScript) &&
                   UnusedSetPieces.Equals(other.UnusedSetPieces) &&
                   UnusedStreaming.Equals(other.UnusedStreaming) &&
                   UnusedPedTypeInfo.Equals(other.UnusedPedTypeInfo) &&
                   UnusedTags.Equals(other.UnusedTags) &&
                   UnusedShopping.Equals(other.UnusedShopping) &&
                   UnusedGangWars.Equals(other.UnusedGangWars) &&
                   UnusedEntryExits.Equals(other.UnusedEntryExits) &&
                   Unused3dMarkers.Equals(other.Unused3dMarkers) &&
                   UnusedVehicles.Equals(other.UnusedVehicles) &&
                   UnusedExtraBlock.Equals(other.UnusedExtraBlock) &&
                   GfwlData.Equals(other.GfwlData));
        }
예제 #2
0
        public override TagCompound Save()
        {
            if (PlayerTransformations == null)
            {
                PlayerTransformations = new Dictionary <TransformationDefinition, PlayerTransformation>();
            }

            TagCompound tag = new TagCompound();

            if (SaveVersion == null)
            {
                SaveVersion = latestVersion;
            }

            tag.Add(nameof(SaveVersion), SaveVersion.ToString());

            foreach (PlayerTransformation playerTransformation in PlayerTransformations.Values)
            {
                playerTransformation.TransformationDefinition.OnPlayerSave(this, tag);
                tag.Add(playerTransformation.TransformationDefinition.GetUnlockedTagCompoundKey(), true);
                tag.Add(playerTransformation.TransformationDefinition.GetMasteryTagCompoundKey(), playerTransformation.Mastery);
            }

            tag.Add("Fragment1", fragment1);
            tag.Add("Fragment2", fragment2);
            tag.Add("Fragment3", fragment3);
            tag.Add("Fragment4", fragment4);
            tag.Add("Fragment5", fragment5);
            tag.Add("KaioFragment1", kaioFragment1);
            tag.Add("KaioFragment2", kaioFragment2);
            tag.Add("KaioFragment3", kaioFragment3);
            tag.Add("KaioFragment4", kaioFragment4);

            // changed save routine to save to a float, orphaning the original KiCurrent.
            tag.Add("KiCurrentFloat", _kiCurrent);
            tag.Add("RageCurrent", rageCurrent);
            tag.Add("KiRegenRate", kiChargeRate);
            tag.Add("KiEssence1", kiEssence1);
            tag.Add("KiEssence2", kiEssence2);
            tag.Add("KiEssence3", kiEssence3);
            tag.Add("KiEssence4", kiEssence4);
            tag.Add("KiEssence5", kiEssence5);

            tag.Add(nameof(SelectedTransformation),
                    SelectedTransformation == null ? "" : SelectedTransformation.UnlocalizedName);

            tag.Add("IsMasteryRetrofitted", isMasteryRetrofitted);

            foreach (KeyValuePair <TransformationDefinition, PlayerTransformation> kvp in PlayerTransformations)
            {
                tag.Add($"MasteryLevel{kvp.Key.UnlocalizedName}", kvp.Value.Mastery);
            }

            foreach (var key in masteryMessagesDisplayed.Keys)
            {
                tag.Add($"MasteryMessagesDisplayed{key}", masteryMessagesDisplayed[key]);
            }

            tag.Add("JungleMessage", jungleMessage);
            tag.Add("HellMessage", hellMessage);
            tag.Add("EvilMessage", evilMessage);
            tag.Add("MushroomMessage", mushroomMessage);
            tag.Add("playerTrait", PlayerTrait == null ? DBZMOD.Instance.TraitManager.GetRandomTrait().UnlocalizedName : PlayerTrait.UnlocalizedName);
            tag.Add("flightUnlocked", flightUnlocked);
            tag.Add("flightDampeningUnlocked", flightDampeningUnlocked);
            tag.Add("flightUpgraded", flightUpgraded);

            tag.Add("KiMax3", kiMax3);
            tag.Add("FirstFourStarDBPickup", firstDragonBallPickup);
            tag.Add("PowerWishesLeft", powerWishesLeft);
            tag.Add("SkillWishesLeft", skillWishesLeft);
            tag.Add("ImmortalityWishesLeft", immortalityWishesLeft);
            tag.Add("AwakeningWishesLeft", awakeningWishesLeft);
            tag.Add("ImmortalityRevivesLeft", immortalityRevivesLeft);
            tag.Add("IsInstantTransmission1Unlocked", isInstantTransmission1Unlocked);
            tag.Add("IsInstantTransmission2Unlocked", isInstantTransmission2Unlocked);
            tag.Add("IsInstantTransmission3Unlocked", isInstantTransmission3Unlocked);
            tag.Add("HairChecked", hairChecked);

            // added to store the player's original eye color if possible
            if (originalEyeColor != null)
            {
                tag.Add("OriginalEyeColorR", originalEyeColor.Value.R);
                tag.Add("OriginalEyeColorG", originalEyeColor.Value.G);
                tag.Add("OriginalEyeColorB", originalEyeColor.Value.B);
            }

            //tag.Add("RealismMode", RealismMode);
            return(tag);
        }