diff --git a/ReallifeGamemode.Client/Interaction/interactionmenu.ts b/ReallifeGamemode.Client/Interaction/interactionmenu.ts index 6bff316d..c3a90cd9 100644 --- a/ReallifeGamemode.Client/Interaction/interactionmenu.ts +++ b/ReallifeGamemode.Client/Interaction/interactionmenu.ts @@ -127,6 +127,10 @@ export default function (globalData: IGlobalData) { item.SetRightLabel("~r~- $" + moneyFormat(Number(p.healthInsurance.toFixed(2)))); paycheckMenu.AddItem(item); + item = new UIMenuItem("Rundfunkbeitrag"); + item.SetRightLabel("~r~- $" + moneyFormat(Number(p.gez.toFixed(2)))); + paycheckMenu.AddItem(item); + item = new UIMenuItem("Einkommensteuer"); item.SetRightLabel(moneyFormat(Number((p.financialInterest * 100).toFixed(3))) + "%"); diff --git a/ReallifeGamemode.Client/global.d.ts b/ReallifeGamemode.Client/global.d.ts index 28e23ada..a3a3e4b2 100644 --- a/ReallifeGamemode.Client/global.d.ts +++ b/ReallifeGamemode.Client/global.d.ts @@ -48,6 +48,7 @@ declare type Paycheck = { amount: number; rentalFees: number; healthInsurance: number; + gez: number; factionMoney: number; otheramount: number; } diff --git a/ReallifeGamemode.Server/Finance/Economy.cs b/ReallifeGamemode.Server/Finance/Economy.cs index ca79a7d2..496f5321 100644 --- a/ReallifeGamemode.Server/Finance/Economy.cs +++ b/ReallifeGamemode.Server/Finance/Economy.cs @@ -110,6 +110,19 @@ namespace ReallifeGamemode.Server.Finance healthInsurance = 150; } + + int gez = (int)((bankAccount + user.Handmoney) * 0.001); + if (gez < 0) + { + gez = 0; + } + + if (gez > 150) + { + gez = 150; + } + + int? factionMoney = null; if (user.Faction != null && user.FactionRank != null) @@ -127,9 +140,9 @@ namespace ReallifeGamemode.Server.Finance factionMoney = factionWage; } int otheramount = user.otheramount; - int amount = wage - (int)(wage * financialInterest) - vehicleTaxation - (int)propertyTax + (int)financialHelp - rentalFees - healthInsurance + (factionMoney ?? 0) + otheramount; + int amount = wage - (int)(wage * financialInterest) - vehicleTaxation - (int)propertyTax + (int)financialHelp - rentalFees - healthInsurance + gez + (factionMoney ?? 0) + otheramount; - Paycheck paycheck = new Paycheck(financialHelp, financialInterest, vehicleTaxation, propertyTax, wage, amount, rentalFees, healthInsurance, factionMoney, otheramount); + Paycheck paycheck = new Paycheck(financialHelp, financialInterest, vehicleTaxation, propertyTax, wage, amount, rentalFees, healthInsurance, gez, factionMoney, otheramount); Paychecks[user.Id] = paycheck; ReleasePayDay(client, paycheck, minusJail); } @@ -178,6 +191,7 @@ namespace ReallifeGamemode.Server.Finance u.BankAccount.Balance + paycheck.Amount, paycheck.Wage, paycheck.FinancialInterest, + paycheck.gez, paycheck.otheramount); u.BankAccount.Balance += paycheck.Amount; @@ -192,6 +206,10 @@ namespace ReallifeGamemode.Server.Finance dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 2).First().BankAccount.Balance += (int)(paycheck.HealthInsurance); logger.LogInformation("Medic faction got a health insurance payment of {0} dollars from player {1}", paycheck.HealthInsurance, client.Name); + + dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 9).First().BankAccount.Balance += (int)(paycheck.gez); + logger.LogInformation("Medic faction got a gez payment of {0} dollars from player {1}", paycheck.gez, client.Name); + if (rentals.Any()) { foreach (var rental in rentals) diff --git a/ReallifeGamemode.Server/Finance/Paycheck.cs b/ReallifeGamemode.Server/Finance/Paycheck.cs index 9c4c0805..b9f8dcfc 100644 --- a/ReallifeGamemode.Server/Finance/Paycheck.cs +++ b/ReallifeGamemode.Server/Finance/Paycheck.cs @@ -28,13 +28,16 @@ namespace ReallifeGamemode.Server.Finance [JsonProperty("healthInsurance")] public int HealthInsurance { get; set; } = 0; + [JsonProperty("gez")] + public int gez { get; set; } = 0; + [JsonProperty("factionMoney")] public int? FactionMoney { get; set; } = 0; [JsonProperty("otheramount")] public int? otheramount { get; set; } = 0; - public Paycheck(float FinancialHelp, float FinancialInterest, int VehicleTaxation, float PropertyTaxation, int Wage, int Amount, int RentalFees, int HealthInsurance, int? FactionMoney, int? otheramount) + public Paycheck(float FinancialHelp, float FinancialInterest, int VehicleTaxation, float PropertyTaxation, int Wage, int Amount, int RentalFees, int HealthInsurance, int gez, int? FactionMoney, int? otheramount) { this.FinancialHelp = FinancialHelp; this.FinancialInterest = FinancialInterest; @@ -44,6 +47,7 @@ namespace ReallifeGamemode.Server.Finance this.Amount = Amount; this.RentalFees = RentalFees; this.HealthInsurance = HealthInsurance; + this.gez = gez; this.FactionMoney = FactionMoney; this.otheramount = otheramount; }