Beispiel #1
0
 public ActionPanelAttackPart2(DeathmatchMap Map, Squad ActiveSquad, int ActivePlayerIndex)
     : base("Attack2", Map)
 {
     this.ActiveSquad       = ActiveSquad;
     this.ActivePlayerIndex = ActivePlayerIndex;
     BattlePreview          = new BattlePreviewer(Map, ActiveSquad, ActiveSquad.CurrentLeader.CurrentAttack);
 }
Beispiel #2
0
        public Map3D(DeathmatchMap Map, GraphicsDevice g)
        {
            this.Map  = Map;
            Random    = new Random();
            sprCursor = Map.sprCursor;
            Camera    = new DeathmatchCamera(g);
            Radius    = (Map.MapSize.X * Map.TileSize.X) / 2;

            PolygonEffect = new BasicEffect(g);

            PolygonEffect.VertexColorEnabled = true;
            PolygonEffect.TextureEnabled     = true;

            float aspectRatio = g.Viewport.Width / (float)g.Viewport.Height;

            Matrix Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4,
                                                                    aspectRatio,
                                                                    1, 10000);

            PolygonEffect.Projection = Projection;

            PolygonEffect.World = Matrix.Identity;
            PolygonEffect.View  = Matrix.Identity;

            DicDrawablePointPerColor = new Dictionary <Color, List <Tile3D> >();
            DicTile3D = new Dictionary <Texture2D, List <Tile3D> >();

            CreateMap(Map);

            Cursor = CreateCursor(Map, Map.CursorPositionVisible.X, Map.CursorPositionVisible.Y, sprCursor.Width, sprCursor.Height, Radius);
        }
 public ActionPanelResupply(DeathmatchMap Map, ActionPanel Owner, Squad ActiveSquad)
     : base("Resupply", Map)
 {
     this.ActiveSquad = ActiveSquad;
     this.Owner       = Owner;
     ListMVChoice     = new List <Vector3>();
 }
Beispiel #4
0
 public ActionPanelInitAttackPER(DeathmatchMap Map, int ActivePlayerIndex, PERAttack ActivePERAttack)
     : base(PanelName, Map)
 {
     ActiveSquad            = ActivePERAttack.Owner;
     this.ActivePlayerIndex = ActivePlayerIndex;
     this.ActivePERAttack   = ActivePERAttack;
 }
Beispiel #5
0
            public ScriptChangeForeground(DeathmatchMap Map)
                : base(Map, 100, 50, "Change Foreground", new string[] { "Change" }, new string[] { "Change Completed" })
            {
                IsEnded = false;

                ListForegrounds = new List <AnimationBackground>();
            }
 public ActionPanelInitDelayedAttackMAP(DeathmatchMap Map, int ActivePlayerIndex, DelayedAttack ActiveDelayedAttack)
     : base("Init Attack MAP", Map)
 {
     ActiveSquad              = ActiveDelayedAttack.Owner;
     this.ActivePlayerIndex   = ActivePlayerIndex;
     this.ActiveDelayedAttack = ActiveDelayedAttack;
 }
        public AnimationScreen(string AnimationPath, DeathmatchMap Map, Squad AttackingSquad, Squad EnemySquad, Attack ActiveAttack,
                               BattleMap.SquadBattleResult BattleResult, AnimationUnitStats UnitStats, AnimationBackground ActiveAnimationBackground, AnimationBackground ActiveAnimationForeground, string ExtraText, bool IsLeftAttacking)
            : base(AnimationPath)
        {
            RequireFocus     = false;
            RequireDrawFocus = false;
            IsOnTop          = false;
            Random           = new Random();
            IsLoaded         = false;

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

            RightSquad = AttackingSquad;
            LeftSquad  = EnemySquad;

            if (IsLeftAttacking)
            {
                RightSquad = EnemySquad;
                LeftSquad  = AttackingSquad;
            }
        }
