Exemplo n.º 1
0
        public void CheckFactionMiningEfficiency()
        {
            var multiplier = 0.5f;

            _game.Faction[1].Bonuses.MiningEfficiency = multiplier;
            _game.InitialiseGame(false);

            _game.AddResources(1, 100, false);
            _game.AddResources(2, 100, false);

            var creds1 = _game.Credits[0];
            var creds2 = _game.Credits[1];

            creds2.ShouldBe((int)(multiplier * creds1));
        }
Exemplo n.º 2
0
        public void AddResources()
        {
            _game.AddResources(2, 100);

            _game.Credits[0].ShouldBe(0);
            _game.Credits[1].ShouldBe((int)(100 * StrategyGame.BaseConversionRate * _game.Faction[1].Bonuses.MiningEfficiency));
        }
Exemplo n.º 3
0
        public virtual void UpdateCheats()
        {
            _cheatVisibilityExpires--;
            _cheatCreditExpires--;

            if (StrategyGame.Random.NextDouble() <= _cheatVisibilityChance)
            {
                CheatVisibility         = true;
                _cheatVisibilityExpires = _cheatVisibilityLastsTicks;
            }
            if (CheatVisibility && _cheatVisibilityExpires <= 0)
            {
                CheatVisibility = false;
            }

            if (StrategyGame.Random.NextDouble() <= _cheatCreditsChance)
            {
                CheatCredits        = true;
                _cheatCreditExpires = _cheatCreditsLastsTicks;
            }
            if (CheatCredits && _cheatCreditExpires <= 0)
            {
                CheatCredits = false;
            }

            if (CheatCredits)
            {
                _game.AddResources(Team, CheatCreditAmout);
            }
        }