protected void LoadMapAssets()
        {
            for (int S = ListMapScript.Count - 1; S >= 0; --S)
            {
                switch (ListMapScript[S].MapScriptType)
                {
                case MapScriptTypes.Trigger:
                    MapTrigger ActiveTrigger = (MapTrigger)ListMapScript[S];
                    ActiveTrigger.Preload();
                    break;
                }
            }

            #region Load Backgrounds and Foregrounds

            for (int B = 0; B < ListBackgroundsPath.Count; B++)
            {
                ListBackgrounds.Add(AnimationBackground.LoadAnimationBackground(ListBackgroundsPath[B], Content, GraphicsDevice));
            }

            for (int F = 0; F < ListForegroundsPath.Count; F++)
            {
                ListForegrounds.Add(AnimationBackground.LoadAnimationBackground(ListForegroundsPath[F], Content, GraphicsDevice));
            }

            #endregion
        }
        public AnimationScreen(string AnimationPath, DeathmatchMap Map, Squad ActiveSquad, Squad EnemySquad, Attack ActiveAttack,
                               BattleMap.SquadBattleResult BattleResult, AnimationUnitStats UnitStats, AnimationBackground ActiveTerrain, string ExtraText, bool IsLeftAttacking)
            : base(AnimationPath)
        {
            RequireFocus     = false;
            RequireDrawFocus = false;
            IsOnTop          = false;
            Random           = new Random();
            IsLoaded         = false;

            this.Map                  = Map;
            this.AttackingSquad       = ActiveSquad;
            this.EnemySquad           = EnemySquad;
            this.ActiveAttack         = ActiveAttack;
            this.BattleResult         = BattleResult;
            this.UnitStats            = UnitStats;
            ActiveAnimationBackground = ActiveTerrain;
            this.ExtraText            = ExtraText;
            this.IsLeftAttacking      = IsLeftAttacking;

            RightSquad = ActiveSquad;
            LeftSquad  = EnemySquad;

            if (IsLeftAttacking)
            {
                RightSquad = EnemySquad;
                LeftSquad  = ActiveSquad;
            }
        }
Example #3
0
            public override void Load(BinaryReader BR)
            {
                int ListForegroundsPathCount = BR.ReadInt32();

                for (int F = 0; F < ListForegroundsPathCount; F++)
                {
                    _ListForegroundsPath.Add(BR.ReadString());
                }

                if (Map != null)
                {
                    for (int F = 0; F < _ListForegroundsPath.Count; F++)
                    {
                        ListForegrounds.Add(AnimationBackground.LoadAnimationBackground(_ListForegroundsPath[F], Map.Content, GameScreen.GraphicsDevice));
                    }
                }
            }
Example #4
0
        public void CreateAnimation(AnimationInfo Info, DeathmatchMap Map, Squad ActiveSquad, Squad EnemySquad, Attack ActiveAttack,
                                    SquadBattleResult BattleResult, AnimationScreen.AnimationUnitStats UnitStats, AnimationBackground ActiveTerrain, string ExtraText, bool IsLeftAttacking)
        {
            AnimationScreen NewAnimationScreen = new AnimationScreen(Info.AnimationName, Map, ActiveSquad, EnemySquad, ActiveAttack, BattleResult, UnitStats, ActiveTerrain, ExtraText, IsLeftAttacking);

            NewAnimationScreen.Load();
            NewAnimationScreen.UpdateKeyFrame(0);

            Dictionary <int, Timeline> DicExtraTimeline = Info.GetExtraTimelines(NewAnimationScreen);

            foreach (KeyValuePair <int, Timeline> ActiveExtraTimeline in DicExtraTimeline)
            {
                NewAnimationScreen.ListAnimationLayer[0].AddTimelineEvent(ActiveExtraTimeline.Key, ActiveExtraTimeline.Value);
            }

            ListNextAnimationScreen.Add(NewAnimationScreen);
        }
