Exemple #1
0
 public ActionPanelMovementPhase(SorcererStreetMap Map, int ActivePlayerIndex, int Movement)
     : base(PanelName, Map, false)
 {
     this.ActivePlayerIndex = ActivePlayerIndex;
     ActivePlayer           = Map.ListPlayer[ActivePlayerIndex];
     this.Movement          = Movement;
 }
Exemple #2
0
 public ActionPanelDiscardCardPhase(SorcererStreetMap Map, int ActivePlayerIndex, int MaximumCardsAllowed)
     : base(PanelName, Map, false)
 {
     this.ActivePlayerIndex   = ActivePlayerIndex;
     this.MaximumCardsAllowed = MaximumCardsAllowed;
     ActivePlayer             = Map.ListPlayer[ActivePlayerIndex];
 }
Exemple #3
0
 public ActionPanelRefillDeckPhase(SorcererStreetMap Map, int ActivePlayerIndex)
     : base(PanelName, Map, false)
 {
     this.ActivePlayerIndex = ActivePlayerIndex;
     ActivePlayer           = Map.ListPlayer[ActivePlayerIndex];
     Random = new Random();
 }
 public ActionPanelConfirmCreatureSummon(SorcererStreetMap Map, int ActivePlayerIndex, CreatureCard ActiveCard)
     : base(PanelName, Map, false)
 {
     this.ActivePlayerIndex = ActivePlayerIndex;
     this.ActiveCard        = ActiveCard;
     ActivePlayer           = Map.ListPlayer[ActivePlayerIndex];
 }
 public ActionPanelBattleLandModifierPhase(ActionPanelHolder ListActionMenuChoice, SorcererStreetMap Map, SorcererStreetUnit PlayerUnit)
     : base(PanelName, ListActionMenuChoice, null, false)
 {
     this.Map           = Map;
     this.PlayerUnit    = PlayerUnit;
     this.ActiveTerrain = Map.GetTerrain(PlayerUnit);
 }
 public ActionPanelChooseDirection(SorcererStreetMap Map, int ActivePlayerIndex, Dictionary <Directions, TerrainSorcererStreet> DicNextTerrain)
     : base(PanelName, Map, false)
 {
     this.ActivePlayerIndex = ActivePlayerIndex;
     this.DicNextTerrain    = DicNextTerrain;
     ActivePlayer           = Map.ListPlayer[ActivePlayerIndex];
 }
Exemple #7
0
 public ActionPanelBattleAttackAnimationPhase(ActionPanelHolder ListActionMenuChoice, SorcererStreetMap Map, string AttackAnimationPath, bool LeftSideAttackRightSide)
     : base("Battle Attack Animation Phase", ListActionMenuChoice, false)
 {
     this.Map = Map;
     this.AttackAnimationPath     = AttackAnimationPath;
     this.LeftSideAttackRightSide = LeftSideAttackRightSide;
 }
Exemple #8
0
        protected virtual void CreateMap(SorcererStreetMap Map)
        {
            DicTile3D.Clear();
            if (Map.ListTileSet.Count == 0)
            {
                return;
            }

            for (int X = Map.MapSize.X - 1; X >= 0; --X)
            {
                for (int Y = Map.MapSize.Y - 1; Y >= 0; --Y)
                {
                    float     Z = Grid.ArrayTerrain[X, Y].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);

                    DrawableTile ActiveTerrain = GroundLayer.GetTile(X, Y);
                    Texture2D    ActiveTileset = Map.ListTileSet[ActiveTerrain.TilesetIndex];
                    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 = Grid.ArrayTerrain[X + 1, Y].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 = Grid.ArrayTerrain[X, Y + 1].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));
                        }
                    }
                }
            }
        }
        private string EndCardText;//Card on the far right used to close the pannel.

        public ActionPanelCardSelectionPhase(string Name, SorcererStreetMap Map)
            : base(Name, Map.ListActionMenuChoice, null, false)
        {
            this.Map = Map;

            ActivePlayer      = Map.ListPlayer[ActivePlayerIndex];
            MaxAnimationScale = 1.1f;
        }
Exemple #10
0
 public ScriptSpawnPlayer(SorcererStreetMap Map)
     : base(Map, 140, 70, "Sorcerer Street Spawn Player", new string[] { "Spawn player" }, new string[] { "Player spawned" })
 {
     _PlayerName    = "";
     _PlayerTeam    = 0;
     _SpawnPosition = new Point();
     _Deck          = new string[0];
 }
