Nipirus Script

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 42

// ==UserScript==

// @name NipirusScript [ glar.io ]


// @namespace -
// @version 0.1
// @description test
// @author Nudo#7346
// @match *://glar.io/*
// @match *://*.glar.io/*
// @icon
data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @run-at document-start
// ==/UserScript==

/******/ (() => { // webpackBootstrap


/******/ "use strict";
/******/ var __webpack_modules__ = ({

/***/ "./src/modules/buildingMarkers/main.js":
/*!*********************************************!*\
!*** ./src/modules/buildingMarkers/main.js ***!
\*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _canvas__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @canvas */ "./src/modules/canvas/main.js");
/* harmony import */ var _entityManager__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @entityManager */ "./src/modules/managers/entities.js");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_3__ =
__webpack_require__(/*! ./settings */
"./src/modules/buildingMarkers/settings.json");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ =
__webpack_require__(/*! @config */ "./src/config.json");
/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_5__ =
__webpack_require__(/*! @colors */ "./src/colors.json");

class BuildingMarkers {
constructor() {
this.filter = (entity) => entity.components.sprite &&
_settings__WEBPACK_IMPORTED_MODULE_3__.types[entity.components.sprite.sprite.key]
}

update() {
if (!_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world) return void 0

if (!_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source) return
void 0
if (!_config__WEBPACK_IMPORTED_MODULE_4__.togglers.buildingMarkers ||
_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source.gameState !== 1) return
void 0

const entities =
_entityManager__WEBPACK_IMPORTED_MODULE_1__["default"].entities.filter((entity) =>
this.filter(entity))

for (const entity of entities) {


if (!entity.components.sprite) continue

const entityX = entity.components.sprite.sprite.worldPosition.x


const entityY = entity.components.sprite.sprite.worldPosition.y
let color = _colors__WEBPACK_IMPORTED_MODULE_5__.entities.atlases_feet

if (entity.parentId ===
_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source.id) {
color = _colors__WEBPACK_IMPORTED_MODULE_5__.entities.team
}

_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.save()
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.globalAlpha =
_settings__WEBPACK_IMPORTED_MODULE_3__.alpha
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.fillStyle =
color
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.beginPath()
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.arc(entityX,
entityY, _settings__WEBPACK_IMPORTED_MODULE_3__.radius, 0, 2 * Math.PI)
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.fill()
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.restore()

_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.save()
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.globalAlpha =
_settings__WEBPACK_IMPORTED_MODULE_3__.strokeAlpha
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.strokeStyle =
_colors__WEBPACK_IMPORTED_MODULE_5__.darkOutline
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.lineWidth =
_settings__WEBPACK_IMPORTED_MODULE_3__.lineWidth
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.beginPath()
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.arc(entityX,
entityY, _settings__WEBPACK_IMPORTED_MODULE_3__.radius, 0, 2 * Math.PI)
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.stroke()
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.restore()
}
}

init() {
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].addAnimationCallback(() =>
{
this.update()
})
}
}

const buildingMarkers = new BuildingMarkers()

window.buildingMarkers = buildingMarkers
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (buildingMarkers);

/***/ }),

/***/ "./src/modules/canvas/Canvas.js":
/*!**************************************!*\
!*** ./src/modules/canvas/Canvas.js ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @utils */ "./src/utils/common.js");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @config */ "./src/config.json");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");

class Canvas {
constructor() {
this.width = 0
this.height = 0

this.source
this.context

this.animationCallbacks = {}
}

setStyle(type, value) {
this.source.style[type] = value

if (type === "width" || type === "height") {


this.source.style[type] = `${value}px`
}
}

resize() {
this.width = window.innerWidth
this.height = window.innerHeight

this.source.width = this.width
this.source.height = this.height

this.setStyle("width", this.width)
this.setStyle("height", this.height)

this.setStyle("position", "absolute")
this.setStyle("top", "0")

this.setStyle("pointerEvents", "none")

this.setStyle("zIndex", "999999")
}

create() {
this.source =
_utils__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("canvas",
_config__WEBPACK_IMPORTED_MODULE_1__.canvas.id)

this.context = this.source.getContext('2d')

this.resize()
}

addAnimationCallback(callback) {

this.animationCallbacks[_utils__WEBPACK_IMPORTED_MODULE_0__["default"].randomId] =
callback
}

updater() {
requestAnimationFrame(() => {
this.updater()
})

if (!_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world) return void 0

this.context.clearRect(0, 0, this.width, this.height)

for (const id in this.animationCallbacks) {


const callback = this.animationCallbacks[id]

callback()
}
}

init() {
this.create()

_utils__WEBPACK_IMPORTED_MODULE_0__["default"].addEvent(window, "resize",
() => {
this.resize()
})

this.updater()
}
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Canvas);

/***/ }),

/***/ "./src/modules/canvas/main.js":
/*!************************************!*\
!*** ./src/modules/canvas/main.js ***!
\************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Canvas__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./Canvas */ "./src/modules/canvas/Canvas.js");

const canvas = new _Canvas__WEBPACK_IMPORTED_MODULE_0__["default"]()

window.canvas = canvas

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (canvas);

/***/ }),

/***/ "./src/modules/entityMap/Canvas.js":
/*!*****************************************!*\
!*** ./src/modules/entityMap/Canvas.js ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @utils */ "./src/utils/common.js");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @config */ "./src/config.json");
/* harmony import */ var _entityManager__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! @entityManager */ "./src/modules/managers/entities.js");
/* harmony import */ var _myPlayer__WEBPACK_IMPORTED_MODULE_3__ =
__webpack_require__(/*! @myPlayer */ "./src/modules/myPlayer/main.js");
/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_4__ =
__webpack_require__(/*! @colors */ "./src/colors.json");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_5__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");

class Canvas {
constructor() {
this.width = 0
this.height = 0

this.source
this.context
}

setStyle(type, value) {
this.source.style[type] = value

if (type === "width" || type === "height" || type === "left" || type ===
"right" || type === "bottom" || type === "top") {
this.source.style[type] = `${value}px`
}
}
create() {
this.source =
_utils__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("canvas",
_config__WEBPACK_IMPORTED_MODULE_1__.map.id)

this.context = this.source.getContext('2d')

this.width = _config__WEBPACK_IMPORTED_MODULE_1__.map.innerWidth
this.height = _config__WEBPACK_IMPORTED_MODULE_1__.map.innerHeight

this.source.width = this.width
this.source.height = this.height

this.setStyle("width", _config__WEBPACK_IMPORTED_MODULE_1__.map.width)
this.setStyle("height", _config__WEBPACK_IMPORTED_MODULE_1__.map.height)

this.setStyle("position", "absolute")
this.setStyle("right", _config__WEBPACK_IMPORTED_MODULE_1__.map.right)
this.setStyle("bottom", _config__WEBPACK_IMPORTED_MODULE_1__.map.bottom)

this.setStyle("pointerEvents", "none")

this.setStyle("display",
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.minimap ? "block" : "none")
}

updater() {
requestAnimationFrame(() => {
this.updater()
})

if (!_hooks__WEBPACK_IMPORTED_MODULE_5__["default"].world) return void 0

this.context.clearRect(0, 0, this.width, this.height)

this.context.save()
this.context.globalAlpha = _config__WEBPACK_IMPORTED_MODULE_1__.map.alpha
this.context.fillStyle =
_config__WEBPACK_IMPORTED_MODULE_1__.map.background
this.context.fillRect(0, 0, this.width, this.height)
this.context.restore()

if (!
_entityManager__WEBPACK_IMPORTED_MODULE_2__["default"].entities.length) return void
0

let entities =
_entityManager__WEBPACK_IMPORTED_MODULE_2__["default"].entities.filter((entity) =>
entity.id !== _hooks__WEBPACK_IMPORTED_MODULE_5__["default"].world.source.id
&&
Math.abs(_entityManager__WEBPACK_IMPORTED_MODULE_2__["default"].getX(entity.id) -
_myPlayer__WEBPACK_IMPORTED_MODULE_3__["default"].x) <
_config__WEBPACK_IMPORTED_MODULE_1__.map.targetRadius.x
&&
Math.abs(_entityManager__WEBPACK_IMPORTED_MODULE_2__["default"].getY(entity.id) -
_myPlayer__WEBPACK_IMPORTED_MODULE_3__["default"].y) <
_config__WEBPACK_IMPORTED_MODULE_1__.map.targetRadius.y)
const pointWidth = _config__WEBPACK_IMPORTED_MODULE_1__.map.point.width
const pointHeight = _config__WEBPACK_IMPORTED_MODULE_1__.map.point.height

for (const entity of entities) {


if (!entity.components.sprite || !
entity.components.sprite.hasOwnProperty("sprite")) continue

const cw = this.width / 2
const cy = this.height / 2
const angle =
Math.atan2(_entityManager__WEBPACK_IMPORTED_MODULE_2__["default"].getY(entity.id) -
_myPlayer__WEBPACK_IMPORTED_MODULE_3__["default"].y,
_entityManager__WEBPACK_IMPORTED_MODULE_2__["default"].getX(entity.id) -
_myPlayer__WEBPACK_IMPORTED_MODULE_3__["default"].x)
const distance =
_utils__WEBPACK_IMPORTED_MODULE_0__["default"].getDistance(_myPlayer__WEBPACK_IMPOR
TED_MODULE_3__["default"], {
x:
_entityManager__WEBPACK_IMPORTED_MODULE_2__["default"].getX(entity.id),
y:
_entityManager__WEBPACK_IMPORTED_MODULE_2__["default"].getY(entity.id)
})
const entityX = cw + distance * Math.cos(angle)
const entityY = cy + distance * Math.sin(angle)

let key = entity.components.sprite.sprite.key


let color = _colors__WEBPACK_IMPORTED_MODULE_4__.entities[key]

if (entity.components.teamcomponent &&
_hooks__WEBPACK_IMPORTED_MODULE_5__["default"].world.source.teamId !== -1) {
if (entity.components.teamcomponent.teamId ===
_myPlayer__WEBPACK_IMPORTED_MODULE_3__["default"].fullData.source.components.teamId
&& color === _colors__WEBPACK_IMPORTED_MODULE_4__.entities.atlases_feet) {
color = _colors__WEBPACK_IMPORTED_MODULE_4__.entities.team
}
}

this.context.save()
this.context.fillStyle = color || "rgba(0, 0, 0, 0)"
this.context.fillRect(entityX - pointWidth / 2, entityY - pointHeight /
2, pointWidth, pointHeight)
this.context.restore()
}

this.context.save()
this.context.fillStyle = "#c8cbc9"
this.context.fillRect(this.width / 2 - pointWidth / 2, this.height / 2 -
pointHeight / 2, pointWidth, pointHeight)
this.context.restore()
}

init() {
this.create()
this.updater()
}
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Canvas);


