Exemplo n.º 1
0
        public void init(Helpers.ObjectState spawn, Script_Multi script)
        {
            _script = script;
            Arena.FlagState flag;
            if (_team._name == "Titan Militia")
            {
                flag = _arena._flags.Values.OrderByDescending(f => f.posX).Where(f => f.team == _team).First();
            }
            else
            {
                flag = _arena._flags.Values.OrderByDescending(f => f.posX).Where(f => f.team == _team).First();
            }

            Helpers.ObjectState dropPoint = findOpenSpawn((short)(flag.posX + 900), 1744, 1000);

            spawn.positionZ = 0;
            _supplyMarker   = _arena.newVehicle(AssetManager.Manager.getVehicleByID(406), _team, null, dropPoint);
            _spawnMarker    = _arena.newVehicle(AssetManager.Manager.getVehicleByID(407), _team, null, spawn);

            if (_supplyMarker == null)
            {
                Log.write(TLog.Warning, "Unable to spawn supply drop marker");
            }

            if (_spawnMarker == null)
            {
                Log.write(TLog.Warning, "Unable to spawn supply drop spawn marker");
            }


            _arena.sendArenaMessage(String.Format("&Supplies inbound to your coordinates ({0}), Sit tight Soldiers!",
                                                  Helpers.posToLetterCoord(_supplyMarker._state.positionX, _supplyMarker._state.positionY)), 4);

            _targetLocation = _supplyMarker;
        }
Exemplo n.º 2
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////
        /// <summary>
        /// Performs script initialization
        /// </summary>
        public Royale(Arena arena, Script_Multi baseScript)
        {
            _baseScript = baseScript;
            _arena      = arena;
            _config     = arena._server._zoneConfig;

            _storm                = new Boundary(_arena, 0, 0, 0, 0);
            _red                  = _arena.getTeamByName("Red");
            _blue                 = _arena.getTeamByName("Blue");
            _rand                 = new Random();
            _activeTeams          = new List <Team>();
            _playersReady         = new Dictionary <string, bool>();
            _tickLastReadyCheck   = 0;
            _tickLastPlayingCheck = 0;
            _tickGameStarting     = 0; //test

            playing = 0;

            manualTeamSizePick = 0;
            bClassic           = false; // Turn on looting.
            bGameLocked        = false;
            bAllPlayersReady   = false;
            bSquadRoyale       = false;

            if (_arena._name.StartsWith("[Royale] Squad"))
            {
                bSquadRoyale = true;
                _baseScript.AllowPrivateTeams(true, 8);
            }
        }
Exemplo n.º 3
0
        public Coop(Arena arena, Script_Multi baseScript)
        {
            _baseScript = baseScript;
            _arena      = arena;
            _config     = arena._server._zoneConfig;

            _activePoints = new List <CapturePoint>();
            _allPoints    = new List <CapturePoint>();

            _bots                = new List <Bot>();
            _condemnedBots       = new List <Bot>();
            spawnBots            = true;
            _medBotFollowTargets = new Dictionary <ushort, Player>();
            _medBotHealTargets   = new Dictionary <ushort, Player>();

            _team    = _arena.getTeamByName("Titan Militia");
            _botTeam = _arena.getTeamByName("Collective Military");

            if (_arena._name.StartsWith("[Co-Op]"))
            {
                _botDifficulty = 1;
                if (_arena._name.EndsWith("Easy"))
                {
                    _botDifficulty = 0;
                }

                if (_arena._name.EndsWith("Normal"))
                {
                    _botDifficulty = 1;
                }

                if (_arena._name.EndsWith("Hard"))
                {
                    _botDifficulty = 3;
                }

                if (_arena._name.EndsWith("Expert"))
                {
                    _botDifficulty = 6;
                }
                if (_arena._name.EndsWith("Master"))
                {
                    _botDifficulty = 9;
                }
                if (_arena._name.EndsWith("Elite"))
                {
                    _botDifficulty = 12;
                }
                if (_arena._name.EndsWith("Insane"))
                {
                    _botDifficulty = 15;
                }
                if (_arena._name.EndsWith("Hell"))
                {
                    _botDifficulty = 35;
                }
            }
        }
