Ejemplo n.º 1
0
 private TerritoryIncomeReport NoTerritoryEffect(TerritoryWorkStatus status)
 {
     return(new TerritoryIncomeReport()
     {
         TerritoryName = status.TerritoryName,
         Income = status.Roll,
     });
 }
Ejemplo n.º 2
0
 private TerritoryIncomeReport Archeotech(TerritoryWorkStatus status)
 {
     // TODO: need a good way to get a number of dice the player would like to use for archeotech harvesting.
     // If they roll any doubles, the archeotech becomes an old ruins.
     return(new TerritoryIncomeReport()
     {
         TerritoryName = status.TerritoryName,
         Income = status.Roll,
     });
 }
Ejemplo n.º 3
0
 private TerritoryIncomeReport MineWorkings(TerritoryWorkStatus status)
 {
     // TODO: Right now we don't know which opponent gang members were captured, the opponent
     // would also have to submit a PostGameReport on Hivemind.
     return(new TerritoryIncomeReport()
     {
         TerritoryName = status.TerritoryName,
         Income = status.Roll,
     });
 }
Ejemplo n.º 4
0
        private TerritoryIncomeReport FriendlyDoc(TerritoryWorkStatus status)
        {
            if (status.Deaths > 0)
            {
                int extraIncome = _diceRoller.RollDie() * 5 * status.Deaths;
                return(new TerritoryIncomeReport()
                {
                    TerritoryName = status.TerritoryName,
                    Description = $"You have sold the bodies of your fallen gangers to the friendly doc for an extra {extraIncome} credits.",
                    Income = status.Roll + extraIncome,
                });
            }

            return(new TerritoryIncomeReport()
            {
                TerritoryName = status.TerritoryName,
                Income = status.Roll,
            });
        }
Ejemplo n.º 5
0
        private TerritoryIncomeReport GuilderContract(TerritoryWorkStatus status)
        {
            if (status.PreviousBattleType == GameType.Scavengers && status.Objectives > 0)
            {
                int extraIncome = status.Objectives * 5;
                return(new TerritoryIncomeReport()
                {
                    TerritoryName = status.TerritoryName,
                    Description = $"You have sold some of your extra loot to guilders for {extraIncome} credits.",
                    Income = status.Roll + extraIncome,
                });
            }

            return(new TerritoryIncomeReport()
            {
                TerritoryName = status.TerritoryName,
                Income = status.Roll,
            });
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Process income
        /// </summary>
        /// <param name="battleReport">Battle reports</param>
        /// <param name="deaths">Number of gangers who've died in the last battle.</param>
        /// <returns>Income report</returns>
        public IncomeReport ProcessIncome(BattleReport battleReport, int deaths)
        {
            var gang        = _gangManager.GetGang(battleReport.GangId);
            var territories = _territoryManager.GetTerritoriesByGangId(battleReport.GangId).ToList();

            territories.Sort();
            var gangers = GetGangers(battleReport.GangId).ToList();
            var gross   = new List <TerritoryIncomeReport>();

            for (int i = 0; i < gangers.Count() && i < territories.Count && i < MaximumTerritoriesWorked; i++)
            {
                var status = new TerritoryWorkStatus()
                {
                    TerritoryName      = territories[i].Name,
                    Deaths             = deaths,
                    Ganger             = gangers[i],
                    GangId             = battleReport.GangId,
                    Objectives         = battleReport.GangBattleStats.Select(stats => stats.Objectives).Sum(),
                    PreviousBattleType = battleReport.GameType,
                    Roll = _diceRoller.ParseDiceString(territories[i].Income),
                };

                gross.Add(territories[i].WorkTerritory(status));
            }

            int territoryGross    = gross.Select(territoryReport => territoryReport.Income).Sum();
            int giantKillerBonus  = GetGiantKillerBonus(gang.GangRating, battleReport.OpponentGangRating);
            int incomeAfterUpkeep = GetGangUpkeep(GetNumberOfGangMembers(battleReport.GangId), territoryGross + giantKillerBonus);

            var report = new IncomeReport()
            {
                Gross            = gross,
                GiantKillerBonus = giantKillerBonus,
                Upkeep           = territoryGross + giantKillerBonus - incomeAfterUpkeep,
                Income           = incomeAfterUpkeep,
            };

            gang.Credits += report.Income;
            _gangManager.UpdateGang(gang);

            return(report);
        }
Ejemplo n.º 7
0
        private TerritoryIncomeReport SporeCave(TerritoryWorkStatus status)
        {
            if (status.Roll == 20)
            {
                var sporeSickness = _injuryManager.GetInjury((int)InjuryEnum.SporeSickness);
                status.Ganger = sporeSickness.InjuryEffect(status.Ganger);
                _gangerManager.UpdateGanger(status.Ganger);

                return(new TerritoryIncomeReport()
                {
                    TerritoryName = status.TerritoryName,
                    Description = $"{status.Ganger.Name} has contracted Spore Sickness while harvesting in the Spore Cave.",
                    Income = status.Roll,
                });
            }

            return(new TerritoryIncomeReport()
            {
                TerritoryName = status.TerritoryName,
                Income = status.Roll,
            });
        }
Ejemplo n.º 8
0
        private TerritoryIncomeReport GamblingDen(TerritoryWorkStatus status)
        {
            // need to know the individual dice roll, so disregard what's in the status
            int roll1  = _diceRoller.RollDie();
            int roll2  = _diceRoller.RollDie();
            int income = (roll1 + roll2) * 10;

            if (roll1 == roll2)
            {
                return(new TerritoryIncomeReport()
                {
                    TerritoryName = status.TerritoryName,
                    Description = $"You've lost {income} credits at the gambling den.",
                    Income = income * -1,
                });
            }

            return(new TerritoryIncomeReport()
            {
                TerritoryName = status.TerritoryName,
                Income = income,
            });
        }
Ejemplo n.º 9
0
        private TerritoryIncomeReport Settlement(TerritoryWorkStatus status)
        {
            if (_diceRoller.RollDie() == 6)
            {
                // gang gets a free Juve.
                var juve = _gangerManager.CreateJuve("New Juve");
                juve.GangId = status.GangId;
                _gangerManager.AddGanger(juve);

                return(new TerritoryIncomeReport()
                {
                    TerritoryName = status.TerritoryName,
                    Description = "After working in the settlement, your gang has recruited a new Juve for free.",
                    Income = 30,
                });
            }

            return(new TerritoryIncomeReport()
            {
                TerritoryName = status.TerritoryName,
                Income = 30,
            });
        }
Ejemplo n.º 10
0
        private TerritoryIncomeReport ChemPit(TerritoryWorkStatus status)
        {
            if (status.Roll == 12)
            {
                // ganger gets horrible scars
                var scars = _injuryManager.GetInjury((int)InjuryEnum.HorribleScars);
                status.Ganger = scars.InjuryEffect(status.Ganger);
                _gangerManager.UpdateGanger(status.Ganger);

                return(new TerritoryIncomeReport()
                {
                    TerritoryName = status.TerritoryName,
                    Description = $"{status.Ganger.Name} has fallen into the chem pits and now has Horrible Scars. No income is collected.",
                    Income = 0,
                });
            }

            return(new TerritoryIncomeReport()
            {
                TerritoryName = status.TerritoryName,
                Income = status.Roll,
            });
        }