/***/ }),

/***/ "./src/modules/entityMap/main.js":
/*!***************************************!*\
!*** ./src/modules/entityMap/main.js ***!
\***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Canvas__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./Canvas */ "./src/modules/entityMap/Canvas.js");

const entityMap = new _Canvas__WEBPACK_IMPORTED_MODULE_0__["default"]()

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (entityMap);

/***/ }),

/***/ "./src/modules/fastPlace/box2x2.js":
/*!*****************************************!*\
!*** ./src/modules/fastPlace/box2x2.js ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ box3x3)
/* harmony export */ });
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");
/* harmony import */ var _myPlayer__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @myPlayer */ "./src/modules/myPlayer/main.js");

function place(offsetX = 0, offsetY = 0) {


const service =
_hooks__WEBPACK_IMPORTED_MODULE_0__["default"].world.source.services.services[7]
const currentId = service.currentBuildingId
const currentPosition = service.currentBuildingPosition

const boxSize = 64

_myPlayer__WEBPACK_IMPORTED_MODULE_1__["default"].socket.send(5, {
buildingType: currentId,
x: currentPosition.x + boxSize * offsetX,
y: currentPosition.y + boxSize * offsetY
})

service.cancelBuild()
}

function box3x3() {
setTimeout(() => {
place(-1, -1)
setTimeout(() => {
place(0, 1)

setTimeout(() => {
place(2, 0)

setTimeout(() => {
place(2, -1)

setTimeout(() => {
place(1, -2)

setTimeout(() => {
place(1, 1)

setTimeout(() => {
place(0, -2)

setTimeout(() => {
place(-1, 0)
}, 250)
}, 125)
}, 125)
}, 125)
}, 125)
}, 125)
}, 125)
}, 125)
}

/***/ }),

/***/ "./src/modules/fastPlace/main.js":
/*!***************************************!*\
!*** ./src/modules/fastPlace/main.js ***!
\***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ fastBuilding)
/* harmony export */ });
/* harmony import */ var _box2x2__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./box2x2 */ "./src/modules/fastPlace/box2x2.js");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");

function fastBuilding() {
document.addEventListener("keyup", (event) => {
if (!_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world) return void 0

if (document.querySelector(".speechbubble")) return void 0

if (event.code === "KeyE") {


(0,_box2x2__WEBPACK_IMPORTED_MODULE_0__["default"])()
}
})
}

/***/ }),

/***/ "./src/modules/freecam/init.js":
/*!*************************************!*\
!*** ./src/modules/freecam/init.js ***!
\*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ initFreecam)
/* harmony export */ });
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @config */ "./src/config.json");
/* harmony import */ var _canvas__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @canvas */ "./src/modules/canvas/main.js");
/* harmony import */ var _main__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! ./main */ "./src/modules/freecam/main.js");
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_3__ =
__webpack_require__(/*! ./settings */ "./src/modules/freecam/settings.json");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_4__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");

function initFreecam() {
_canvas__WEBPACK_IMPORTED_MODULE_1__["default"].addAnimationCallback(() => {
if (!_hooks__WEBPACK_IMPORTED_MODULE_4__["default"].world) return void 0

if (!_hooks__WEBPACK_IMPORTED_MODULE_4__["default"].world.source) return
void 0

if (_hooks__WEBPACK_IMPORTED_MODULE_4__["default"].world.source.gameState !
== 1) {
_config__WEBPACK_IMPORTED_MODULE_0__.togglers.freecam = false

return void 0
}

if (_config__WEBPACK_IMPORTED_MODULE_0__.togglers.freecam) {
if (!_settings__WEBPACK_IMPORTED_MODULE_3__.isUnfollowed) {

_hooks__WEBPACK_IMPORTED_MODULE_4__["default"].world.source.camera.unfollow()
}

(0,_main__WEBPACK_IMPORTED_MODULE_2__["default"])()
} else {
if (_settings__WEBPACK_IMPORTED_MODULE_3__.isUnfollowed) return void 0

_hooks__WEBPACK_IMPORTED_MODULE_4__["default"].world.source.camera.follow(_hooks__W
EBPACK_IMPORTED_MODULE_4__["default"].world.source.assignedObject.components.sprite
.sprite, Phaser.Camera.FOLLOW_LOCKON, .1, .1)
}
})
}

/***/ }),

/***/ "./src/modules/freecam/main.js":
/*!*************************************!*\
!*** ./src/modules/freecam/main.js ***!
\*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ freecam)
/* harmony export */ });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @utils */ "./src/utils/common.js");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! ./settings */ "./src/modules/freecam/settings.json");

function freecam() {
if (_utils__WEBPACK_IMPORTED_MODULE_0__["default"].keys.KeyA) {
_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera.view.x -
= _settings__WEBPACK_IMPORTED_MODULE_2__.speed

_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera._targetPosition.
x -= _settings__WEBPACK_IMPORTED_MODULE_2__.speed
_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera.x -=
_settings__WEBPACK_IMPORTED_MODULE_2__.speed
}

if (_utils__WEBPACK_IMPORTED_MODULE_0__["default"].keys.KeyD) {
_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera.view.x
+= _settings__WEBPACK_IMPORTED_MODULE_2__.speed

_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera._targetPosition.
x += _settings__WEBPACK_IMPORTED_MODULE_2__.speed
_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera.x +=
_settings__WEBPACK_IMPORTED_MODULE_2__.speed
}

if (_utils__WEBPACK_IMPORTED_MODULE_0__["default"].keys.KeyW) {
_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera.view.y -
= _settings__WEBPACK_IMPORTED_MODULE_2__.speed

_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera._targetPosition.
y -= _settings__WEBPACK_IMPORTED_MODULE_2__.speed
_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera.y -=
_settings__WEBPACK_IMPORTED_MODULE_2__.speed
}

if (_utils__WEBPACK_IMPORTED_MODULE_0__["default"].keys.KeyS) {
_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera.view.y
+= _settings__WEBPACK_IMPORTED_MODULE_2__.speed

_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera._targetPosition.
y += _settings__WEBPACK_IMPORTED_MODULE_2__.speed
_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera.y +=
_settings__WEBPACK_IMPORTED_MODULE_2__.speed
}

_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.assignedObject.componen
ts.transform.position.x =
_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera.view.x - 467

_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.assignedObject.componen
ts.transform.position.y =
_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.camera.view.y - 388
}

