Beispiel #1
0
        public void ProcessDeadKerbal(ProtoCrewMember crewMember)
        {
            Kerbals.Remove(crewMember.name);
            if (LossAlreadyProcessed(crewMember))
            {
                return;
            }
            for (int i = 0; i < Kerbals.Count; i++)
            {
                CrewMember c = Kerbals.ElementAt(i).Value;
                if (Utilities.Instance.Randomise.NextDouble() < c.CrewReference().courage)
                {
                    continue;
                }
                string lostVessel = crewMember.name;
                if (CrewOnValidVessel(crewMember))
                {
                    lostVessel = crewMember.seat.vessel.vesselName;
                }
                c.AddUnhappiness("Loss of " + lostVessel);
                Debug.Log("[Bureaucracy]: Unhappiness event registered for " + crewMember.name + ": Dead Kerbal");
            }
            float penalty = Reputation.Instance.reputation * (SettingsClass.Instance.DeadKerbalPenalty / 100.0f);

            Reputation.Instance.AddReputation(-penalty, TransactionReasons.VesselLoss);
            Debug.Log("[Bureaucracy]: Dead Kerbal Penalty Applied");
        }
Beispiel #2
0
 public void ProcessUnpaidKerbals(List <CrewMember> unpaidKerbals)
 {
     for (int i = 0; i < unpaidKerbals.Count; i++)
     {
         CrewMember c = Kerbals.ElementAt(i).Value;
         c.AddUnhappiness("not being paid");
         Debug.Log("[Bureaucracy]: Adding new unpaid crew member " + c.Name);
     }
 }
Beispiel #3
0
        public int Bonuses(double availableFunding, bool clearBonuses)
        {
            int bonus = 0;

            for (int i = 0; i < Kerbals.Count; i++)
            {
                CrewMember c = Kerbals.ElementAt(i).Value;
                int        bonusToProcess = c.GetBonus(clearBonuses);
                if (clearBonuses && bonusToProcess > 0 && availableFunding < bonusToProcess)
                {
                    c.AddUnhappiness("not being paid");
                }
                else
                {
                    bonus += bonusToProcess;
                }
                availableFunding -= bonus;
            }
            lastBonus = bonus;
            return(bonus);
        }