Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- window.body = windowBody;
- } catch (e) {}
- Object.values = o => Object.keys(o).map(k => o[k]);
- const sum = arr => arr.length > 0 ? arr.reduce((a, b) => a + b) : 0;
- windowBody = window.body;
- window.body = function() {
- windowBody.apply(this, null, arguments);
- if (ui.mode === "battle") {
- eval(onecup.import())
- div("#NetWorthAlpha", function() {
- position("absolute");
- top(64);
- right(12);
- padding(10);
- color("white");
- z_index('2');
- const alphaUnits = Object.values(sim.things).filter(x => x.unit && x.side === "alpha"),
- alphaPlayers = sim.players.filter(x => x.side === "alpha");
- text("Alpha: $" + (sum(alphaUnits.map(x => Math.round(x.cost * x.hp / x.maxHP))) + sum(alphaPlayers.map(x => x.money))));
- });
- div("#NetWorthBeta", function() {
- position("absolute");
- top(88);
- right(12);
- padding(10);
- color("white");
- z_index('2');
- const betaUnits = Object.values(sim.things).filter(x => x.unit && x.side === "beta"),
- betaPlayers = sim.players.filter(x => x.side === "beta");
- text("Beta: $" + (sum(betaUnits.map(x => Math.round(x.cost * x.hp / x.maxHP))) + sum(betaPlayers.map(x => x.money))));
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement