예제 #1
0
 public ScriptStartAnimation(BattleMap Map)
     : base(100, 50, "Start Animation", new string[] { "Play" }, new string[] { "Animation Ended" })
 {
     _AnimationPath  = "";
     _AnimationSpeed = 15f;
     this.Map        = Map;
 }
예제 #2
0
        public ExplosionCutscene(OnCutsceneEndedDelegate OnCutsceneEnded, BattleMap Map, Squad SquadToDestroy)
            : base(OnCutsceneEnded, new System.Collections.Generic.Dictionary <string, CutsceneScript>())
        {
            RequireFocus     = false;
            RequireDrawFocus = false;
            CutscenePath     = "";

            ScriptCutsceneBehavior CutsceneBehavior = new ScriptCutsceneBehavior();
            ScriptStartAnimation   StartAnimation   = new ScriptStartAnimation(Map);

            ScriptingScriptHolder.ScriptPlaySFX PlaySFX = new ScriptingScriptHolder.ScriptPlaySFX();

            PlaySFX.ExecuteEvent             = ExecuteEvent;
            PlaySFX.SFXPath                  = "Explosion";
            StartAnimation.ExecuteEvent      = ExecuteEvent;
            StartAnimation.AnimationPosition = new Vector2(SquadToDestroy.Position.X - Map.CameraPosition.X, SquadToDestroy.Position.Y - Map.CameraPosition.Y);
            StartAnimation.AnimationPath     = "Explosion_strip12";
            StartAnimation.AnimationSpeed    = 15f;

            CutsceneBehavior.ArrayEvents[0].Add(new EventInfo(0, 0));
            CutsceneBehavior.ArrayEvents[0].Add(new EventInfo(1, 0));
            CutsceneBehavior.ExecuteEvent = ExecuteEvent;

            ListCutsceneBehavior.Add(CutsceneBehavior);
            AddActionScript(StartAnimation);
            AddActionScript(PlaySFX);
        }
예제 #3
0
        public static void LoadMap(List <GameScreen> ListGameScreen, Roster PlayerRoster)
        {
            int OldNumberOfGameScreen = ListGameScreen.Count;

            ListSpawnSquad = new List <Squad>();
            Dictionary <string, List <Squad> > DicSpawnSquadByPlayer = new Dictionary <string, List <Squad> >();

            DicSpawnSquadByPlayer.Add("Player", ListSpawnSquad);
            NewMap = BattleMap.DicBattmeMapType[BattleMap.NextMapType].GetNewMap(string.Empty);
            NewMap.BattleMapPath         = BattleMap.NextMapPath;
            NewMap.DicSpawnSquadByPlayer = DicSpawnSquadByPlayer;
            NewMap.ListGameScreen        = ListGameScreen;
            NewMap.PlayerRoster          = PlayerRoster;
            NewMap.Load();
            NewMap.Init();
            NewMap.TogglePreview(true);

            //Remove any GameScreen created by the map so they don't show up immediately.
            ListGameScreenCreatedByMap = new List <GameScreen>(ListGameScreen.Count - OldNumberOfGameScreen);
            for (int S = ListGameScreen.Count - 1 - OldNumberOfGameScreen; S >= 0; --S)
            {
                ListGameScreenCreatedByMap.Add(ListGameScreen[S]);
                ListGameScreen.RemoveAt(S);
            }
        }
 public ScriptUnitEventFlag(BattleMap Map)
     : base(Map, 140, 70, "Unit Event Flag", new string[] { "Set flag" }, new string[] { "Flag set" })
 {
     _CharacterName = "";
     _UnitName      = "";
     _EventID       = "";
 }
예제 #5
0
 public StartMusicTrigger(BattleMap Map)
     : base(null, 140, 70, "Music Event", new string[] { "Check Condition" }, new string[] { })
 {
     _MusicPath = "";
     _Loop      = false;
     _PreLoad   = true;
 }
예제 #6
0
 public ScriptAddCharacter(BattleMap Map)
     : base(Map, 140, 70, "Add Character", new string[] { "Add character" }, new string[] { "Character added" })
 {
     _CharacterName = new string[1];
     _IsPresent = true;
     _IsEvent = false;
 }
예제 #7
0
 public AsignVariableTrigger(BattleMap Map)
     : base(Map, 140, 70, "Asign Variable Event", new string[] { "Asign Variable" }, new string[] { "Variable asigned" })
 {
     _VariableName = "";
     _Value        = 0;
     _SignOperator = Operators.SignOperators.Equal;
 }