/***/ }),

/***/ "./src/modules/hatSwitcher/main.js":
/*!*****************************************!*\
!*** ./src/modules/hatSwitcher/main.js ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./settings */ "./src/modules/hatSwitcher/settings.json");
/* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! ./switch */ "./src/modules/hatSwitcher/switch.js");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");

class HatSwitcher {
constructor() {

ShiftLeft() {
(0,_switch__WEBPACK_IMPORTED_MODULE_1__["default"])
(_settings__WEBPACK_IMPORTED_MODULE_0__.hats.booster)
}

KeyR() {
(0,_switch__WEBPACK_IMPORTED_MODULE_1__["default"])
(_settings__WEBPACK_IMPORTED_MODULE_0__.hats.viking)
}

KeyQ() {
(0,_switch__WEBPACK_IMPORTED_MODULE_1__["default"])
(_settings__WEBPACK_IMPORTED_MODULE_0__.hats.cowboy)
}
KeyG() {
(0,_switch__WEBPACK_IMPORTED_MODULE_1__["default"])
(_settings__WEBPACK_IMPORTED_MODULE_0__.hats.tank)
}

KeyV() {
(0,_switch__WEBPACK_IMPORTED_MODULE_1__["default"])
(_settings__WEBPACK_IMPORTED_MODULE_0__.hats.whitebear)
}

KeyJ() {
(0,_switch__WEBPACK_IMPORTED_MODULE_1__["default"])
(_settings__WEBPACK_IMPORTED_MODULE_0__.hats.chicken)
}

KeyY() {
(0,_switch__WEBPACK_IMPORTED_MODULE_1__["default"])
(_settings__WEBPACK_IMPORTED_MODULE_0__.hats.hockey)
}

init() {
document.addEventListener("keydown", (event) => {
if (!_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world) return void
0

if (!this[event.code] || document.querySelector(".speechbubble"))
return void 0

this[event.code]()
})
}
}

const hatSwitcher = new HatSwitcher()

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hatSwitcher);

/***/ }),

/***/ "./src/modules/hatSwitcher/switch.js":
/*!*******************************************!*\
!*** ./src/modules/hatSwitcher/switch.js ***!
\*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ switchHat)
/* harmony export */ });
/* harmony import */ var _myPlayer__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @myPlayer */ "./src/modules/myPlayer/main.js");

function switchHat(id) {
if
(_myPlayer__WEBPACK_IMPORTED_MODULE_0__["default"].fullData.source.components.hat.h
atId !== id)
_myPlayer__WEBPACK_IMPORTED_MODULE_0__["default"].socket.send(48, {
hatType: id
})
}

/***/ }),

/***/ "./src/modules/hooks/Game.js":
/*!***********************************!*\
!*** ./src/modules/hooks/Game.js ***!
\***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
class Game {
constructor(key, value) {
this.key = key

this.source = value
}

get isDefined() {
return Boolean(this.source)
}
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Game);

/***/ }),

/***/ "./src/modules/hooks/ObjectList.js":
/*!*****************************************!*\
!*** ./src/modules/hooks/ObjectList.js ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
class ObjectList {
constructor(key) {
this.key = key

this.source
}

get isDefined() {
return Boolean(this.source)
}

init(Utils, callback) {
Utils.createHook(Object.prototype, "objectList", (_this, symbol, value) =>
{
_this[symbol] = value
this.source = value

callback(value)
})
}
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ObjectList);

/***/ }),

/***/ "./src/modules/hooks/Protocol.js":
/*!***************************************!*\
!*** ./src/modules/hooks/Protocol.js ***!
\***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
class Protocol {
constructor(key, value) {
this.key = key

this.source = value
}

get isDefined() {
return Boolean(this.source)
}
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Protocol);

/***/ }),

/***/ "./src/modules/hooks/ScaleManager.js":
/*!*******************************************!*\
!*** ./src/modules/hooks/ScaleManager.js ***!
\*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
class ScaleManager {
constructor(key, value) {
this.key = key

this.source = value
}

get isDefined() {
return Boolean(this.source)
}
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ScaleManager);

/***/ }),

/***/ "./src/modules/hooks/World.js":
/*!************************************!*\
!*** ./src/modules/hooks/World.js ***!
\************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
class World {
constructor(key) {
this.key = key

this.source
}

get isDefined() {
return Boolean(this.source)
}

init(Utils, callback) {
Utils.createHook(Object.prototype, "world", (_this, symbol, value) => {
_this[symbol] = value

if (!value || !value.socket) return void 0

this.source = value

callback(value)
})
}
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (World);

/***/ }),

/***/ "./src/modules/hooks/main.js":
/*!***********************************!*\
!*** ./src/modules/hooks/main.js ***!
\***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _World__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./World */ "./src/modules/hooks/World.js");
/* harmony import */ var _ObjectList__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! ./ObjectList */ "./src/modules/hooks/ObjectList.js");
/* harmony import */ var _Protocol__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! ./Protocol */ "./src/modules/hooks/Protocol.js");
/* harmony import */ var _ScaleManager__WEBPACK_IMPORTED_MODULE_3__ =
__webpack_require__(/*! ./ScaleManager */ "./src/modules/hooks/ScaleManager.js");
/* harmony import */ var _Game__WEBPACK_IMPORTED_MODULE_4__ =
__webpack_require__(/*! ./Game */ "./src/modules/hooks/Game.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ =
__webpack_require__(/*! @utils */ "./src/utils/common.js");
/* harmony import */ var _myPlayer__WEBPACK_IMPORTED_MODULE_6__ =
__webpack_require__(/*! @myPlayer */ "./src/modules/myPlayer/main.js");
/* harmony import */ var _entityManager__WEBPACK_IMPORTED_MODULE_7__ =
__webpack_require__(/*! @entityManager */ "./src/modules/managers/entities.js");

class Hooks {
constructor() {
this.toAdd = {
"world": [ _World__WEBPACK_IMPORTED_MODULE_0__["default"], (() =>
_myPlayer__WEBPACK_IMPORTED_MODULE_6__["default"].init()) ],
"objectList": [ _ObjectList__WEBPACK_IMPORTED_MODULE_1__["default"],
((entities) =>
_entityManager__WEBPACK_IMPORTED_MODULE_7__["default"].update(entities)) ],
}
}

add(key, Hook, callback) {


this[key] = new Hook(key)

this[key].init(_utils__WEBPACK_IMPORTED_MODULE_5__["default"], callback)
}

has(key) {
return Boolean(this[key])
}

get(key) {
return this[key]
}

set(key, Hook, value) {


this[key] = new Hook(key, value)
}

remove(key) {
delete this[key]
}

init() {
for (const key in this.toAdd) {
hooks.add(key, this.toAdd[key][0], this.toAdd[key][1])
}
}
}
const hooks = new Hooks()

window.hooks = hooks

_utils__WEBPACK_IMPORTED_MODULE_5__["default"].createHook(Object.prototype,
"Protocol", (_this, symbol, value) => {
_this[symbol] = value

hooks.set("protocol", _Protocol__WEBPACK_IMPORTED_MODULE_2__["default"], value)


})

_utils__WEBPACK_IMPORTED_MODULE_5__["default"].createHook(Object.prototype,
"ScaleManager", (_this, symbol, value) => {
_this[symbol] = value

hooks.set("game", _Game__WEBPACK_IMPORTED_MODULE_4__["default"], _this)

hooks.set("scaleManager",
_ScaleManager__WEBPACK_IMPORTED_MODULE_3__["default"], value)
})

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hooks);

/***/ }),

/***/ "./src/modules/managers/entities.js":
/*!******************************************!*\
!*** ./src/modules/managers/entities.js ***!
\******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");

class EntityManager {
constructor() {
this.player = []

this.bots = []

this.animals = []

this.pickUp = []

this.cars = []

this.entities = []
}

has(id) {
return Boolean(this.entities.filter((entity) => entity.id === id)[0])
}

getEntityById(id) {
if (!this.has(id)) return {}

return this.entities.filter((entity) => entity.id === id)[0]


}

getX(id) {
if (!this.has(id)) return -99999

const entity = this.getEntityById(id)

return entity.components.transform.position.x
}

getY(id) {
if (!this.has(id)) return -99999

const entity = this.getEntityById(id)

return entity.components.transform.position.y
}

update() {
if (!_hooks__WEBPACK_IMPORTED_MODULE_0__["default"].world) return void 0

this.entities =
Object.values(_hooks__WEBPACK_IMPORTED_MODULE_0__["default"].objectList.source)
}
}

const entityManager = new EntityManager()

window.entityManager = entityManager

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (entityManager);

/***/ }),

/***/ "./src/modules/menu/addToggler.js":
/*!****************************************!*\
!*** ./src/modules/menu/addToggler.js ***!
\****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ addToggler)
/* harmony export */ });
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./settings */ "./src/modules/menu/settings.json");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @utils */ "./src/utils/common.js");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! @config */ "./src/config.json");

const elements = _settings__WEBPACK_IMPORTED_MODULE_0__.menu


function addToggler(name, active, callback) {
const contentMenu = document.getElementById(elements.container.id)

let toggleBtnId = elements.toggleBtn.id


toggleBtnId = toggleBtnId.replace(/\[id\]/,
_utils__WEBPACK_IMPORTED_MODULE_1__["default"].randomId.toString())

let toggleId = elements.toggleName.id


toggleId = toggleId.replace(/\[name\]/, name)

contentMenu.innerHTML += `
<${elements.item.tag} id="${elements.item.id}">
<${elements.toggleBtn.tag} class="${elements.toggleBtn.class}" id="$
{toggleBtnId}">${elements.toggleBtn.active[active]}</${elements.toggleBtn.tag}>
<${elements.toggleName.tag} class="${elements.toggleName.class}" id="$
{toggleId}">${name}</${elements.toggleName.tag}>
</${elements.item.tag}>
`

let toggleActive = active

contentMenu.addEventListener("click", (event) => {


const id = event.target.id

if (id === toggleBtnId) {


toggleActive = !toggleActive

event.target.textContent = elements.toggleBtn.active[toggleActive]

callback(event)

localStorage.setItem(_config__WEBPACK_IMPORTED_MODULE_2__.localStoragename,
JSON.stringify(_config__WEBPACK_IMPORTED_MODULE_2__.togglers))
}
})
}

/***/ }),

/***/ "./src/modules/menu/control.js":
/*!*************************************!*\
!*** ./src/modules/menu/control.js ***!
\*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ addTogglers)
/* harmony export */ });
/* harmony import */ var _addToggler__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./addToggler */ "./src/modules/menu/addToggler.js");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @config */ "./src/config.json");

function addTogglers() {
(0,_addToggler__WEBPACK_IMPORTED_MODULE_0__["default"])("EntitiesMinimap",
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.minimap, () => {
const minimap =
document.getElementById(_config__WEBPACK_IMPORTED_MODULE_1__.map.id)
const display = minimap.style.display

minimap.style.display = display !== "block" ? "block" : "none"

_config__WEBPACK_IMPORTED_MODULE_1__.togglers.minimap = !
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.minimap
})

;(0,_addToggler__WEBPACK_IMPORTED_MODULE_0__["default"])("Tracers",
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.tracers, () => {
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.tracers = !
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.tracers
})

;(0,_addToggler__WEBPACK_IMPORTED_MODULE_0__["default"])("WeaponRange",
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.weaponRange, () => {
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.weaponRange = !
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.weaponRange
})

;(0,_addToggler__WEBPACK_IMPORTED_MODULE_0__["default"])("BuildingMarkers",
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.buildingMarkers, () => {
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.buildingMarkers = !
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.buildingMarkers
})

;(0,_addToggler__WEBPACK_IMPORTED_MODULE_0__["default"])("AutoRespawn",
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.autoRespawn, () => {
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.autoRespawn = !
_config__WEBPACK_IMPORTED_MODULE_1__.togglers.autoRespawn
})
}

/***/ }),

/***/ "./src/modules/menu/css.js":
/*!*********************************!*\
!*** ./src/modules/menu/css.js ***!
\*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ css)
/* harmony export */ });
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./settings */ "./src/modules/menu/settings.json");

function getPropStyles(element) {
let result = ""

for (const key in element.style) {


result += `${key}:${element.style[key]};`
}
return result
}

function getStyles(styleObject) {
let result = ""

for (const key in _settings__WEBPACK_IMPORTED_MODULE_0__.menu) {


if (_settings__WEBPACK_IMPORTED_MODULE_0__.menu[key].class) {
result += `\n.${_settings__WEBPACK_IMPORTED_MODULE_0__.menu[key].class}
{ ${getPropStyles(_settings__WEBPACK_IMPORTED_MODULE_0__.menu[key])} }`

continue
}

result += `\n#${_settings__WEBPACK_IMPORTED_MODULE_0__.menu[key].id} { $
{getPropStyles(_settings__WEBPACK_IMPORTED_MODULE_0__.menu[key])} }`
}

return result
}

function css() {
const style = document.createElement("style")

style.innerHTML = getStyles()

document.querySelector(_settings__WEBPACK_IMPORTED_MODULE_0__.openTo).appendChild(s
tyle)
}

/***/ }),

/***/ "./src/modules/menu/html.js":
/*!**********************************!*\
!*** ./src/modules/menu/html.js ***!
\**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ html)
/* harmony export */ });
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./settings */ "./src/modules/menu/settings.json");

const elements = _settings__WEBPACK_IMPORTED_MODULE_0__.menu

function html() {
const html = document.createElement("div")

html.innerHTML = `
<${elements.holder.tag} id="${elements.holder.id}" style="display: $
{elements.holder.style.display}">
<${elements.wrapper.tag} id="${elements.wrapper.id}">
<${elements.header.tag} id="${elements.header.id}">Settings</$
{elements.header.tag}>
<${elements.closeBtn.tag} id="${elements.closeBtn.id}">$
{elements.closeBtn.content}</${elements.closeBtn.tag}>
<${elements.container.tag} id="${elements.container.id}">

</${elements.container.tag}>
</${elements.wrapper.tag}>
</${elements.holder.tag}>
`

document.querySelector(_settings__WEBPACK_IMPORTED_MODULE_0__.openTo).appendChild(h
tml)
}

/***/ }),

/***/ "./src/modules/menu/openButton.js":
/*!****************************************!*\
!*** ./src/modules/menu/openButton.js ***!
\****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ openButton)
/* harmony export */ });
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./settings */ "./src/modules/menu/settings.json");

function openButton() {
const topPanel = document.getElementById("top-panel")

topPanel.style.width = "auto"

const btn = document.createElement("div")

btn.classList.add("item")
btn.id = _settings__WEBPACK_IMPORTED_MODULE_0__.openButton.id

btn.style.marginLeft = "5px"

btn.innerHTML += `
<img src="${_settings__WEBPACK_IMPORTED_MODULE_0__.openButton.image}">
<div class="hotkey" id="$
{_settings__WEBPACK_IMPORTED_MODULE_0__.openButton.id}:hotkey">$
{_settings__WEBPACK_IMPORTED_MODULE_0__.toggleKey[1]}</div>
`

topPanel.appendChild(btn)
}

/***/ }),

/***/ "./src/modules/menu/setup.js":
/*!***********************************!*\
!*** ./src/modules/menu/setup.js ***!
\***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ setup)
/* harmony export */ });
/* harmony import */ var _openButton__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./openButton */ "./src/modules/menu/openButton.js");
/* harmony import */ var _css__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! ./css */ "./src/modules/menu/css.js");
/* harmony import */ var _html__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! ./html */ "./src/modules/menu/html.js");
/* harmony import */ var _togglers__WEBPACK_IMPORTED_MODULE_3__ =
__webpack_require__(/*! ./togglers */ "./src/modules/menu/togglers.js");
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_4__ =
__webpack_require__(/*! ./control */ "./src/modules/menu/control.js");

function setup() {
(0,_openButton__WEBPACK_IMPORTED_MODULE_0__["default"])()

;(0,_css__WEBPACK_IMPORTED_MODULE_1__["default"])()
;(0,_html__WEBPACK_IMPORTED_MODULE_2__["default"])()

;(0,_togglers__WEBPACK_IMPORTED_MODULE_3__["default"])()

;(0,_control__WEBPACK_IMPORTED_MODULE_4__["default"])()
}

