Skip to content

Commit

Permalink
pc_of_gathered
Browse files Browse the repository at this point in the history
  • Loading branch information
fohristiwhirl committed Oct 20, 2018
1 parent 161cdc9 commit 2c009ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fluorine_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,7 @@ function make_renderer() {
let spent = deposited + initial - current;
let gathered = deposited + initial;
let dead_ships = builds - (ships + dropoffs);
let pc_of_gathered = Math.round(10000 * current / gathered) / 100;

if (renderer.game.game_statistics.player_statistics[pid].last_turn_alive < renderer.turn) {
current = "dead"; // Set this after spent is calculated, above.
Expand All @@ -1801,7 +1802,7 @@ function make_renderer() {
<li>Initial: ${c}${initial}${z}, mined: ${c}${mined}${z}, absorbed: ${c}${absorbed}${z}</li>
<li>Burned: ${c}${burned}${z}, carrying ${c}${carrying}${z}, dropped: ${c}${scrapped}${z}</li>
<li>Gathered: ${c}${gathered}${z} &ndash; spent: ${c}${spent}${z}</li>
<li>Profit = ${c}${current}${z}</li>`
<li>Profit = ${c}${current}${z} (${c}${pc_of_gathered}%${z} of gathered)</li>`
);

if (mined + absorbed - deposited - carrying - burned - scrapped !== 0) {
Expand Down

0 comments on commit 2c009ec

Please sign in to comment.