예제 #8
0
        public LoadingScreen(BattleMap ScreenToLoad, BattleMapOnlineClient Client)
        {
            this.ScreenToLoad = ScreenToLoad;
            this.Client       = Client;

            HasAskedForInfo = false;
        }
        public override void Load()
        {
            sprRectangle    = Content.Load <Texture2D>("Pixel");
            sprBackground   = Content.Load <Texture2D>("Intermission Screens/Unit Selection");
            sprCursor       = Content.Load <Texture2D>("Intermission Screens/Unit Selection Cursor");
            sprConfirmation = Content.Load <Texture2D>("Intermission Screens/Unit Selection Confirmation");
            sprWarning      = Content.Load <Texture2D>("Intermission Screens/Unit Selection Warning");
            fntArial8       = Content.Load <SpriteFont>("Fonts/Arial8");
            fntArial12      = Content.Load <SpriteFont>("Fonts/Arial12");
            fntArial14      = Content.Load <SpriteFont>("Fonts/Arial");

            ListPresentSquad = PlayerRoster.TeamSquads.GetPresent();

            PageMax = (int)Math.Ceiling(ListPresentSquad.Count / (float)ItemPerPage);
            if (NewMap == null)
            {
                ListSpawnSquad        = new List <Squad>();
                NewMap                = BattleMap.DicBattmeMapType[BattleMap.NextMapType].GetNewMap(BattleMap.NextMapPath, 0, ListSpawnSquad);
                NewMap.ListGameScreen = ListGameScreen;
                NewMap.Load();
            }

            ListSingleplayerSpawns = new List <EventPoint>();
            foreach (EventPoint ActiveSpawn in NewMap.ListSingleplayerSpawns)
            {
                if (ActiveSpawn.Tag == "P")
                {
                    ListSingleplayerSpawns.Add(ActiveSpawn);
                }
            }
        }
예제 #10
0
        protected void LoadSpawns(BinaryReader BR)
        {
            ArrayMultiplayerColor = new Color[16];

            //Deathmatch colors
            for (int D = 0; D < ArrayMultiplayerColor.Length; D++)
            {
                ArrayMultiplayerColor[D].R = BR.ReadByte();
                ArrayMultiplayerColor[D].G = BR.ReadByte();
                ArrayMultiplayerColor[D].B = BR.ReadByte();
            }

            int ListSingleplayerSpawnsCount = BR.ReadInt32();

            ListSingleplayerSpawns = new List <EventPoint>(ListSingleplayerSpawnsCount);

            for (int S = 0; S < ListSingleplayerSpawnsCount; S++)
            {
                EventPoint NewPoint = new EventPoint(BR);
                NewPoint.ColorRed   = Color.Blue.R;
                NewPoint.ColorGreen = Color.Blue.G;
                NewPoint.ColorBlue  = Color.Blue.B;

                ListSingleplayerSpawns.Add(NewPoint);
            }

            int ListMultiplayerSpawnsCount = BR.ReadInt32();

            ListMultiplayerSpawns = new List <EventPoint>(ListMultiplayerSpawnsCount);

            for (int S = 0; S < ListMultiplayerSpawnsCount; S++)
            {
                EventPoint NewPoint   = new EventPoint(BR);
                int        ColorIndex = Convert.ToInt32(NewPoint.Tag) - 1;
                NewPoint.ColorRed   = ArrayMultiplayerColor[ColorIndex].R;
                NewPoint.ColorGreen = ArrayMultiplayerColor[ColorIndex].G;
                NewPoint.ColorBlue  = ArrayMultiplayerColor[ColorIndex].B;
                ListMultiplayerSpawns.Add(NewPoint);
            }

            ListSubMap.Add(this);
            int ListMapSwitchPointCount = BR.ReadInt32();

            ListMapSwitchPoint = new List <MapSwitchPoint>(ListMapSwitchPointCount);

            for (int S = 0; S < ListMapSwitchPointCount; S++)
            {
                MapSwitchPoint NewMapSwitchPoint = new MapSwitchPoint(BR);
                ListMapSwitchPoint.Add(NewMapSwitchPoint);
                if (DicBattmeMapType.Count > 0 && !string.IsNullOrEmpty(NewMapSwitchPoint.SwitchMapPath) &&
                    ListSubMap.Find(x => x.BattleMapPath == NewMapSwitchPoint.SwitchMapPath) == null)
                {
                    BattleMap NewMap = DicBattmeMapType[NewMapSwitchPoint.SwitchMapType].GetNewMap(NewMapSwitchPoint.SwitchMapPath, 0, new List <Squad>());
                    NewMap.ListGameScreen = ListGameScreen;
                    NewMap.ListSubMap     = ListSubMap;
                    NewMap.Load();
                }
            }
        }
 public ScriptDefineGlobalPilotUnit(BattleMap Map)
     : base(100, 50, ScriptName)
 {
     this.Map           = Map;
     _SpawnUnitName     = "";
     _SpawnCharacter    = new string[0];
     DeleteAfterMission = true;
 }