Beispiel #8
0
 public ScriptEditMap(DeathmatchMap Map)
     : base(Map, 150, 50, "Edit Map", new string[] { "Change" }, new string[] { "Map Changed" })
 {
     _TilesPerSeconds      = 6;
     _MinSimultaneousTiles = 2;
     TerrainAttribute      = new MapEditorSelector.ChangeTerrainAttribute(new Point(32, 32));
 }
Beispiel #9
0
        public DeathmatchMap LoadAutoplay()
        {
            Random        Random = new Random();
            MapAttributes ActiveMapAttributes = ListMap.Where(x => x.Name == "Autoplay").First();
            DeathmatchMap Autoplay            = new DeathmatchMap(ActiveMapAttributes.Name, "Classic", null);

            Autoplay.ListGameScreen = ListGameScreen;
            while (Autoplay.ListPlayer.Count < ActiveMapAttributes.MaxNumberOfPlayers)
            {
                Player NewPlayer = new Player("Player " + (Autoplay.ListPlayer.Count + 1), "AI", false, false, Autoplay.ListPlayer.Count, ActiveMapAttributes.ArrayColor[Autoplay.ListPlayer.Count]);
                NewPlayer.IsAlive = false;
                Autoplay.ListPlayer.Add(NewPlayer);
            }

            for (int P = ActiveMapAttributes.MaxNumberOfPlayers - 1; P >= 0; --P)
            {
                Autoplay.ListPlayer[P].ListSpawnPoint.Clear();
                for (int S = ActiveMapAttributes.ListSpawns.Count - 1; S >= 0; --S)
                {
                    if (Convert.ToInt32(ActiveMapAttributes.ListSpawns[S].Tag) == P + 1)
                    {
                        EventPoint NewSpawnPoint = ActiveMapAttributes.ListSpawns[S];
                        Autoplay.ListPlayer[P].ListSpawnPoint.Add(NewSpawnPoint);
                        NewSpawnPoint.LeaderPilot = ListPilot[Random.Next(ListPilot.Count)];

                        int NewUnitIndex = Random.Next(ArrayUnit.Length);
                        NewSpawnPoint.LeaderTypeName = ArrayUnit[NewUnitIndex].Item1;
                        NewSpawnPoint.LeaderName     = ArrayUnit[NewUnitIndex].Item2;
                    }
                }
            }

            return(Autoplay);
        }
Beispiel #10
0
 public ActionPanelEndTurn(DeathmatchMap Map)
     : base(PanelName, Map, false)
 {
     ConfirmMenuChoice      = 0;
     sprCursorConfirmEndNo  = MapMenu.sprCursorConfirmEndNo;
     sprCursorConfirmEndYes = MapMenu.sprCursorConfirmEndYes;
 }
Beispiel #11
0
 public NonDemoBattleUnitFrame(DeathmatchMap Map, NonDemoSharedUnitStats SharedUnitStats, float PositionX, float PositionY, bool IsRight)
 {
     this.Map             = Map;
     this.SharedUnitStats = SharedUnitStats;
     this.PositionX       = PositionX;
     this.PositionY       = PositionY;
     this.IsRight         = IsRight;
 }
 public ScriptMoveSquad(DeathmatchMap Map)
     : base(Map, 100, 50, "Move Squad", new string[] { "Move" }, new string[] { "Squad Moved" })
 {
     _UnitToMoveID      = 0;
     _TargetEndPosition = new Point();
     IsEnded            = false;
     IsActive           = false;
 }
Beispiel #13
0
 public ActionPanelResupply(DeathmatchMap Map, ActionPanel Owner, Squad ActiveSquad)
     : base(PanelName, Map)
 {
     this.ActiveSquad  = ActiveSquad;
     this.Owner        = Owner;
     ListMVChoice      = new List <Vector3>();
     ListTerrainChoice = new List <MovementAlgorithmTile>();
 }