/***/ }),

/***/ "./src/modules/menu/togglers.js":
/*!**************************************!*\
!*** ./src/modules/menu/togglers.js ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ togglers)
/* harmony export */ });
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./settings */ "./src/modules/menu/settings.json");
/* harmony import */ var _myPlayer__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @myPlayer */ "./src/modules/myPlayer/main.js");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ =
__webpack_require__(/*! @config */ "./src/config.json");

function togglers() {
const onClickBtn =
document.getElementById(_settings__WEBPACK_IMPORTED_MODULE_0__.openButton.id)
const onClickCloseBtn =
document.getElementById(_settings__WEBPACK_IMPORTED_MODULE_0__.menu.closeBtn.id)
const menuHolder =
document.getElementById(_settings__WEBPACK_IMPORTED_MODULE_0__.menu.holder.id)

window.addEventListener("keydown", (event) => {


if (event.code === "KeyT" && !document.querySelector(".speechbubble")) {

_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source.services.services[14].t
oggle()
}

if (_settings__WEBPACK_IMPORTED_MODULE_0__.isPressed || event.code !==


_settings__WEBPACK_IMPORTED_MODULE_0__.toggleKey[0]) return void 0

_settings__WEBPACK_IMPORTED_MODULE_0__.active = !
_settings__WEBPACK_IMPORTED_MODULE_0__.active

menuHolder.style.display =
_settings__WEBPACK_IMPORTED_MODULE_0__.displays[_settings__WEBPACK_IMPORTED_MODULE_
0__.active]

_settings__WEBPACK_IMPORTED_MODULE_0__.isPressed = true
})

window.addEventListener("keyup", (event) => {


_settings__WEBPACK_IMPORTED_MODULE_0__.isPressed = false

if (event.code === "KeyU") {


_config__WEBPACK_IMPORTED_MODULE_3__.togglers.freecam = !
_config__WEBPACK_IMPORTED_MODULE_3__.togglers.freecam

_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source.input.keyboard.enabled
= !_config__WEBPACK_IMPORTED_MODULE_3__.togglers.freecam
}
})

onClickBtn.addEventListener("click", () => {
_settings__WEBPACK_IMPORTED_MODULE_0__.active = !
_settings__WEBPACK_IMPORTED_MODULE_0__.active

menuHolder.style.display =
_settings__WEBPACK_IMPORTED_MODULE_0__.displays[_settings__WEBPACK_IMPORTED_MODULE_
0__.active]
})

onClickCloseBtn.addEventListener("click", () => {
_settings__WEBPACK_IMPORTED_MODULE_0__.active = !
_settings__WEBPACK_IMPORTED_MODULE_0__.active

menuHolder.style.display =
_settings__WEBPACK_IMPORTED_MODULE_0__.displays[_settings__WEBPACK_IMPORTED_MODULE_
0__.active]
})

const topPanel = document.getElementById("top-panel")

topPanel.addEventListener("click", (event) => {


if (event.target.id !==
_settings__WEBPACK_IMPORTED_MODULE_0__.openButton.id) return void 0

_settings__WEBPACK_IMPORTED_MODULE_0__.active = false

menuHolder.style.display = "none"
})

const loginBtn = document.getElementById("login-button")

loginBtn.addEventListener("click", (event) => {


if (!_myPlayer__WEBPACK_IMPORTED_MODULE_1__["default"].socket) return void
0

const name = document.cookie.split("=")[3].split(";")[0]

_myPlayer__WEBPACK_IMPORTED_MODULE_1__["default"].socket.send(2, {
name: name,
teamId:
_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source.teamId
})

if (_config__WEBPACK_IMPORTED_MODULE_3__.isJoined) return void 0

setTimeout(() => {
_myPlayer__WEBPACK_IMPORTED_MODULE_1__["default"].socket.send(7, {
message: `/s ${_config__WEBPACK_IMPORTED_MODULE_3__.project.name} >
${name} has joined the game!`
})

_config__WEBPACK_IMPORTED_MODULE_3__.isJoined = true
}, 1000)
})

const leftPanel = document.getElementById("left-panel")

leftPanel.style.left = "18px"
leftPanel.style.top = "114px"

const statsResources = document.getElementById("ui-stats-resources")

statsResources.style.position = "relative"
statsResources.style.left = "5px"
statsResources.style.top = "10px"
}

/***/ }),

/***/ "./src/modules/myPlayer/Socket.js":
/*!****************************************!*\
!*** ./src/modules/myPlayer/Socket.js ***!
\****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _main__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./main */ "./src/modules/myPlayer/main.js");
/* harmony import */ var _determinants_FullData__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! ./determinants/FullData */
"./src/modules/myPlayer/determinants/FullData.js");
/* harmony import */ var _entityManager__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! @entityManager */ "./src/modules/managers/entities.js");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_3__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");
/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_4__ =
__webpack_require__(/*! @menu */ "./src/modules/menu/setup.js");
/* harmony import */ var _menuSettings__WEBPACK_IMPORTED_MODULE_5__ =
__webpack_require__(/*! @menuSettings */ "./src/modules/menu/settings.json");
/* harmony import */ var _showKeys__WEBPACK_IMPORTED_MODULE_6__ =
__webpack_require__(/*! @showKeys */ "./src/modules/showKeys/main.js");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ =
__webpack_require__(/*! @config */ "./src/config.json");

class Socket {
constructor() {
this.source

this.currentDataItem
this.currentDataContent
}

send(item, data) {

this.source.send(_hooks__WEBPACK_IMPORTED_MODULE_3__["default"].protocol.source.enc
ode(item, data))
}

onItem(item, callback) {
if (this.currentDataItem === item) {
callback(this.currentDataContent)
}
}

onMessage(data) {
const topPanelItem = document.querySelector(".item")

if (_config__WEBPACK_IMPORTED_MODULE_7__.togglers.autoRespawn &&
_config__WEBPACK_IMPORTED_MODULE_7__.isJoined && !
_config__WEBPACK_IMPORTED_MODULE_7__.isRespawning) {
if
(_hooks__WEBPACK_IMPORTED_MODULE_3__["default"].world.source.gameState !== 1) {
const name = document.cookie.split("=")[3].split(";")[0]

_config__WEBPACK_IMPORTED_MODULE_7__.isRespawning = true

setTimeout(() => {
_main__WEBPACK_IMPORTED_MODULE_0__["default"].socket.send(2, {
name: name,
teamId:
_hooks__WEBPACK_IMPORTED_MODULE_3__["default"].world.source.teamId
})

_config__WEBPACK_IMPORTED_MODULE_7__.isRespawning = false
}, 1000)
}
}

if (topPanelItem && !_menuSettings__WEBPACK_IMPORTED_MODULE_5__.added) {


(0,_menu__WEBPACK_IMPORTED_MODULE_4__["default"])()
;(0,_showKeys__WEBPACK_IMPORTED_MODULE_6__["default"])()

_menuSettings__WEBPACK_IMPORTED_MODULE_5__.added = true
}

this.currentDataItem = data.type
this.currentDataContent = data.content

_entityManager__WEBPACK_IMPORTED_MODULE_2__["default"].update()

_main__WEBPACK_IMPORTED_MODULE_0__["default"].fullData = new
_determinants_FullData__WEBPACK_IMPORTED_MODULE_1__["default"]()
_main__WEBPACK_IMPORTED_MODULE_0__["default"].fullData.update()

this.onItem(25, (content) => {


const decodedData =
_hooks__WEBPACK_IMPORTED_MODULE_3__["default"].protocol.source.decode(content.messa
ge)

if (!decodedData) return void 0


})

this.onItem(11, (content) => {

})
}

init(socket) {
this.source = socket
}
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Socket);

/***/ }),

/***/ "./src/modules/myPlayer/determinants/FullData.js":
/*!*******************************************************!*\
!*** ./src/modules/myPlayer/determinants/FullData.js ***!
\*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _entityManager__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @entityManager */ "./src/modules/managers/entities.js");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");

class FullData {
constructor() {
this.source
}

update() {
const entities =
_entityManager__WEBPACK_IMPORTED_MODULE_0__["default"].entities

this.source = entities.filter((entity) => entity.id ===


_hooks__WEBPACK_IMPORTED_MODULE_1__["default"].world.source.id)[0]
}
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FullData);