예제 #12
0
            public ScriptFadeToBlack(BattleMap Map)
                : base(Map, 100, 50, "Fade To Black", new string[] { "Start" }, new string[] { "Fade Ended" })
            {
                _EndingValue = 1;
                _TimerType   = TimerTypes.Seconds;

                IsEnded = false;
            }
 public HealthCrateSpawner(BattleMap Map)
     : base("HP Crate", PropCategories.Interactive, new bool[, ] {
     { true }
 }, false)
 {
     this.Map = Map;
     IsUsed   = false;
 }
예제 #14
0
 public StatusMenuScreen(BattleMap Map)
 {
     this.Map = Map;
     if (Map != null)
     {
         ListGameScreen = Map.ListGameScreen;
     }
 }
예제 #15
0
 public ScriptFlashCursor(BattleMap Map)
     : base(Map, 100, 50, "Flash Cursor", new string[] { "Flash cursor" }, new string[] { "Flash ended" })
 {
     _EndingValue   = 2;
     _TimeVisible   = 0.5f;
     _TimeInvisible = 0.5f;
     IsEnded        = false;
 }
 public override void Update(GameTime gameTime)
 {
     if (Stage == -1)
     {
         if (InputHelper.InputUpPressed())
         {
             if (CursorIndex > 0)
             {
                 CursorIndex--;
             }
         }
         else if (InputHelper.InputDownPressed())
         {
             if (CursorIndex < 8 && CursorIndex + 1 + (PageCurrent - 1) * 8 < ListPresentSquad.Count)
             {
                 CursorIndex++;
             }
         }
         else if (InputHelper.InputLeftPressed())
         {
             if (PageCurrent > 1)
             {
                 PageCurrent--;
             }
         }
         else if (InputHelper.InputRightPressed())
         {
             if (PageCurrent * 8 < ListPresentSquad.Count)
             {
                 PageCurrent++;
             }
         }
         else if (InputHelper.InputConfirmPressed())
         {
             if (ListSpawnSquad.Count == ListSingleplayerSpawns.Count)
             {
                 RemoveAllScreens();
                 ListGameScreen.Insert(0, NewMap);
                 NewMap = null;
             }
             else
             {
                 ListSpawnSquad.Add(ListPresentSquad[CursorIndex + (PageCurrent - 1) * 8]);
             }
         }
         else if (InputHelper.InputCancelPressed())
         {
             RemoveScreen(this);
         }
     }
     else
     {
         if (InputHelper.InputCancelPressed() || InputHelper.InputConfirmPressed())
         {
             Stage--;
         }
     }
 }
예제 #17
0
 public ScriptRoadSelection(BattleMap Map)
     : base(Map, 140, 80, "Road Selection", new string[] { "Open Selection" }, new string[] { "Road A", "Road B", "Road C", "Road D" })
 {
     _RouteName = "";
     _RoadA     = new RouteMenu.RouteParams("", "", "");
     _RoadB     = new RouteMenu.RouteParams("", "", "");
     _RoadC     = new RouteMenu.RouteParams("", "", "");
     _RoadD     = new RouteMenu.RouteParams("", "", "");
 }
            public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
            {
                BattleMap NewMap = BattleMap.DicBattmeMapType[BattleMap.NextMapType].GetNewMap(BattleMap.NextMapPath, 0, new List <Squad>());

                NewMap.ListGameScreen = Owner.ListGameScreen;
                Owner.RemoveAllScreens();
                Owner.PushScreen(NewMap);
                IsEnded = true;
            }
예제 #19
0
            public ScriptShakeScreen(BattleMap Map)
                : base(Map, 100, 50, "Shake Screen", new string[] { "Start" }, new string[] { "Shake Ended" })
            {
                _EndingValue = 5;
                _TimerType   = TimerTypes.Seconds;

                _ShakingRadius = 3;

                IsEnded = false;
            }
예제 #20
0
        public Map2D(BattleMap Map, List <AnimationBackground> ListBackgrounds, List <AnimationBackground> ListForegrounds)
        {
            this.Map   = Map;
            MapOverlay = new DayNightCycleColorOnly();
            DicDrawablePointPerColor = new Dictionary <Color, List <Vector3> >();
            Depth = 1f;

            ListTileSet          = Map.ListTileSet;
            this.ListBackgrounds = ListBackgrounds;
            this.ListForegrounds = ListForegrounds;
        }
예제 #21
0
            public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
            {
                BattleMap NewMap = BattleMap.DicBattmeMapType[BattleMap.NextMapType].GetNewMap(string.Empty);

                NewMap.BattleMapPath  = BattleMap.NextMapPath;
                NewMap.ListGameScreen = Owner.ListGameScreen;
                Owner.RemoveAllScreens();
                Owner.PushScreen(NewMap);
                NewMap.TogglePreview(true);
                IsEnded = true;
            }
예제 #22
0
        public WeaponSpawner(BattleMap Map)
            : base("Weapon Spawner", PropCategories.Interactive, new bool[, ] {
            { true }
        }, false)
        {
            this.Map = Map;

            _WeaponName  = string.Empty;
            _RespawnTime = 1;
            _Ammo        = 1;

            IsUsed = false;
        }
예제 #23
0
        public static void StartMap(GameScreen Owner, GameTime gameTime)
        {
            Owner.RemoveAllScreens();

            Owner.ListGameScreen.Insert(0, NewMap);
            NewMap.Update(gameTime);

            for (int S = 0; S < ListGameScreenCreatedByMap.Count; ++S)
            {
                Owner.ListGameScreen.Insert(0, ListGameScreenCreatedByMap[S]);
                ListGameScreenCreatedByMap[S].Update(gameTime);
            }

            ListGameScreenCreatedByMap.Clear();
            NewMap = null;
        }
예제 #24
0
        public static BattleMap LoadTemporaryMap()
        {
            FileStream   FS = new FileStream("TempSave.sav", FileMode.Open, FileAccess.Read);
            BinaryReader BR = new BinaryReader(FS, Encoding.UTF8);

            string    BattleMapPath = BR.ReadString();
            string    MapAssembly   = BR.ReadString();
            Type      MapType       = Type.GetType(MapAssembly);
            BattleMap NewMap        = (BattleMap)Activator.CreateInstance(MapType, BattleMapPath);

            NewMap.Load();
            NewMap.LoadTemporaryMap(BR);

            FS.Close();
            BR.Close();

            return(NewMap);
        }
예제 #25
0
            public ScriptAddSquad(BattleMap Map)
                : base(Map, 140, 70, "Add Squad", new string[] { "Add squad" }, new string[] { "Squad added" })
            {
                _SquadName    = "";
                _LeaderName   = "";
                _WingmanAName = "";
                _WingmanBName = "";

                _LeaderCharacterName   = new string[0];
                _WingmanACharacterName = new string[0];
                _WingmanBCharacterName = new string[0];

                _IsEventSquad     = false;
                _IsNameLocked     = false;
                _IsLeaderLocked   = false;
                _IsWingmanALocked = false;
                _IsWingmanBLocked = false;
            }