Exemplo n.º 4
0
        public Conquest(Arena arena, Script_Multi baseScript)
        {
            _baseScript = baseScript;
            _arena      = arena;
            _config     = arena._server._zoneConfig;

            _activePoints = new List <CapturePoint>();
            _allPoints    = new List <CapturePoint>();
            _bots         = new List <Bot>();

            cqTeam1 = _arena.getTeamByName("Titan Militia");
            cqTeam2 = _arena.getTeamByName("Collective Military");
        }
        public CapturePoint(Arena arena, Arena.FlagState flag, Script_Multi script)
        {
            _flag        = flag;
            _arena       = arena;
            players      = new List <Player>();
            tickLastWave = 0;
            _flags       = _arena._flags.Values.OrderBy(f => f.posX).ToList();
            _baseScript  = script;

            posX = _flag.posX;
            posY = _flag.posY;

            name = Helpers.posToLetterCoord(posX, posY);
        }
Exemplo n.º 6
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////
        /// <summary>
        /// Performs script initialization
        /// </summary>
        public RTS(Arena arena, Script_Multi baseScript)
        {
            _baseScript = baseScript;
            _arena      = arena;
            _config     = arena._server._zoneConfig;
            _rand       = new Random();

            _arena._bIsPublic = true;

            _titan      = _arena.getTeamByName("Titan Militia");
            _collective = _arena.getTeamByName("Collective Military");
            _bots       = new List <Bot>();
            _units      = new Dictionary <ushort, Unit>();
        }
Exemplo n.º 7
0
        public void init(Helpers.ObjectState spawn, Script_Multi script, Vehicle target, Player owner, Settings.GameTypes gameType)
        {
            _script         = script;
            spawn.positionZ = 0;
            _target         = target;

            _target.destroy(true);
            _target      = null;
            _spawnMarker = _arena.newVehicle(AssetManager.Manager.getVehicleByID(407), _team, null, spawn);


            if (_spawnMarker == null)
            {
                Log.write(TLog.Warning, "Unable to spawn spawn marker");
            }

            _tickArrivedAtLocation = Environment.TickCount;
        }
Exemplo n.º 8
0
        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////
        /// <summary>
        /// Performs script initialization
        /// </summary>
        public Royale(Arena arena, Script_Multi baseScript)
        {
            _baseScript = baseScript;
            _arena      = arena;
            _config     = arena._server._zoneConfig;

            _storm              = new Boundary(_arena, 0, 0, 0, 0);
            _red                = _arena.getTeamByName("Red");
            _blue               = _arena.getTeamByName("Blue");
            _rand               = new Random();
            _activeTeams        = new List <Team>();
            _playersReady       = new Dictionary <string, bool>();
            _tickLastReadyCheck = 0;
            _tickGameStarting   = 0; //test

            manualTeamSizePick = 0;
            bClassic           = false; // Turn on looting.
            bGameLocked        = false;
            bAllPlayersReady   = false;
        }
Exemplo n.º 9
0
 public Loot(Arena arena, Script_Multi script)
 {
     _script = script;
     _arena  = arena;
     _logger = Log.createClient(String.Format("Loot_{0}", arena._name));
 }
Exemplo n.º 10
0
        static public Jackpot calculateJackpot(IEnumerable <Player> players, Team winner, Settings.GameTypes gameType, Script_Multi script, bool bTicker)
        {
            Jackpot result       = new Jackpot();
            int     fixedjackpot = 0;

            Jackpot.Reward rewards;
            int            highest = 0;

            int    pointsPerKill         = 0;
            int    pointsPerDeath        = 0;
            int    pointsPerFlag         = 0;
            double pointsPerSecondWinner = 0;
            double pointsPerSecondLoser  = 0;
            double pointsPerHP           = 0;

            int totalkills  = 0;
            int totalDeaths = 0;
            int gameLength  = 0;

            if (winner != null)
            {
                totalkills  = winner._currentGameKills;
                totalDeaths = winner._currentGameDeaths;
                gameLength  = (winner._arena._tickGameEnded - winner._arena._tickGameStarted) / 1000;
            }
            int totalHPHealed = 0;
            int totalFlagCaps = 0;

            switch (gameType)
            {
            case Settings.GameTypes.Conquest:
                fixedjackpot          = Settings.c_jackpot_CQ_Fixed;
                pointsPerKill         = Settings.c_jackpot_CQ_PointsPerKill;
                pointsPerDeath        = Settings.c_jackpot_CQ_PointsPerDeath;
                pointsPerFlag         = Settings.c_jackpot_CQ_PointsPerFlag;
                pointsPerSecondWinner = Settings.c_jackpot_CQ_WinnerPointsPerSecond;
                pointsPerSecondLoser  = Settings.c_jackpot_CQ_LoserPointsPerSecond;
                pointsPerHP           = Settings.c_jackpot_CQ_PointsPerHP;
                break;

            case Settings.GameTypes.Coop:
                fixedjackpot          = Settings.c_jackpot_Co_Fixed;
                pointsPerKill         = Settings.c_jackpot_Co_PointsPerKill;
                pointsPerDeath        = Settings.c_jackpot_Co_PointsPerDeath;
                pointsPerFlag         = Settings.c_jackpot_Co_PointsPerFlag;
                pointsPerSecondWinner = Settings.c_jackpot_Co_WinnerPointsPerSecond;
                pointsPerSecondLoser  = Settings.c_jackpot_Co_LoserPointsPerSecond;
                pointsPerHP           = Settings.c_jackpot_Co_PointsPerHP;
                break;

            case Settings.GameTypes.Royale:
                fixedjackpot          = Settings.c_jackpot_CQ_Fixed;
                pointsPerKill         = Settings.c_jackpot_CQ_PointsPerKill;
                pointsPerDeath        = Settings.c_jackpot_CQ_PointsPerDeath;
                pointsPerFlag         = Settings.c_jackpot_CQ_PointsPerFlag;
                pointsPerSecondWinner = Settings.c_jackpot_CQ_WinnerPointsPerSecond;
                pointsPerSecondLoser  = Settings.c_jackpot_CQ_LoserPointsPerSecond;
                pointsPerHP           = Settings.c_jackpot_CQ_PointsPerHP;
                break;
            }

            //Set our fixed
            result.totalJackPot += fixedjackpot;

            //Calculate MVP
            foreach (Player player in players)
            {
                rewards = new Jackpot.Reward();
                int score = 0;
                rewards.player = player;

                score += Convert.ToInt32((script.StatsCurrent(player).kills *pointsPerKill));
                score += Convert.ToInt32((script.StatsCurrent(player).deaths *pointsPerDeath));
                score += Convert.ToInt32((script.StatsCurrent(player).flagCaptures *pointsPerFlag));
                score += Convert.ToInt32((script.StatsCurrent(player).potentialHealthHealed *pointsPerHP));

                //Increment Jackpot totals
                totalHPHealed += script.StatsCurrent(player).potentialHealthHealed;
                totalFlagCaps += script.StatsCurrent(player).flagCaptures;

                //Calculate win/loss play seconds
                if (winner != null)
                {
                    if (winner._name == "Titan Militia")
                    {
                        score += Convert.ToInt32((script.StatsCurrent(player).titanPlaySeconds *pointsPerSecondWinner));
                        score += Convert.ToInt32((script.StatsCurrent(player).collectivePlaySeconds *pointsPerSecondLoser));
                    }
                    else
                    {
                        score += Convert.ToInt32((script.StatsCurrent(player).collectivePlaySeconds *pointsPerSecondWinner));
                        score += Convert.ToInt32((script.StatsCurrent(player).titanPlaySeconds *pointsPerSecondLoser));
                    }
                }

                //Tally up his overall score and check if it's our new highest
                rewards.Score    = score;
                result.totalMVP += score;
                result._playerRewards.Add(rewards);

                if (score >= highest)
                {
                    highest = score;
                }
            }

            //Calculate Total Jackpot
            result.totalJackPot += (totalkills * pointsPerKill);
            result.totalJackPot += (totalDeaths * pointsPerDeath);
            result.totalJackPot += (gameLength * 4);
            result.totalJackPot += Convert.ToInt32(totalHPHealed * pointsPerHP);
            result.totalJackPot += (totalFlagCaps * pointsPerFlag);


            //Calculate each players reward based on their MVP score and the overall jackpot
            foreach (Jackpot.Reward reward in result._playerRewards)
            {
                reward.MVP = (double)reward.Score / (double)highest;
                if (!bTicker)
                {
                    reward.points     = Convert.ToInt32(result.totalJackPot * reward.MVP);
                    reward.cash       = Convert.ToInt32(((result.totalJackPot * reward.MVP) * Settings.c_jackpot_CashMultiplier));
                    reward.experience = Convert.ToInt32((result.totalJackPot * reward.MVP) * Settings.c_jackpot_ExpMultiplier);
                }
            }
            return(result);
        }