Add payday bonus multiplier
This commit is contained in:
@@ -30,8 +30,10 @@ function playerPayDay(client) {
|
|||||||
let wealth = calculateWealth(client);
|
let wealth = calculateWealth(client);
|
||||||
let grossIncome = getPlayerData(client).payDayAmount;
|
let grossIncome = getPlayerData(client).payDayAmount;
|
||||||
|
|
||||||
// Public Beta Bonus
|
// Passive income
|
||||||
grossIncome = grossIncome + getGlobalConfig().economy.passiveIncomePerPayDay;
|
grossIncome = grossIncome + getGlobalConfig().economy.passiveIncomePerPayDay;
|
||||||
|
|
||||||
|
// Payday bonus
|
||||||
grossIncome = grossIncome*getGlobalConfig().economy.grossIncomeMultiplier;
|
grossIncome = grossIncome*getGlobalConfig().economy.grossIncomeMultiplier;
|
||||||
|
|
||||||
let incomeTaxAmount = calculateIncomeTax(wealth);
|
let incomeTaxAmount = calculateIncomeTax(wealth);
|
||||||
@@ -110,6 +112,26 @@ function forcePlayerPayDayCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setPayDayBonusMultiplier(command, params, client) {
|
||||||
|
if(areParamsEmpty(params)) {
|
||||||
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let newMultiplier = params;
|
||||||
|
|
||||||
|
if(isNaN(newMultiplier)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "AmountNotNumber"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getGlobalConfig().economy.grossIncomeMultiplier = newMultiplier;
|
||||||
|
|
||||||
|
messageAdminAction(`${client.name} set payday bonus to ${newMultiplier*100}%`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function taxInfoCommand(command, params, client) {
|
function taxInfoCommand(command, params, client) {
|
||||||
let wealth = calculateWealth(client);
|
let wealth = calculateWealth(client);
|
||||||
let tax = calculateIncomeTax(wealth);
|
let tax = calculateIncomeTax(wealth);
|
||||||
|
|||||||
Reference in New Issue
Block a user