Exemple #11
0
        public ActionPanelRollDicePhase(SorcererStreetMap Map, Player ActivePlayer)
            : base("Roll Dice", Map, false)
        {
            this.ActivePlayer = ActivePlayer;

            Random       = new Random();
            DicePosition = new Vector2(Constants.Width / 2 - 20, Constants.Height / 2 - 25);
        }
        public ActionPanelBattleStartPhase(SorcererStreetMap Map, Player ActivePlayer, CreatureCard Invader)
        {
            this.Map          = Map;
            this.ActivePlayer = ActivePlayer;
            this.Invader      = Invader;

            ListActionMenuChoice = new ActionPanelHolder();
        }
        public ActionPanelRollDicePhase(SorcererStreetMap Map, int ActivePlayerIndex)
            : base(PanelName, Map, false)
        {
            this.ActivePlayerIndex = ActivePlayerIndex;
            ActivePlayer           = Map.ListPlayer[ActivePlayerIndex];

            Random       = new Random();
            DicePosition = new Vector2(Constants.Width / 2 - 20, Constants.Height / 2 - 25);
        }
        public ActionPanelBattleStartPhase(SorcererStreetMap Map, int ActivePlayerIndex, CreatureCard Invader)
        {
            this.Map = Map;
            this.ActivePlayerIndex = ActivePlayerIndex;
            ActivePlayer           = Map.ListPlayer[ActivePlayerIndex];
            this.Invader           = Invader;

            ListActionMenuChoice = new ActionPanelHolder();
        }
Exemple #15
0
        private string EndCardText;//Card on the far right used to close the pannel.

        public ActionPanelCardSelectionPhase(ActionPanelHolder ListActionMenuChoice, SorcererStreetMap Map, Player ActivePlayer, string CardType, string EndCardText = "")
            : base("Card Selection", ListActionMenuChoice, false)
        {
            this.Map          = Map;
            this.ActivePlayer = ActivePlayer;
            this.CardType     = CardType;
            this.EndCardText  = EndCardText;

            MaxAnimationScale = 1.1f;
        }
Exemple #16
0
        private static Tile3D CreateCursor(SorcererStreetMap Map, float X, float Y, float Z, int TextureWidth, int TextureHeight, float Radius)
        {
            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);

            return(CreateTile3D(Map, ArrayVertexPosition, 0, 0, X, Y, TextureWidth, TextureHeight, Radius));
        }
        public MapLayer(SorcererStreetMap Map, List <AnimationBackground> ListBackgrounds, List <AnimationBackground> ListForegrounds, BinaryReader BR)
        {
            this.Map = Map;

            ListSubLayer = new List <SubMapLayer>();

            StartupDelay   = BR.ReadInt32();
            ToggleDelayOn  = BR.ReadInt32();
            ToggleDelayOff = BR.ReadInt32();
            Depth          = BR.ReadSingle();

            if (StartupDelay == 0)
            {
                IsVisible   = true;
                ToggleTimer = ToggleDelayOn;
            }
            else
            {
                IsVisible   = false;
                ToggleTimer = StartupDelay;
            }

            ArrayTerrain = new TerrainSorcererStreet[Map.MapSize.X, Map.MapSize.Y];
            for (int Y = 0; Y < Map.MapSize.Y; Y++)
            {
                for (int X = 0; X < Map.MapSize.X; X++)
                {
                    int TerrainTypeIndex = BR.ReadInt32();

                    switch (Map.ListTerrainType[TerrainTypeIndex])
                    {
                    case TerrainSorcererStreet.FireElement:
                    case TerrainSorcererStreet.WaterElement:
                    case TerrainSorcererStreet.EarthElement:
                    case TerrainSorcererStreet.AirElement:
                        ArrayTerrain[X, Y] = new ElementalTerrain(X, Y, TerrainTypeIndex);
                        break;

                    case TerrainSorcererStreet.EastGate:
                    case TerrainSorcererStreet.WestGate:
                    case TerrainSorcererStreet.SouthGate:
                    case TerrainSorcererStreet.NorthGate:
                        ArrayTerrain[X, Y] = new GateTerrain(X, Y, TerrainTypeIndex);
                        break;

                    default:
                        ArrayTerrain[X, Y] = new TerrainSorcererStreet(X, Y, TerrainTypeIndex);
                        break;
                    }
                }
            }

            OriginalLayerGrid = new SorcererStreetMap2D(Map, BR);
            LayerGrid         = new Map3D(Map, this, OriginalLayerGrid, GameScreen.GraphicsDevice);
        }
        public ActionPanelCardSelectionPhase(string Name, ActionPanelHolder ListActionMenuChoice, SorcererStreetMap Map, int ActivePlayerIndex, string CardType, string EndCardText = "")
            : base(Name, ListActionMenuChoice, null, false)
        {
            this.Map = Map;
            this.ActivePlayerIndex = ActivePlayerIndex;
            this.CardType          = CardType;
            this.EndCardText       = EndCardText;

            ActivePlayer      = Map.ListPlayer[ActivePlayerIndex];
            MaxAnimationScale = 1.1f;
        }