Beispiel #14
0
        public ActionPanelMainMenu(DeathmatchMap Map, int ActivePlayerIndex, int ActiveSquadIndex)
            : base(PanelName, Map)
        {
            this.ActivePlayerIndex = ActivePlayerIndex;
            this.ActiveSquadIndex  = ActiveSquadIndex;

            ActiveSquad = Map.ListPlayer[ActivePlayerIndex].ListSquad[ActiveSquadIndex];
        }
 public ActionPanelAttackMAPDirection(DeathmatchMap Map, Squad ActiveSquad, int ActivePlayerIndex)
     : base("Attack MAP Direction", Map)
 {
     this.ActiveSquad       = ActiveSquad;
     this.ActivePlayerIndex = ActivePlayerIndex;
     CurrentAttack          = ActiveSquad.CurrentLeader.CurrentAttack;
     AttackChoice           = new List <Vector3>();
 }
Beispiel #16
0
 public ActionPanelUseMAPAttack(DeathmatchMap Map, Squad ActiveSquad, int ActivePlayerIndex, List <Vector3> AttackChoice)
     : base("UseMapAttack", Map)
 {
     this.ActiveSquad       = ActiveSquad;
     this.ActivePlayerIndex = ActivePlayerIndex;
     this.AttackChoice      = AttackChoice;
     BattlePreview          = new BattlePreviewer(Map, ActiveSquad, ActiveSquad.CurrentLeader.CurrentAttack);
 }
Beispiel #17
0
 public ScriptAddPlayer(DeathmatchMap Map)
     : base(Map, 100, 50, "Add Player", new string[] { "Add" }, new string[] { "Player created" })
 {
     _PlayerName  = string.Empty;
     _PlayerTeam  = 0;
     _IsHuman     = false;
     _PlayerColor = Color.Red;
 }
Beispiel #18
0
        public ActionPanelHubStep(DeathmatchMap Map, int ActivePlayerIndex, int ActiveSquadIndex)
            : base(PanelName, Map, false)
        {
            this.ActivePlayerIndex = ActivePlayerIndex;
            this.ActiveSquadIndex  = ActiveSquadIndex;

            this.HubSquad = Map.ListPlayer[ActivePlayerIndex].ListSquad[ActiveSquadIndex];
        }
 public ScriptSpawnSquadFast(DeathmatchMap Map)
     : base(Map, 140, 70, "Spawn Squad Fast", new string[] { "Spawn" }, new string[] { "Timer Ended", "Animation Ended", "SFX Ended" })
 {
     UnitSpawner = new ScriptSpawnSquadHelper(Map, this);
     Leader      = new ScriptUnit(Map);
     WingmanA    = new ScriptUnit(Map);
     WingmanB    = new ScriptUnit(Map);
 }
        public ActionPanelConsumableParts(DeathmatchMap Map, ActionPanel Owner, Squad ActiveSquad)
            : base("Parts", Map)
        {
            this.Owner       = Owner;
            this.ActiveSquad = ActiveSquad;

            IsInit = false;
        }
        public ActionPanelEndTurn(DeathmatchMap Map, Texture2D sprCursorConfirmEndNo, Texture2D sprCursorConfirmEndYes)
            : base("End Turn", Map, false)
        {
            this.sprCursorConfirmEndNo  = sprCursorConfirmEndNo;
            this.sprCursorConfirmEndYes = sprCursorConfirmEndYes;

            ConfirmMenuChoice = 0;
        }