Example #5
0
        public void CreateAnimation(string AnimationName, DeathmatchMap Map, Squad ActiveSquad, Squad EnemySquad, Attack ActiveAttack,
                                    SquadBattleResult BattleResult, AnimationScreen.AnimationUnitStats UnitStats, AnimationBackground ActiveTerrain, string ExtraText, bool IsLeftAttacking)
        {
            AnimationScreen NewAnimationScreen = new AnimationScreen(AnimationName, Map, ActiveSquad, EnemySquad, ActiveAttack, BattleResult, UnitStats, ActiveTerrain, ExtraText, IsLeftAttacking);

            ListNextAnimationScreen.Add(NewAnimationScreen);
        }
        private void LoadAnimationBackground(string AnimationBackgroundPath)
        {
            string Name = AnimationBackgroundPath.Substring(0, AnimationBackgroundPath.Length - 5).Substring(19);

            this.Text = Name + " - Project Eternity Animation Background Editor";

            AnimationBackgroundViewer.Preload();

            AnimationBackgroundViewer.ActiveAnimationBackground = (AnimationBackground3D)AnimationBackground.LoadAnimationBackground(Name, AnimationBackgroundViewer.content,
                                                                                                                                     AnimationBackgroundViewer.GraphicsDevice);

            PropertiesDialog = new BackgroundProperties(AnimationBackgroundViewer.ActiveAnimationBackground);

            PropertiesDialog.txtBackgroundStartX.Value = (decimal)AnimationBackgroundViewer.ActiveAnimationBackground.DefaultCameraPosition.X;
            PropertiesDialog.txtBackgroundStartY.Value = (decimal)AnimationBackgroundViewer.ActiveAnimationBackground.DefaultCameraPosition.Y;
            PropertiesDialog.txtBackgroundStartZ.Value = (decimal)AnimationBackgroundViewer.ActiveAnimationBackground.DefaultCameraPosition.Z;

            PropertiesDialog.txtBackgroundYaw.Value   = (decimal)AnimationBackgroundViewer.ActiveAnimationBackground.DefaultCameraRotation.X;
            PropertiesDialog.txtBackgroundPitch.Value = (decimal)AnimationBackgroundViewer.ActiveAnimationBackground.DefaultCameraRotation.Y;
            PropertiesDialog.txtBackgroundRoll.Value  = (decimal)AnimationBackgroundViewer.ActiveAnimationBackground.DefaultCameraRotation.Z;

            foreach (AnimationBackground3DBase ActiveBackgroundSystem in AnimationBackgroundViewer.ActiveAnimationBackground.ListBackground)
            {
                TreeNode NewTreeNode = new TreeNode(ActiveBackgroundSystem.ToString());
                NewTreeNode.Tag = ActiveBackgroundSystem;
                lstItemChoices.Nodes.Add(NewTreeNode);
                foreach (string ActiveChild in ActiveBackgroundSystem.GetChild())
                {
                    NewTreeNode.Nodes.Add(ActiveChild);
                }
            }
        }