/***/ }),

/***/ "./src/modules/myPlayer/main.js":
/*!**************************************!*\
!*** ./src/modules/myPlayer/main.js ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");
/* harmony import */ var _Socket__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! ./Socket */ "./src/modules/myPlayer/Socket.js");

class MyPlayer {
constructor() {
this.isInitialized = false
this.socket = new _Socket__WEBPACK_IMPORTED_MODULE_1__["default"]()
this.fullData = {}
}

get x() {
if (!this.fullData.source) return -99999

return this.fullData.source.components.transform.position.x
}

get y() {
if (!this.fullData.source) return -99999

return this.fullData.source.components.transform.position.y
}
get screenX() {
if (!this.fullData.source) return -99999

return this.fullData.source.components.sprite.sprite.worldPosition.x
}

get screenY() {
if (!this.fullData.source) return -99999

return this.fullData.source.components.sprite.sprite.worldPosition.y
}

init() {
if (this.isInitialized) return void 0

if (_hooks__WEBPACK_IMPORTED_MODULE_0__["default"].has("world")) {
if (!_hooks__WEBPACK_IMPORTED_MODULE_0__["default"].world.isDefined)
return void 0

this.socket.init(_hooks__WEBPACK_IMPORTED_MODULE_0__["default"].world.source.socket
.websocket)

if (_hooks__WEBPACK_IMPORTED_MODULE_0__["default"].has("protocol")) {
this.socket.source.addEventListener("message", (event) => {
if (!
_hooks__WEBPACK_IMPORTED_MODULE_0__["default"].protocol.isDefined) return void 0

const data = new Uint8Array(event.data)


const decodedData =
_hooks__WEBPACK_IMPORTED_MODULE_0__["default"].protocol.source.decode(data)

this.socket.onMessage(decodedData)
})
}

this.isInitialized = true
}
}
}

const myPlayer = new MyPlayer()

window.myPlayer = myPlayer

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (myPlayer);

/***/ }),

/***/ "./src/modules/setup.js":
/*!******************************!*\
!*** ./src/modules/setup.js ***!
\******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ setup)
/* harmony export */ });
/* harmony import */ var _canvas__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @canvas */ "./src/modules/canvas/main.js");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @config */ "./src/config.json");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! @utils */ "./src/utils/common.js");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_3__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");
/* harmony import */ var _entityMap__WEBPACK_IMPORTED_MODULE_4__ =
__webpack_require__(/*! @entityMap */ "./src/modules/entityMap/main.js");
/* harmony import */ var _tracers__WEBPACK_IMPORTED_MODULE_5__ =
__webpack_require__(/*! @tracers */ "./src/modules/tracers/main.js");
/* harmony import */ var _weaponRange__WEBPACK_IMPORTED_MODULE_6__ =
__webpack_require__(/*! @weaponRange */ "./src/modules/weaponRange/main.js");
/* harmony import */ var _hatSwitcher__WEBPACK_IMPORTED_MODULE_7__ =
__webpack_require__(/*! @hatSwitcher */ "./src/modules/hatSwitcher/main.js");
/* harmony import */ var _buildingMarkers__WEBPACK_IMPORTED_MODULE_8__ =
__webpack_require__(/*! @buildingMarkers */
"./src/modules/buildingMarkers/main.js");
/* harmony import */ var _fastPlace__WEBPACK_IMPORTED_MODULE_9__ =
__webpack_require__(/*! @fastPlace */ "./src/modules/fastPlace/main.js");
/* harmony import */ var _initFreecam__WEBPACK_IMPORTED_MODULE_10__ =
__webpack_require__(/*! @initFreecam */ "./src/modules/freecam/init.js");

function setup() {
if
(localStorage.getItem(_config__WEBPACK_IMPORTED_MODULE_1__.localStoragename)) {
_config__WEBPACK_IMPORTED_MODULE_1__.togglers =
JSON.parse(localStorage.getItem(_config__WEBPACK_IMPORTED_MODULE_1__.localStoragena
me))
}

window.clientConfig = _config__WEBPACK_IMPORTED_MODULE_1__

document.title = `${_config__WEBPACK_IMPORTED_MODULE_1__.project.name} - [$
{_config__WEBPACK_IMPORTED_MODULE_1__.project.version}]`

_utils__WEBPACK_IMPORTED_MODULE_2__["default"].addEvent(window, "load", () => {


_utils__WEBPACK_IMPORTED_MODULE_2__["default"].initKeys()

_hooks__WEBPACK_IMPORTED_MODULE_3__["default"].init()

_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].init()

_entityMap__WEBPACK_IMPORTED_MODULE_4__["default"].init()

_weaponRange__WEBPACK_IMPORTED_MODULE_6__["default"].init()
_tracers__WEBPACK_IMPORTED_MODULE_5__["default"].init()

_hatSwitcher__WEBPACK_IMPORTED_MODULE_7__["default"].init()

_buildingMarkers__WEBPACK_IMPORTED_MODULE_8__["default"].init()

;(0,_fastPlace__WEBPACK_IMPORTED_MODULE_9__["default"])()

;(0,_initFreecam__WEBPACK_IMPORTED_MODULE_10__["default"])()
})
}

/***/ }),

/***/ "./src/modules/showKeys/main.js":
/*!**************************************!*\
!*** ./src/modules/showKeys/main.js ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ showKeys)
/* harmony export */ });
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! ./settings */ "./src/modules/showKeys/settings.json");

function showKeys() {
const topPanel = document.getElementById("top-panel")

topPanel.style.width = "auto"

for (const hat of _settings__WEBPACK_IMPORTED_MODULE_0__.hats) {


if (hat.key === _settings__WEBPACK_IMPORTED_MODULE_0__.hats[0].key ||
hat.key === _settings__WEBPACK_IMPORTED_MODULE_0__.hats[5].key) {
const br = document.createElement("br")

topPanel.appendChild(br)
}

const btn = document.createElement("div")

btn.classList.add("item")
btn.id = _settings__WEBPACK_IMPORTED_MODULE_0__.id

btn.style.marginLeft = hat.key ===


_settings__WEBPACK_IMPORTED_MODULE_0__.hats[0].key || hat.key ===
_settings__WEBPACK_IMPORTED_MODULE_0__.hats[5].key ? "65px" : "5px"

btn.innerHTML += `
<img src="${hat.src}">
<div class="hotkey" id="${hat.key}:hotkey">${hat.key}</div>
`

topPanel.appendChild(btn)
}
}

/***/ }),

/***/ "./src/modules/tracers/main.js":
/*!*************************************!*\
!*** ./src/modules/tracers/main.js ***!
\*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _canvas__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @canvas */ "./src/modules/canvas/main.js");
/* harmony import */ var _entityManager__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @entityManager */ "./src/modules/managers/entities.js");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");
/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_3__ =
__webpack_require__(/*! @colors */ "./src/colors.json");
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_4__ =
__webpack_require__(/*! ./settings */ "./src/modules/tracers/settings.json");
/* harmony import */ var _myPlayer__WEBPACK_IMPORTED_MODULE_5__ =
__webpack_require__(/*! @myPlayer */ "./src/modules/myPlayer/main.js");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ =
__webpack_require__(/*! @config */ "./src/config.json");