예제 #26
0
        public TileAttributesEditor3D(DrawableTile TileInfo, BattleMap Owner)
        {
            InitializeComponent();

            this.TileInfo = TileInfo;
            this.Owner    = Owner;

            cbo3DStyle.SelectedIndex = (int)TileInfo.Terrain3DInfo.TerrainStyle;

            for (int T = 0; T < Owner.ListTilesetPreset.Count; T++)
            {
                cboTilesFront.Items.Add(Owner.ListTilesetPreset[T].TilesetName);
                cboTilesBack.Items.Add(Owner.ListTilesetPreset[T].TilesetName);
                cboTilesLeft.Items.Add(Owner.ListTilesetPreset[T].TilesetName);
                cboTilesRight.Items.Add(Owner.ListTilesetPreset[T].TilesetName);
            }

            if (Owner.ListTilesetPreset.Count > 0)
            {
                cboTilesFront.SelectedIndex = TileInfo.Terrain3DInfo.FrontFace.TilesetIndex;
                cboTilesBack.SelectedIndex  = TileInfo.Terrain3DInfo.BackFace.TilesetIndex;
                cboTilesLeft.SelectedIndex  = TileInfo.Terrain3DInfo.LeftFace.TilesetIndex;
                cboTilesRight.SelectedIndex = TileInfo.Terrain3DInfo.RightFace.TilesetIndex;
                TilesetViewerFront.InitTileset(Owner.ListTileSet[cboTilesFront.SelectedIndex], Owner.TileSize);
                TilesetViewerBack.InitTileset(Owner.ListTileSet[cboTilesBack.SelectedIndex], Owner.TileSize);
                TilesetViewerLeft.InitTileset(Owner.ListTileSet[cboTilesLeft.SelectedIndex], Owner.TileSize);
                TilesetViewerRight.InitTileset(Owner.ListTileSet[cboTilesRight.SelectedIndex], Owner.TileSize);

                TilesetViewerBack.ActiveTile  = TileInfo.Terrain3DInfo.FrontFace.Origin.Location;
                TilesetViewerFront.ActiveTile = TileInfo.Terrain3DInfo.BackFace.Origin.Location;
                TilesetViewerLeft.ActiveTile  = TileInfo.Terrain3DInfo.LeftFace.Origin.Location;
                TilesetViewerRight.ActiveTile = TileInfo.Terrain3DInfo.RightFace.Origin.Location;
            }
            else
            {
                TilesetViewerFront.InitTileset(string.Empty, Owner.TileSize);
                TilesetViewerBack.InitTileset(string.Empty, Owner.TileSize);
                TilesetViewerLeft.InitTileset(string.Empty, Owner.TileSize);
                TilesetViewerRight.InitTileset(string.Empty, Owner.TileSize);
            }

            TileViewer3D.ListTileSet = Owner.ListTileSet;
            UpdatePreview();
        }
예제 #27
0
        public CenterOnSquadCutscene(OnCutsceneEndedDelegate OnCutsceneEnded, BattleMap Map, Vector3 Position)
            : base(OnCutsceneEnded, new System.Collections.Generic.Dictionary <string, CutsceneScript>())
        {
            RequireFocus     = true;
            RequireDrawFocus = true;
            CutscenePath     = "";

            ScriptCutsceneBehavior CutsceneBehavior = new ScriptCutsceneBehavior();
            ScriptCenterCamera     CenterCamera     = new ScriptCenterCamera(Map);

            CenterCamera.ExecuteEvent   = ExecuteEvent;
            CenterCamera.CursorPosition = Position;

            CutsceneBehavior.ArrayEvents[0].Add(new EventInfo(0, 0));
            CutsceneBehavior.ExecuteEvent = ExecuteEvent;

            ListCutsceneBehavior.Add(CutsceneBehavior);
            AddActionScript(CenterCamera);
        }
예제 #28
0
        public static BattleMap LoadTemporaryMap(List <GameScreen> ListGameScreen)
        {
            FileStream   FS = new FileStream("User Data/Saves/TempSave.sav", FileMode.Open, FileAccess.Read);
            BinaryReader BR = new BinaryReader(FS, Encoding.UTF8);

            string    BattleMapPath = BR.ReadString();
            string    MapAssembly   = BR.ReadString();
            Type      MapType       = Type.GetType(MapAssembly);
            BattleMap NewMap        = (BattleMap)Activator.CreateInstance(MapType, 0);

            NewMap.BattleMapPath  = BattleMapPath;
            NewMap.ListGameScreen = ListGameScreen;
            NewMap.LoadTemporaryMap(BR);
            NewMap.TogglePreview(true);

            FS.Close();
            BR.Close();

            return(NewMap);
        }
예제 #29
0
 public ScriptCenterCamera(BattleMap Map)
     : base(100, 50, "Center Camera", new string[] { "Center" }, new string[] { "Camera Centered" })
 {
     this.Map = Map;
 }
예제 #30
0
 public ScriptCenterCamera(BattleMap Map)
     : base(Map, 100, 50, "Center Camera", new string[] { "Center" }, new string[] { "Camera Centered" })
 {
 }