Example #7
0
        public override BattleMap LoadTemporaryMap(BinaryReader BR)
        {
            PlayerRoster = new Roster();
            PlayerRoster.LoadRoster();

            Load();
            DataScreen.LoadProgression(BR, PlayerRoster, DicUnitType, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget);

            //Initialise the ScreenSize based on the map loaded.
            ScreenSize = new Point(Constants.Width / TileSize.X, Constants.Height / TileSize.Y);

            IsInit           = true;
            RequireDrawFocus = false;

            TogglePreview(true);

            int DicMapVariablesCount = BR.ReadInt32();

            DicMapVariables = new Dictionary <string, double>(DicMapVariablesCount);
            for (int i = 0; i < DicMapVariablesCount; ++i)
            {
                DicMapVariables.Add(BR.ReadString(), BR.ReadDouble());
            }

            CursorPosition.X = BR.ReadSingle();
            CursorPosition.Y = BR.ReadSingle();

            CameraPosition.X = BR.ReadSingle();
            CameraPosition.Y = BR.ReadSingle();

            ActivePlayerIndex = BR.ReadInt32();
            GameTurn          = BR.ReadInt32();

            VictoryCondition = BR.ReadString();
            LossCondition    = BR.ReadString();
            SkillPoint       = BR.ReadString();

            ListBackground.Clear();
            int ListBackgroundCount = BR.ReadInt32();

            for (int B = 0; B < ListBackgroundCount; ++B)
            {
                ListBackground.Add(AnimationBackground.LoadAnimationBackground(BR.ReadString(), Content, GraphicsDevice));
            }

            ListForeground.Clear();
            int ListForegroundCount = BR.ReadInt32();

            for (int F = 0; F < ListForegroundCount; ++F)
            {
                ListForeground.Add(AnimationBackground.LoadAnimationBackground(BR.ReadString(), Content, GraphicsDevice));
            }

            sndBattleThemeName = BR.ReadString();
            if (!string.IsNullOrEmpty(sndBattleThemeName))
            {
                FMODSound NewBattleTheme = new FMODSound(FMODSystem, "Content/Maps/BGM/" + sndBattleThemeName + ".mp3");

                NewBattleTheme.SetLoop(true);
                sndBattleTheme = NewBattleTheme;
            }

            string ThemePath     = BR.ReadString();
            uint   ThemePosition = BR.ReadUInt32();

            if (!string.IsNullOrEmpty(ThemePath))
            {
                FMODSound NewTheme = new FMODSound(FMODSystem, "Content/Maps/BGM/" + ThemePath + ".mp3");
                NewTheme.SetLoop(true);
                NewTheme.PlayAsBGM();
                FMODSystem.sndActiveBGMName = ThemePath;
                NewTheme.SetPosition(ThemePosition);
            }

            Dictionary <uint, Squad> DicLoadedSquad = new Dictionary <uint, Squad>();

            int ListPlayerCount = BR.ReadInt32();

            ListPlayer = new List <Player>(ListPlayerCount);
            for (int P = 0; P < ListPlayerCount; ++P)
            {
                string ActivePlayerName       = BR.ReadString();
                string ActivePlayerType       = BR.ReadString();
                bool   ActivePlayerIsHuman    = BR.ReadBoolean();
                int    ActivePlayerTeam       = BR.ReadInt32();
                byte   ActivePlayerColorRed   = BR.ReadByte();
                byte   ActivePlayerColorGreen = BR.ReadByte();
                byte   ActivePlayerColorBlue  = BR.ReadByte();

                Player NewPlayer = new Player(ActivePlayerName, ActivePlayerType, ActivePlayerIsHuman, false, ActivePlayerTeam,
                                              Color.FromNonPremultiplied(ActivePlayerColorRed, ActivePlayerColorGreen, ActivePlayerColorBlue, 255));

                ListPlayer.Add(NewPlayer);

                int ActivePlayerListSquadCount = BR.ReadInt32();
                for (int S = 0; S < ActivePlayerListSquadCount; ++S)
                {
                    Squad  NewSquad;
                    UInt32 ActiveSquadID                 = BR.ReadUInt32();
                    bool   CanMove                       = BR.ReadBoolean();
                    int    ActionsRemaining              = BR.ReadInt32();
                    float  ActiveSquadPositionX          = BR.ReadSingle();
                    float  ActiveSquadPositionY          = BR.ReadSingle();
                    float  ActiveSquadPositionZ          = BR.ReadSingle();
                    string ActiveSquadSquadName          = BR.ReadString();
                    string ActiveSquadCurrentMovement    = BR.ReadString();
                    bool   ActiveSquadIsFlying           = BR.ReadBoolean();
                    bool   ActiveSquadIsUnderTerrain     = BR.ReadBoolean();
                    bool   ActiveSquadIsPlayerControlled = BR.ReadBoolean();
                    string ActiveSquadSquadAI            = BR.ReadString();

                    int ActiveSquadUnitsInSquad = BR.ReadInt32();
                    int CurrentLeaderIndex      = BR.ReadInt32();
                    int CurrentWingmanAIndex    = BR.ReadInt32();
                    int CurrentWingmanBIndex    = BR.ReadInt32();

                    Unit[] ArrayNewUnit = new Unit[ActiveSquadUnitsInSquad];
                    for (int U = 0; U < ActiveSquadUnitsInSquad; ++U)
                    {
                        string UnitTypeName = BR.ReadString();
                        string RelativePath = BR.ReadString();
                        string TeamEventID  = BR.ReadString();

                        if (string.IsNullOrEmpty(TeamEventID))
                        {
                            ArrayNewUnit[U] = DicUnitType[UnitTypeName].FromFile(RelativePath, Content, DicRequirement, DicEffect, DicAutomaticSkillTarget);
                        }
                        else
                        {
                            foreach (Unit ActiveUnit in PlayerRoster.TeamUnits.GetAll())
                            {
                                if (ActiveUnit.TeamEventID == TeamEventID)
                                {
                                    ArrayNewUnit[U] = ActiveUnit;
                                    break;
                                }
                            }
                        }

                        ArrayNewUnit[U].QuickLoad(BR, Content, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget);
                    }

                    NewSquad = new Squad(ActiveSquadSquadName, ArrayNewUnit[0],
                                         ArrayNewUnit.Length >= 2 ? ArrayNewUnit[1] : null,
                                         ArrayNewUnit.Length >= 3 ? ArrayNewUnit[2] : null);

                    int ListAttackedTeamCount = BR.ReadInt32();
                    NewSquad.ListAttackedTeam = new List <int>(ListAttackedTeamCount);
                    for (int U = 0; U < ListAttackedTeamCount; ++U)
                    {
                        NewSquad.ListAttackedTeam.Add(BR.ReadInt32());
                    }

                    NewSquad.SetLeader(CurrentLeaderIndex);
                    NewSquad.SetWingmanA(CurrentWingmanAIndex);
                    NewSquad.SetWingmanB(CurrentWingmanBIndex);

                    if (!CanMove)
                    {
                        NewSquad.EndTurn();
                    }

                    NewSquad.ActionsRemaining = ActionsRemaining;
                    NewSquad.SquadName        = ActiveSquadSquadName;
                    NewSquad.ID = ActiveSquadID;

                    DicLoadedSquad.Add(ActiveSquadID, NewSquad);

                    if (NewSquad.CurrentLeader != null)
                    {
                        //Do not spawn squads as it will trigger effect that were already activated
                        if (Content != null)
                        {
                            NewSquad.Unit3D = new UnitMap3D(GraphicsDevice, Content.Load <Effect>("Shaders/Squad shader 3D"), NewSquad.CurrentLeader.SpriteMap, 1);
                        }

                        if (!string.IsNullOrEmpty(ActiveSquadSquadAI))
                        {
                            NewSquad.SquadAI = new DeathmatchScripAIContainer(new DeathmatchAIInfo(this, NewSquad));
                            NewSquad.SquadAI.Load(ActiveSquadSquadAI);
                        }

                        NewPlayer.IsAlive = true;

                        ActivateAutomaticSkills(NewSquad, string.Empty);
                    }

                    NewSquad.UpdateSquad();

                    //Load the Battle Themes.
                    for (int U = 0; U < NewSquad.UnitsInSquad; ++U)
                    {
                        for (int C = NewSquad.At(U).ArrayCharacterActive.Length - 1; C >= 0; --C)
                        {
                            if (!string.IsNullOrEmpty(NewSquad.At(U).ArrayCharacterActive[C].BattleThemeName))
                            {
                                if (!Character.DicBattleTheme.ContainsKey(NewSquad.At(U).ArrayCharacterActive[C].BattleThemeName))
                                {
                                    Character.DicBattleTheme.Add(NewSquad.At(U).ArrayCharacterActive[C].BattleThemeName, new FMODSound(FMODSystem, "Content/Maps/BGM/" + NewSquad.At(U).ArrayCharacterActive[C].BattleThemeName + ".mp3"));
                                }
                            }
                        }
                    }

                    NewSquad.CurrentMovement    = ActiveSquadCurrentMovement;
                    NewSquad.IsFlying           = ActiveSquadIsFlying;
                    NewSquad.IsUnderTerrain     = ActiveSquadIsUnderTerrain;
                    NewSquad.IsPlayerControlled = ActiveSquadIsPlayerControlled;
                    NewSquad.SetPosition(new Vector3(ActiveSquadPositionX, ActiveSquadPositionY, ActiveSquadPositionZ));
                    NewPlayer.ListSquad.Add(NewSquad);
                }
            }

            GlobalQuickLoadContext.SetContext(DicLoadedSquad);

            for (int P = 0; P < ListPlayer.Count; P++)
            {
                for (int S = 0; S < ListPlayer[P].ListSquad.Count; S++)
                {
                    if (!ListPlayer[P].ListSquad[S].IsDead)
                    {
                        for (int U = 0; U < ListPlayer[P].ListSquad[S].UnitsInSquad; ++U)
                        {
                            for (int C = 0; C < ListPlayer[P].ListSquad[S].At(U).ArrayCharacterActive.Length; C++)
                            {
                                Character ActiveCharacter = ListPlayer[P].ListSquad[S].At(U).ArrayCharacterActive[C];
                                ActiveCharacter.Effects.QuickLoad(BR, ActiveParser, DicRequirement, DicEffect, DicAutomaticSkillTarget);
                            }
                        }
                    }
                }
            }

            for (int P = 0; P < ListPlayer.Count; ++P)
            {
                for (int S = 0; S < ListPlayer[P].ListSquad.Count; ++S)
                {
                    ListPlayer[P].ListSquad[S].ReloadSkills(DicUnitType, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget);
                }
            }

            int ListMapScriptCount = BR.ReadInt32();

            if (ListMapScript.Count != ListMapScriptCount)
            {
                throw new Exception("An error occured while loading the map.");
            }

            for (int S = 0; S < ListMapScript.Count; S++)
            {
                ListMapScript[S].Load(BR);
            }

            ListActionMenuChoice.Add(new ActionPanelPhaseChange(this));

            return(this);
        }
        public void InitPlayerBattle(bool IsActiveSquadOnRight)
        {
            int   FinalActivePlayerIndex = ActivePlayerIndex;
            int   FinalActiveSquadIndex  = ActiveSquadIndex;
            Squad FinalActiveSquad       = ActiveSquad;
            SupportSquadHolder FinalActiveSquadSupport = ActiveSquadSupport;

            int   FinalTargetPlayerIndex = TargetPlayerIndex;
            int   FinalTargetSquadIndex  = TargetSquadIndex;
            Squad FinalTargetSquad       = TargetSquad;
            SupportSquadHolder FinalTargetSquadSupport = TargetSquadSupport;

            if (TargetSquad.CurrentLeader.Boosts.AttackFirstModifier && !ActiveSquad.CurrentLeader.Boosts.AttackFirstModifier)
            {
                FinalActivePlayerIndex  = TargetPlayerIndex;
                FinalActiveSquadIndex   = TargetSquadIndex;
                FinalActiveSquad        = TargetSquad;
                FinalActiveSquadSupport = TargetSquadSupport;

                FinalTargetPlayerIndex  = ActivePlayerIndex;
                FinalTargetSquadIndex   = ActiveSquadIndex;
                FinalTargetSquad        = ActiveSquad;
                FinalTargetSquadSupport = ActiveSquadSupport;
            }

            bool ShowAnimation = Constants.ShowAnimation && FinalActiveSquad.CurrentLeader.CurrentAttack.GetAttackAnimations(Map.ActiveParser).Start.AnimationName != null;

            ListNextAnimationScreen.Clear();
            Map.NonDemoScreen.ListNonDemoBattleFrame.Clear();

            if (Map.IsOfflineOrServer)
            {
                AttackingResult = Map.CalculateFinalHP(FinalActiveSquad, FinalActiveSquadSupport.ActiveSquadSupport, FinalActivePlayerIndex,
                                                       Map.BattleMenuOffenseFormationChoice, FinalTargetSquad, FinalTargetSquadSupport.ActiveSquadSupport,
                                                       FinalTargetPlayerIndex, FinalTargetSquadIndex, true, true);

                DefendingResult = new SquadBattleResult(new BattleResult[1] {
                    new BattleResult()
                });
            }
            else
            {
                Map.CalculateFinalHP(FinalActiveSquad, FinalActiveSquadSupport.ActiveSquadSupport, FinalActivePlayerIndex,
                                     Map.BattleMenuOffenseFormationChoice, FinalTargetSquad, FinalTargetSquadSupport.ActiveSquadSupport,
                                     FinalTargetPlayerIndex, FinalTargetSquadIndex, true, true);
            }

            AnimationScreen.AnimationUnitStats UnitStats = new AnimationScreen.AnimationUnitStats(FinalActiveSquad, FinalTargetSquad, IsActiveSquadOnRight);
            AnimationBackground TargetSquadBackground    = null;
            AnimationBackground TargetSquadForeground    = null;

            if (ShowAnimation)
            {
                AnimationScreen.BattleAnimationTypes BattleAnimationType = AnimationScreen.BattleAnimationTypes.LeftAttackRight;

                if (IsActiveSquadOnRight)
                {
                    BattleAnimationType = AnimationScreen.BattleAnimationTypes.RightAttackLeft;
                }

                ListNextAnimationScreen.AddRange(Map.GenerateNextAnimationScreens(FinalActiveSquad, FinalActiveSquadSupport, FinalTargetSquad, FinalTargetSquadSupport, UnitStats, BattleAnimationType,
                                                                                  AttackingResult, out TargetSquadBackground, null, out TargetSquadForeground, null));
            }

            if (AttackingResult.ArrayResult[0].Target.ComputeRemainingHPAfterDamage(AttackingResult.ArrayResult[0].AttackDamage) > 0)
            {
                //Counter.
                if (FinalTargetSquad.CurrentLeader.BattleDefenseChoice == Unit.BattleDefenseChoices.Attack)
                {
                    if (Map.IsOfflineOrServer)
                    {
                        DefendingResult = Map.CalculateFinalHP(FinalTargetSquad, null, FinalTargetPlayerIndex,
                                                               Map.BattleMenuDefenseFormationChoice, FinalActiveSquad, null,
                                                               FinalActivePlayerIndex, FinalActiveSquadIndex, true, true);
                    }
                    else
                    {
                        Map.CalculateFinalHP(FinalTargetSquad, null, FinalTargetPlayerIndex,
                                             Map.BattleMenuDefenseFormationChoice, FinalActiveSquad, null,
                                             FinalActivePlayerIndex, FinalActiveSquadIndex, true, true);
                    }

                    if (ShowAnimation)
                    {
                        AnimationScreen.BattleAnimationTypes BattleAnimationType = AnimationScreen.BattleAnimationTypes.LeftConteredByRight;

                        if (IsActiveSquadOnRight)
                        {
                            BattleAnimationType = AnimationScreen.BattleAnimationTypes.RightConteredByLeft;
                        }

                        ListNextAnimationScreen.AddRange(Map.GenerateNextAnimationScreens(FinalActiveSquad, FinalActiveSquadSupport, FinalTargetSquad, FinalTargetSquadSupport, UnitStats,
                                                                                          BattleAnimationType, DefendingResult, out _, TargetSquadBackground, out _, TargetSquadForeground));
                    }
                }
            }

            if (Map.IsClient)
            {
                if (ShowAnimation)
                {
                    Map.PushScreen(ListNextAnimationScreen[0]);
                    ListNextAnimationScreen.RemoveAt(0);
                    ListNextAnimationScreen.Add(new EndBattleAnimationScreen(Map, FinalActiveSquad, FinalActiveSquadSupport, FinalActivePlayerIndex,
                                                                             FinalTargetSquad, FinalTargetSquadSupport, FinalTargetPlayerIndex, AttackingResult, DefendingResult));
                }
                else
                {
                    Map.NonDemoScreen.InitNonDemo(FinalActiveSquad, FinalActiveSquadSupport, FinalActivePlayerIndex, AttackingResult, Map.BattleMenuOffenseFormationChoice,
                                                  FinalTargetSquad, FinalTargetSquadSupport, FinalTargetPlayerIndex, DefendingResult, Map.BattleMenuDefenseFormationChoice, IsActiveSquadOnRight);

                    Map.NonDemoScreen.Alive = true;
                    Map.ListGameScreen.Insert(0, Map.NonDemoScreen);
                }
            }

            //AttackingSquad Activations.
            for (int U = 0; U < FinalActiveSquad.UnitsAliveInSquad; U++)
            {
                FinalActiveSquad[U].UpdateSkillsLifetime(SkillEffect.LifetimeTypeBattle);
            }
            //DefendingSquad Activations.
            for (int U = 0; U < FinalTargetSquad.UnitsAliveInSquad; U++)
            {
                FinalTargetSquad[U].UpdateSkillsLifetime(SkillEffect.LifetimeTypeBattle);
            }

            Map.FinalizeMovement(FinalActiveSquad, (int)Map.GetTerrain(FinalActiveSquad).MovementCost);
            FinalActiveSquad.EndTurn();

            if (Map.IsClient)
            {
                bool HasAfterAttack = false;
                ActionPanelDeathmatch AfterAttack = new ActionPanelMainMenu(Map, FinalActivePlayerIndex, FinalActiveSquadIndex);

                if (FinalActiveSquad.CurrentLeader.Boosts.PostAttackModifier.Attack)
                {
                    HasAfterAttack = true;
                    AfterAttack.AddChoiceToCurrentPanel(new ActionPanelAttackPart1(Map, FinalActivePlayerIndex, FinalActiveSquadIndex, FinalActiveSquad.CanMove));
                }

                if (FinalActiveSquad.CurrentLeader.Boosts.PostAttackModifier.Move)
                {
                    HasAfterAttack     = true;
                    Map.CursorPosition = FinalActiveSquad.Position;
                    AfterAttack.AddChoiceToCurrentPanel(new ActionPanelMovePart1(Map, FinalActivePlayerIndex, FinalActiveSquadIndex, FinalActiveSquad.Position, Map.CameraPosition, true));
                }

                if (HasAfterAttack)
                {
                    AfterAttack.AddChoiceToCurrentPanel(new ActionPanelWait(Map, FinalActiveSquad));
                    ListActionMenuChoice.Add(AfterAttack);
                }
            }
        }
Example #9
0
        private void LoadAnimationBackground(string AnimationBackgroundPath)
        {
            string Name = AnimationBackgroundPath.Substring(0, AnimationBackgroundPath.Length - 5).Substring(19);

            this.Text = Name + " - Project Eternity Animation Background Editor";

            AnimationBackgroundViewer.Preload();

            AnimationBackgroundViewer.ActiveAnimationBackground = (AnimationBackground2D)AnimationBackground.LoadAnimationBackground(Name,
                                                                                                                                     AnimationBackgroundViewer.content, AnimationBackgroundViewer.GraphicsDevice);

            foreach (AnimationBackground2DBase ActiveBackgroundSystem in AnimationBackgroundViewer.ActiveAnimationBackground.ListBackground)
            {
                TreeNode NewTreeNode = new TreeNode(ActiveBackgroundSystem.ToString());
                NewTreeNode.Tag = ActiveBackgroundSystem;
                lstItemChoices.Nodes.Add(NewTreeNode);
            }
        }