class Tracers {
constructor() {
this.filter = (entity) => entity.id !==
_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source.id &&
_colors__WEBPACK_IMPORTED_MODULE_3__.entities[entity.components.sprite.sprite.key]
}

update() {
if (!_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source) return
void 0

if (!_config__WEBPACK_IMPORTED_MODULE_6__.togglers.tracers ||
_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source.gameState !== 1) return
void 0

const entities =
_entityManager__WEBPACK_IMPORTED_MODULE_1__["default"].entities.filter((entity) =>
this.filter(entity))
const myPlayerX = _myPlayer__WEBPACK_IMPORTED_MODULE_5__["default"].screenX
const myPlayerY = _myPlayer__WEBPACK_IMPORTED_MODULE_5__["default"].screenY

for (const entity of entities) {


if (!entity.components.sprite) continue
const key = entity.components.sprite.sprite.key
const entityX = entity.components.sprite.sprite.worldPosition.x
const entityY = entity.components.sprite.sprite.worldPosition.y
const distance = Math.floor(Math.hypot(myPlayerY - entityY, myPlayerX -
entityX))
let color = _colors__WEBPACK_IMPORTED_MODULE_3__.entities[key]

if (entity.components.teamcomponent &&
_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source.teamId !== -1) {
if (entity.components.teamcomponent.teamId ===
_myPlayer__WEBPACK_IMPORTED_MODULE_5__["default"].fullData.source.components.teamId
&& color === _colors__WEBPACK_IMPORTED_MODULE_3__.entities.atlases_feet) {
color = _colors__WEBPACK_IMPORTED_MODULE_3__.entities.team
}
}

_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.save()
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.lineCap =
_settings__WEBPACK_IMPORTED_MODULE_4__.lineCap
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.lineWidth =
_settings__WEBPACK_IMPORTED_MODULE_4__.lineWidth
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.globalAlpha =
_settings__WEBPACK_IMPORTED_MODULE_4__.globalAlpha
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.strokeStyle =
color
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.beginPath()

_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.moveTo(myPlayerX,
myPlayerY)
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.lineTo(entityX,
entityY)
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.stroke()
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.restore()

const name = key.split("_")[1] === "feet" ? "player" : key.split("_")


[1]

_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.save()
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.font =
_settings__WEBPACK_IMPORTED_MODULE_4__.text.font
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.fillStyle =
_settings__WEBPACK_IMPORTED_MODULE_4__.text.color
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.fillText(`$
{name} [${distance}]`, (myPlayerX + entityX) / 2, (myPlayerY + entityY) / 2)
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.restore()
}
}

init() {
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].addAnimationCallback(() =>
{
this.update()
})
}
}

const tracers = new Tracers()


window.tracers = tracers

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (tracers);

/***/ }),

/***/ "./src/modules/weaponRange/main.js":
/*!*****************************************!*\
!*** ./src/modules/weaponRange/main.js ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _canvas__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @canvas */ "./src/modules/canvas/main.js");
/* harmony import */ var _entityManager__WEBPACK_IMPORTED_MODULE_1__ =
__webpack_require__(/*! @entityManager */ "./src/modules/managers/entities.js");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_2__ =
__webpack_require__(/*! @hooks */ "./src/modules/hooks/main.js");
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_3__ =
__webpack_require__(/*! ./settings */ "./src/modules/weaponRange/settings.json");
/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_4__ =
__webpack_require__(/*! @colors */ "./src/colors.json");
/* harmony import */ var _myPlayer__WEBPACK_IMPORTED_MODULE_5__ =
__webpack_require__(/*! @myPlayer */ "./src/modules/myPlayer/main.js");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ =
__webpack_require__(/*! @config */ "./src/config.json");

class WeaponRange {
constructor() {
this.filter = (entity) => entity.components.teamcomponent
}

update() {
if (!_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world) return void 0

if (!_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source) return
void 0

if (!_config__WEBPACK_IMPORTED_MODULE_6__.togglers.weaponRange ||
_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source.gameState !== 1) return
void 0

const entities =
_entityManager__WEBPACK_IMPORTED_MODULE_1__["default"].entities.filter((entity) =>
this.filter(entity))

for (const entity of entities) {


if (!entity.components.sprite) continue
const entityX = entity.components.sprite.sprite.worldPosition.x
const entityY = entity.components.sprite.sprite.worldPosition.y
const dir = entity.components.animator.cachedTransform.rotation
let color = _colors__WEBPACK_IMPORTED_MODULE_4__.entities.atlases_feet

if (entity.components.teamcomponent &&
entity.components.teamcomponent.teamId !== -1) {
if (entity.components.teamcomponent.teamId ===
_myPlayer__WEBPACK_IMPORTED_MODULE_5__["default"].fullData.source.components.teamco
mponent.teamId && color ===
_colors__WEBPACK_IMPORTED_MODULE_4__.entities.atlases_feet) {
color = _colors__WEBPACK_IMPORTED_MODULE_4__.entities.team
}
}

if (entity.id ===
_hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source.id || entity.parentId
=== _hooks__WEBPACK_IMPORTED_MODULE_2__["default"].world.source.id) {
color = _colors__WEBPACK_IMPORTED_MODULE_4__.entities.team
}

_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.save();
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.lineWidth =
_settings__WEBPACK_IMPORTED_MODULE_3__.lineWidth
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.beginPath()
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.arc(entityX,
entityY, _settings__WEBPACK_IMPORTED_MODULE_3__.range, (dir -
_settings__WEBPACK_IMPORTED_MODULE_3__.offset), (dir -
_settings__WEBPACK_IMPORTED_MODULE_3__.offset) + Math.PI)
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.strokeStyle =
color
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.stroke()

_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.arc(entityX,
entityY, _settings__WEBPACK_IMPORTED_MODULE_3__.range, (dir -
_settings__WEBPACK_IMPORTED_MODULE_3__.offset), (dir -
_settings__WEBPACK_IMPORTED_MODULE_3__.offset) + Math.PI)
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.globalAlpha =
_settings__WEBPACK_IMPORTED_MODULE_3__.alpha
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.fillStyle =
color
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.fill()
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.closePath()
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].context.restore()
}
}

init() {
_canvas__WEBPACK_IMPORTED_MODULE_0__["default"].addAnimationCallback(() =>
{
this.update()
})
}
}

const weaponRange = new WeaponRange()

window.weaponRange = weaponRange
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (weaponRange);

/***/ }),

/***/ "./src/utils/common.js":
/*!*****************************!*\
!*** ./src/utils/common.js ***!
\*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
class Utils {
static keys = {}

static initKeys() {
Utils.addEvent(window, "keydown", (event) => {
Utils.keys[event.code] = true
})

Utils.addEvent(window, "keyup", (event) => {


Utils.keys[event.code] = false
})
}

static randomInt(min, max) {


return Math.floor(Math.random() * (max - min + 1)) + min
}

static get randomId() {


return Utils.randomInt(1e9, 10e9)
}

static createHook(target, prop, callback) {


const symbol = Symbol(prop)

Object.defineProperty(target, prop, {
get() {
return this[symbol]
},
set(value) {
callback(this, symbol, value)
},
configurable: true
})
}

static addEvent(target, prop, callback) {


target.addEventListener(prop, (event) => {
callback(event)
})
}

static getDistance(target, tmpObj) {


return Math.hypot(target.y - tmpObj.y, target.x - tmpObj.x)
}
static getDirection(target, tmpObj) {
return Math.atan2(target.y - tmpObj.y, target.x, tmpObj.x)
}

static sortNearObject(target, objects, position = 0) {


return objects.sort((a, b) => Utils.getDistance(target, a) -
Utils.getDistance(target, b))[position]
}

static createElement(tag, id) {


const element = document.createElement(tag)

element.id = id

document.body.appendChild(element)

return element
}

static randInt(min, max) {


return Math.floor(Math.random() * (max - min + 1)) + min
}
}

window.Utils = Utils

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Utils);

/***/ }),

