From ec42359d806071747ffc58953710972327dff5cb Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Wed, 1 Jul 2020 22:45:48 -0400 Subject: [PATCH] slaveCost whitespace --- src/js/slaveCostJS.js | 80 +++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/src/js/slaveCostJS.js b/src/js/slaveCostJS.js index 1c1af3ba8aa..f9930f16398 100644 --- a/src/js/slaveCostJS.js +++ b/src/js/slaveCostJS.js @@ -1585,7 +1585,7 @@ globalThis.BeautyArray = (function() { })(); globalThis.Beauty = function(s) { - let beauty = BeautyArray(s).reduce((result, {value})=>result + value, 0); + let beauty = BeautyArray(s).reduce((result, {value}) => result + value, 0); beauty = Math.max(1, Math.trunc(0.5 * beauty)); return beauty; }; @@ -1647,21 +1647,21 @@ globalThis.BeautyTooltip = function(slave) { line.value = (Math.floor(line.value * 10) / 10); domLine = document.createElement('div'); domLine.style.display = "float"; - domCell = document.createElement('span'); - domCell.style.float = "left"; - domCell.style.minWidth = "50px"; - - let textNode = document.createTextNode(line.value); - if (line.value > 0) { - domCell.className = "green"; - } else if (line.value < 0) { - domCell.className = "red"; - } - domCell.appendChild(textNode); - domLine.appendChild(domCell); + domCell = document.createElement('span'); + domCell.style.float = "left"; + domCell.style.minWidth = "50px"; + + let textNode = document.createTextNode(line.value); + if (line.value > 0) { + domCell.className = "green"; + } else if (line.value < 0) { + domCell.className = "red"; + } + domCell.appendChild(textNode); + domLine.appendChild(domCell); - textNode = document.createTextNode(line.text); - domLine.appendChild(textNode); + textNode = document.createTextNode(line.text); + domLine.appendChild(textNode); el.appendChild(domLine); }); return el; @@ -1749,7 +1749,7 @@ globalThis.FResultArray = (function() { if (supremeRaceP(slave) && V.arcologies[0].FSSupremacist > 20) { adjustFResult(`Race is Supreme Race`, -result); } else { - adjustFResult(`Rounding off: Slave value cannot be less than 2`, 2-result); + adjustFResult(`Rounding off: Slave value cannot be less than 2`, 2 - result); } } return retval; @@ -1758,8 +1758,8 @@ globalThis.FResultArray = (function() { /** * @param {App.Entity.SlaveState} slave */ - function calcUseWeights(slave, forSale=0) { - adjustFResult(`Muscles`, (slave.muscles / 30)-result); + function calcUseWeights(slave, forSale = 0) { + adjustFResult(`Muscles`, (slave.muscles / 30) - result); if (slave.muscles < -95) { adjustFResult(`Muscles: Extremely weak`, -5); } else if (slave.muscles < -30) { @@ -2021,7 +2021,7 @@ globalThis.FResultArray = (function() { /** * @param {App.Entity.SlaveState} slave */ - function calcNotFuckdoll(slave, forSale=0) { + function calcNotFuckdoll(slave, forSale = 0) { if (!forSale) { if (totalRelatives(slave) > 0) { calcWorksWithRelatives(slave); @@ -2120,7 +2120,7 @@ globalThis.FResultArray = (function() { })(); globalThis.FResult = function(s) { - let FResult = FResultArray(s).reduce((result, {value})=>result + value, 0); + let FResult = FResultArray(s).reduce((result, {value}) => result + value, 0); FResult = Math.trunc(FResult); return FResult; }; @@ -2180,21 +2180,21 @@ globalThis.FResultTooltip = function(slave) { line.value = (Math.floor(line.value * 10) / 10); domLine = document.createElement('div'); domLine.style.display = "float"; - domCell = document.createElement('span'); - domCell.style.float = "left"; - domCell.style.minWidth = "50px"; - - let textNode = document.createTextNode(line.value); - if (line.value > 0) { - domCell.className = "green"; - } else if (line.value < 0) { - domCell.className = "red"; - } - domCell.appendChild(textNode); - domLine.appendChild(domCell); + domCell = document.createElement('span'); + domCell.style.float = "left"; + domCell.style.minWidth = "50px"; + + let textNode = document.createTextNode(line.value); + if (line.value > 0) { + domCell.className = "green"; + } else if (line.value < 0) { + domCell.className = "red"; + } + domCell.appendChild(textNode); + domLine.appendChild(domCell); - textNode = document.createTextNode(line.text); - domLine.appendChild(textNode); + textNode = document.createTextNode(line.text); + domLine.appendChild(textNode); el.appendChild(domLine); }); return el; @@ -2216,11 +2216,11 @@ globalThis.FResultTooltip = function(slave) { * @param {boolean} [followLaws=false] Apply cost variations from enacted Slave Market Regulations * @returns {number} */ -globalThis.slaveCost = function(slave, isStartingSlave=false, followLaws=false) { +globalThis.slaveCost = function(slave, isStartingSlave = false, followLaws = false) { const milked = App.SlaveAssignment.getMilked(slave, true); const beauty = slaveCostBeauty(slave, isStartingSlave, followLaws); - if ((milked*52) > beauty && !isStartingSlave) { // Arbitrarily, let's say their milk worth is what they would make in a year. Blocking starting slave for now because milk makes so much money, the estimation makes game start impossible. - return milked*52; + if ((milked * 52) > beauty && !isStartingSlave) { // Arbitrarily, let's say their milk worth is what they would make in a year. Blocking starting slave for now because milk makes so much money, the estimation makes game start impossible. + return milked * 52; } else { return beauty; } @@ -2626,9 +2626,9 @@ globalThis.slaveCostBeauty = (function() { multiplier += 0.2; } if (V.rep > 10000) { - multiplier += 0.1*(Object.getOwnPropertyNames(slave.brand).length); + multiplier += 0.1 * (Object.getOwnPropertyNames(slave.brand).length); } else if (V.rep < 5000) { - multiplier -= 0.1*(Object.getOwnPropertyNames(slave.brand).length); + multiplier -= 0.1 * (Object.getOwnPropertyNames(slave.brand).length); } multiplier -= getLimbCount(slave, 0) * 0.05; if (!canSee(slave)) { @@ -2745,7 +2745,7 @@ globalThis.startingSlaveCost = function(slave) { */ globalThis.heroSlaveCost = function(slave, costFloor) { V.specialSlavesPriceOverride = 1; // TODO: this probably shouldn't be a global - let cost = (10*Math.trunc((slaveCost(slave)/10)*2)); + let cost = (10 * Math.trunc((slaveCost(slave) / 10) * 2)); V.specialSlavesPriceOverride = 0; if (cost < costFloor) { cost += jsRandom(Math.trunc(costFloor / 2000), Math.trunc((costFloor * 3) / 2000)) * 1000; -- GitLab