Advertisement
Guest User

LWG cheat: press F4 to see all enemy units and buildings

a guest
Jul 21st, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function () {
  2.   const oldSeeUnit = Team.prototype.canSeeUnit;
  3.   let seeAllYes = false;
  4.   let seeAllInterval = null;
  5.   window.seeAll = function(yes) {
  6.     if (typeof yes === 'undefined') {
  7.       yes = !seeAllYes;
  8.     }
  9.     clearInterval(seeAllInterval);
  10.     if (yes) {
  11.       seeAllInterval = setInterval(() => game.buildings.forEach(b => {
  12.         if (b.owner.team !== PLAYING_PLAYER.team && b.owner.team.number !== 0) {
  13.           b.seenBy[PLAYING_PLAYER.team.number] = b.seenBy[b.owner.team.number];
  14.         }
  15.       }), 250);
  16.       Team.prototype.canSeeUnit = () => true;
  17.     } else {
  18.       Team.prototype.canSeeUnit = oldSeeUnit;
  19.     }
  20.     seeAllYes = yes;
  21.   }
  22.   window.addEventListener('keydown', e => {
  23.     if (e.keyCode === 115)
  24.       seeAll();
  25.   });
  26. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement