The West - Enhanced Fort Arrow

Enhanced Fort Arrow for The-West browser game

目前为 2021-02-22 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name The West - Enhanced Fort Arrow
  3. // @name:pt-BR The West - Seta de forte melhorada
  4. // @version 0.02
  5. // @author Venozmat
  6. // @include http://*.the-west.*/game.php*
  7. // @include https://*.the-west.*/game.php*
  8. // @include http://*.tw.innogames.*/game.php*
  9. // @include https://*.tw.innogames.*/game.php*
  10. // @grant none
  11. // @description Enhanced Fort Arrow for The-West browser game
  12. // @description:pt-br Seta de forte melhorada para o jogo de navegador The-West
  13. // @namespace https://gf.qytechs.cn/users/729559
  14. // ==/UserScript==
  15. var tilewidth = 15,
  16. tileheight = 15;
  17. var guestId = 0xFFF;
  18. var charclasses = {
  19. '-1': 'greenhorn',
  20. '0': 'adventurer',
  21. '1': 'duelist',
  22. '2': 'worker',
  23. '3': 'soldier'
  24. };
  25. FortBattleWindow.drawArrow = function(g, character) {
  26. if (character.dead || character.position === character.destinycell) return;
  27. var posXY = this.toxy(character.position);
  28. var targetXY = this.toxy(character.destinycell);
  29. var x = posXY[0] * tilewidth;
  30. var y = posXY[1] * tileheight;
  31. var tx = (targetXY[0] + .5) * tilewidth;
  32. var ty = (targetXY[1] + .5) * tileheight;
  33. x += tilewidth * .5;
  34. y += tileheight * .5;
  35. var dx = tx - x;
  36. var dy = ty - y;
  37. var len = Math.sqrt(dx * dx + dy * dy);
  38. dx /= len;
  39. dy /= len;
  40. var gradient = g.createLinearGradient(tx, ty, x - dy * tilewidth * .0 + dx * tilewidth * .5, y + dx * tileheight * .0 + dy * tileheight * .5);
  41. gradient.addColorStop(0, 'rgba(0, 0, 0, 0.9)');
  42. gradient.addColorStop(1, 'rgba(0, 0, 0, 0.4)');
  43. g.fillStyle = gradient;
  44. g.strokeStyle = '#000000';
  45. g.beginPath();
  46. g.moveTo(tx, ty);
  47. g.lineTo(tx - dx * tilewidth * 1 + dy * tilewidth * .5, ty - dy * tileheight * 1 - dx * tileheight * .5);
  48. g.lineTo(x + dy * tilewidth * .3 + dx * tilewidth * .25, y - dx * tileheight * .3 + dy * tileheight * .25);
  49. g.lineTo(x - dy * tilewidth * .0 + dx * tilewidth * .5, y + dx * tileheight * .0 + dy * tileheight * .5);
  50. g.lineTo(x - dy * tilewidth * .3 + dx * tilewidth * .25, y + dx * tileheight * .3 + dy * tileheight * .25);
  51. g.lineTo(tx - dx * tilewidth * 1 - dy * tilewidth * .5, ty - dy * tileheight * 1 + dx * tileheight * .5);
  52. g.closePath();
  53. g.fill();
  54. g.stroke();
  55. };
  56. FortBattleWindow.setSwapState = function(swapState) {
  57. if (swapState) document.querySelectorAll(".battleground_thick_arrow")[0].style.filter = "invert(1)";
  58. else document.querySelectorAll(".battleground_thick_arrow")[0].style.filter = "";
  59. };

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址