/***/ "./src/colors.json":
/*!*************************!*\
!*** ./src/colors.json ***!
\*************************/
/***/ ((module) => {

module.exports = JSON.parse('{"entities":
{"team":"#74be8f","atlases_feet":"#ad4343","entity_FarmerBot":"#804ec6","entity_Fol
lowerBot":"#804ec6","entity_DarkGuardBot":"#804ec6","entity_GuardBot":"#804ec6","en
tity_CarrotPickup":"#c6744e","entity_PigMeatPickup":"#c6744e","entity_EggPickup":"#
c6744e","entity_BearMeatPickup":"#c6744e","entity_CoinPickup":"#c6744e","entity_Sou
lPickup":"#c6744e","entity_SoulCrate":"#c6744e","entity_Chicken":"#9ec64e","entity_
Pig":"#9ec64e","entity_Wolf":"#c6c24e","entity_WhiteWalker":"#c6c24e","entity_Bear"
:"#c6c24e","entity_WhiteBear":"#c6c24e","entity_Spider":"#c6c24e","entity_Troll":"#
c6c24e","entity_BoxPickup":"#4e5ac6","entity_RideablePig":"#4ec6b4","entity_Rideabl
eWolf":"#4ec6b4","entity_RideableBear":"#4ec6b4","entity_RideableDragon":"#4ec6b4"}
,"darkOutline":"#222222"}');

/***/ }),

/***/ "./src/config.json":
/*!*************************!*\
!*** ./src/config.json ***!
\*************************/
/***/ ((module) => {

module.exports = JSON.parse('{"project":
{"name":"NipirusScript","version":"1.0"},"betaTest":false,"isJoined":false,"isRespa
wning":false,"hello dude":"u know... why u here?","togglers":
{"minimap":true,"tracers":true,"weaponRange":true,"buildingMarkers":true,"autoRespa
wn":true,"freecam":false},"localStoragename":"__nipirusscript__storage__","canvas":
{"id":"__nipirusscript__canvas__"},"mapScale":{"x":25320,"y":25320},"map":
{"id":"__nipirusscript_map__","width":150,"height":150,"innerWidth":1920,"innerHeig
ht":1080,"targetRadius":{"x":1920,"y":1080},"point":
{"width":75,"height":50},"background":"#222222","right":20,"bottom":20,"alpha":0.6}
}');

/***/ }),

/***/ "./src/modules/buildingMarkers/settings.json":
/*!***************************************************!*\
!*** ./src/modules/buildingMarkers/settings.json ***!
\***************************************************/
/***/ ((module) => {

module.exports = JSON.parse('{"types":
{"entity_WoodBlock":1,"entity_StoneBlock":1,"entity_Door":1,"entity_Garden":1,"enti
ty_WoodSpikes":1,"entity_Portal":1,"entity_DarkStoneBlock":1,"entity_DarkDoor":1,"e
ntity_HealWard":1,"entity_WoodFloor":1,"entity_StoneFloor":1,"entity_MarbleFloor":1
,"entity_IronSpikes":1,"entity_CrystalWall":1,"entity_CrystalDoor":1,"entity_Tower"
:1,"entity_Mannequin":1,"entity_Heartstone":1,"entity_FoodCrate":1,"entity_WoodCrat
e":1,"entity_StoneCrate":1,"entity_SoulCrate":1},"alpha":0.8,"strokeAlpha":1,"radiu
s":10,"lineWidth":3}');

/***/ }),

/***/ "./src/modules/freecam/settings.json":
/*!*******************************************!*\
!*** ./src/modules/freecam/settings.json ***!
\*******************************************/
/***/ ((module) => {

module.exports = JSON.parse('{"speed":10,"isUnfollowed":false}');

/***/ }),

/***/ "./src/modules/hatSwitcher/settings.json":
/*!***********************************************!*\
!*** ./src/modules/hatSwitcher/settings.json ***!
\***********************************************/
/***/ ((module) => {

module.exports = JSON.parse('{"hats":{"booster":2,"common":-
1,"viking":10,"cowboy":3,"tank":11,"whitebear":0,"chicken":6,"hockey":9}}');

/***/ }),

/***/ "./src/modules/menu/settings.json":
/*!****************************************!*\
!*** ./src/modules/menu/settings.json ***!
\****************************************/
/***/ ((module) => {

module.exports = JSON.parse('{"active":false,"added":false,"displays":
{"true":"flex","false":"none"},"openTo":"#game-layout","toggleKey":
["Escape","Esc"],"openButton":
{"id":"__nipirusscript__openbutton__","image":"https://media.discordapp.net/
attachments/1008129573197729873/1009495997392625695/free-settings-icon-778-
thumb.png?width=455&height=455"},"menu":{"holder":
{"id":"__nipirusscript__menuholder__","tag":"div","style":{"pointer-
events":"none","width":"100%","height":"100%","position":"absolute","top":"0","left
":"0","display":"none","align-items":"center","justify-
content":"center","cursor":"default","user-select":"all"}},"wrapper":
{"id":"__nipirusscript__menuwrapper__","tag":"main","style":{"z-
index":"3","position":"absolute","left":"50%","top":"50%","width":"400px","height":
"400px","margin-left":"-200px","margin-top":"-200px","background-color":"rgba(0, 0,
0, .3)","user-select":"none","display":"block","overflow":"hidden","pointer-
events":"all"}},"header":
{"id":"__nipirusscript__menuheader__","tag":"header","style":
{"display":"block","position":"relative","background-color":"#4CAF50","font-
family":"\'Slabo 27px\', serif","font-size":"18px","color":"#fff","text-
align":"center","width":"100%","padding":"5px","height":"20px","user-
select":"none","cursor":"default"}},"closeBtn":
{"id":"__nipirusscript__menuclosebutton__","tag":"div","content":"X","style":
{"position":"absolute","display":"inline-block","line-
height":"30px","right":"18px","top":"0","color":"#fff","cursor":"pointer"}},"contai
ner":{"id":"__nipirusscript__menucontainer__","tag":"container","style":
{"height":"320px","overflow-x":"hidden","overflow-
y":"auto","width":"100%"}},"item":
{"id":"__nipirusscript__menuitem__","tag":"div","style":
{"width":"100%","display":"block","height":"44px","vertical-
align":"middle","color":"white","font-size":"18px","font-family":"\'Slabo 27px\',
serif","background-color":"rgba(0, 0, 0, .8)","margin":"2px","user-
select":"none","cursor":"default"}},"toggleBtn":
{"class":"__nipirusscript__menutogglebutton__","id":"__nipirusscript__menutogglebut
ton__[id]__","tag":"div","active":{"false":"Disabled","true":"Enabled"},"style":
{"background-color":"#4CAF50","border":"none","color":"white","padding":"12px
24px","font-size":"16px","pointer-
events":"all","cursor":"pointer","float":"right","user-
select":"none"}},"toggleName":
{"class":"__nipirusscript__menutogglename__","id":"__nipirusscript__menutogglename_
_[name]__","tag":"div","active":{"false":"Disabled","true":"Enabled"},"style":
{"color":"rgba(216, 191, 73, 1)","font-size":"20px","padding-top":"10px","padding-
left":"10px","overflow-x":"hidden"}}}}');

/***/ }),

/***/ "./src/modules/showKeys/settings.json":
/*!********************************************!*\
!*** ./src/modules/showKeys/settings.json ***!
\********************************************/
/***/ ((module) => {

module.exports =
JSON.parse('{"hats":[{"src":"https://media.discordapp.net/attachments/
1008129573197729873/1010259293632745573/vikinghat_1.png","key":"R"},
{"src":"https://media.discordapp.net/attachments/
1008129573197729873/1010259572616863864/chesshat.png","key":"Shift"},
{"src":"https://media.discordapp.net/attachments/
1008129573197729873/1010259729416724550/cowboyhat.png","key":"Q"},{"src":"https://
media.discordapp.net/attachments/1008129573197729873/1010259886115926076/
tankhat.png","key":"G"},{"src":"https://media.discordapp.net/attachments/
1008129573197729873/1010261320496586752/tankhat_1.png","key":"V"},{"src":"https://
media.discordapp.net/attachments/1008129573197729873/1010262522194047097/
chickenhat.png","key":"J"},{"src":"https://media.discordapp.net/attachments/
1008129573197729873/1010299910907777136/hockeyhat.png","key":"Y"},{"src":"https://
media.discordapp.net/attachments/
1008129573197729873/1010307784807555073/1.png","key":"E"}],"id":"__nipirusscript__s
howhat__"}');

/***/ }),

/***/ "./src/modules/tracers/settings.json":
/*!*******************************************!*\
!*** ./src/modules/tracers/settings.json ***!
\*******************************************/
/***/ ((module) => {

module.exports = JSON.parse('{"text":{"font":"14px
Courier","color":"#ffffff"},"lineWidth":1,"globalAlpha":1,"notDefinedColor":"rgba(0
, 0, 0, 0)","lineCap":"round"}');

/***/ }),

/***/ "./src/modules/weaponRange/settings.json":
/*!***********************************************!*\
!*** ./src/modules/weaponRange/settings.json ***!
\***********************************************/
/***/ ((module) => {

module.exports =
JSON.parse('{"lineWidth":3,"alpha":0.1,"range":87,"offset":3.14}');

/***/ })

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports,
__webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !
__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key,
{ enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) =>
(Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag,
{ value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value:
true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against
other modules in the chunk.
(() => {
/*!**********************!*\
!*** ./src/index.js ***!
\**********************/
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _modules_setup__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(/*! @modules/setup */ "./src/modules/setup.js");

(0,_modules_setup__WEBPACK_IMPORTED_MODULE_0__["default"])()

})();

/******/ })()
;
//# sourceMappingURL=nipirus.js.map

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy