Esempio n. 1
0
        public SystemViewModel(ISaveKh3 save)
        {
            this.save     = save;
            Difficulty    = new KhEnumListModel <DifficultyType>(() => save.Difficulty, x => save.Difficulty = x);
            WorldIcon     = new KhEnumListModel <WorldType>(() => save.WorldLogo, x => save.WorldLogo = x);
            Location      = new KhEnumListModel <LocationType>(() => save.LocationName, x => save.LocationName = x);
            CharacterIcon = new KhEnumListModel <CharacterIconType>(() => save.BaseSaveIcon, x =>
            {
                save.BaseSaveIcon = x;
                save.DlcSaveIcon  = x;
            });
            Maps = Lib3.Presets.Presets.MAPS.Select(x => new MapViewModel(x.Key, x.Value)).ToList();

            PlayableCharacters =
                Lib3.Presets.Presets.PlayablePawns.Select(x => new SpawnModel
            {
                Name  = x.Value.Name,
                Value = string.Format(Lib3.Presets.Presets.PlayablePawnPath, x.Key)
            })
                .Concat(Lib3.Presets.Presets.NpcPawns.Select(x => new SpawnModel
            {
                Name  = x.Value.Name,
                Value = string.Format(Lib3.Presets.Presets.NpcPawnPath, x.Key)
            }))
                .Concat(Lib3.Presets.Presets.EnemyPawns.Select(x => new SpawnModel
            {
                Name  = x.Value.Name,
                Value = string.Format(Lib3.Presets.Presets.EnemyPawnPath, x.Key)
            }))
                .ToArray();
        }
 public StorySimpleViewModel(ISaveKh3 save)
 {
     Save = save;
     NewGamePlusCommand = new StoryCommand(save, "New Game+ (simulated)", "/Game/Levels/ew/ew_01/ew_01", new Dictionary <StoryFlagType, int>()
     {
         [StoryFlagType.TheFinalWorld] = 0,
         [StoryFlagType.Story33]       = 2000,
         [StoryFlagType.Story34]       = 0,
         [StoryFlagType.Story35]       = 0,
         [StoryFlagType.Story36]       = 0,
         [StoryFlagType.Story37]       = 0,
         [StoryFlagType.Story38]       = 0,
         [StoryFlagType.Story39]       = 0,
         [StoryFlagType.Story3A]       = 0,
         [StoryFlagType.Story3B]       = 0,
         [StoryFlagType.Story3C]       = 0,
     }, true);
     NewGamePlusGlitchyCommand = new StoryCommand(save, "New Game+ (but with story complete)", "/Game/Levels/ew/ew_01/ew_01", CompleteSave(new Dictionary <StoryFlagType, int>()
     {
         [StoryFlagType.TheFinalWorld] = 0,
     }), false);
     CompleteGameCommand    = new StoryCommand(save, "Complete game", "/Game/Levels/bt/bt_01/bt_01", CompleteSave(), false);
     LandOfDepartureCommand = new StoryCommand(save, "Back to Land of Departure (before Vanitas fight)", "/Game/Levels/dp/dp_01/dp_01", new Dictionary <StoryFlagType, int>()
     {
         [StoryFlagType.LandOfDeparture] = 0,
         [StoryFlagType.Story33]         = 2000,
         [StoryFlagType.Story34]         = 2000,
         [StoryFlagType.Story35]         = 2000,
         [StoryFlagType.Story36]         = 2000,
         [StoryFlagType.Story37]         = 2000,
         [StoryFlagType.Story38]         = 2000,
         [StoryFlagType.Story39]         = 2000,
         [StoryFlagType.Story3A]         = 0,
         [StoryFlagType.Story3B]         = 0,
         [StoryFlagType.Story3C]         = 0,
     }, false);
     KgBattleGameCommand = new StoryCommand(save, "Keyblade Graveyard, before 1000 Heartless", "/Game/Levels/kg/kg_01/kg_01", CompleteSave(new Dictionary <StoryFlagType, int>()
     {
         [StoryFlagType.ScalaAdCaelum]              = 0,
         [StoryFlagType.Story03]                    = 900,
         [StoryFlagType.Story04]                    = 100,
         [StoryFlagType.Story05]                    = 382,
         [StoryFlagType.TheFinalWorld]              = 2300,
         [StoryFlagType.Story0D]                    = 0,
         [StoryFlagType.Story0E]                    = 0,
         [StoryFlagType.Story0F]                    = 0,
         [StoryFlagType.Story10]                    = 0,
         [StoryFlagType.Story11]                    = 0,
         [StoryFlagType.Story12]                    = 0,
         [StoryFlagType.Story1A]                    = 10,
         [StoryFlagType.Story1E]                    = 0,
         [StoryFlagType.KeybladeGraveyard]          = 50,
         [StoryFlagType.KG_Riku_Xigbar]             = 0,
         [StoryFlagType.KG_Luxord_Marluxia_Larxene] = 0,
         [StoryFlagType.KG_Vanitas_Terra]           = 0,
         [StoryFlagType.KG_Xion_Saix]               = 0,
         [StoryFlagType.Story31]                    = 100,
         [StoryFlagType.Story32]                    = 0,
     }), false);
 }
Esempio n. 3
0
        public SystemViewModel(ISaveKh3 save)
        {
            this.save     = save;
            Difficulty    = new KhEnumListModel <DifficultyType>(() => save.Difficulty, x => save.Difficulty = x);
            WorldIcon     = new KhEnumListModel <WorldType>(() => save.WorldLogo, x => save.WorldLogo = x);
            Location      = new KhEnumListModel <LocationType>(() => save.LocationName, x => save.LocationName = x);
            CharacterIcon = new KhEnumListModel <CharacterIconType>(() => save.MySaveIcon, x => save.MySaveIcon = x);
            RoomWorld     = new KhEnumListModel <GenericEntryModel <string, string>, WorldType, string>(
                () => RoomWorldId,
                x => RoomWorldId = x,
                x => WorldAttribute.GetWorldId(x));
            Maps = Lib3.Presets.Presets.MAPS.Select(x => new MapViewModel(x.Key, x.Value)).ToList();

            PlayableCharacters =
                Lib3.Presets.Presets.PlayablePawns.Select(x => new SpawnModel
            {
                Name  = x.Value.Name,
                Value = string.Format(Lib3.Presets.Presets.PlayablePawnPath, x.Key)
            })
                .Concat(Lib3.Presets.Presets.NpcPawns.Select(x => new SpawnModel
            {
                Name  = x.Value.Name,
                Value = string.Format(Lib3.Presets.Presets.NpcPawnPath, x.Key)
            }))
                .Concat(Lib3.Presets.Presets.EnemyPawns.Select(x => new SpawnModel
            {
                Name  = x.Value.Name,
                Value = string.Format(Lib3.Presets.Presets.EnemyPawnPath, x.Key)
            }))
                .ToArray();
        }
        public ShortcutsViewModel(ISaveKh3 save)
        {
            _save     = save;
            Shortcut1 = new ShortcutGroupViewModel(_save, 0);
            Shortcut2 = new ShortcutGroupViewModel(_save, 1);
            Shortcut3 = new ShortcutGroupViewModel(_save, 2);

            Magic1 = new ItemComboBoxModel <CommandType>(() => save.Magics[0], x => save.Magics[0] = x);
            Magic2 = new ItemComboBoxModel <CommandType>(() => save.Magics[1], x => save.Magics[1] = x);
            Magic3 = new ItemComboBoxModel <CommandType>(() => save.Magics[2], x => save.Magics[2] = x);
            Magic4 = new ItemComboBoxModel <CommandType>(() => save.Magics[3], x => save.Magics[3] = x);
            Magic5 = new ItemComboBoxModel <CommandType>(() => save.Magics[4], x => save.Magics[4] = x);
            Magic6 = new ItemComboBoxModel <CommandType>(() => save.Magics[5], x => save.Magics[5] = x);
            Link1  = new ItemComboBoxModel <CommandType>(() => save.Links[0], x => save.Links[0] = x);
            Link2  = new ItemComboBoxModel <CommandType>(() => save.Links[1], x => save.Links[1] = x);
            Link3  = new ItemComboBoxModel <CommandType>(() => save.Links[2], x => save.Links[2] = x);
            Link4  = new ItemComboBoxModel <CommandType>(() => save.Links[3], x => save.Links[3] = x);
            Link5  = new ItemComboBoxModel <CommandType>(() => save.Links[4], x => save.Links[4] = x);
        }
            public ShortcutGroupViewModel(ISaveKh3 save, int groupIndex)
            {
                _save = save;

                Circle = new ItemComboBoxModel <CommandType>(
                    () => save.Shortcuts[groupIndex].Circle,
                    x => save.Shortcuts[groupIndex].Circle = x);

                Triangle = new ItemComboBoxModel <CommandType>(
                    () => save.Shortcuts[groupIndex].Triangle,
                    x => save.Shortcuts[groupIndex].Triangle = x);

                Square = new ItemComboBoxModel <CommandType>(
                    () => save.Shortcuts[groupIndex].Square,
                    x => save.Shortcuts[groupIndex].Square = x);

                Cross = new ItemComboBoxModel <CommandType>(
                    () => save.Shortcuts[groupIndex].Cross,
                    x => save.Shortcuts[groupIndex].Cross = x);
            }
Esempio n. 6
0
        public StoryCommand(
            ISaveKh3 save,
            string name,
            string map,
            Dictionary <StoryFlagType, int> flags,
            bool zeroEverything = false)
            : base(x =>
        {
            if (!ThrowConfirmationMessage(name))
            {
                return;
            }

            if (!string.IsNullOrEmpty(map))
            {
                save.MapPath  = map;
                save.MapSpawn = "default";
            }

            if (zeroEverything)
            {
                for (var i = 0; i < save.Storyflags.Count; i++)
                {
                    save.Storyflags[i] = 0;
                }
            }

            for (var i = 0; i < save.Storyflags.Count; i++)
            {
                if (flags.TryGetValue((StoryFlagType)i, out var newFlag))
                {
                    save.Storyflags[i] = newFlag;
                }
            }
        })
        {
            Name = name;
        }
Esempio n. 7
0
 public MaterialModel(ISaveKh3 save, int index)
 {
     this.save  = save;
     this.index = index;
 }
Esempio n. 8
0
 public MaterialsViewModel(ISaveKh3 save) :
     base(save.MaterialsCount
          .Where((_, i) => Global.CanDisplay((MaterialType)i))
          .Select((_, i) => new MaterialModel(save, i)))
 {
 }
Esempio n. 9
0
        private static void AssertSaveGame(ISaveKh3 save)
        {
            Assert.Equal(0x45764053, save.MagicCode);
            Assert.Equal(DifficultyType.Proud, save.Difficulty);
            Assert.Equal(WorldType.ScalaAdCaelum, save.WorldLogo);
            Assert.Equal(new TimeSpan(52, 54, 3), save.GameTime);
            Assert.Equal(1413899, save.TotalExp);
            Assert.Equal(223439, save.Munny);
            Assert.Equal(94, save.Level);
            Assert.Equal(DesireChoice.Vitality, save.DesireChoice);
            Assert.Equal(PowerChoice.Warrior, save.PowerChoice);
            Assert.Equal(PartyCharacter.Sora, save.Party[0]);
            Assert.Equal(PartyCharacter.Donald, save.Party[1]);
            Assert.Equal(PartyCharacter.Goofy, save.Party[2]);
            Assert.Equal(PartyCharacter.Sora, save.Party[3]);
            Assert.Equal(PartyCharacter.Sora, save.Party[4]);
            Assert.True(save.SaveClear);
            Assert.Equal(LocationType.Location57, save.LocationName);
            Assert.Equal(CharacterIconType.Sora, save.BaseSaveIcon);
            Assert.Equal(6485, save.EnemiesDefeated);
            Assert.Equal(161, save.SavesCount);

            Assert.Equal(41, save.RecordAttractionsUseCount[0]);
            Assert.Equal(24, save.RecordAttractionsUseCount[1]);
            Assert.Equal(32, save.RecordAttractionsUseCount[4]);
            //Assert.Equal(3, save.RecordShotlocksUseCount[0]);
            //Assert.Equal(3, save.RecordShotlocksUseCount[1]);
            //Assert.Equal(10, save.RecordShotlocksUseCount[16]);
            //Assert.Equal(1, save.RecordShotlocksUseCount[27]);
            //Assert.Equal(0, save.RecordShotlocksUseCount[29]);

            Assert.Equal(54, save.Inventory[(int)InventoryType.Potion].Count);
            Assert.Equal(5, save.Inventory[(int)InventoryType.ApBoost].Count);

            Assert.Equal(60, save.MaterialsCount[0]);
            Assert.Equal(51, save.MaterialsCount[1]);
            Assert.Equal(139, save.MaterialsCount[40]);

            Assert.Equal(1723, save.CrabsCollected);

            Assert.Equal(WeaponType.UltimaWeapon, save.Pc[0].Weapons[0].WeaponId);
            Assert.Equal(WeaponType.GrandChef, save.Pc[0].Weapons[1].WeaponId);
            Assert.Equal(WeaponType.HunnySpout, save.Pc[0].Weapons[2].WeaponId);
            Assert.Equal(ArmorType.CosmicChain, save.Pc[1].Armors[0].ArmorId);
            Assert.Equal(AccessoryType.FlanniversaryBadge, save.Pc[0].Accessories[1].AccessoryId);
            Assert.Equal(0x444, save.Pc[0].Abilities[0].Data);
            Assert.Equal(0x444, save.Pc[0].Abilities[save.Pc[0].Abilities.Count - 1].Data);
            Assert.Equal(AiCombatStyleType.StickBySora, save.Pc[1].Ai.CombatStyle);
            Assert.Equal(AiAbilityType.GoWild, save.Pc[1].Ai.Abilitiy);
            Assert.Equal(AiRecoveryType.UseInEmergencies, save.Pc[1].Ai.Recovery);
            Assert.Equal(0b11111, save.Pc[1].Ai.RecoveryTargets);
            Assert.Equal(180, save.Pc[3].Hp);
            Assert.Equal(100, save.Pc[3].Mp);
            Assert.Equal(100, save.Pc[3].Focus);
            Assert.Equal(175, save.Pc[4].Hp);

            Assert.Equal(44, save.BonusHp);
            Assert.Equal(33, save.BonusMp);
            Assert.Equal(2, save.BonusStrength);
            Assert.Equal(2, save.BonusMagic);
            Assert.Equal(2, save.BonusDefense);

            Assert.Equal(100, save.Storyflags[0]);
            Assert.Equal(382, save.Storyflags[5]);
            Assert.Equal(2120, save.Storyflags[21]);
            Assert.Equal(6000, save.Storyflags[61]);
            Assert.Equal(0, save.Storyflags[63]);

            Assert.Equal("/Game/Levels/ex/ex_26/ex_26", save.MapPath);
            Assert.Equal("TresPlayerStart_Debug", save.MapSpawn);
            Assert.Equal("/Script/TresGame.TresPlayerControllerLowerBase", save.PlayerScript);
            Assert.Equal("Pawn path", save.PlayerCharacter);

            Assert.Equal(CommandType.Firaga, save.Magics[0]);

            Assert.Equal(3, save.Shortcuts.Count);
            Assert.Equal(CommandType.Curaga, save.Shortcuts[0].Circle);
            Assert.Equal(CommandType.Thundaga, save.Shortcuts[0].Triangle);
            Assert.Equal(CommandType.Waterga, save.Shortcuts[0].Square);
            Assert.Equal(CommandType.Firaga, save.Shortcuts[0].Cross);
            Assert.Equal(CommandType.UnionX, save.Shortcuts[2].Triangle);

            Assert.Equal(CommandType.Firaga, save.Magics[0]);
            Assert.Equal(CommandType.Aeroga, save.Magics[5]);
            Assert.Equal(CommandType.MeowWowBaloon, save.Links[0]);
            Assert.Equal(CommandType.PlasmaEncounter, save.Links[4]);

            Assert.Equal(20722, save.Records.CherryFlan.HighScore);
            Assert.Equal(20722, save.Records.CherryFlan.HighScore2);
            Assert.Equal(11, save.Records.CherryFlan.AttemptCount);
            Assert.Equal(24050, save.Records.StrawberryFlan.HighScore);
            Assert.Equal(24050, save.Records.StrawberryFlan.HighScore2);
            Assert.Equal(17, save.Records.ShotlocksHighScore[0]);
            Assert.Equal(23, save.Records.ShotlocksHighScore[1]);

            Assert.Equal(200, save.PhotoMaxCount);
            Assert.Equal(84725, save.Photos[0].Length);
            Assert.Equal(84065, save.Photos[89].Length);
        }
Esempio n. 10
0
 public StoryViewModel(ISaveKh3 save) :
     this(save.Storyflags)
 {
 }
Esempio n. 11
0
 public StoryViewModel(ISaveKh3 save)
 {
     Advanced = new StoryAdvancedViewModel(save.Storyflags);
     Simple   = new StorySimpleViewModel(save);
 }