예제 #1
0
파일: Scenario.cs 프로젝트: GarethIW/Fodder
        public ScenarioResult(GameSession session, Scenario scenario)
        {
            Team1TotalReinforcements = session.Team1StartReinforcements;
            Team2TotalReinforcements = session.Team2StartReinforcements;
            Team1RemainingReinforcements = session.Team1Reinforcements;
            Team2RemainingReinforcements = session.Team2Reinforcements;
            Team1ActiveCount = session.Team1ActiveCount;
            Team2ActiveCount = session.Team2ActiveCount;
            Team1DeadCount = session.Team1DeadCount;
            Team2DeadCount = session.Team2DeadCount;
            Team1Win = session.Team1Win;
            Team2Win = session.Team2Win;

            Team1Human = (session.Team1ClientType == GameClientType.Human ? true : false);
            Team2Human = (session.Team2ClientType == GameClientType.Human ? true : false);

            int Team1Percent = (int)((100M / (decimal)Team1TotalReinforcements) * ((decimal)Team1RemainingReinforcements + (decimal)Team1ActiveCount));
            int Team2Percent = (int)((100M / (decimal)Team2TotalReinforcements) * ((decimal)Team2RemainingReinforcements + (decimal)Team2ActiveCount));

            if (Team1Percent >= scenario.BronzeScore) Team1ScoreRewarded = 1;
            if (Team1Percent >= scenario.SilverScore) Team1ScoreRewarded = 2;
            if (Team1Percent >= scenario.GoldScore) Team1ScoreRewarded = 3;

            if (Team2Percent >= scenario.BronzeScore) Team2ScoreRewarded = 1;
            if (Team2Percent >= scenario.SilverScore) Team2ScoreRewarded = 2;
            if (Team2Percent >= scenario.GoldScore) Team2ScoreRewarded = 3;
        }
예제 #2
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Fodder.Content");

            gameSession = new GameSession(GameClientType.Human, GameClientType.AI, gameScenario, ScreenManager.GraphicsDevice.Viewport, false);
            gameSession.LoadContent(content);

            ScreenManager.Game.ResetElapsedTime();
        }
예제 #3
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Fodder.Content");

            List<Function> funcs = new List<Function>();
            funcs.Add(new Function("boost", 1000, true));
            funcs.Add(new Function("shield", 10000, true));
            funcs.Add(new Function("pistol", 4000, true));
            funcs.Add(new Function("shotgun", 6000, true));
            funcs.Add(new Function("sniper", 30000, true));
            funcs.Add(new Function("machinegun", 30000, true));
            funcs.Add(new Function("mortar", 30000, true));

            gameSession = new GameSession(GameClientType.Human, GameClientType.AI, gameScenario, ScreenManager.GraphicsDevice.Viewport, false);
            gameSession.LoadContent(content);

            ScreenManager.Game.ResetElapsedTime();
        }
예제 #4
0
        /// <summary>
        /// Loads graphics content for this screen. The background texture is quite
        /// big, so we use our own local ContentManager to load it. This allows us
        /// to unload before going from the menus into the game itself, wheras if we
        /// used the shared ContentManager provided by the Game class, the content
        /// would remain loaded forever.
        /// </summary>
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Fodder.Content");

            texBG = content.Load<Texture2D>("blank");
            texLogo = content.Load<Texture2D>("logo");

            List<Function> funcs = new List<Function>();
            funcs.Add(new Function("boost", 1000, true));
            funcs.Add(new Function("shield", 10000, true));
            funcs.Add(new Function("pistol", 4000, true));
            funcs.Add(new Function("shotgun", 6000, true));
            funcs.Add(new Function("smg", 8000, true));
            funcs.Add(new Function("sniper", 30000, true));
            funcs.Add(new Function("machinegun", 30000, true));
            funcs.Add(new Function("mortar", 30000, true));
            funcs.Add(new Function("haste", 20, true));
            funcs.Add(new Function("meteors", 20, true));
            funcs.Add(new Function("elite", 20, true));

            Scenario scenario = new Scenario("Attract", "attract", funcs, 3000, 100, 100, 1000, 1000);

            attractSession = new GameSession(GameClientType.AI, GameClientType.AI, scenario, ScreenManager.GraphicsDevice.Viewport, true);
            attractSession.LoadContent(content);
        }
예제 #5
0
        public GameSession(GameClientType t1CT, GameClientType t2CT, Scenario scenario, Viewport vp, bool attractmode)
        {
            Instance = this;

            Team1ClientType = t1CT;
            Team2ClientType = t2CT;
            Team1Reinforcements = scenario.T1Reinforcements;
            Team2Reinforcements = scenario.T2Reinforcements;
            Team1StartReinforcements = scenario.T1Reinforcements;
            Team2StartReinforcements = scenario.T2Reinforcements;
            Team1SpawnRate = scenario.T1SpawnRate;
            Team2SpawnRate = scenario.T2SpawnRate;

            Team1DeadCount = 0;
            Team2DeadCount = 0;
            Team1SoulCount = 0;
            Team2SoulCount = 0;

            Team1Win = false;
            Team2Win = false;

            AvailableFunctions = scenario.AvailableFunctions;

            DudeController = new DudeController();
            ButtonController = new ButtonController();
            SoulController = new SoulController();
            ProjectileController = new ProjectileController();
            ParticleController = new ParticleController();
            HUD = new HUD();

            AI1.Initialize(scenario.AIReactionTime);
            AI2.Initialize(scenario.AIReactionTime);

            Viewport = vp;

            IsAttractMode = attractmode;

            ScreenBottom = (IsAttractMode ? 0 : 60);

            StartCountdown = (IsAttractMode ? 0 : 4000);
            prepareTransition = (IsAttractMode ?0f:1f);
            fightTransition = 0f;

            Map = new Map(scenario.MapName);
        }