Beispiel #22
0
 public ScriptSpawnUnitEvent(DeathmatchMap Map)
     : base(Map, 140, 70, "Spawn Event Unit", new string[] { "Spawn" }, new string[] { "Timer Ended", "Animation Ended", "SFX Ended" })
 {
     _EventID    = string.Empty;
     UnitSpawner = new ScriptSpawnSquadHelper(Map, this);
     UnitSpawner.WingmanAToSpawnID = 0;
     UnitSpawner.WingmanAToSpawnID = 0;
 }
            public ScriptStartAnimationRelative(DeathmatchMap Map)
                : base(Map, 100, 50, "Start Animation Relative", new string[] { "Play" }, new string[] { "Animation Ended" })
            {
                _AnimationPath  = "";
                _AnimationSpeed = 0.5f;

                _RelativeSpawnUnitID = 0;
            }
 public ScriptSpawnTransformingUnitEventFast(DeathmatchMap Map)
     : base(Map, 180, 70, "Spawn Transforming Unit Event Fast", new string[] { "Spawn" }, new string[] { "Timer Ended", "Animation Ended", "SFX Ended" })
 {
     _EventID    = string.Empty;
     UnitSpawner = new ScriptSpawnSquadHelper(Map, this);
     UnitSpawner.WingmanAToSpawnID = 0;
     UnitSpawner.WingmanAToSpawnID = 0;
     _TransformationIndex          = 0;
 }
Beispiel #25
0
 public SpiritMenu(DeathmatchMap Map)
 {
     this.Map         = Map;
     RequireDrawFocus = true;
     if (Map != null)
     {
         ListGameScreen = Map.ListGameScreen;
     }
 }
 public ScriptMoveSquadRelative(DeathmatchMap Map)
     : base(Map, 100, 50, "Move Squad Relative", new string[] { "Move" }, new string[] { "Unit Moved" })
 {
     _UnitToMoveID     = 0;
     _RelativeMovement = new Point();
     _MovementSpeed    = 0.1f;
     IsEnded           = false;
     IsActive          = false;
 }
