Guest User

Untitled

a guest
Aug 20th, 2019
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. try {
  2. window.body = windowBody;
  3. } catch (e) {}
  4.  
  5. Object.values = o => Object.keys(o).map(k => o[k]);
  6. const sum = arr => arr.length > 0 ? arr.reduce((a, b) => a + b) : 0;
  7.  
  8. windowBody = window.body;
  9. window.body = function() {
  10. windowBody.apply(this, null, arguments);
  11.  
  12. if (ui.mode === "battle") {
  13. eval(onecup.import())
  14. div("#NetWorthAlpha", function() {
  15. position("absolute");
  16. top(64);
  17. right(12);
  18. padding(10);
  19. color("white");
  20. z_index('2');
  21.  
  22. const alphaUnits = Object.values(sim.things).filter(x => x.unit && x.side === "alpha"),
  23. alphaPlayers = sim.players.filter(x => x.side === "alpha");
  24. text("Alpha: $" + (sum(alphaUnits.map(x => Math.round(x.cost * x.hp / x.maxHP))) + sum(alphaPlayers.map(x => x.money))));
  25. });
  26.  
  27. div("#NetWorthBeta", function() {
  28. position("absolute");
  29. top(88);
  30. right(12);
  31. padding(10);
  32. color("white");
  33. z_index('2');
  34.  
  35. const betaUnits = Object.values(sim.things).filter(x => x.unit && x.side === "beta"),
  36. betaPlayers = sim.players.filter(x => x.side === "beta");
  37. text("Beta: $" + (sum(betaUnits.map(x => Math.round(x.cost * x.hp / x.maxHP))) + sum(betaPlayers.map(x => x.money))));
  38. });
  39. }
  40. }
RAW Paste Data