Exemple #19
0
        private static Tile3D CreateTile3D(SorcererStreetMap Map, Vector3[] ArrayVertexPosition, float OffsetX, float OffsetY, float X, float Y, int TextureWidth, int TextureHeight, float Radius)
        {
            VertexPositionColorTexture[] ArrayVertex = new VertexPositionColorTexture[4];
            float UVXValue = OffsetX + 0.5f;
            float UVYValue = OffsetY + 0.5f;

            ArrayVertex[0]                   = new VertexPositionColorTexture();
            ArrayVertex[0].Position          = new Vector3(ArrayVertexPosition[0].X - Map.TileSize.X / 2f, ArrayVertexPosition[0].Y, ArrayVertexPosition[0].Z - Map.TileSize.Y / 2f);
            ArrayVertex[0].TextureCoordinate = new Vector2(UVXValue / TextureWidth, UVYValue / TextureHeight);
            ArrayVertex[0].Color             = Color.White;

            UVXValue                         = OffsetX + Map.TileSize.X - 0.5f;
            UVYValue                         = OffsetY + 0.5f;
            ArrayVertex[1]                   = new VertexPositionColorTexture();
            ArrayVertex[1].Position          = new Vector3(ArrayVertexPosition[1].X - Map.TileSize.X / 2f, ArrayVertexPosition[1].Y, ArrayVertexPosition[1].Z - Map.TileSize.Y / 2f);
            ArrayVertex[1].TextureCoordinate = new Vector2(UVXValue / TextureWidth, UVYValue / TextureHeight);
            ArrayVertex[1].Color             = Color.White;

            UVXValue                         = OffsetX + 0.5f;
            UVYValue                         = OffsetY + Map.TileSize.Y - 0.5f;
            ArrayVertex[2]                   = new VertexPositionColorTexture();
            ArrayVertex[2].Position          = new Vector3(ArrayVertexPosition[2].X - Map.TileSize.X / 2f, ArrayVertexPosition[2].Y, ArrayVertexPosition[2].Z - Map.TileSize.Y / 2f);
            ArrayVertex[2].TextureCoordinate = new Vector2(UVXValue / TextureWidth, UVYValue / TextureHeight);
            ArrayVertex[2].Color             = Color.White;

            UVXValue                         = OffsetX + Map.TileSize.X - 0.5f;
            UVYValue                         = OffsetY + Map.TileSize.Y - 0.5f;
            ArrayVertex[3]                   = new VertexPositionColorTexture();
            ArrayVertex[3].Position          = new Vector3(ArrayVertexPosition[3].X - Map.TileSize.X / 2f, ArrayVertexPosition[3].Y, ArrayVertexPosition[3].Z - Map.TileSize.Y / 2f);
            ArrayVertex[3].TextureCoordinate = new Vector2(UVXValue / TextureWidth, UVYValue / TextureHeight);
            ArrayVertex[3].Color             = Color.White;

            short[] ArrayIndex = new short[6];
            ArrayIndex[0] = 0;
            ArrayIndex[1] = 1;
            ArrayIndex[2] = 3;
            ArrayIndex[3] = 0;
            ArrayIndex[4] = 3;
            ArrayIndex[5] = 2;

            Vector3[] ArrayTransformedVertexPosition = new Vector3[ArrayVertexPosition.Length];

            Matrix TranslationToOriginMatrix = Matrix.CreateTranslation(-Radius, Radius, -Radius);

            Vector3.Transform(ArrayVertexPosition, ref TranslationToOriginMatrix, ArrayTransformedVertexPosition);
            for (int V = ArrayVertexPosition.Length - 1; V >= 0; --V)
            {
                ArrayVertex[V].Position = ArrayTransformedVertexPosition[V];
            }

            return(new Tile3D(ArrayVertex, ArrayIndex));
        }
 public override void OnSelect(SorcererStreetMap Map, Player ActivePlayer)
 {
     if (DefendingCreature == null)
     {
         Map.ListActionMenuChoice.AddToPanelListAndSelect(new ActionPanelCreatureCardSelectionPhase(Map, ActivePlayer));
     }
     else if (Owner.Team == ActivePlayer.Team)
     {
         Map.ListActionMenuChoice.AddToPanelListAndSelect(new ActionPanelTerrainLevelUpCommands(Map, ActivePlayer));
     }
     else
     {
         Map.ListActionMenuChoice.AddToPanelListAndSelect(new ActionPanelPayTollPhase(Map, ActivePlayer, this));
     }
 }
        public SorcererStreetMap2D(SorcererStreetMap Map, List <AnimationBackground> ListBackgrounds, List <AnimationBackground> ListForegrounds)
            : base(Map, ListBackgrounds, ListForegrounds)
        {
            ActiveMap = Map;

            DrawableTile[,] ArrayTile = new DrawableTile[MapSize.X, MapSize.Y];

            for (int X = MapSize.X - 1; X >= 0; --X)
            {
                for (int Y = MapSize.Y - 1; Y >= 0; --Y)
                {
                    ArrayTile[X, Y] = new DrawableTile(new Rectangle(0, 0, ActiveMap.TileSize.X, ActiveMap.TileSize.Y), 0);
                }
            }

            ReplaceGrid(ArrayTile);
        }
Exemple #22
0
        public SorcererStreetMap2D(SorcererStreetMap Map)
            : base(Map)
        {
            ActiveMap = Map;

            DrawableTile[,] ArrayTile = new DrawableTile[MapSize.X, MapSize.Y];

            for (int X = MapSize.X - 1; X >= 0; --X)
            {
                for (int Y = MapSize.Y - 1; Y >= 0; --Y)
                {
                    ArrayTile[X, Y] = new DrawableTile(new Rectangle(0, 0, ActiveMap.TileSize.X, ActiveMap.TileSize.Y), 0);
                }
            }

            ReplaceGrid(ArrayTile);
        }
        public MapLayer(SorcererStreetMap Map)
        {
            this.Map = Map;

            ListSubLayer = new List <SubMapLayer>();
            ToggleTimer  = StartupDelay;
            IsVisible    = StartupDelay > 0;

            //Tiles
            ArrayTerrain = new TerrainSorcererStreet[Map.MapSize.X, Map.MapSize.Y];
            for (int Y = 0; Y < Map.MapSize.Y; Y++)
            {
                for (int X = 0; X < Map.MapSize.X; X++)
                {
                    ArrayTerrain[X, Y] = new TerrainSorcererStreet(X, Y);
                }
            }

            OriginalLayerGrid = new SorcererStreetMap2D(Map);
            LayerGrid         = new Map3D(Map, this, OriginalLayerGrid, GameScreen.GraphicsDevice);
        }
Exemple #24
0
        public Map3D(SorcererStreetMap Map, MapLayer Grid, Map2D GroundLayer, GraphicsDevice g)
        {
            this.Map         = Map;
            this.Grid        = Grid;
            this.GroundLayer = GroundLayer;
            sprCursor        = Map.sprCursor;
            Camera           = new SorcererStreetCamera(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);

            int CursorWidth  = sprCursor == null ? 32 : sprCursor.Width;
            int CursorHeight = sprCursor == null ? 32 : sprCursor.Height;

            Cursor = CreateCursor(Map, Map.CursorPositionVisible.X, Map.CursorPositionVisible.Y, Grid.ArrayTerrain[(int)Map.CursorPositionVisible.X, (int)Map.CursorPositionVisible.Y].Position.Z,
                                  CursorWidth, CursorHeight, Radius);
        }
 public ActionPanelTerrainLevelUpCommands(SorcererStreetMap Map, Player ActivePlayer)
     : base("Terrain Commands", Map, false)
 {
     this.ActivePlayer = ActivePlayer;
 }
 public ActionPanelChooseTerritory(SorcererStreetMap Map, Player ActivePlayer)
     : base("Choose Territory", Map, false)
 {
     this.ActivePlayer = ActivePlayer;
 }
 public ActionPanelBattleLandModifierPhase(SorcererStreetMap Map)
     : base(PanelName, Map.ListActionMenuChoice, null, false)
 {
     this.Map = Map;
 }
Exemple #28
0
 public ActionPanelRefillDeckPhase(SorcererStreetMap Map)
     : base(PanelName, Map, false)
 {
 }
Exemple #29
0
 public ActionPanelBattleCreatureModifierPhase(ActionPanelHolder ListActionMenuChoice, SorcererStreetMap Map)
     : base("Battle Creature Modifier Phase", ListActionMenuChoice, false)
 {
     this.Map = Map;
 }
Exemple #30
0
 public ActionPanelDrawCardPhase(SorcererStreetMap Map, int ActivePlayerIndex)
     : base(PanelName, Map, false)
 {
     this.ActivePlayerIndex = ActivePlayerIndex;
     ActivePlayer           = Map.ListPlayer[ActivePlayerIndex];
 }