Beispiel #27
0
        protected virtual void CreateMap(DeathmatchMap Map)
        {
            DicTile3D.Clear();

            for (int X = Map.MapSize.X - 1; X >= 0; --X)
            {
                for (int Y = Map.MapSize.Y - 1; Y >= 0; --Y)
                {
                    Map.GetTerrain(X, Y, Map.ActiveLayerIndex).Position.Z = Random.Next(2) * 32;
                    float     Z = Map.GetTerrain(X, Y, Map.ActiveLayerIndex).Position.Z;
                    Vector3[] ArrayVertexPosition = new Vector3[4];
                    ArrayVertexPosition[0] = new Vector3(X * Map.TileSize.X, Z, Y * Map.TileSize.Y);
                    ArrayVertexPosition[1] = new Vector3(X * Map.TileSize.X + Map.TileSize.X, Z, Y * Map.TileSize.Y);
                    ArrayVertexPosition[2] = new Vector3(X * Map.TileSize.X, Z, Y * Map.TileSize.Y + Map.TileSize.Y);
                    ArrayVertexPosition[3] = new Vector3(X * Map.TileSize.X + Map.TileSize.X, Z, Y * Map.TileSize.Y + Map.TileSize.Y);

                    Map2D        GroundLayer   = Map.ListLayer[0].OriginalLayerGrid;
                    DrawableTile ActiveTerrain = GroundLayer.GetTile(X, Y);
                    Texture2D    ActiveTileset = Map.ListTileSet[ActiveTerrain.Tileset];
                    if (!DicTile3D.ContainsKey(ActiveTileset))
                    {
                        DicTile3D.Add(ActiveTileset, new List <Tile3D>());
                    }
                    DicTile3D[ActiveTileset].Add(CreateTile3D(Map, ArrayVertexPosition, ActiveTerrain.Origin.X, ActiveTerrain.Origin.Y, X, Y, ActiveTileset.Width, ActiveTileset.Height, Radius));

                    //Create slope right
                    if (X + 1 < Map.MapSize.X)
                    {
                        float ZRight = Map.GetTerrain(X + 1, Y, Map.ActiveLayerIndex).Position.Z;
                        if (Z != ZRight)
                        {
                            Vector3[] ArrayVertexPositionRight = new Vector3[4];
                            ArrayVertexPositionRight[0] = new Vector3(X * Map.TileSize.X + Map.TileSize.X, Z, Y * Map.TileSize.Y);
                            ArrayVertexPositionRight[2] = new Vector3(X * Map.TileSize.X + Map.TileSize.X, Z, Y * Map.TileSize.Y + Map.TileSize.Y);
                            ArrayVertexPositionRight[1] = new Vector3((X + 1) * Map.TileSize.X, ZRight, Y * Map.TileSize.Y);
                            ArrayVertexPositionRight[3] = new Vector3((X + 1) * Map.TileSize.X, ZRight, Y * Map.TileSize.Y + Map.TileSize.Y);
                            DicTile3D[ActiveTileset].Add(CreateTile3D(Map, ArrayVertexPositionRight, ActiveTerrain.Origin.X, ActiveTerrain.Origin.Y, X, Y, ActiveTileset.Width, ActiveTileset.Height, Radius));
                        }
                    }

                    //Create slope down
                    if (Y + 1 < Map.MapSize.Y)
                    {
                        float ZDown = Map.GetTerrain(X, Y + 1, Map.ActiveLayerIndex).Position.Z;
                        if (Z != ZDown)
                        {
                            Vector3[] ArrayVertexPositionDown = new Vector3[4];
                            ArrayVertexPositionDown[0] = new Vector3(X * Map.TileSize.X, Z, Y * Map.TileSize.Y + Map.TileSize.Y);
                            ArrayVertexPositionDown[1] = new Vector3(X * Map.TileSize.X + Map.TileSize.X, Z, Y * Map.TileSize.Y + Map.TileSize.Y);
                            ArrayVertexPositionDown[2] = new Vector3(X * Map.TileSize.X, ZDown, (Y + 1) * Map.TileSize.Y);
                            ArrayVertexPositionDown[3] = new Vector3(X * Map.TileSize.X + Map.TileSize.X, ZDown, (Y + 1) * Map.TileSize.Y);
                            DicTile3D[ActiveTileset].Add(CreateTile3D(Map, ArrayVertexPositionDown, ActiveTerrain.Origin.X, ActiveTerrain.Origin.Y, X, Y, ActiveTileset.Width, ActiveTileset.Height, Radius));
                        }
                    }
                }
            }
        }
            public ScriptStartBattleSequence(DeathmatchMap Map)
                : base(Map, 100, 50, "Start Battle Sequence", new string[] { "Start" }, new string[] { "Sequence Ended" })
            {
                _RightUnitWeaponName    = "";
                DefendingUnitWeaponName = "";

                IsInit  = false;
                IsEnded = false;
            }
Beispiel #29
0
 public ActionPanelAttackMAPSpread(DeathmatchMap Map, int ActivePlayerIndex, int ActiveSquadIndex)
     : base(PanelName, Map)
 {
     this.ActivePlayerIndex = ActivePlayerIndex;
     this.ActiveSquadIndex  = ActiveSquadIndex;
     ActiveSquad            = Map.ListPlayer[ActivePlayerIndex].ListSquad[ActiveSquadIndex];
     CurrentAttack          = ActiveSquad.CurrentLeader.CurrentAttack;
     BattlePreview          = new BattlePreviewer(Map, ActivePlayerIndex, ActiveSquadIndex, ActiveSquad.CurrentLeader.CurrentAttack);
 }
 public ActionPanelMovePart1(DeathmatchMap Map, Vector3 LastPosition, Vector3 LastCameraPosition, Squad ActiveSquad, int ActivePlayerIndex, bool IsPostAttack = false)
     : base("Move", Map, !IsPostAttack)
 {
     this.LastPosition       = LastPosition;
     this.LastCameraPosition = LastCameraPosition;
     this.ActiveSquad        = ActiveSquad;
     this.ActivePlayerIndex  = ActivePlayerIndex;
     this.IsPostAttack       = IsPostAttack;
 }