aok nordwest

This commit is contained in:
hydrant
2020-04-05 12:19:19 +02:00
parent de2af71cd6
commit 18b316dfe4
2 changed files with 11 additions and 3 deletions

View File

@@ -71,6 +71,7 @@ namespace ReallifeGamemode.Server.Finance
public static void SetPaycheck(Player client, int wage)
{
User user = client.GetUser();
(int bankAccount, float financialHelp, float financialInterest) = GetEconomyClass(client, wage);
float propertyTax = GetPropertyTaxation(client);
int vehicleTaxation = GetVehicleTaxation(client);
@@ -78,8 +79,9 @@ namespace ReallifeGamemode.Server.Finance
int amount = wage - (int)(wage * financialInterest) - vehicleTaxation - (int)propertyTax + (int)financialHelp - rentalFees;
Paycheck paycheck = new Paycheck(financialHelp, financialInterest, vehicleTaxation, propertyTax, wage, amount, rentalFees);
User user = client.GetUser();
int healthInsurance = (int)(user.BankAccount.Balance * 0.001);
Paycheck paycheck = new Paycheck(financialHelp, financialInterest, vehicleTaxation, propertyTax, wage, amount, rentalFees, healthInsurance);
Paychecks[user.Id] = paycheck;
ReleasePayDay(client, paycheck);
}
@@ -106,6 +108,8 @@ namespace ReallifeGamemode.Server.Finance
.ThenInclude(h => h.BankAccount)
.Where(hR => hR.UserId == u.Id);
dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 2).First().BankAccount.Balance += (int)(paycheck.HealthInsurance * 0.1);
foreach (var rental in rentals)
{
rental.House.BankAccount.Balance += (int)(rental.House.RentalFee * 0.7);

View File

@@ -34,7 +34,10 @@ namespace ReallifeGamemode.Server.Finance
[JsonProperty("rentalFees")]
public int RentalFees { get; set; } = 0;
public Paycheck(float FinancialHelp, float FinancialInterest, int VehicleTaxation, float PropertyTaxation, int Wage, int Amount, int RentalFees)
[JsonProperty("healthInsurance")]
public int HealthInsurance { get; set; } = 0;
public Paycheck(float FinancialHelp, float FinancialInterest, int VehicleTaxation, float PropertyTaxation, int Wage, int Amount, int RentalFees, int HealthInsurance)
{
this.FinancialHelp = FinancialHelp;
this.FinancialInterest = FinancialInterest;
@@ -43,6 +46,7 @@ namespace ReallifeGamemode.Server.Finance
this.Wage = Wage;
this.Amount = Amount;
this.RentalFees = RentalFees;
this.HealthInsurance = HealthInsurance;
}
}
}