Gats.io - Anti Camera Movement

helps if you're used to other io games' fixed view

当前为 2021-07-25 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Gats.io - Anti Camera Movement
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description helps if you're used to other io games' fixed view
  6. // @author Nitrogem 35
  7. // @match https://gats.io/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. setTimeout(function(){
  14. function a57(event) {
  15. relPos = c2.getRelPos(RD.pool[c3].getAttr())
  16. , relPosX = relPos.x * j6
  17. , relPosY = relPos.y * j5
  18. , mouseAngle = Math.atan2(relPosY - event.clientY, relPosX - event.clientX) * 180 / Math.PI + 180
  19. , playerAngle = Math.round(mouseAngle + Math.asin(18 / Math.sqrt(Math.pow(relPosX - event.clientX, 2) + Math.pow(relPosY - event.clientY, 2))) * 180 / Math.PI)
  20. , console.log(mouseAngle, playerAngle);
  21. j16 = [Math.round(relPosX - event.clientX), Math.round(relPosY - event.clientY), Math.round(mouseAngle)],
  22. RD.pool[c3].playerAngle = playerAngle;
  23. };
  24. addJS_Node (a57);
  25.  
  26.  
  27. RD.prototype.applyPrimaryUpdate = function(idk) {
  28. if (!this['activated'])
  29. return;
  30. this.x = parseFloat(idk.x / 10),
  31. this.y = parseFloat(idk.y / 10),
  32. idk['id'] != c3 && (this['playerAngle'] = parseInt(idk.playerAngle));
  33. }
  34. }, 1000)
  35.  
  36.  
  37. function addJS_Node (text, s_URL, funcToRun, runOnLoad) { //used to add the edited functions to the code
  38. var D = document;
  39. var scriptNode = D.createElement ('script');
  40. if (runOnLoad) {
  41. scriptNode.addEventListener ("load", runOnLoad, false);
  42. }
  43. scriptNode.type = "text/javascript";
  44. if (text) scriptNode.textContent = text;
  45. if (s_URL) scriptNode.src = s_URL;
  46. if (funcToRun) scriptNode.textContent = '(' + funcToRun.toString() + ')()';
  47.  
  48. var targ = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
  49. targ.appendChild (scriptNode);
  50. }
  51.  
  52. })();