Example #1
0
 public void OnInvoicePaid(object sender, InvoiceItem.InvoicePaidEventArgs args)
 {
     if (args.PaidInFull)
         Debug.Log("Invoice Paid in full");
     else
         Debug.Log("Invoice Paid : " + args.AmountPaid);
 }
 public void OnInvoicePaid(object sender, InvoiceItem.InvoicePaidEventArgs args)
 {
 }
 public InvoiceItem ProcessQuarterly()
 {
     //We will only give up to a specified amount (the yearly total)
     double MaxBudget = base_funding + rep_funding * Math.Max(Reputation.CurrentRep, 0);
     //Past that amount we give nothing
     double income = Math.Max(Math.Min(MaxBudget / 4, MaxBudget - Funding.Instance.Funds), 0);
     var invoice = new InvoiceItem(this, income, 0, "Quarterly Budget");
     return invoice;
 }
Example #4
0
 public void OnInvoicePaid(object sender, InvoiceItem.InvoicePaidEventArgs args)
 {
     if (args.PaidInFull)
     {
         string crewName = ((InvoiceItem)sender).ItemName;
         var unpaidCrewMember = HighLogic.CurrentGame.CrewRoster.Unowned.FirstOrDefault(crew => crew.name == crewName);
         if (unpaidCrew.ContainsKey(crewName))
         {
             unpaidCrew[crewName]--;
             if (unpaidCrew[crewName] <= 0)
             {
                 unpaidCrew[crewName] = 0;
                 if (unpaidCrewMember != null)
                 {
                     unpaidCrewMember.type = ProtoCrewMember.KerbalType.Crew;
                 }
             }
         }
     }
 }
 public void OnInvoicePaid(object sender, InvoiceItem.InvoicePaidEventArgs args)
 {
     modifier.OnInvoicePaid(sender, args);
 }
Example #6
0
 public InvoiceItem ProcessYearly()
 {
     Debug.Log("Example Yearly update!");
     AllTimeRevenue += 100;
     AllTimeExpenses += 25;
     var invoice = new InvoiceItem(this, 100, 25);
     return invoice;
 }
Example #7
0
 public InvoiceItem ProcessQuarterly()
 {
     Debug.Log("Example Quarterly update!");
     AllTimeRevenue += 31;
     AllTimeExpenses += 42;
     var invoice = new InvoiceItem(this, 31, 42);
     return invoice;
 }
Example #8
0
 public void OnInvoicePaid(object sender, InvoiceItem.InvoicePaidEventArgs args)
 {
     InvoiceItem item = (InvoiceItem)sender;
     currentLoans.Single(loan => loan.Value.GetName() == item.ItemName).Value.Pay(args.AmountPaid);
 }
 public InvoiceItem ProcessQuarterly()
 {
     float f = Math.Max((int)Math.Ceiling(((base_funding / 4) + ((rep_funding / 4) * Reputation.CurrentRep))), 0);
     var invoice = new InvoiceItem(this, f, 0);
     return invoice;
 }