Example #1
0
        public PlayerInventory()
        {
            ListSquadLoadout   = new List <SquadLoadout>();
            ListOwnedSquad     = new List <Squad>();
            ListOwnedCharacter = new List <Character>();

            ActiveLoadout = new SquadLoadout();
            ListSquadLoadout.Add(ActiveLoadout);
        }
Example #2
0
        public override void Load()
        {
            fntArial12 = Content.Load <SpriteFont>("Fonts/Arial12");

            sndButtonOver  = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Over.wav");
            sndButtonClick = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Click.wav");

            IniFile IniUnlocks = IniFile.ReadFromFile("Content/Battle Lobby Unlocks.ini");

            foreach (string RequiredLevel in IniUnlocks.ReadAllValues("Loadout Slots"))
            {
                if (Owner.ActivePlayer.Level >= int.Parse(RequiredLevel))
                {
                    ++MaxLoadouts;
                }
            }

            foreach (string RequiredLevel in IniUnlocks.ReadAllValues("Loadout Sizes"))
            {
                if (Owner.ActivePlayer.Level >= int.Parse(RequiredLevel))
                {
                    ++LoadoutSize;
                }
            }

            for (int L = 0; L < MaxLoadouts; ++L)
            {
                SquadLoadout ActiveLoadout;
                if (L >= Owner.ActivePlayer.Inventory.ListSquadLoadout.Count)
                {
                    ActiveLoadout = new SquadLoadout();
                    Owner.ActivePlayer.Inventory.ListSquadLoadout.Add(ActiveLoadout);
                }
                else
                {
                    ActiveLoadout = Owner.ActivePlayer.Inventory.ListSquadLoadout[L];
                }

                for (int S = 0; S < LoadoutSize; S++)
                {
                    if (S >= ActiveLoadout.ListSquad.Count)
                    {
                        ActiveLoadout.ListSquad.Add(null);
                    }
                }
            }
        }
Example #3
0
        public void Load(BinaryReader BR, Microsoft.Xna.Framework.Content.ContentManager Content, Dictionary <string, Unit> DicUnitType,
                         Dictionary <string, BaseSkillRequirement> DicRequirement, Dictionary <string, BaseEffect> DicEffect,
                         Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget, Dictionary <string, ManualSkillTarget> DicManualSkillTarget)
        {
            int ListOwnedSquadCount = BR.ReadInt32();

            ListOwnedSquad = new List <Squad>(ListOwnedSquadCount);
            for (int S = 0; S < ListOwnedSquadCount; ++S)
            {
                string RelativePath = BR.ReadString();
                string UnitTypeName = BR.ReadString();

                Unit LoadedUnit = Unit.FromType(UnitTypeName, RelativePath, Content, DicUnitType, DicRequirement, DicEffect, DicAutomaticSkillTarget);

                string    CharacterFullName = BR.ReadString();
                Character LoadedCharacter   = new Character(CharacterFullName, Content, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget);
                LoadedCharacter.Level = 1;

                LoadedUnit.ArrayCharacterActive[0] = LoadedCharacter;

                Squad NewSquad = new Squad("Squad", LoadedUnit);
                NewSquad.IsPlayerControlled = true;

                ListOwnedSquad.Add(NewSquad);
            }

            int ListOwnedCharacterCount = BR.ReadInt32();

            ListOwnedCharacter = new List <Character>(ListOwnedCharacterCount);
            for (int C = 0; C < ListOwnedCharacterCount; ++C)
            {
                string    CharacterFullName = BR.ReadString();
                Character LoadedCharacter   = new Character(CharacterFullName, Content, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget);
                LoadedCharacter.Level = 1;

                ListOwnedCharacter.Add(LoadedCharacter);
            }

            int ListSquadLoadoutCount = BR.ReadInt32();

            ListSquadLoadout = new List <SquadLoadout>(ListSquadLoadoutCount);
            for (int L = 0; L < ListSquadLoadoutCount; ++L)
            {
                SquadLoadout NewSquadLoadout = new SquadLoadout();
                ListSquadLoadout.Add(NewSquadLoadout);

                int NewSquadLoadoutSquadCount = BR.ReadInt32();
                NewSquadLoadout.ListSquad = new List <Squad>(NewSquadLoadoutSquadCount);
                for (int S = 0; S < NewSquadLoadoutSquadCount; ++S)
                {
                    string RelativePath = BR.ReadString();

                    if (string.IsNullOrEmpty(RelativePath))
                    {
                        NewSquadLoadout.ListSquad.Add(null);
                        continue;
                    }

                    string UnitTypeName      = BR.ReadString();
                    string CharacterFullName = BR.ReadString();

                    Unit LoadedUnit = Unit.FromType(UnitTypeName, RelativePath, Content, DicUnitType, DicRequirement, DicEffect, DicAutomaticSkillTarget);

                    Character LoadedCharacter = new Character(CharacterFullName, Content, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget);
                    LoadedCharacter.Level = 1;

                    LoadedUnit.ArrayCharacterActive[0] = LoadedCharacter;

                    Squad NewSquad = new Squad("Squad", LoadedUnit);
                    NewSquad.IsPlayerControlled = true;

                    NewSquadLoadout.ListSquad.Add(NewSquad);
                }
            }

            ActiveLoadout = ListSquadLoadout[0];
        }