Message
Message
MEMBERS:
Zylex
Mia
Margot
ZK-B
*/
// ANTI ALTCHA
let altcha = document.getElementById("altcha");
let checkbox = document.getElementById("altcha_checkbox");
let enterGame = document.getElementById("enterGame");
let verifying = false;
let token = undefined;
enterGame.innerHTML = "Verifying...";
let antiAltcha = setInterval(() => {
if (!altcha) altcha = document.getElementById("altcha"), verifying = false
if (!checkbox) checkbox = document.getElementById('altcha_checkbox'), verifying
= false
if (token !== undefined) {
enterGame.innerHTML = "Enter Game";
clearInterval(antiAltcha);
}
if (enterGame.classList.contains("disabled")) {
if (verifying) return
verifying = true;
altcha.style.display = "none";
checkbox.click();
setTimeout(()=>{
verifying = false;
setTimeout(()=>{
if (enterGame.classList.contains("disabled")) {
window.location.reload();
}
}, 5000);
}, 1000);
} else enterGame.innerHTML = "Enter Game";
/*
if (token !== undefined) {
enterGame.classList.remove("disabled");
enterGame.innerHTML = "Enter Game";
clearInterval(antiAltcha);
}
*/
}, 1000);
window.addEventListener("load", () => {
if (!altcha) return
altcha.addEventListener("statechange", getToken);
});
setInterval(clicktheverify, 10);
function ShowSettingTextRed(life, setting) {
textManager.showText(player.x, player.y, player.scale, 0.1, life, setting,
"#FF0000");
}
function ShowSettingTextGreen(life, setting) {
textManager.showText(player.x, player.y, player.scale, 0.1, life, setting,
"#00FF00");
}
function ShowSettingTextBlue(life, setting) {
textManager.showText(player.x, player.y, player.scale, 0.1, life, setting,
"#0000FF");
}
function ShowSettingTextYellow(life, setting) {
textManager.showText(player.x, player.y, player.scale, 0.1, life, setting,
"#FFFF00");
}
function ShowSettingTextPurple(life, setting) {
textManager.showText(player.x, player.y, player.scale, 0.1, life, setting,
"#FF00FF");
}
function ShowSettingTextCyan(life, setting) {
textManager.showText(player.x, player.y, player.scale, 0.1, life, setting,
"#00FFFF");
}
function ShowSettingTextWhite(life, setting) {
textManager.showText(player.x, player.y, player.scale, 0.1, life, setting,
"#FFFFFF");
}
function ShowSettingTextBlack(life, setting) {
textManager.showText(player.x, player.y, player.scale, 0.1, life, setting,
"#000000");
}
function ShowSettingTextOrange(life, setting) {
textManager.showText(player.x, player.y, player.scale, 0.1, life, setting,
"#FFA500");
}
function ShowSettingTextPink(life, setting) {
textManager.showText(player.x, player.y, player.scale, 0.1, life, setting,
"#FFC0CB");
}
function ShowSettingTextGrey(life, setting) {
textManager.showText(player.x, player.y, player.scale, 0.1, life, setting,
"#808080");
}
// Know If Teamate:
function isTeam(tmpObj) {
return (tmpObj == player || (tmpObj.team && tmpObj.team == player.team));
}
function cdf (e, t){
try {
return Math.hypot((t.y2||t.y)-(e.y2||e.y), (t.x2||t.x)-(e.x2||e.x));
} catch(e){
return Infinity;
}
}
document.getElementById("partyButton").remove();
document.getElementById("joinPartyButton").remove();
document.getElementById("linksContainer2").remove();
document.getElementById("gameName").style.font = "120px zamruds";
document.getElementById('menuCardHolder').style.marginTop = '50px';
document.getElementById("gameName").style.textShadow = "0px 0px 10px rgba(255, 255,
255, 1)"; // Используем rgba для задания прозрачного голубого цвета
document.getElementById('gameName').style.marginTop = '0px';
document.getElementById('gameName').innerHTML = 'Uno Reversed';
document.addEventListener("keydown", function(event) {
if (event.keyCode === 192) {
const chatHolder = document.getElementById("gameUI");
if (chatHolder) {
const currentDisplay = chatHolder.style.display;
chatHolder.style.display = currentDisplay === "none" ? "block" :
"none";
}
}
});
var styleItem = document.createElement("style");
styleItem.type = "text/css";
styleItem.appendChild(document.createTextNode(`
#suggestBox {
width: 355px;
border-radius: 3px;
background-color: rgba(0,0,0,0.5);
margin: auto;
text-align: left;
z-index: 49;
pointer-events: auto;
position: relative;
bottom: 3.5px;
overflow-y: auto;
}
#suggestBox div {
background-color: rgba(255,255,255,0);
color: rgba(255,255,255,1);
transition: background-color 0.3s, color 0.3s;
}
#suggestBox div:hover {
background-color: rgba(255,255,255,0.2);
color: rgba(0,0,0,1);
}
.suggestBoxHard {
color: rgba(255,255,255,1);
font-size: 18px;
}
.suggestBoxLight {
color: rgba(255,255,255,0.7);
font-size: 18px;
}
`));
document.head.appendChild(styleItem);
window.addEventListener('load', function() {
var allianceButton = document.getElementById('allianceButton');
var storeButton = document.getElementById('storeButton');
if (storeButton) {
storeButton.style.right = '26px';
storeButton.style.top = '420px';
}
if (allianceButton) {
allianceButton.style.right = '26px';
allianceButton.style.top = '479px';
}
});
function getEl(id) {
return document.getElementById(id);
}
} = Math;
let autoOneFrameToggled = false;
const {
awas, // sin
cawas, // cos
sawas, // sqrt
} = Math;
let config = window.config;
// CLIENT:
config.clientSendRate = 9; // Aim Packet Send Rate
config.serverUpdateRate = 9;
// UI:
config.deathFadeout = 0;
config.playerCapacity = 9999;
// CHECK IN SANDBOX:
config.isSandbox = window.location.hostname == "sandbox.moomoo.io";
// CUSTOMIZATION:
config.skinColors = ["#bf8f54", "#cbb091", "#896c4b",
"#fadadc", "#ececec", "#c37373", "#4c4c4c", "#ecaff7",
"#738cc3",
"#8bc373", "#91b2db"
];
config.weaponVariants = [{
id: 0,
src: "",
xp: 0,
val: 1,
}, {
id: 1,
src: "_g",
xp: 3000,
val: 1.1,
}, {
id: 2,
src: "_d",
xp: 7000,
val: 1.18,
}, {
id: 3,
src: "_r",
poison: true,
xp: 12000,
val: 1.18,
}, {
id: 4,
src: "_e",
poison: true,
heal: true,
xp: 24000,
val: 1.18,
}];
// VISUAL:
config.anotherVisual = true;
config.useWebGl = false;
config.resetRender = true;
function waitTime(timeout) {
return new Promise((done) => {
setTimeout(() => {
done();
}, timeout);
});
}
// STORAGE:
let canStore;
if (typeof(Storage) !== "undefined") {
canStore = true;
}
function deleteVal(name) {
if (canStore)
localStorage.removeItem(name);
}
function getSavedVal(name) {
if (canStore)
return localStorage.getItem(name);
return null;
}
// CONFIGS:
let gC = function(a, b) {
try {
let res = JSON.parse(getSavedVal(a));
if (typeof res === "object") {
return b;
} else {
return res;
}
} catch (e) {
alert("dieskid");
return b;
}
};
function setCommands() {
return {
"help": {
desc: "Show Commands",
action: function(message) {
for (let cmds in commands) {
addMenuChText("/" + cmds, commands[cmds].desc, "lime", 1);
}
}
},
"clear": {
desc: "Clear Chats",
action: function(message) {
resetMenuChText();
}
},
"debug": {
desc: "Debug Mod For Development",
action: function(message) {
addDeadPlayer(player);
addMenuChText("Debug", "Done", "#99ee99", 1);
}
},
"play": {
desc: "Play Music ( /play [link] )",
action: function(message) {
let link = message.split(" ");
if (link[1]) {
let audio = new Audio(link[1]);
audio.play();
} else {
addMenuChText("Warn", "Enter Link ( /play [link] )", "#99ee99",
1);
}
}
},
"bye": {
desc: "Leave Game",
action: function(message) {
window.leave();
}
},
};
}
function setConfigs() {
return {
slowOT: true,
autoPlace212121: false,
autoOneFrame: true,
};
}
window.removeConfigs = function() {
for (let cF in configs) {
deleteVal(cF, configs[cF]);
}
};
// MENU FUNCTIONS:
window.changeMenu = function() {};
window.debug = function() {};
window.freezePlayer = function() {};
window.wasdMode = function() {};
// PAGE 1:
window.startGrind = function() {};
// PAGE 3:
window.resBuild = function() {};
window.toggleVisual = function() {};
// SOME FUNCTIONS:
window.prepareUI = function() {};
window.leave = function() {};
class deadfuturechickenmodrevival {
constructor(flarez, lore) {
this.inGame = false;
this.lover = flarez + lore;
this.baby = "ae86";
this.isBlack = 0;
this.webSocket = undefined;
this.checkBaby = function() {
this.baby !== "ae86" ? this.isBlack++ : this.isBlack--;
if (this.isBlack >= 1) return "bl4cky";
return "noting for you";
};
this.x2 = 0;
this.y2 = 0;
this.chat = "Imagine playing this badass game XDDDDD";
this.summon = function(tmpObj) {
this.x2 = tmpObj.x;
this.y2 = tmpObj.y;
this.chat = tmpObj.name + " ur so bad XDDDD";
};
this.commands = function(cmd) {
cmd == "rv3link" && window.open("https://florr.io/");
cmd == "woah" && window.open("https://www.youtube.com/watch?
v=MO0AGukzj6M");
return cmd;
};
this.dayte = "11yearold";
this.memeganoob = "69yearold";
this.startDayteSpawn = function(tmpObj) {
let ratio = setInterval(() => {
this.x2 = tmpObj.x + 20;
this.y2 = tmpObj.y - 20;
this.chat = "UR SO BAD LOL";
if (tmpObj.name == "ae86") {
this.chat = "omg ae86 go run";
setTimeout(() => {
this.inGame = false;
clearInterval(ratio);
}, 1000);
}
}, 1234);
};
this.AntiChickenModV69420 = function(tmpObj) {
return "!c!dc user " + tmpObj.name;
};
}
};
class HtmlAction {
constructor(element) {
this.element = element;
};
add(code) {
if (!this.element) return undefined;
this.element.innerHTML += code;
};
newLine(amount) {
let result = `<br>`;
if (amount > 0) {
result = ``;
for (let i = 0; i < amount; i++) {
result += `<br>`;
}
}
this.add(result);
};
checkBox(setting) {
let newCheck = `<input type = "checkbox"`;
setting.id && (newCheck += ` id = ${setting.id}`);
setting.style && (newCheck += ` style = ${setting.style.replaceAll(" ",
"")}`);
setting.class && (newCheck += ` class = ${setting.class}`);
setting.checked && (newCheck += ` checked`);
setting.onclick && (newCheck += ` onclick = ${setting.onclick}`);
newCheck += `>`;
this.add(newCheck);
};
text(setting) {
let newText = `<input type = "text"`;
setting.id && (newText += ` id = ${setting.id}`);
setting.style && (newText += ` style = ${setting.style.replaceAll(" ",
"")}`);
setting.class && (newText += ` class = ${setting.class}`);
setting.size && (newText += ` size = ${setting.size}`);
setting.maxLength && (newText += ` maxLength = ${setting.maxLength}`);
setting.value && (newText += ` value = ${setting.value}`);
setting.placeHolder && (newText += ` placeHolder = $
{setting.placeHolder.replaceAll(" ", " ")}`);
newText += `>`;
this.add(newText);
};
select(setting) {
let newSelect = `<select`;
setting.id && (newSelect += ` id = ${setting.id}`);
setting.style && (newSelect += ` style = ${setting.style.replaceAll(" ",
"")}`);
setting.class && (newSelect += ` class = ${setting.class}`);
newSelect += `>`;
for (let options in setting.option) {
newSelect += `<option value = ${setting.option[options].id}`
setting.option[options].selected && (newSelect += ` selected`);
newSelect += `>${options}</option>`;
}
newSelect += `</select>`;
this.add(newSelect);
};
button(setting) {
let newButton = `<button`;
setting.id && (newButton += ` id = ${setting.id}`);
setting.style && (newButton += ` style = ${setting.style.replaceAll(" ",
"")}`);
setting.class && (newButton += ` class = ${setting.class}`);
setting.onclick && (newButton += ` onclick = ${setting.onclick}`);
newButton += `>`;
setting.innerHTML && (newButton += setting.innerHTML);
newButton += `</button>`;
this.add(newButton);
};
selectMenu(setting) {
let newSelect = `<select`;
if (!setting.id) {
alert("please put id skid");
return;
}
window[setting.id + "Func"] = function() {};
setting.id && (newSelect += ` id = ${setting.id}`);
setting.style && (newSelect += ` style = ${setting.style.replaceAll(" ",
"")}`);
setting.class && (newSelect += ` class = ${setting.class}`);
newSelect += ` onchange = window.${setting.id + "Func"}()`;
newSelect += `>`;
let last;
let i = 0;
for (let options in setting.menu) {
newSelect += `<option value = ${"option_" + options} id = ${"O_" +
options}`;
setting.menu[options] && (newSelect += ` checked`);
newSelect += ` style = "color: ${setting.menu[options] ? "#000" :
"#fff"}; background: ${setting.menu[options] ? "#8ecc51" : "#cc5151"};">$
{options}</option>`;
i++;
}
newSelect += `</select>`;
this.add(newSelect);
i = 0;
for (let options in setting.menu) {
window[options + "Func"] = function() {
setting.menu[options] = getEl("check_" + options).checked ? true :
false;
saveVal(options, setting.menu[options]);
};
this.checkBox({
id: "check_" + options,
style: `display: ${i == 0 ? "inline-block" : "none"};`,
class: "checkB",
onclick: `window.${options + "Func"}()`,
checked: setting.menu[options]
});
i++;
}
//getEl(setting.id).style.color = setting.menu[last.split("_")[1]] ?
"#8ecc51" : "#fff";
};
};
};
class Html {
constructor() {
this.element = null;
this.action = null;
this.divElement = null;
this.startDiv = function(setting, func) {
};
this.addDiv = function(setting, func) {
};
};
set(id) {
this.element = getEl(id);
this.action = new HtmlAction(this.element);
};
resetHTML(text) {
if (text) {
this.element.innerHTML = ``;
} else {
this.element.innerHTML = ``;
}
};
setStyle(style) {
this.element.style = style;
};
setCSS(style) {
this.action.add(`<style>` + style + `</style>`);
};
};
// MENU
let UnoReverse = document.createElement("div");
UnoReverse.id = 'UnoReverse';
UnoReverse.classList.add('menu-container');
UnoReverse.style = `
opacity: 0;
display: none;
padding: 10px;
background-color: rgba(0, 0, 0, 0.2);
backdrop-filter: blur(8px);
border-radius: 15px;
position: absolute;
top: 45%;
left: 50%;
margin: -250px 0 0 -375px;
width: 765px;
height: 460px;
`;
UnoReverse.innerHTML = `
<style>
.menu-container {
animation: glow 1.5s ease-in-out infinite alternate;
}
@keyframes glow {
from {
box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255,
0.5);
}
to {
box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 255, 255,
0.7);
}
}
/* Checkbox styles */
input[type="checkbox"] {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
width: 35px;
height: 20px;
border-radius: 50px;
background: rgba(0, 0, 0, 0.3);
box-shadow: inset 0 0 5px rgba(41, 41, 41, 0.5);
cursor: pointer;
position: relative;
left: -5px;
transition: background-color 0.4s;
margin-bottom: -4px
}
input:checked[type="checkbox"] {
background: #4CAF50;
}
input[type="checkbox"]::after {
content: "";
position: absolute;
top: 50%;
left: 3px;
transform: translateY(-50%);
width: 14px;
height: 14px;
border-radius: 50%;
background: #ffffff;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
transition: left 0.4s;
}
input:checked[type="checkbox"]::after {
left: calc(100% - 17px);
}
#sidebar {
position: absolute;
left: 5px;
top: 5px;
width: 200px;
height: calc(100% - 30px);
background-color: rgba(7, 7, 7, 0.5);
color: #ffffff;
padding: 10px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
display: flex;
flex-direction: column;
align-items: center;
}
#mainmenu {
position: fixed;
left: 235px;
top: 5px;
width: 525px;
height: calc(100% - 30px);
background-color: rgba(7, 7, 7, 0.3);
color: #ffffff;
padding: 10px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
display: flex;
overflow-y: auto;
}
#mainmenu {
scrollbar-width: none;
}
#mainmenu::-webkit-scrollbar {
display: none;
}
.tab-box {
width: 170px;
height: 50px;
background-color: rgba(0, 0, 0, 0.1);
border: 0px solid rgba(0, 0, 0, 0.1);
border-radius: 10px;
overflow: hidden;
margin-bottom: 20px;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0 0 10px rgba(255, 255, 255, 0.5), inset 0 0 5px rgba(255, 255, 255,
0.2);
transition: transform 0.3s ease, box-shadow 0.3s ease;
cursor: pointer;
font-size: 20px;
}
.tab-box:hover {
transform: scale(1.03);
box-shadow: 0 0 15px rgba(255, 255, 255, 0.8), inset 0 0 8px rgba(255, 255, 255,
0.3);
}
.tab-box.selected {
transform: scale(1.05);
box-shadow: 0 0 20px rgba(255, 255, 255, 1), inset 0 0 10px rgba(255, 255, 255,
0.5);
background-color: rgba(255, 255, 255, 0.1);
font-size: 22px;
}
.styled-select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
background-color: rgba(0, 0, 0, 0.3);
color: #ffffff;
padding: 8px 12px;
font-size: 13px;
border-radius: 15px;
width: auto+40px;
height: 30px;
margin-bottom: 5px;
border: none;
outline: none;
text-align-last: center;
}
.styled-select option {
background-color: rgba(0, 0, 0, 0.5);
color: #ffffff;
}
.styled-select:hover, .styled-select:focus {
background-color: rgba(0, 0, 0, 0.7);
color: #ffffff;
}
.customText {
color: #fff;
background-color: #2c3e50;
border: 1px solid #444; /* Dark border color */
border-radius: 8px; /* Rounded corners */
padding: 8px;
transition: background-color 0.3s ease;
}
.customText:focus {
background-color: #333; /* Darker focus color */
}
.slidecontainer {
width: 100%; /* Width of the outside container */
}
/* Mouse-over effects */
.slider:hover {
opacity: 1; /* Fully shown on mouse-over */
}
/* The slider handle (use -webkit- (Chrome, Opera, Safari, Edge) and -moz-
(Firefox) to override default look) */
.slider::-webkit-slider-thumb {
-webkit-appearance: none; /* Override default look */
appearance: none;
width: 25px; /* Set a specific slider handle width */
height: 25px; /* Slider handle height */
background: #04AA6D; /* Green background */
cursor: pointer; /* Cursor on hover */
}
.slider::-moz-range-thumb {
width: 25px; /* Set a specific slider handle width */
height: 20px; /* Slider handle height */
background: #04AA6D; /* Green background */
cursor: pointer; /* Cursor on hover */
}
</style>
<div id = "sidebar">
<div id = "headline" style="font-size: 25px; color: #b3b3b3;">
<div style="text-align: center; font-size: 25px; margin-bottom: -
40px;">`+GM_info.script.name +" "+ GM_info.script.version +`</div>
<br><br>
<div class = "tab-box" selected id = "combat">Combat</div>
<div class = "tab-box" id = "visual">Visuals</div>
<div class = "tab-box" id = "misc">Misc/Other</div>
</div>
Dev: Zylex
</div>
<div id = "mainmenu">
<div id = "Combat" style = "display: block; font-size: 20px;">
Placements Settings:
<br>
<input type = "checkbox" checked id = "Autoplace">
AutoPlace
<br>
<input type = "checkbox" id = "Retrap">
Retrap
<br>
<input type = "checkbox" checked id = "autoPush">
autoPush
<br>
<input type = "checkbox" checked id = "revTick">
Rev Insta
<br>
<input type = "checkbox" checked id = "predictTick">
predictTick
<br>
<input type = "checkbox" checked id = "slowOT">
Slow OneTick
<br>
<input type = "checkbox" checked id = "doSpikeOnReverse">
ReverseSpikeTick
<br>
<input type = "checkbox" checked id = "antiTrap">
antiTrap
<br>
<input type = "checkbox" checked id = "Replace">
RePlacer
<br>
<input type = "checkbox" checked id = "Preplace">
PrePlacer
<br>
InstaType:
<select id="instaType" class="styled-select">
<option value="OneShot">Morning/oneshot</option>
<option selected value="spammer">spammer</option>
</select>
<br>
AntiBullType:
<select id="antiBullType" class="styled-select">
<option selected value="noab">Disable/oneshot</option>
<option value="abreload">Hit SpikeGear</option>
<option value="abalway">SpikeGear</option>
</select>
<br>
Main Settings:
<br>
<input type = "checkbox" checked id = "healingBeta">
AutoHeal
<br>
Other:
<br>
<input type = "checkbox" checked id = "antikick">
AntiKick
<br>
<input type = "checkbox" checked id = "safeAntiSpikeTick">
safeAntiSpikeTick
<br>
<input type = "checkbox" checked id = "turretCombat">
turretCombat
<br>
<input type = "checkbox" checked id = "backupNobull">
Insta With No Bull
<br>
</div>
<div id = "Visual" style = "display: none; font-size: 20px;">
Visuals:
<br>
<input type = "checkbox" checked id = "VelocityOneTick">
VelocityOneTick(toggle shif T)
<br>
<button onclick="window.toggleVisual()">Toggle Another Visual</button>
<br>
<input type = "checkbox" checked id = "placeVis">
PlaceVisual
<br>
<input type = "checkbox" id = "StackText">
StackedText
<br>
<input type = "checkbox" id = "BoostSpikers">
BoostSpike
<br>
</div>
<div id = "Misc" style = "display: none; font-size: 20px;">
#AutoGrind Settings:
<br>
<input type = "checkbox" id = "weaponGrind">
AutoGrind
<br>
<input type = "checkbox" checked id = "spikeTick">
spikeTick
<br>
<input type = "checkbox" checked id = "KillChat">
killChat:
<br>
<button onclick="window.freezePlayer()">Crash player</button>
<br>
<button onclick="window.debug()">debug</button>
<br>
<input type = "checkbox" checked id = "trySync">
trySync
<br>
<input type = "checkbox" checked id = "autoBuy">
autoBuy
<br>
<input type = "checkbox" checked id = "alwaysFlipper">
alwaysFlipper
<br>
<input type = "checkbox" checked id = "AutoBot">
AutoBotIDK
<br>
<input type = "checkbox" checked id = "autoBuyEquip">
autoBuyEquip
<br>
preplaceMore:
<select id="preplaceMore" class="styled-select">
<option value="trap">For Retrap</option>
<option selected value="spike">For Spiketick</option>
</select>
<br>
<br>
#Song Settings:
<br>
Song(z):
<select id="song" class="styled-select">
<option selected value="0">Dead Of Night</option>
<option value="1">none</option>
<option value="2">none</option>
</select>
</div>
<div id = "seti" style="display: none; font-size: 25px;">
Profile:
</div>
</div>
`;
let song1 = new Audio("https://ncs.io/track/download/3db2d7b2-fe13-4063-a618-
a29eca83f45f");
let Songs = [song1];
let songC1 = {
'0:03' : "Baby, this is do or die",
'0:06' : "Feel it in my veins at night",
'0:08' : "Emotional suicide",
'0:11' : "You know it's an eye for eye",
'0:13' : "I didn't wanna walk,",
'0:15' : "didn't wanna walk the plank",
'0:19' : "No,",
'0:20' : "but then ready or not,",
'0:21' : "then ready or not it came",
'0:23' : "Like the thunder,",
'0:24' : "I was on my way to going under",
'0:26' : "(under)",
'0:27' : "Swimming in the pain,",
'0:28' : "yeah, I was covered",
'0:30' : "In a tidal wave,",
'0:32' : "in a tidal wave",
'0:33' : "But I'm a fighter",
'0:34' : "(hu)",
'0:35' : "Tryna take me down,",
'0:36' : "I'm going higher",
'0:37' : "(I'm higher)",
'0:38' : "Baby, you've been playing",
'0:39' : "with some fire",
'0:40' : "(you've playing)",
'0:41' : "You've been playing with fire",
'0:42' : "(playing with fire)",
'0:43' : "One day you will see",
'0:46' : "What you made of me",
'0:48' : "Found my inner beast",
'0:49' : "(inner beast)",
'0:51' : "You'll watch it release",
'0:53' : "In the dead of night",
'1:05' : "In the dead of night",
'1:10' : "In the dead of",
'1:14' : " Night ",
'1:18' : "Baby, when it's do or die",
'1:19' : "(when it's do or die)",
'1:20' : "You know it's an eye for eye",
'1:22' : "(it's an eye for eye)",
'1:23' : "Feel the energy align",
'1:25' : "(oh)",
'1:26' : "In the dead of night",
'1:27' : "you've been playing with fire",
'1:28' : "In the dead of night,",
'1:31' : "In the dead of night",
'1:33' : "(in the dead of night)",
'1:37' : "In the dead of night",
'1:50' : "You can save your alibi",
'1:52' : "I already know you lied",
'1:55' : "Oh no, no don't even try",
'1:57' : "(don't even try)",
'1:58' : "Watch the flame in me ignite",
'2:00' : "You didn't wanna walk,",
'2:02' : "didn't wanna walk the plank",
'2:05' : "But then ready or not,",
'2:07' : "then ready or not it came",
'2:09' : "Baby, it was dark",
'2:10' : "It was hard to see",
'2:12' : "And that's when a spark",
'2:14' : "lit inside of me,",
'2:16' : " Oh ",
'2:17' : "I was lost in reverie,",
'2:19' : "Oh-oh, oh-oh",
'2:22' : "One day you will see",
'2:23' : "(you will see)",
'2:24' : "What you made of me",
'2:27' : "What's inside of me",
'2:28' : "(what's inside of me)",
'2:30' : "Oh, one day you will see",
'2:35' : "I found my inner beast",
'2:37' : "(I found my inner beast)",
'2:38' : "You'll watch it release",
'2:41' : "In the dead of night, oh",
'2:51' : "In the dead of night",
'2:55' : "(In the dead of)",
'2:57' : "In the dead of night, oh-woah",
'3:03' : "In the dead of night",
'3:05' : "Baby, when it's do or die",
'3:07' : "You know it's an eye for eye",
'3:10' : "Feel the energy align",
'3:12' : "In the dead of night",
'3:16' : " In the dead of night ",
'3:18' : " In the dead of night ",
'3:21' : " In the dead of night ",
'3:23' : " In the dead of night ",
'3:26' : "And one day you will see",
'3:28' : "What you made of me",
'3:31' : "What's inside of me",
'3:35' : "Oh, and one day you will see",
'3:39' : "I found my inner beast",
'3:42' : "And you'll watch it release",
}
let songC = [songC1];
document.body.appendChild(UnoReverse);
}
.chMainDiv {
font-family: "Ubuntu";
font-size: 16px;
max-height: 215px;
overflow-y: scroll;
scrollbar-width: thin;
scrollbar-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0);
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
overflow-x: hidden;
}
.chMainDiv::-webkit-scrollbar {
width: 8px;
}
.chMainDiv::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.5);
}
.chMainDiv::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.7);
}
.chMainBox {
display:none;
position: absolute;
left: 10px;
bottom: 10px;
width: 380px;
height: 25px;
background-color: rgba(255, 255, 255, 0);
border-radius: 5px;
color: rgba(255, 255, 255, 0.75);
font-family: "HammerSmith One";
font-size: 12px;
}
`);
HTML.startDiv({
id: "mChDiv",
class: "chDiv"
}, (html) => {
HTML.addDiv({
id: "mChMain",
class: "chMainDiv",
appendID: "mChDiv"
}, (html) => {});
html.text({
id: "mChBox",
class: "chMainBox",
// placeHolder: `To chat click here or press "Enter" key`
});
});
menuChatBox.value = "";
menuChatBox.addEventListener("focus", () => {
menuCBFocus = true;
});
menuChatBox.addEventListener("blur", () => {
menuCBFocus = false;
});
let menuIndex = 0;
let menus = ["menuMain", "menuConfig", "menuOther"];
window.changeMenu = function() {
getEl(menus[menuIndex % menus.length]).style.display = "none";
menuIndex++;
getEl(menus[menuIndex % menus.length]).style.display = "block";
};
/*function modLog() {
let logs = [];
for (let i = 0; i < arguments.length; i++) {
logs.push(arguments[i]);
}
getEl("modLog").innerHTML = logs;
}*/
let WS = undefined;
let socketID = undefined;
WebSocket.prototype.nsend = WebSocket.prototype.send;
WebSocket.prototype.send = function(message) {
if (!WS) {
WS = this;
WS.addEventListener("message", function(msg) {
getMessage(msg);
});
WS.addEventListener("close", (event) => {
if (event.code == 4001) {
window.location.reload();
}
});
}
if (WS == this) {
dontSend = false;
// SEND MESSAGE:
if (type == "6") {
if (data[0]) {
// ANTI PROFANITY:
let profanity = ["cunt", "whore", "fuck", "shit", "faggot",
"nigger", "nigga", "dick", "vagina", "minge", "cock", "rape", "cum", "sex", "tits",
"penis", "clit", "pussy", "meatcurtain", "jizz", "prune", "douche", "wanker",
"damn", "bitch", "dick", "fag", "bastard", ];
let tmpString;
profanity.forEach((profany) => {
if (data[0].indexOf(profany) > -1) {
tmpString = "";
for (let i = 0; i < profany.length; ++i) {
if (i == 1) {
tmpString += String.fromCharCode(0);
}
tmpString += profany[i];
}
let re = new RegExp(profany, "g");
data[0] = data[0].replace(re, tmpString);
}
});
// FIX CHAT:
data[0] = data[0].slice(0, 30);
}
// START COUNT:
if (!firstSend.sec) {
firstSend.sec = true;
setTimeout(() => {
firstSend.sec = false;
secPacket = 0;
}, secTime);
}
secPacket++;
}
} else {
this.nsend(message);
}
}
function packet(type) {
// EXTRACT DATA ARRAY:
let data = Array.prototype.slice.call(arguments, 1);
// SEND MESSAGE:
let binary = window.msgpack.encode([type, data]);
WS.send(binary);
}
function origPacket(type) {
// EXTRACT DATA ARRAY:
let data = Array.prototype.slice.call(arguments, 1);
// SEND MESSAGE:
let binary = window.msgpack.encode([type, data]);
WS.nsend(binary);
}
window.leave = function() {
origPacket("kys", {
"frvr is so bad": true,
"sidney is too good": true,
"dev are too weak": true,
});
};
//...lol
let io = {
send: packet
};
function getMessage(message) {
let data = new Uint8Array(message.data);
let parsed = window.msgpack.decode(data);
let type = parsed[0];
data = parsed[1];
let events = {
A: setInitData, // id: setInitData,
//B: disconnect,
C: setupGame, // 1: setupGame,
D: addPlayer, // 2: addPlayer,
E: removePlayer, // 4: removePlayer,
a: updatePlayers, // 33: updatePlayers,
G: updateLeaderboard, // 5: updateLeaderboard,here
H: loadGameObject, // 6: loadGameObject,
I: loadAI, // a: loadAI,
J: animateAI, // aa: animateAI,
K: gatherAnimation, // 7: gatherAnimation,
L: wiggleGameObject, // 8: wiggleGameObject,
M: shootTurret, // sp: shootTurret,
N: updatePlayerValue, // 9: updatePlayerValue,
O: updateHealth1, // h: updateHealth,//here
O: updateHealth, // h: updateHealth,//here
P: killPlayer, // 11: killPlayer,
Q: killObject, // 12: killObject,
R: killObjects, // 13: killObjects,
S: updateItemCounts, // 14: updateItemCounts,
T: updateAge, // 15: updateAge,
U: updateUpgrades, // 16: updateUpgrades,
V: updateItems, // 17: updateItems,
X: addProjectile, // 18: addProjectile,
// Y: remProjectile, // 19: remProjectile,
//Z: serverShutdownNotice,
//0: addAlliance,
//1: deleteAlliance,
2: allianceNotification, // an: allianceNotification,
3: setPlayerTeam, // st: setPlayerTeam,
4: setAlliancePlayers, // sa: setAlliancePlayers,
5: updateStoreItems, // us: updateStoreItems,
6: receiveChat, // ch: receiveChat,
7: updateMinimap, // mm: updateMinimap,
8: showText, // t: showText,
9: pingMap, // p: pingMap,
0: pingSocketResponse,
};
if (type == "io-init") {
socketID = data[0];
} else {
if (events[type]) {
events[type].apply(undefined, data);
}
}
}
// MATHS:
Math.lerpAngle = function(value1, value2, amount) {
let difference = Math.abs(value2 - value1);
if (difference > Math.PI) {
if (value1 > value2) {
value2 += Math.PI * 2;
} else {
value1 += Math.PI * 2;
}
}
let value = value2 + ((value1 - value2) * amount);
if (value >= 0 && value <= Math.PI * 2) return value;
return value % (Math.PI * 2);
};
// REOUNDED RECTANGLE:
CanvasRenderingContext2D.prototype.roundRect = function(x, y, w, h, r) {
if (w < 2 * r) r = w / 2;
if (h < 2 * r) r = h / 2;
if (r < 0)
r = 0;
this.beginPath();
this.moveTo(x + r, y);
this.arcTo(x + w, y, x + w, y + h, r);
this.arcTo(x + w, y + h, x, y + h, r);
this.arcTo(x, y + h, x, y, r);
this.arcTo(x, y, x + w, y, r);
this.closePath();
return this;
};
// GLOBAL VALUES:
function resetMoveDir() {
keys = {};
io.send("e");
}
let player;
let playerSID;
let tmpObj;
function findPlayerByID(id) {
return findID(players, id);
}
function findPlayerBySID(sid) {
return findSID(players, sid);
}
function findAIBySID(sid) {
return findSID(ais, sid);
}
function findObjectBySid(sid) {
return findSID(gameObjects, sid);
}
function findProjectileBySid(sid) {
return findSID(gameObjects, sid);
}
// ON LOAD:
let inWindow = true;
window.onblur = function() {
inWindow = false;
};
window.onfocus = function() {
inWindow = true;
if (player && player.alive) {
// resetMoveDir();
}
};
let ms = {
avg: 0,
max: 0,
min: 0,
delay: 0
}
function pingSocketResponse() {
let pingTime = window.pingTime;
const pingDisplay = document.getElementById("pingDisplay")
pingDisplay.innerText = "";
if (pingTime > ms.max || isNaN(ms.max)) {
ms.max = pingTime;
}
if (pingTime < ms.min || isNaN(ms.min)) {
ms.min = pingTime;
}
// MATH UTILS:
let mathABS = Math.abs,
mathCOS = Math.cos,
mathSIN = Math.sin,
mathPOW = Math.pow,
mathSQRT = Math.sqrt,
mathATAN2 = Math.atan2,
mathPI = Math.PI;
// GLOBAL UTILS:
this.round = function(n, v) {
return Math.round(n * v) / v;
};
this.toRad = function(angle) {
return angle * (mathPI / 180);
};
this.toAng = function(radian) {
return radian / (mathPI / 180);
};
this.randInt = function(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
this.randFloat = function(min, max) {
return Math.random() * (max - min + 1) + min;
};
this.lerp = function(value1, value2, amount) {
return value1 + (value2 - value1) * amount;
};
this.decel = function(val, cel) {
if (val > 0)
val = Math.max(0, val - cel);
else if (val < 0)
val = Math.min(0, val + cel);
return val;
};
this.getDistance = function(x1, y1, x2, y2) {
return mathSQRT((x2 -= x1) * x2 + (y2 -= y1) * y2);
};
this.getDist = function(tmp1, tmp2, type1, type2) {
let tmpXY1 = {
x: type1 == 0 ? tmp1.x : type1 == 1 ? tmp1.x1 : type1 == 2 ?
tmp1.x2 : type1 == 3 && tmp1.x3,
y: type1 == 0 ? tmp1.y : type1 == 1 ? tmp1.y1 : type1 == 2 ?
tmp1.y2 : type1 == 3 && tmp1.y3,
};
let tmpXY2 = {
x: type2 == 0 ? tmp2.x : type2 == 1 ? tmp2.x1 : type2 == 2 ?
tmp2.x2 : type2 == 3 && tmp2.x3,
y: type2 == 0 ? tmp2.y : type2 == 1 ? tmp2.y1 : type2 == 2 ?
tmp2.y2 : type2 == 3 && tmp2.y3,
};
return mathSQRT((tmpXY2.x -= tmpXY1.x) * tmpXY2.x + (tmpXY2.y -=
tmpXY1.y) * tmpXY2.y);
};
this.getDirection = function(x1, y1, x2, y2) {
return mathATAN2(y1 - y2, x1 - x2);
};
this.getDirect = function(tmp1, tmp2, type1, type2) {
let tmpXY1 = {
x: type1 == 0 ? tmp1.x : type1 == 1 ? tmp1.x1 : type1 == 2 ?
tmp1.x2 : type1 == 3 && tmp1.x3,
y: type1 == 0 ? tmp1.y : type1 == 1 ? tmp1.y1 : type1 == 2 ?
tmp1.y2 : type1 == 3 && tmp1.y3,
};
let tmpXY2 = {
x: type2 == 0 ? tmp2.x : type2 == 1 ? tmp2.x1 : type2 == 2 ?
tmp2.x2 : type2 == 3 && tmp2.x3,
y: type2 == 0 ? tmp2.y : type2 == 1 ? tmp2.y1 : type2 == 2 ?
tmp2.y2 : type2 == 3 && tmp2.y3,
};
return mathATAN2(tmpXY1.y - tmpXY2.y, tmpXY1.x - tmpXY2.x);
};
this.getAngleDist = function(a, b) {
let p = mathABS(b - a) % (mathPI * 2);
return (p > mathPI ? (mathPI * 2) - p : p);
};
this.isNumber = function(n) {
return (typeof n == "number" && !isNaN(n) && isFinite(n));
};
this.isString = function(s) {
return (s && typeof s == "string");
};
this.kFormat = function(num) {
return num > 999 ? (num / 1000).toFixed(1) + "k" : num;
};
this.sFormat = function(num) {
let fixs = [{
num: 1e3,
string: "k"
},
{
num: 1e6,
string: "m"
},
{
num: 1e9,
string: "b"
},
{
num: 1e12,
string: "q"
}
].reverse();
let sp = fixs.find(v => num >= v.num);
if (!sp) return num;
return (num / sp.num).toFixed(1) + sp.string;
};
this.capitalizeFirst = function(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
};
this.fixTo = function(n, v) {
return parseFloat(n.toFixed(v));
};
this.sortByPoints = function(a, b) {
return parseFloat(b.points) - parseFloat(a.points);
};
this.lineInRect = function(recX, recY, recX2, recY2, x1, y1, x2, y2) {
let minX = x1;
let maxX = x2;
if (x1 > x2) {
minX = x2;
maxX = x1;
}
if (maxX > recX2)
maxX = recX2;
if (minX < recX)
minX = recX;
if (minX > maxX)
return false;
let minY = y1;
let maxY = y2;
let dx = x2 - x1;
if (Math.abs(dx) > 0.0000001) {
let a = (y2 - y1) / dx;
let b = y1 - a * x1;
minY = a * minX + b;
maxY = a * maxX + b;
}
if (minY > maxY) {
let tmp = maxY;
maxY = minY;
minY = tmp;
}
if (maxY > recY2)
maxY = recY2;
if (minY < recY)
minY = recY;
if (minY > maxY)
return false;
return true;
};
this.containsPoint = function(element, x, y) {
let bounds = element.getBoundingClientRect();
let left = bounds.left + window.scrollX;
let top = bounds.top + window.scrollY;
let width = bounds.width;
let height = bounds.height;
function touchStart(e) {
_this.mousifyTouchEvent(e);
window.setUsingTouch(true);
if (preventDefault) {
e.preventDefault();
e.stopPropagation();
}
if (element.onmouseover)
element.onmouseover(e);
isHovering = true;
}
function touchMove(e) {
_this.mousifyTouchEvent(e);
window.setUsingTouch(true);
if (preventDefault) {
e.preventDefault();
e.stopPropagation();
}
if (_this.containsPoint(element, e.pageX, e.pageY)) {
if (!isHovering) {
if (element.onmouseover)
element.onmouseover(e);
isHovering = true;
}
} else {
if (isHovering) {
if (element.onmouseout)
element.onmouseout(e);
isHovering = false;
}
}
}
function touchEnd(e) {
_this.mousifyTouchEvent(e);
window.setUsingTouch(true);
if (preventDefault) {
e.preventDefault();
e.stopPropagation();
}
if (isHovering) {
if (element.onclick)
element.onclick(e);
if (element.onmouseout)
element.onmouseout(e);
isHovering = false;
}
}
};
this.removeAllChildren = function(element) {
while (element.hasChildNodes()) {
element.removeChild(element.lastChild);
}
};
this.generateElement = function(config) {
let element = document.createElement(config.tag || "div");
class GameObject {
constructor(sid) {
this.sid = sid;
// INIT:
this.init = function(x, y, dir, scale, type, data, owner) {
data = data || {};
this.sentTo = {};
this.gridLocations = [];
this.active = true;
this.render = true;
this.doUpdate = data.doUpdate;
this.x = x;
this.y = y;
this.dir = dir;
this.lastDir = dir;
this.xWiggle = 0;
this.yWiggle = 0;
this.visScale = scale;
this.scale = scale;
this.type = type;
this.id = data.id;
this.owner = owner;
this.name = data.name;
this.isItem = (this.id != undefined);
this.group = data.group;
this.maxHealth = data.health;
this.health = this.maxHealth;
this.layer = 2;
if (this.group != undefined) {
this.layer = this.group.layer;
} else if (this.type == 0) {
this.layer = 3;
} else if (this.type == 2) {
this.layer = 0;
} else if (this.type == 4) {
this.layer = -1;
}
this.colDiv = data.colDiv || 1;
this.blocker = data.blocker;
this.ignoreCollision = data.ignoreCollision;
this.dontGather = data.dontGather;
this.hideFromEnemy = data.hideFromEnemy;
this.friction = data.friction;
this.projDmg = data.projDmg;
this.dmg = data.dmg;
this.pDmg = data.pDmg;
this.pps = data.pps;
this.zIndex = data.zIndex || 0;
this.turnSpeed = data.turnSpeed;
this.req = data.req;
this.trap = data.trap;
this.healCol = data.healCol;
this.teleport = data.teleport;
this.boostSpeed = data.boostSpeed;
this.projectile = data.projectile;
this.shootRange = data.shootRange;
this.shootRate = data.shootRate;
this.shootCount = this.shootRate;
this.spawnPoint = data.spawnPoint;
this.onNear = 0;
this.breakObj = false;
this.alpha = data.alpha || 1;
this.maxAlpha = data.alpha || 1;
this.damaged = 0;
};
// GET HIT:
this.changeHealth = function(amount, doer) {
this.health += amount;
return (this.health <= 100);
};
// GET SCALE:
this.getScale = function(sM, ig) {
sM = sM || 1;
return this.scale * ((this.isItem || this.type == 2 || this.type == 3
|| this.type == 4) ?
1 : (0.6 * sM)) * (ig ? 1 : this.colDiv);
};
// VISIBLE TO PLAYER:
this.visibleToPlayer = function(player) {
return !(this.hideFromEnemy) || (this.owner && (this.owner == player ||
(this.owner.team &&
player.team == this.owner.team)));
};
// UPDATE:
this.update = function(delta) {
if (this.active) {
if (this.xWiggle) {
this.xWiggle *= Math.pow(0.99, delta);
}
if (this.yWiggle) {
this.yWiggle *= Math.pow(0.99, delta);
}
let d2 = UTILS.getAngleDist(this.lastDir, this.dir);
if (d2 > 0.01) {
this.dir += d2 / 5;
} else {
this.dir = this.lastDir;
}
} else {
if (this.alive) {
this.alpha -= delta / (200 / this.maxAlpha);
this.visScale += delta / (this.scale / 2.5);
if (this.alpha <= 0) {
this.alpha = 0;
this.alive = false;
}
}
}
};
// CHECK TEAM:
this.isTeam = function(tmpObj) {
return (this == tmpObj || (this.team && this.team == tmpObj.team));
};
// CHECK TEAM:
this.isTeamObject = function(tmpObj) {
return this.owner == null ? true : (this.owner && tmpObj.sid ==
this.owner.sid || tmpObj.findAllianceBySid(this.owner.sid));
};
}
}
class Items {
constructor() {
// ITEM GROUPS:
this.groups = [{
id: 0,
name: "food",
layer: 0
}, {
id: 1,
name: "walls",
place: true,
limit: 30,
layer: 0
}, {
id: 2,
name: "spikes",
place: true,
limit: 15,
layer: 0
}, {
id: 3,
name: "mill",
place: true,
limit: 7,
layer: 1
}, {
id: 4,
name: "mine",
place: true,
limit: 1,
layer: 0
}, {
id: 5,
name: "trap",
place: true,
limit: 6,
layer: -1
}, {
id: 6,
name: "booster",
place: true,
limit: 12,
layer: -1
}, {
id: 7,
name: "turret",
place: true,
limit: 2,
layer: 1
}, {
id: 8,
name: "watchtower",
place: true,
limit: 12,
layer: 1
}, {
id: 9,
name: "buff",
place: true,
limit: 4,
layer: -1
}, {
id: 10,
name: "spawn",
place: true,
limit: 1,
layer: -1
}, {
id: 11,
name: "sapling",
place: true,
limit: 2,
layer: 0
}, {
id: 12,
name: "blocker",
place: true,
limit: 3,
layer: -1
}, {
id: 13,
name: "teleporter",
place: true,
limit: 2,
layer: -1
}];
// PROJECTILES:
this.projectiles = [{
indx: 0,
layer: 0,
src: "arrow_1",
dmg: 25,
speed: 1.6,
scale: 103,
range: 1000
}, {
indx: 1,
layer: 1,
dmg: 25,
scale: 20
}, {
indx: 0,
layer: 0,
src: "arrow_1",
dmg: 35,
speed: 2.5,
scale: 103,
range: 1200
}, {
indx: 0,
layer: 0,
src: "arrow_1",
dmg: 30,
speed: 2,
scale: 103,
range: 1200
}, {
indx: 1,
layer: 1,
dmg: 16,
scale: 20
}, {
indx: 0,
layer: 0,
src: "bullet_1",
dmg: 50,
speed: 3.6,
scale: 160,
range: 1400
}];
// WEAPONS:
this.weapons = [{
id: 0,
type: 0,
name: "tool hammer",
desc: "tool for gathering all resources",
src: "hammer_1",
length: 140,
width: 140,
xOff: -3,
yOff: 18,
dmg: 25,
range: 65,
gather: 1,
speed: 300
}, {
id: 1,
type: 0,
age: 2,
name: "hand axe",
desc: "gathers resources at a higher rate",
src: "axe_1",
length: 140,
width: 140,
xOff: 3,
yOff: 24,
dmg: 30,
spdMult: 1,
range: 70,
gather: 2,
speed: 400
}, {
id: 2,
type: 0,
age: 8,
pre: 1,
name: "great axe",
desc: "deal more damage and gather more resources",
src: "great_axe_1",
length: 140,
width: 140,
xOff: -8,
yOff: 25,
dmg: 35,
spdMult: 1,
range: 75,
gather: 4,
speed: 400
}, {
id: 3,
type: 0,
age: 2,
name: "short sword",
desc: "increased attack power but slower move speed",
src: "sword_1",
iPad: 1.3,
length: 130,
width: 210,
xOff: -8,
yOff: 46,
dmg: 35,
spdMult: 0.85,
range: 110,
gather: 1,
speed: 300
}, {
id: 4,
type: 0,
age: 8,
pre: 3,
name: "katana",
desc: "greater range and damage",
src: "samurai_1",
iPad: 1.3,
length: 130,
width: 210,
xOff: -8,
yOff: 59,
dmg: 40,
spdMult: 0.8,
range: 118,
gather: 1,
speed: 300
}, {
id: 5,
type: 0,
age: 2,
name: "polearm",
desc: "long range melee weapon",
src: "spear_1",
iPad: 1.3,
length: 130,
width: 210,
xOff: -8,
yOff: 53,
dmg: 45,
knock: 0.2,
spdMult: 0.82,
range: 142,
gather: 1,
speed: 700
}, {
id: 6,
type: 0,
age: 2,
name: "bat",
desc: "fast long range melee weapon",
src: "bat_1",
iPad: 1.3,
length: 110,
width: 180,
xOff: -8,
yOff: 53,
dmg: 20,
knock: 0.7,
range: 110,
gather: 1,
speed: 300
}, {
id: 7,
type: 0,
age: 2,
name: "daggers",
desc: "really fast short range weapon",
src: "dagger_1",
iPad: 0.8,
length: 110,
width: 110,
xOff: 18,
yOff: 0,
dmg: 20,
knock: 0.1,
range: 65,
gather: 1,
hitSlow: 0.1,
spdMult: 1.13,
speed: 100
}, {
id: 8,
type: 0,
age: 2,
name: "stick",
desc: "great for gathering but very weak",
src: "stick_1",
length: 140,
width: 140,
xOff: 3,
yOff: 24,
dmg: 1,
spdMult: 1,
range: 70,
gather: 7,
speed: 400
}, {
id: 9,
type: 1,
age: 6,
name: "hunting bow",
desc: "bow used for ranged combat and hunting",
src: "bow_1",
req: ["wood", 4],
length: 120,
width: 120,
xOff: -6,
yOff: 0,
Pdmg: 25,
projectile: 0,
spdMult: 0.75,
speed: 600
}, {
id: 10,
type: 1,
age: 6,
name: "great hammer",
desc: "hammer used for destroying structures",
src: "great_hammer_1",
length: 140,
width: 140,
xOff: -9,
yOff: 25,
dmg: 10,
Pdmg: 10,
spdMult: 0.88,
range: 75,
sDmg: 7.5,
gather: 1,
speed: 400
}, {
id: 11,
type: 1,
age: 6,
name: "wooden shield",
desc: "blocks projectiles and reduces melee damage",
src: "shield_1",
length: 120,
width: 120,
shield: 0.2,
xOff: 6,
yOff: 0,
Pdmg: 0,
spdMult: 0.7
}, {
id: 12,
type: 1,
age: 8,
pre: 9,
name: "crossbow",
desc: "deals more damage and has greater range",
src: "crossbow_1",
req: ["wood", 5],
aboveHand: true,
armS: 0.75,
length: 120,
width: 120,
xOff: -4,
yOff: 0,
Pdmg: 35,
projectile: 2,
spdMult: 0.7,
speed: 700
}, {
id: 13,
type: 1,
age: 9,
pre: 12,
name: "repeater crossbow",
desc: "high firerate crossbow with reduced damage",
src: "crossbow_2",
req: ["wood", 10],
aboveHand: true,
armS: 0.75,
length: 120,
width: 120,
xOff: -4,
yOff: 0,
Pdmg: 30,
projectile: 3,
spdMult: 0.7,
speed: 230
}, {
id: 14,
type: 1,
age: 6,
name: "mc grabby",
desc: "steals resources from enemies",
src: "grab_1",
length: 130,
width: 210,
xOff: -8,
yOff: 53,
dmg: 0,
Pdmg: 0,
steal: 250,
knock: 0.2,
spdMult: 1.05,
range: 125,
gather: 0,
speed: 700
}, {
id: 15,
type: 1,
age: 9,
pre: 12,
name: "musket",
desc: "slow firerate but high damage and range",
src: "musket_1",
req: ["stone", 10],
aboveHand: true,
rec: 0.35,
armS: 0.6,
hndS: 0.3,
hndD: 1.6,
length: 205,
width: 205,
xOff: 25,
yOff: 0,
Pdmg: 50,
projectile: 5,
hideProjectile: true,
spdMult: 0.6,
speed: 1500
}];
// ITEMS:
this.list = [{
group: this.groups[0],
name: "apple",
desc: "restores 20 health when consumed",
req: ["food", 10],
consume: function(doer) {
return doer.changeHealth(20, doer);
},
scale: 22,
holdOffset: 15,
healing: 20,
itemID: 0,
itemAID: 16,
}, {
age: 3,
group: this.groups[0],
name: "cookie",
desc: "restores 40 health when consumed",
req: ["food", 15],
consume: function(doer) {
return doer.changeHealth(40, doer);
},
scale: 27,
holdOffset: 15,
healing: 40,
itemID: 1,
itemAID: 17,
}, {
age: 7,
group: this.groups[0],
name: "cheese",
desc: "restores 30 health and another 50 over 5 seconds",
req: ["food", 25],
consume: function(doer) {
if (doer.changeHealth(30, doer) || doer.health < 100) {
doer.dmgOverTime.dmg = -10;
doer.dmgOverTime.doer = doer;
doer.dmgOverTime.time = 5;
return true;
}
return false;
},
scale: 27,
holdOffset: 15,
healing: 30,
itemID: 2,
itemAID: 18,
}, {
group: this.groups[1],
name: "wood wall",
desc: "provides protection for your village",
req: ["wood", 10],
projDmg: true,
health: 380,
scale: 50,
holdOffset: 20,
placeOffset: -5,
itemID: 3,
itemAID: 19,
}, {
age: 3,
group: this.groups[1],
name: "stone wall",
desc: "provides improved protection for your village",
req: ["stone", 25],
health: 900,
scale: 50,
holdOffset: 20,
placeOffset: -5,
itemID: 4,
itemAID: 20,
}, {
age: 7,
group: this.groups[1],
name: "castle wall",
desc: "provides powerful protection for your village",
req: ["stone", 35],
health: 1500,
scale: 52,
holdOffset: 20,
placeOffset: -5,
itemID: 5,
itemAID: 21,
}, {
group: this.groups[2],
name: "spikes",
desc: "damages enemies when they touch them",
req: ["wood", 20, "stone", 5],
health: 400,
dmg: 20,
scale: 49,
spritePadding: -23,
holdOffset: 8,
placeOffset: -5,
itemID: 6,
itemAID: 22,
shadow: {
offsetX: 5, // Adjust the shadow's X offset as needed
offsetY: 5, // Adjust the shadow's Y offset as needed
blur: 20, // Adjust the shadow's blur as needed
color: "rgba(0, 0, 0, 0.5)" // Adjust the shadow's color and
transparency as needed
}
}, {
age: 5,
group: this.groups[2],
name: "greater spikes",
desc: "damages enemies when they touch them",
req: ["wood", 30, "stone", 10],
health: 500,
dmg: 35,
scale: 52,
spritePadding: -23,
holdOffset: 8,
placeOffset: -5,
itemID: 7,
itemAID: 23,
}, {
age: 9,
group: this.groups[2],
name: "poison spikes",
desc: "poisons enemies when they touch them",
req: ["wood", 35, "stone", 15],
health: 600,
dmg: 30,
pDmg: 5,
scale: 52,
spritePadding: -23,
holdOffset: 8,
placeOffset: -5,
itemID: 8,
itemAID: 24,
}, {
age: 9,
group: this.groups[2],
name: "spinning spikes",
desc: "damages enemies when they touch them",
req: ["wood", 30, "stone", 20],
health: 500,
dmg: 45,
turnSpeed: 0.003,
scale: 52,
spritePadding: -23,
holdOffset: 8,
placeOffset: -5,
itemID: 9,
itemAID: 25,
}, {
group: this.groups[3],
name: "windmill",
desc: "generates gold over time",
req: ["wood", 50, "stone", 10],
health: 400,
pps: 1,
turnSpeed: 0.0016,
spritePadding: 25,
iconLineMult: 12,
scale: 45,
holdOffset: 20,
placeOffset: 5,
itemID: 10,
itemAID: 26,
}, {
age: 5,
group: this.groups[3],
name: "faster windmill",
desc: "generates more gold over time",
req: ["wood", 60, "stone", 20],
health: 500,
pps: 1.5,
turnSpeed: 0.0025,
spritePadding: 25,
iconLineMult: 12,
scale: 47,
holdOffset: 20,
placeOffset: 5,
itemID: 11,
itemAID: 27,
}, {
age: 8,
group: this.groups[3],
name: "power mill",
desc: "generates more gold over time",
req: ["wood", 100, "stone", 50],
health: 800,
pps: 2,
turnSpeed: 0.005,
spritePadding: 25,
iconLineMult: 12,
scale: 47,
holdOffset: 20,
placeOffset: 5,
itemID: 12,
itemAID: 28,
}, {
age: 5,
group: this.groups[4],
type: 2,
name: "mine",
desc: "allows you to mine stone",
req: ["wood", 20, "stone", 100],
iconLineMult: 12,
scale: 65,
holdOffset: 20,
placeOffset: 0,
itemID: 13,
itemAID: 29,
}, {
age: 5,
group: this.groups[11],
type: 0,
name: "sapling",
desc: "allows you to farm wood",
req: ["wood", 150],
iconLineMult: 12,
colDiv: 0.5,
scale: 110,
holdOffset: 50,
placeOffset: -15,
itemID: 14,
itemAID: 30,
}, {
age: 4,
group: this.groups[5],
name: "pit trap",
desc: "pit that traps enemies if they walk over it",
req: ["wood", 30, "stone", 30],
trap: true,
ignoreCollision: true,
hideFromEnemy: true,
health: 500,
colDiv: 0.2,
scale: 50,
holdOffset: 20,
placeOffset: -5,
alpha: 0.6,
itemID: 15,
itemAID: 31,
}, {
age: 4,
group: this.groups[6],
name: "boost pad",
desc: "provides boost when stepped on",
req: ["stone", 20, "wood", 5],
ignoreCollision: true,
boostSpeed: 1.5,
health: 150,
colDiv: 0.7,
scale: 45,
holdOffset: 20,
placeOffset: -5,
itemID: 16,
itemAID: 32,
}, {
age: 7,
group: this.groups[7],
doUpdate: true,
name: "turret",
desc: "defensive structure that shoots at enemies",
req: ["wood", 200, "stone", 150],
health: 800,
projectile: 1,
shootRange: 700,
shootRate: 2200,
scale: 43,
holdOffset: 20,
placeOffset: -5,
itemID: 17,
itemAID: 33,
}, {
age: 7,
group: this.groups[8],
name: "platform",
desc: "platform to shoot over walls and cross over water",
req: ["wood", 20],
ignoreCollision: true,
zIndex: 1,
health: 300,
scale: 43,
holdOffset: 20,
placeOffset: -5,
itemID: 18,
itemAID: 34,
}, {
age: 7,
group: this.groups[9],
name: "healing pad",
desc: "standing on it will slowly heal you",
req: ["wood", 30, "food", 10],
ignoreCollision: true,
healCol: 15,
health: 400,
colDiv: 0.7,
scale: 45,
holdOffset: 20,
placeOffset: -5,
itemID: 19,
itemAID: 35,
}, {
age: 9,
group: this.groups[10],
name: "spawn pad",
desc: "you will spawn here when you die but it will dissapear",
req: ["wood", 100, "stone", 100],
health: 400,
ignoreCollision: true,
spawnPoint: true,
scale: 45,
holdOffset: 20,
placeOffset: -5,
itemID: 20,
itemAID: 36,
}, {
age: 7,
group: this.groups[12],
name: "blocker",
desc: "blocks building in radius",
req: ["wood", 30, "stone", 25],
ignoreCollision: true,
blocker: 300,
health: 400,
colDiv: 0.7,
scale: 45,
holdOffset: 20,
placeOffset: -5,
itemID: 21,
itemAID: 37,
}, {
age: 7,
group: this.groups[13],
name: "teleporter",
desc: "teleports you to a random point on the map",
req: ["wood", 60, "stone", 60],
ignoreCollision: true,
teleport: true,
health: 200,
colDiv: 0.7,
scale: 45,
holdOffset: 20,
placeOffset: -5,
itemID: 22,
itemAID: 38
}];
// ASSIGN IDS:
for (let i = 0; i < this.list.length; ++i) {
this.list[i].id = i;
if (this.list[i].pre) this.list[i].pre = i - this.list[i].pre;
}
// TROLOLOLOL:
if (typeof window !== "undefined") {
function shuffle(a) {
for (let i = a.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[a[i], a[j]] = [a[j], a[i]];
}
return a;
}
//shuffle(this.list);
}
}
}
class Objectmanager {
constructor(GameObject, liztobj, UTILS, config, players, server) {
let mathFloor = Math.floor,
mathABS = Math.abs,
mathCOS = Math.cos,
mathSIN = Math.sin,
mathPOW = Math.pow,
mathSQRT = Math.sqrt;
this.ignoreAdd = false;
this.hitObj = [];
// DISABLE OBJ:
this.disableObj = function(obj) {
obj.active = false;
};
// ADD NEW:
let tmpObj;
this.add = function(sid, x, y, dir, s, type, data, setSID, owner) {
tmpObj = findObjectBySid(sid);
if (!tmpObj) {
tmpObj = gameObjects.find((tmp) => !tmp.active);
if (!tmpObj) {
tmpObj = new GameObject(sid);
gameObjects.push(tmpObj);
}
}
if (setSID) {
tmpObj.sid = sid;
}
tmpObj.init(x, y, dir, s, type, data, owner);
};
// DISABLE BY SID:
this.disableBySid = function(sid) {
let find = findObjectBySid(sid);
if (find) {
this.disableObj(find);
}
};
// CHECK IF PLACABLE:
this.checkItemLocation = function(x, y, s, sM, indx, ignoreWater, placer) {
let cantPlace = liztobj.find((tmp) => tmp.active &&
UTILS.getDistance(x, y, tmp.x, tmp.y) < s + (tmp.blocker ? tmp.blocker :
tmp.getScale(sM, tmp.isItem)));
if (cantPlace) return false;
if (!ignoreWater && indx != 18 && y >= config.mapScale / 2 -
config.riverWidth / 2 && y <= config.mapScale / 2 + config.riverWidth / 2) return
false;
return true;
};
this.preplaceCheck = function (p371, p372, p373, p374) {
let v399 = player.x2 + p374 * Math.cos(p372);
let v400 = player.y2 + p374 * Math.sin(p372);
let v401 = liztobj.filter(p375 => p375.active && UTILS.getDist(player,
p375, 2, 0) < 300);
const v402 = {
x: v399,
y: v400
};
let v403 = v401.find(p376 => p376.active && p376.sid !== p373.sid &&
UTILS.getDist(v402, p376, 0, 0) < p371.scale + (p376.blocker ? p376.blocker :
p376.getScale(0.6, p376.isItem)));
if (v403) {
return false;
}
if (p371.id != 18 && v400 >= config.mapScale / 2 - config.riverWidth /
2 && v400 <= config.mapScale / 2 + config.riverWidth / 2) {
return false;
}
return true;
};
let v274 = {
active: false,
x: 0,
y: 0,
aim: 0,
info: {},
dist: 0
};
this.canBeBroken = function (p377) {
if (!inGame || !p377 || !enemy.length) {
return;
}
let v404 = player.weapons[traps.notFast(p377) ? 1 : 0];
let v405 = player[(v404 < 9 ? "prima" : "seconda") + "ryVariant"];
let v406 = v405 != undefined ? config.weaponVariants[v405].val : 1;
let v407 = near.secondaryIndex != undefined && near.primaryIndex !=
undefined ? near.secondaryIndex == 10 && (p377.health >
items.weapons[near.weapons[0]].dmg || near.primaryIndex == 5) ? near.secondaryIndex
: near.primaryIndex : 10;
let v408 = near.secondaryIndex != undefined && near.primaryIndex !=
undefined ? near[(v407 < 9 ? "prima" : "seconda") + "ryVariant"] : 3;
let v409 = config.weaponVariants[v408].val;
let v410 = items.weapons[v404].dmg;
let v411 = items.weapons[v407].dmg;
let v412 = 3.3;
let v413 = 0;
if (near.reloads[v407] == 0 && this.canHit(near, p377, v407, 50)) {
v413 += v411 * v412 * v409 * (items.weapons[v404].sDmg || 1);
}
if (traps.inTrap && (p377 == traps.info[1] || p377 == traps.info[0]) ||
v274.active && p377 == v274.info || clicks.right && player.reloads[v404] == 0) {
v413 += v410 * v412 * v406 * (items.weapons[v404].sDmg || 1);
}
if (p377.health <= v413) {
return true;
}
return false;
};
this.hitsToBreak = function (p378, p379) {
if (!inGame || !p378 || !enemy.length || !p379) {
return;
}
let v414 = traps.notFast(p378, p379) ? p379.weapons[1] :
p379.weapons[0];
let v415 = p379[(v414 < 9 ? "prima" : "seconda") + "ryVariant"];
let v416 = v415 != undefined ? config.weaponVariants[v415].val : 1.18;
let v417 = items.weapons[v414].dmg;
let v418 = 3.3;
let v419 = v417 * v418 * v416 * (items.weapons[v414].sDmg || 1);
return Math.ceil(p378.health / v419);
};
this.canHit = function (p380, p381, p382, p383 = 0) {
return UTILS.getDist(p380, p381, 2, 0) <= items.weapons[p382].range +
p380.scale + p381.scale / 3.25 + p383;
};
}
}
class Projectile {
constructor(players, ais, objectManager, items, config, UTILS, server) {
// INIT:
this.init = function(indx, x, y, dir, spd, dmg, rng, scl, owner) {
this.active = true;
this.tickActive = true;
this.indx = indx;
this.x = x;
this.y = y;
this.x2 = x;
this.y2 = y;
this.dir = dir;
this.skipMov = true;
this.speed = spd;
this.dmg = dmg;
this.scale = scl;
this.range = rng;
this.r2 = rng;
this.owner = owner;
};
// UPDATE:
this.update = function(delta) {
if (this.active) {
let tmpSpeed = this.speed * delta;
if (!this.skipMov) {
this.x += tmpSpeed * Math.cos(this.dir);
this.y += tmpSpeed * Math.sin(this.dir);
this.range -= tmpSpeed;
if (this.range <= 0) {
this.x += this.range * Math.cos(this.dir);
this.y += this.range * Math.sin(this.dir);
tmpSpeed = 1;
this.range = 0;
this.active = false;
}
} else {
this.skipMov = false;
}
}
};
this.tickUpdate = function(delta) {
if (this.tickActive) {
let tmpSpeed = this.speed * delta;
if (!this.skipMov) {
this.x2 += tmpSpeed * Math.cos(this.dir);
this.y2 += tmpSpeed * Math.sin(this.dir);
this.r2 -= tmpSpeed;
if (this.r2 <= 0) {
this.x2 += this.r2 * Math.cos(this.dir);
this.y2 += this.r2 * Math.sin(this.dir);
tmpSpeed = 1;
this.r2 = 0;
this.tickActive = false;
}
} else {
this.skipMov = false;
}
}
};
}
};
class Store {
constructor() {
// STORE HATS:
this.hats = [{
id: 45,
name: "Shame!",
dontSell: true,
price: 0,
scale: 120,
desc: "hacks are for winners"
}, {
id: 51,
name: "Moo Cap",
price: 0,
scale: 120,
desc: "coolest mooer around"
}, {
id: 50,
name: "Apple Cap",
price: 0,
scale: 120,
desc: "apple farms remembers"
}, {
id: 28,
name: "Moo Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 29,
name: "Pig Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 30,
name: "Fluff Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 36,
name: "Pandou Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 37,
name: "Bear Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 38,
name: "Monkey Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 44,
name: "Polar Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 35,
name: "Fez Hat",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 42,
name: "Enigma Hat",
price: 0,
scale: 120,
desc: "join the enigma army"
}, {
id: 43,
name: "Blitz Hat",
price: 0,
scale: 120,
desc: "hey everybody i'm blitz"
}, {
id: 49,
name: "Bob XIII Hat",
price: 0,
scale: 120,
desc: "like and subscribe"
}, {
id: 57,
name: "Pumpkin",
price: 50,
scale: 120,
desc: "Spooooky"
}, {
id: 8,
name: "Bummle Hat",
price: 100,
scale: 120,
desc: "no effect"
}, {
id: 2,
name: "Straw Hat",
price: 500,
scale: 120,
desc: "no effect"
}, {
id: 15,
name: "Winter Cap",
price: 600,
scale: 120,
desc: "allows you to move at normal speed in snow",
coldM: 1
}, {
id: 5,
name: "Cowboy Hat",
price: 1000,
scale: 120,
desc: "no effect"
}, {
id: 4,
name: "Ranger Hat",
price: 2000,
scale: 120,
desc: "no effect"
}, {
id: 18,
name: "Explorer Hat",
price: 2000,
scale: 120,
desc: "no effect"
}, {
id: 31,
name: "Flipper Hat",
price: 2500,
scale: 120,
desc: "have more control while in water",
watrImm: true
}, {
id: 1,
name: "Marksman Cap",
price: 3000,
scale: 120,
desc: "increases arrow speed and range",
aMlt: 1.3
}, {
id: 10,
name: "Bush Gear",
price: 3000,
scale: 160,
desc: "allows you to disguise yourself as a bush"
}, {
id: 48,
name: "Halo",
price: 3000,
scale: 120,
desc: "no effect"
}, {
id: 6,
name: "Soldier Helmet",
price: 4000,
scale: 120,
desc: "reduces damage taken but slows movement",
spdMult: 0.94,
dmgMult: 0.75
}, {
id: 23,
name: "Anti Venom Gear",
price: 4000,
scale: 120,
desc: "makes you immune to poison",
poisonRes: 1
}, {
id: 13,
name: "Medic Gear",
price: 5000,
scale: 110,
desc: "slowly regenerates health over time",
healthRegen: 3
}, {
id: 9,
name: "Miners Helmet",
price: 5000,
scale: 120,
desc: "earn 1 extra gold per resource",
extraGold: 1
}, {
id: 32,
name: "Musketeer Hat",
price: 5000,
scale: 120,
desc: "reduces cost of projectiles",
projCost: 0.5
}, {
id: 7,
name: "Bull Helmet",
price: 6000,
scale: 120,
desc: "increases damage done but drains health",
healthRegen: -5,
dmgMultO: 1.5,
spdMult: 0.96
}, {
id: 22,
name: "Emp Helmet",
price: 6000,
scale: 120,
desc: "turrets won't attack but you move slower",
antiTurret: 1,
spdMult: 0.7
}, {
id: 12,
name: "Booster Hat",
price: 6000,
scale: 120,
desc: "increases your movement speed",
spdMult: 1.16
}, {
id: 26,
name: "Barbarian Armor",
price: 8000,
scale: 120,
desc: "knocks back enemies that attack you",
dmgK: 0.6
}, {
id: 21,
name: "Plague Mask",
price: 10000,
scale: 120,
desc: "melee attacks deal poison damage",
poisonDmg: 5,
poisonTime: 6
}, {
id: 46,
name: "Bull Mask",
price: 10000,
scale: 120,
desc: "bulls won't target you unless you attack them",
bullRepel: 1
}, {
id: 14,
name: "Windmill Hat",
topSprite: true,
price: 10000,
scale: 120,
desc: "generates points while worn",
pps: 1.5
}, {
id: 11,
name: "Spike Gear",
topSprite: true,
price: 10000,
scale: 120,
desc: "deal damage to players that damage you",
dmg: 0.45
}, {
id: 53,
name: "Turret Gear",
topSprite: true,
price: 10000,
scale: 120,
desc: "you become a walking turret",
turret: {
proj: 1,
range: 700,
rate: 2500
},
spdMult: 0.7
}, {
id: 20,
name: "Samurai Armor",
price: 12000,
scale: 120,
desc: "increased attack speed and fire rate",
atkSpd: 0.78
}, {
id: 58,
name: "Dark Knight",
price: 12000,
scale: 120,
desc: "restores health when you deal damage",
healD: 0.4
}, {
id: 27,
name: "Scavenger Gear",
price: 15000,
scale: 120,
desc: "earn double points for each kill",
kScrM: 2
}, {
id: 40,
name: "Tank Gear",
price: 15000,
scale: 120,
desc: "increased damage to buildings but slower movement",
spdMult: 0.3,
bDmg: 3.3
}, {
id: 52,
name: "Thief Gear",
price: 15000,
scale: 120,
desc: "steal half of a players gold when you kill them",
goldSteal: 0.5
}, {
id: 55,
name: "Bloodthirster",
price: 20000,
scale: 120,
desc: "Restore Health when dealing damage. And increased damage",
healD: 0.25,
dmgMultO: 1.2,
}, {
id: 56,
name: "Assassin Gear",
price: 20000,
scale: 120,
desc: "Go invisible when not moving. Can't eat. Increased speed",
noEat: true,
spdMult: 1.1,
invisTimer: 1000
}];
// STORE ACCESSORIES:
this.accessories = [{
id: 12,
name: "Snowball",
price: 1000,
scale: 105,
xOff: 18,
desc: "no effect"
}, {
id: 9,
name: "Tree Cape",
price: 1000,
scale: 90,
desc: "no effect"
}, {
id: 10,
name: "Stone Cape",
price: 1000,
scale: 90,
desc: "no effect"
}, {
id: 3,
name: "Cookie Cape",
price: 1500,
scale: 90,
desc: "no effect"
}, {
id: 8,
name: "Cow Cape",
price: 2000,
scale: 90,
desc: "no effect"
}, {
id: 11,
name: "Monkey Tail",
price: 2000,
scale: 97,
xOff: 25,
desc: "Super speed but reduced damage",
spdMult: 1.35,
dmgMultO: 0.2
}, {
id: 17,
name: "Apple Basket",
price: 3000,
scale: 80,
xOff: 12,
desc: "slowly regenerates health over time",
healthRegen: 1
}, {
id: 6,
name: "Winter Cape",
price: 3000,
scale: 90,
desc: "no effect"
}, {
id: 4,
name: "Skull Cape",
price: 4000,
scale: 90,
desc: "no effect"
}, {
id: 5,
name: "Dash Cape",
price: 5000,
scale: 90,
desc: "no effect"
}, {
id: 2,
name: "Dragon Cape",
price: 6000,
scale: 90,
desc: "no effect"
}, {
id: 1,
name: "Super Cape",
price: 8000,
scale: 90,
desc: "no effect"
}, {
id: 7,
name: "Troll Cape",
price: 8000,
scale: 90,
desc: "no effect"
}, {
id: 14,
name: "Thorns",
price: 10000,
scale: 115,
xOff: 20,
desc: "no effect"
}, {
id: 15,
name: "Blockades",
price: 10000,
scale: 95,
xOff: 15,
desc: "no effect"
}, {
id: 20,
name: "Devils Tail",
price: 10000,
scale: 95,
xOff: 20,
desc: "no effect"
}, {
id: 16,
name: "Sawblade",
price: 12000,
scale: 90,
spin: true,
xOff: 0,
desc: "deal damage to players that damage you",
dmg: 0.15
}, {
id: 13,
name: "Angel Wings",
price: 15000,
scale: 138,
xOff: 22,
desc: "slowly regenerates health over time",
healthRegen: 3
}, {
id: 19,
name: "Shadow Wings",
price: 15000,
scale: 138,
xOff: 22,
desc: "increased movement speed",
spdMult: 1.1
}, {
id: 18,
name: "Blood Wings",
price: 20000,
scale: 178,
xOff: 26,
desc: "restores health when you deal damage",
healD: 0.2
}, {
id: 21,
name: "Corrupt X Wings",
price: 20000,
scale: 178,
xOff: 26,
desc: "deal damage to players that damage you",
dmg: 0.25
}];
}
};
class ProjectileManager {
constructor(Projectile, projectiles, players, ais, objectManager, items,
config, UTILS, server) {
this.addProjectile = function(x, y, dir, range, speed, indx, owner,
ignoreObj, layer, inWindow) {
let tmpData = items.projectiles[indx];
let tmpProj;
for (let i = 0; i < projectiles.length; ++i) {
if (!projectiles[i].active) {
tmpProj = projectiles[i];
break;
}
}
if (!tmpProj) {
tmpProj = new Projectile(players, ais, objectManager, items,
config, UTILS, server);
tmpProj.sid = projectiles.length;
projectiles.push(tmpProj);
}
tmpProj.init(indx, x, y, dir, speed, tmpData.dmg, range, tmpData.scale,
owner);
tmpProj.ignoreObj = ignoreObj;
tmpProj.layer = layer || tmpData.layer;
tmpProj.inWindow = inWindow;
tmpProj.src = tmpData.src;
return tmpProj;
};
}
};
class AiManager {
// AI MANAGER:
constructor(ais, AI, players, items, objectManager, config, UTILS,
scoreCallback, server) {
// AI TYPES:
this.aiTypes = [{
id: 0,
src: "cow_1",
killScore: 150,
health: 500,
weightM: 0.8,
speed: 0.00095,
turnSpeed: 0.001,
scale: 72,
drop: ["food", 50]
}, {
id: 1,
src: "pig_1",
killScore: 200,
health: 800,
weightM: 0.6,
speed: 0.00085,
turnSpeed: 0.001,
scale: 72,
drop: ["food", 80]
}, {
id: 2,
name: "Bull",
src: "bull_2",
hostile: true,
dmg: 20,
killScore: 1000,
health: 1800,
weightM: 0.5,
speed: 0.00094,
turnSpeed: 0.00074,
scale: 78,
viewRange: 800,
chargePlayer: true,
drop: ["food", 100]
}, {
id: 3,
name: "Bully",
src: "bull_1",
hostile: true,
dmg: 20,
killScore: 2000,
health: 2800,
weightM: 0.45,
speed: 0.001,
turnSpeed: 0.0008,
scale: 90,
viewRange: 900,
chargePlayer: true,
drop: ["food", 400]
}, {
id: 4,
name: "Wolf",
src: "wolf_1",
hostile: true,
dmg: 8,
killScore: 500,
health: 300,
weightM: 0.45,
speed: 0.001,
turnSpeed: 0.002,
scale: 84,
viewRange: 800,
chargePlayer: true,
drop: ["food", 200]
}, {
id: 5,
name: "Quack",
src: "chicken_1",
dmg: 8,
killScore: 2000,
noTrap: true,
health: 300,
weightM: 0.2,
speed: 0.0018,
turnSpeed: 0.006,
scale: 70,
drop: ["food", 100]
}, {
id: 6,
name: "MOOSTAFA",
nameScale: 50,
src: "enemy",
hostile: true,
dontRun: true,
fixedSpawn: true,
spawnDelay: 60000,
noTrap: true,
colDmg: 100,
dmg: 40,
killScore: 8000,
health: 18000,
weightM: 0.4,
speed: 0.0007,
turnSpeed: 0.01,
scale: 80,
spriteMlt: 1.8,
leapForce: 0.9,
viewRange: 1000,
hitRange: 210,
hitDelay: 1000,
chargePlayer: true,
drop: ["food", 100]
}, {
id: 7,
name: "Treasure",
hostile: true,
nameScale: 35,
src: "crate_1",
fixedSpawn: true,
spawnDelay: 120000,
colDmg: 200,
killScore: 5000,
health: 20000,
weightM: 0.1,
speed: 0.0,
turnSpeed: 0.0,
scale: 70,
spriteMlt: 1.0
}, {
id: 8,
name: "MOOFIE",
src: "wolf_2",
hostile: true,
fixedSpawn: true,
dontRun: true,
hitScare: 4,
spawnDelay: 30000,
noTrap: true,
nameScale: 35,
dmg: 10,
colDmg: 100,
killScore: 3000,
health: 7000,
weightM: 0.45,
speed: 0.0015,
turnSpeed: 0.002,
scale: 90,
viewRange: 800,
chargePlayer: true,
drop: ["food", 1000]
}, {
id: 9,
name: "💀MOOFIE",
src: "wolf_2",
hostile: !0,
fixedSpawn: !0,
dontRun: !0,
hitScare: 50,
spawnDelay: 6e4,
noTrap: !0,
nameScale: 35,
dmg: 12,
colDmg: 100,
killScore: 3e3,
health: 9e3,
weightM: .45,
speed: .0015,
turnSpeed: .0025,
scale: 94,
viewRange: 1440,
chargePlayer: !0,
drop: ["food", 3e3],
minSpawnRange: .85,
maxSpawnRange: .9
}, {
id: 10,
name: "💀Wolf",
src: "wolf_1",
hostile: !0,
fixedSpawn: !0,
dontRun: !0,
hitScare: 50,
spawnDelay: 3e4,
dmg: 10,
killScore: 700,
health: 500,
weightM: .45,
speed: .00115,
turnSpeed: .0025,
scale: 88,
viewRange: 1440,
chargePlayer: !0,
drop: ["food", 400],
minSpawnRange: .85,
maxSpawnRange: .9
}, {
id: 11,
name: "💀Bully",
src: "bull_1",
hostile: !0,
fixedSpawn: !0,
dontRun: !0,
hitScare: 50,
dmg: 20,
killScore: 5e3,
health: 5e3,
spawnDelay: 1e5,
weightM: .45,
speed: .00115,
turnSpeed: .0025,
scale: 94,
viewRange: 1440,
chargePlayer: !0,
drop: ["food", 800],
minSpawnRange: .85,
maxSpawnRange: .9
}];
// SPAWN AI:
this.spawn = function(x, y, dir, index) {
let tmpObj = ais.find((tmp) => !tmp.active);
if (!tmpObj) {
tmpObj = new AI(ais.length, objectManager, players, items, UTILS,
config, scoreCallback, server);
ais.push(tmpObj);
}
tmpObj.init(x, y, dir, index, this.aiTypes[index]);
return tmpObj;
};
}
};
class AI {
constructor(sid, objectManager, players, items, UTILS, config, scoreCallback,
server) {
this.sid = sid;
this.isAI = true;
this.nameIndex = UTILS.randInt(0, config.cowNames.length - 1);
// INIT:
this.init = function(x, y, dir, index, data) {
this.x = x;
this.y = y;
this.startX = data.fixedSpawn ? x : null;
this.startY = data.fixedSpawn ? y : null;
this.xVel = 0;
this.yVel = 0;
this.zIndex = 0;
this.dir = dir;
this.dirPlus = 0;
this.showName = 'aaa';
this.index = index;
this.src = data.src;
if (data.name) this.name = data.name;
this.weightM = data.weightM;
this.speed = data.speed;
this.killScore = data.killScore;
this.turnSpeed = data.turnSpeed;
this.scale = data.scale;
this.maxHealth = data.health;
this.leapForce = data.leapForce;
this.health = this.maxHealth;
this.chargePlayer = data.chargePlayer;
this.viewRange = data.viewRange;
this.drop = data.drop;
this.dmg = data.dmg;
this.hostile = data.hostile;
this.dontRun = data.dontRun;
this.hitRange = data.hitRange;
this.hitDelay = data.hitDelay;
this.hitScare = data.hitScare;
this.spriteMlt = data.spriteMlt;
this.nameScale = data.nameScale;
this.colDmg = data.colDmg;
this.noTrap = data.noTrap;
this.spawnDelay = data.spawnDelay;
this.hitWait = 0;
this.waitCount = 1000;
this.moveCount = 0;
this.targetDir = 0;
this.active = true;
this.alive = true;
this.runFrom = null;
this.chargeTarget = null;
this.dmgOverTime = {};
};
let tmpRatio = 0;
let animIndex = 0;
this.animate = function(delta) {
if (this.animTime > 0) {
this.animTime -= delta;
if (this.animTime <= 0) {
this.animTime = 0;
this.dirPlus = 0;
tmpRatio = 0;
animIndex = 0;
} else {
if (animIndex == 0) {
tmpRatio += delta / (this.animSpeed *
config.hitReturnRatio);
this.dirPlus = UTILS.lerp(0, this.targetAngle, Math.min(1,
tmpRatio));
if (tmpRatio >= 1) {
tmpRatio = 1;
animIndex = 1;
}
} else {
tmpRatio -= delta / (this.animSpeed * (1 -
config.hitReturnRatio));
this.dirPlus = UTILS.lerp(0, this.targetAngle, Math.max(0,
tmpRatio));
}
}
}
};
// ANIMATION:
this.startAnim = function() {
this.animTime = this.animSpeed = 600;
this.targetAngle = Math.PI * 0.8;
tmpRatio = 0;
animIndex = 0;
};
};
};
class addCh {
constructor(x, y, chat, tmpObj) {
this.x = x;
this.y = y;
this.alpha = 0;
this.active = true;
this.alive = false;
this.chat = chat;
this.owner = tmpObj;
};
};
class DeadPlayer {
constructor(x, y, dir, buildIndex, weaponIndex, weaponVariant, skinColor,
scale, name) {
this.x = x;
this.y = y;
this.lastDir = dir;
this.dir = dir + Math.PI;
this.buildIndex = buildIndex;
this.weaponIndex = weaponIndex;
this.weaponVariant = weaponVariant;
this.skinColor = skinColor;
this.scale = scale;
this.visScale = 0;
this.name = name;
this.alpha = 1;
this.active = true;
this.animate = function(delta) {
let d2 = UTILS.getAngleDist(this.lastDir, this.dir);
if (d2 > 0.01) {
this.dir += d2 / 20;
} else {
this.dir = this.lastDir;
}
if (this.visScale < this.scale) {
this.visScale += delta / (this.scale / 2);
if (this.visScale >= this.scale) {
this.visScale = this.scale;
}
}
this.alpha -= delta / 30000;
if (this.alpha <= 0) {
this.alpha = 0;
this.active = false;
}
}
}
};
class Player {
constructor(id, sid, config, UTILS, projectileManager, objectManager, players,
ais, items, hats, accessories, server, scoreCallback, iconCallback) {
this.id = id;
this.sid = sid;
this.tmpScore = 0;
this.team = null;
this.latestSkin = 0;
this.oldSkinIndex = 0;
this.skinIndex = 0;
this.latestTail = 0;
this.oldTailIndex = 0;
this.tailIndex = 0;
this.hitTime = 0;
this.lastHit = 0;
this.showName = 'NOOO';
this.tails = {};
for (let i = 0; i < accessories.length; ++i) {
if (accessories[i].price <= 0)
this.tails[accessories[i].id] = 1;
}
this.skins = {};
for (let i = 0; i < hats.length; ++i) {
if (hats[i].price <= 0)
this.skins[hats[i].id] = 1;
}
this.points = 0;
this.dt = 0;
this.hidden = false;
this.itemCounts = {};
this.isPlayer = true;
this.pps = 0;
this.moveDir = undefined;
this.skinRot = 0;
this.lastPing = 0;
this.iconIndex = 0;
this.skinColor = 0;
this.dist2 = 0;
this.aim2 = 0;
this.maxSpeed = 1;
this.chat = {
message: null,
count: 0
};
this.backupNobull = true;
this.circle = false;
this.circleRad = 200;
this.circleRadSpd = 0.1;
this.cAngle = 0;
// SPAWN:
this.spawn = function(moofoll) {
this.attacked = false;
this.timeDamaged = 0;
this.timeHealed = 100;
this.pinge = 0;
this.millPlace = 'NOOO';
this.lastshamecount = 0;
this.death = false;
this.spinDir = 0;
this.sync = false;
this.antiBull = 0;
this.bullTimer = 0;
this.poisonTimer = 0;
this.active = true;
this.alive = true;
this.lockMove = false;
this.lockDir = false;
this.minimapCounter = 0;
this.chatCountdown = 0;
this.shameCount = 0;
this.shameTimer = 0;
this.sentTo = {};
this.gathering = 0;
this.gatherIndex = 0;
this.shooting = {};
this.shootIndex = 9;
this.autoGather = 0;
this.animTime = 0;
this.animSpeed = 0;
this.mouseState = 0;
this.buildIndex = -1;
this.weaponIndex = 0;
this.weaponCode = 0;
this.weaponVariant = 0;
this.primaryIndex = undefined;
this.secondaryIndex = undefined;
this.dmgOverTime = {};
this.noMovTimer = 0;
this.maxXP = 300;
this.XP = 0;
this.age = 1;
this.kills = 0;
this.upgrAge = 2;
this.upgradePoints = 0;
this.x = 0;
this.y = 0;
this.oldXY = {
x: 0,
y: 0
};
this.zIndex = 0;
this.xVel = 0;
this.yVel = 0;
this.slowMult = 1;
this.dir = 0;
this.dirPlus = 0;
this.targetDir = 0;
this.targetAngle = 0;
this.maxHealth = 100;
this.health = this.maxHealth;
this.oldHealth = this.maxHealth;
this.damaged = 0;
this.scale = config.playerScale;
this.speed = config.playerSpeed;
this.resetMoveDir();
this.resetResources(moofoll);
this.items = [0, 3, 6, 10];
this.weapons = [0];
this.shootCount = 0;
this.weaponXP = [3000];
this.reloads = {
0: 0,
1: 0,
2: 0,
3: 0,
4: 0,
5: 0,
6: 0,
7: 0,
8: 0,
9: 0,
10: 0,
11: 0,
12: 0,
13: 0,
14: 0,
15: 0,
53: 0,
};
this.bowThreat = {
9: 0,
12: 0,
13: 0,
15: 0,
};
this.damageThreat = 0;
this.inTrap = false;
this.canEmpAnti = false;
this.empAnti = false;
this.soldierAnti = false;
this.BarbarianAnti = false;
this.poisonTick = 0;
this.bullTick = 0;
this.setPoisonTick = false;
this.setBullTick = false;
this.antiTimer = 2;
};
// ADD ITEM:
this.getItemType = function(id) {
let findindx = this.items.findIndex((ids) => ids == id);
if (findindx != -1) {
return findindx;
} else {
return items.checkItem.index(id, this.items);
}
};
// SET DATA:
this.setData = function(data) {
this.id = data[0];
this.sid = data[1];
this.name = data[2];
this.x = data[3];
this.y = data[4];
this.dir = data[5];
this.health = data[6];
this.maxHealth = data[7];
this.scale = data[8];
this.skinColor = data[9];
};
let plaguemask =false;
// UPDATE POISON TICK:
this.updateTimer = function() {
this.bullTimer -= 1;
if (this.bullTimer <= 0) {
this.setBullTick = false;
this.bullTick = game.tick - 1;
this.bullTimer = config.serverUpdateRate;
}
this.poisonTimer -= 1;
if (this.poisonTimer < 0) {
this.setPoisonTick = false;
this.poisonTick = game.tick - 1;
this.poisonTimer = config.serverUpdateRate;
plaguemask = true;
setTimeout(() => {
plaguemask = false;
}, 1000);
} else if(this.poisonTimer >= 0) {
plaguemask = false;
}
};
this.update = function(delta) {
if (this.sid == playerSID) {
this.circleRad = parseInt() || 0;
this.circleRadSpd = parseFloat() || 0;
this.cAngle += this.circleRadSpd;
}
if (this.active) {
// MOVE:
let gear = {
skin: findID(hats, this.skinIndex),
tail: findID(accessories, this.tailIndex)
}
let spdMult = ((this.buildIndex >= 0) ? 0.5 : 1) *
(items.weapons[this.weaponIndex].spdMult || 1) * (gear.skin ? (gear.skin.spdMult ||
1) : 1) * (gear.tail ? (gear.tail.spdMult || 1) : 1) * (this.y <=
config.snowBiomeTop ? ((gear.skin && gear.skin.coldM) ? 1 : config.snowSpeed) : 1)
* this.slowMult;
this.maxSpeed = spdMult;
}
};
let tmpRatio = 0;
let animIndex = 0;
this.animate = function(delta) {
if (this.animTime > 0) {
this.animTime -= delta;
if (this.animTime <= 0) {
this.animTime = 0;
this.dirPlus = 0;
tmpRatio = 0;
animIndex = 0;
} else {
if (animIndex == 0) {
tmpRatio += delta / (this.animSpeed *
config.hitReturnRatio);
this.dirPlus = UTILS.lerp(0, this.targetAngle, Math.min(1,
tmpRatio));
if (tmpRatio >= 1) {
tmpRatio = 1;
animIndex = 1;
}
} else {
tmpRatio -= delta / (this.animSpeed * (1 -
config.hitReturnRatio));
this.dirPlus = UTILS.lerp(0, this.targetAngle, Math.max(0,
tmpRatio));
}
}
}
};
// GATHER ANIMATION:
this.startAnim = function(didHit, index) {
this.animTime = this.animSpeed = items.weapons[index].speed;
this.targetAngle = (didHit ? -config.hitAngle : -Math.PI);
tmpRatio = 0;
animIndex = 0;
};
// CAN SEE:
this.canSee = function(other) {
if (!other) return false;
let dx = Math.abs(other.x - this.x) - other.scale;
let dy = Math.abs(other.y - this.y) - other.scale;
return dx <= (config.maxScreenWidth / 2) * 1.3 && dy <=
(config.maxScreenHeight / 2) * 1.3;
};
// SHAME SYSTEM:
this.judgeShame = function() {
this.lastshamecount = this.shameCount;
if (this.oldHealth < this.health) {
if (this.hitTime) {
let timeSinceHit = game.tick - this.hitTime;
this.lastHit = game.tick;
this.hitTime = 0;
if (timeSinceHit < 2) {
this.shameCount++;
} else {
this.shameCount = Math.max(0, this.shameCount - 2);
}
}
} else if (this.oldHealth > this.health) {
this.hitTime = game.tick;
}
};
this.addShameTimer = function() {
this.shameCount = 0;
this.shameTimer = 30;
let interval = setInterval(() => {
this.shameTimer--;
if (this.shameTimer <= 0) {
clearInterval(interval);
}
}, 1000);
};
// CHECK TEAM:
this.isTeam = function(tmpObj) {
return (this == tmpObj || (this.team && this.team == tmpObj.team));
};
let lastPlacementTime = 0;
let enemyHeatmap = {};
let enemyMovementPatterns = {};
let environmentalFactors = {};
let trapPositionCache = {};
let teamCoordination = {};
let liveCombatData = {};
if (this.gathering || this.shooting[1]) {
if (this.gathering) {
this.gathering = 0;
this.reloads[this.gatherIndex] =
(items.weapons[this.gatherIndex].speed * (this.skinIndex == 20 ? 0.78 : 1));
this.attacked = true;
}
if (this.shooting[1]) {
this.shooting[1] = 0;
this.reloads[this.shootIndex] =
(items.weapons[this.shootIndex].speed * (this.skinIndex == 20 ? 0.78 : 1));
this.attacked = true;
}
} else {
this.attacked = false;
if (this.buildIndex < 0) {
if (this.reloads[this.weaponIndex] > 0) {
this.reloads[this.weaponIndex] = Math.max(0,
this.reloads[this.weaponIndex] - game.tickRate);
}
}
}
};
if (player.canUse("trap")) {
const lowHealthGameObjects = gameObjects.filter(gameObject => {
const { x2, y2, buildHealth } = gameObject;
return buildHealth <= trapHealthThreshold &&
getDistanceSquared(player.x, player.y, x2, y2) <= rangeSquared;
});
if (lowHealthGameObjects.length > 0) {
player.use("trap", player.pos.add(player.dir().setMag(1)),
1, 0.05);
}
}
}
};
function getPlaceDelay() {
return BASE_PLACE_DELAY * (liveCombatData[player.teamId]?.threatLevel >
0.5 ? 0.5 : 1);
}
function getTrapPlacementRadius() {
return liveCombatData[player.teamId]?.threatLevel > 0.5 ?
BASE_TRAP_PLACEMENT_RADIUS * 1.2 : BASE_TRAP_PLACEMENT_RADIUS;
}
function calculatePriorityScore(targetObject) {
const { x2, y2, threatLevel, isMoving, buildHealth, environmentalImpact
} = targetObject;
const distance = calculateDistance(player.x2, player.y2, x2, y2);
if (score > 0) {
bestPlacements.push({ angle: rad, score, position: { x: trapX,
y: trapY } });
targetObjects = targetObjects.filter(target => !
isWithinPlacementRadius(target, { x: trapX, y: trapY }, trapPlacementRadius));
}
}
return bestPlacements;
}
if (target.lineOfSightBlocked) {
score -= LINE_OF_SIGHT_BLOCKAGE_PENALTY;
}
}
return score;
}
function deployEnhancedTraps(position) {
traps.addTrap(position.x, position.y, 'standard');
}
function getHeatmapDensity(x, y) {
return enemyHeatmap[`${x},${y}`] || 0;
}
function evaluateMovementPattern(targetObject) {
return enemyMovementPatterns[targetObject.id] || 0;
}
function getEnvironmentalImpact(x, y) {
return environmentalFactors[`${x},${y}`] || 0;
}
function updateHeatmap(x, y) {
const key = `${x},${y}`;
enemyHeatmap[key] = (enemyHeatmap[key] || 0) * (1 - HEATMAP_DECAY_RATE)
+ 1;
}
function preplacer() {
if (!gameObjects.length || !inGame || !enemy.length || !player) return;
if (objectss.length == 0) return;
let postTickTime = 0;
let frameTickRate = 1000 / 165;
let timeBetweenTicks = 1000 / 9;
function somePreStuff() {
let currentTime = Date.now();
let newTime = currentTime - postTickTime;
if (newTime + frameTickRate >= timeBetweenTicks) {
postTickTime = currentTime;
preplacer();
}
}
// FOR ANTI INSTA:
this.addDamageThreat = function (tmpObj) {
const defaultPrimaryDmg = 45;
const defaultSecondaryDmg = 35;
const bullMultiplier = 1.5;
const defaultVariantVal = 1.18;
const skinIndexPenalty = 0.75;
const closeRangeThreshold = 300;
const additionalThreatReloadTickRate = game.tickRate;
const additionalThreatValue = 25;
let { primaryIndex, primaryVariant, secondaryIndex, secondaryVariant,
reloads, dist2 } = this;
let { weapons } = items;
let { weaponVariants } = config;
let primary = {
weapon: primaryIndex,
variant: primaryVariant,
dmg: primaryIndex === undefined ? defaultPrimaryDmg :
weapons[primaryIndex].dmg
};
let secondary = {
weapon: secondaryIndex,
variant: secondaryVariant,
dmg: secondaryIndex === undefined ? defaultSecondaryDmg :
weapons[secondaryIndex].Pdmg
};
let primaryVariantValue = primary.variant !== undefined ?
weaponVariants[primary.variant].val : defaultVariantVal;
let secondaryVariantValue = secondary.variant !== undefined && ![9, 12,
17, 15].includes(secondary.weapon) ? weaponVariants[secondary.variant].val :
defaultVariantVal;
let damageThreat = 0;
if (primary.weapon === undefined || reloads[primary.weapon] === 0) {
damageThreat += primary.dmg * primaryVariantValue * bullMultiplier;
}
if (secondary.weapon === undefined || reloads[secondary.weapon] === 0)
{
damageThreat += secondary.dmg * secondaryVariantValue;
}
if (reloads[53] <= additionalThreatReloadTickRate) {
damageThreat += additionalThreatValue;
}
damageThreat *= tmpObj.skinIndex === 6 ? skinIndexPenalty : 1;
if (!this.isTeam(tmpObj) && dist2 <= closeRangeThreshold) {
tmpObj.damageThreat += damageThreat;
}
// ANTI
this.addDamageProbability = function (tmpObj) {
let primary = {
weapon: this.primaryIndex,
variant: this.primaryVariant,
dmg: this.primaryIndex === undefined ? 45 :
items.weapons[this.primaryIndex].dmg
};
let secondary = {
weapon: this.secondaryIndex,
variant: this.secondaryVariant,
dmg: this.secondaryIndex === undefined ? 50 :
items.weapons[this.secondaryIndex].Pdmg
};
let bull = 1.5;
let pV = primary.variant !== undefined ?
config.weaponVariants[primary.variant].val : 1.18;
let sV = secondary.variant !== undefined ? [9, 12, 17,
15].includes(secondary.weapon) ? 1 : config.weaponVariants[secondary.variant].val :
1.18;
if (this.reloads[primary.weapon] === 0) {
this.damageProbably += primary.dmg * pV * bull * 0.75;
}
if (this.reloads[secondary.weapon] === 0) {
this.damageProbably += secondary.dmg * sV;
}
this.damageProbably *= 0.75;
if (!this.isTeam(tmpObj) && this.dist2 <= 300) {
tmpObj.damageProbably += this.damageProbably;
}
}
};
}
};
// SOME CODES:
function sendUpgrade(index) {
player.reloads[index] = 0;
packet("H", index);
}
function sendAutoGather() {
packet("K", 1, 1);
}
// PLACER:
function place(id, rad, rmd) {
try {
if (id == undefined) return;
let item = items.list[player.items[id]];
let tmpS = player.scale + item.scale + (item.placeOffset || 0);
let tmpX = player.x2 + tmpS * Math.cos(rad);
let tmpY = player.y2 + tmpS * Math.sin(rad);
if ((player.alive && inGame && player.itemCounts[item.group.id] ==
undefined ? true : player.itemCounts[item.group.id] < (config.isSandbox ? 299 :
item.group.limit ? item.group.limit : 99))) {
selectToBuild(player.items[id]);
sendAtck(1, rad);
selectWeapon(player.weaponCode, 1);
if (rmd && getEl("placeVis").checked) {
placeVisible.push({
x: tmpX,
y: tmpY,
name: item.name,
scale: item.scale,
dir: rad
});
game.tickBase(() => {
placeVisible.shift();
}, 1)
game.tickBase(() => {
placeVisible.shift();
}, 1)
}
}
} catch (e) {}
}
if(!spike) return;
if(!tmpObj) return;
function getAttacker(damaged) {
let attackers = enemy.filter(tmp => {
let damages = new Damages(items);
let dmg = damages.weapons[tmp.weaponIndex];
let by = tmp.weaponIndex < 9 ? [dmg[0], dmg[1], dmg[2], dmg[3]] : [dmg[0],
dmg[1]];
let rule = {
one: tmp.dist2 <= 300,
two: by.includes(damaged),
three: tmp.attacked
}
return rule.one && rule.two && rule.three;
});
return attackers;
}
function healer(extra = 0) {
if (extra == 0) {
for (let i = 0; i < healthBased(); i++) {
place(0, getAttackDir());
}
} else {
for (let i = 0; i < healthBased() + extra; i++) {
place(0, getAttackDir());
}
}
}
// ADVANCED:
// ADVANCED:
function applCxC(value) {
if (player.skinIndex != 45 && player.skinIndex != 56) {
if (0 == player.items[0]) {
if (value < -80) {
return 5;
} else if (value < -60) {
return 4;
} else if (value < -40) {
return 3;
} else if (value < -20) {
return 2;
} else {
return 1;
}
} else if (1 == player.items[0]) {
if (value < -80) {
return 3;
} else if (value < -40) {
return 2;
} else {
return 1;
}
} else if (2 == player.items[0]) {
if (value < -90) {
return 4;
} else if (value < -60) {
return 3;
} else if (value < -30) {
return 2;
} else {
return 1;
}
} else {
return 4;
}
} else {
return 0;
}
}
function healthBased() {
if (player.health == 100)
return 0;
if (player.skinIndex != 45 && player.skinIndex != 56) {
return Math.ceil((100 - player.health) /
items.list[player.items[0]].healing);
}
return 0;
}
function calcDmg(value) {
return value * player.skinIndex == 6 ? 0.75 : 1;
}
let predictDamage = 0;
class Traps {
constructor(UTILS, items) {
this.dist = 0;
this.aim = 0;
this.inTrap = false;
this.replaced = false;
this.antiTrapped = false;
this.info = {};
this.notFast = function() {
return player.weapons[1] == 10 && ((this.info.health >
items.weapons[player.weapons[0]].dmg) || player.weapons[0] == 5);
}
this.testCanPlace = function(id, first = -(Math.PI / 2), repeat =
(Math.PI / 2), plus = (Math.PI / 18), radian, replacer, yaboi) {
try {
let item = items.list[player.items[id]];
let tmpS = player.scale + item.scale + (item.placeOffset || 0);
let counts = {
attempts: 0,
placed: 0
};
let tmpObjects = [];
gameObjects.forEach((p) => {
tmpObjects.push({
x: p.x,
y: p.y,
active: p.active,
blocker: p.blocker,
scale: p.scale,
isItem: p.isItem,
type: p.type,
colDiv: p.colDiv,
getScale: function(sM, ig) {
sM = sM || 1;
return this.scale * ((this.isItem || this.type == 2 ||
this.type == 3 || this.type == 4)
? 1 : (0.6 * sM)) * (ig ? 1 :
this.colDiv);
},
});
});
for (let i = first; i < repeat; i += plus) {
counts.attempts++;
let relAim = radian + i;
let tmpX = player.x2 + tmpS * Math.cos(relAim);
let tmpY = player.y2 + tmpS * Math.sin(relAim);
let cantPlace = tmpObjects.find((tmp) => tmp.active &&
UTILS.getDistance(tmpX, tmpY, tmp.x, tmp.y) < item.scale + (tmp.blocker ?
tmp.blocker : tmp.getScale(0.6, tmp.isItem)));
if (cantPlace) continue;
if (item.id != 19 && tmpY >= config.mapScale / 2 -
config.riverWidth / 2 && tmpY <= config.mapScale / 2 + config.riverWidth / 2)
continue;
if ((!replacer && yaboi) || useWasd) {
if (useWasd ? false : yaboi.inTrap) {
if (UTILS.getAngleDist(near.aim2 + Math.PI, relAim +
Math.PI) <= Math.PI) {
place(2, relAim, 1);
} else {
player.items[4] == 15 && place(4, relAim, 1);
}
} else {
if (UTILS.getAngleDist(near.aim2, relAim) <=
config.gatherAngle / 1.5) {
place(2, relAim, 1);
} else {
player.items[4] == 15 && place(4, relAim, 1);
}
}
} else {
place(id, relAim, 1);
}
tmpObjects.push({
x: tmpX,
y: tmpY,
active: true,
blocker: item.blocker,
scale: item.scale,
isItem: true,
type: null,
colDiv: item.colDiv,
getScale: function() {
return this.scale;
},
});
if (UTILS.getAngleDist(near.aim2, relAim) <= 1) {
counts.placed++;
}
}
if (counts.placed > 0 && replacer && item.dmg) {
if (near.dist2 <= items.weapons[player.weapons[0]].range +
(player.scale * 1.8) && getEl("spikeTick").checked) {
instaC.canSpikeTick = true;
}
}
} catch (err) {
}
};
// ANTI SP TICK
this.checkSpikeTick = function () {
try {
if (![3, 4, 5].includes(near.primaryIndex)) return false;
let danger = 0;
let counts = {
attempts: 0,
block: `unblocked`
};
if (cantPlace) continue;
if (tmpY >= config.mapScale / 2 - config.riverWidth / 2 &&
tmpY <= config.mapScale / 2 + config.riverWidth / 2) continue;
danger++;
counts.block = `blocked`;
break;
}
if (danger) {
my.anti0Tick = 1;
return true;
}
}
} catch (err) {
return null;
}
return false;
};
function getDist(e, t) {
try {
return Math.hypot((t.y2 || t.y) - (e.y2 || e.y), (t.x2 || t.x) -
(e.x2 || e.x));
} catch (e) {
return Infinity;
}
}
let closeObjects = [];
// INVIS PRE PLACE BY SPIRAL
this.invisPrePlace = function() {
if (!closeObjects.length || !inGame || !enemy.length || !player ||
near.dist2 > 350) return;
if (player.items[4]) {
this.testCanPlace(4, -(Math.PI / 2), (Math.PI / 2), (Math.PI / 18),
aim + Math.PI);
this.antiTrapped = true;
}
};
/*this.autoPlace = function() {
if (enemy.length && configs.autoPlace && !instaC.ticking) {
if (game.tick % (Math.max(1,
parseInt(getEl("autoPlaceTick").value)) || 1) === 0) {
if (gameObjects.length) {
let near2 = {
inTrap: false,
};
let nearTrap = gameObjects.filter(e => e.trap
&& e.active && e.isTeamObject(player) && UTILS.getDist(e, near, 0, 2) <=
(near.scale + e.getScale() + 5)).sort(function(a, b) {
return UTILS.getDist(a, near, 0, 2) -
UTILS.getDist(b, near, 0, 2);
})[0];
if (nearTrap) {
near2.inTrap = true;
} else {
near2.inTrap = false;
}
if ((near.dist3 <= 450)) {
if (near.dist3 <= 200) {
this.testCanPlace(4, 0, (Math.PI * 2),
(Math.PI / 24), near.aim2, 0, {
inTrap: near2.inTrap
});
} else {
player.items[4] == 15 &&
this.testCanPlace(4, 0, (Math.PI * 2), (Math.PI / 24), near.aim2);
}
}
} else {
if ((near.dist3 <= 450)) {
player.items[4] == 15 &&
this.testCanPlace(4, 0, (Math.PI * 2), (Math.PI / 24), near.aim2);
}
}
}
}
};*/
for(var i1 = 0; i1 < gameObjects.length; i1++) {
if (gameObjects[i1].active && gameObjects[i1].health > 0 &&
UTILS.getDist(gameObjects[i1], player, 0, 2) < 130 && getEl("antipush").checked)
{ // || gameObjects[i1].buildHealth <= items.weapons[nearEnemy.weaponIndex].dmg)
function getEnemyDirection(near) {
return Math.atan2(near.yVel, near.xVel);
}
function findAnglesToTest() {
let anglesToTest = [];
return anglesToTest;
}
function findAnglesToTest2(obj, player) {
let perfectAngle = UTILS.getDirect(obj, player, 0, 2);
for (let i = 0; i < 360; i += 25) {
perfectAngle.push((Math.PI/180) * i);
}
return perfectAngle;
}
function findAnglesToTest1() {
let anglesToTest = [];
return anglesToTest;
}
UTILS.deg2rad = function (degrees) {
return degrees * (Math.PI / 180);
}
let placedSpikePositions = new Set();
let placedTrapPositions = new Set();
var breakTrack = [];
const PLACE_SPEED = 100;
function calculatePerfectAngle(x1, y1, x2, y2) {
return Math.atan2(y2 - y1, x2 - x1);
}
function isObjectBroken(object) {
const healthThreshold = 20;
return object.health < healthThreshold;
}
function PlacementLocation(x, y, trapType) {
this.x = x;
this.y = y;
this.trapType = trapType;
}
function checkPlaceWithAngles1(angle1, angle2, x, y) {
checkPlace(4, x, y, angle1, angle2);
}
function checkPlaceWithAngles2(angle1, angle2, x, y) {
checkPlace(2, x, y, angle1, angle2);
}
// SPIRALS PLACER BEGINNING
const trap1 = gameObjects.filter(e => e.trap && e.active).sort((a, b) =>
UTILS.getDist(a, near, 0, 2) - UTILS.getDist(b, near, 0, 2)).find(trap => {
const trapDist = Math.sqrt((trap.y - near.y2) ** 2 + (trap.x - near.x2)
** 2);
return trap !== player && (player.sid === trap.owner.sid ||
findAllianceBySid(trap.owner.sid)) && trapDist <= 50;
});
this.autoPlace = function () {
if (!enemy.length || !configs.autoPlace212121 || instaC.ticking)
return;
if (secPacket <= 90) {
const autoPlaceTick = Math.max(1, parseInt()) || 1;
if (game.tick % autoPlaceTick !== 0) return;
if (!gameObjects.length) return;
if (!placedSpikePositions.has(JSON.stringify(position)) &&
isPositionValid(position) && distToPlayer <= 87 && predictedDist <= 50) {
const angleToPlace = Math.atan2(position[1] -
player.y2, position[0] - player.x2);
checkPlace(2, angleToPlace);
placedSpikePositions.add(JSON.stringify(position));
}
}
}
if (near.dist2 <= 385 && near.dist2 > 365 && player.items[4] ===
15) {
const aimAngle = near.aim2;
const fullCircle = Math.PI * 2;
const smallStep = Math.PI / 36;
if (
!placedSpikePositions.has(JSON.stringify(position)) &&
isPositionValid(position) &&
distToPlayer <= 87
) {
validPositions.push(position);
}
}
validPositions.sort((a, b) => {
const distA = Math.hypot(a[0] - player.x2, a[1] - player.y2);
const distB = Math.hypot(b[0] - player.x2, b[1] - player.y2);
return distA - distB;
});
function placeTrapsAroundPlayer(isReplacing) {
const maxTrapsToPlace = 4;
const trapRadius = 50;
const trapPositions = calculatePossibleTrapPositions(player.x2, player.y2,
trapRadius);
const packetLimit = isReplacing ? 80 : 50; // 80 if replacing, 50 if placing
new
let trapsPlaced = 0;
let packetSendCount = 0;
trapPositions.sort((a, b) => {
const distA = Math.hypot(a[0] - player.x2, a[1] - player.y2);
const distB = Math.hypot(b[0] - player.x2, b[1] - player.y2);
return distA - distB;
});
if (spike) {
let aim = UTILS.getDirect(spike, player, 0, 2);
return aim;
} else {
return lastDir || 0;
}
}
let PrePlaceCount = false;
this.ReTrap = function () {
if (secPacket >= 90) return;
gameObjects.forEach(obj => {
const distance = UTILS.getDist(obj, player, 0, 2);
const angle = UTILS.getDirect(obj, player, 0, 2);
const objAim = UTILS.getDirect(obj, player, 0, 2);
if (
distance <= range &&
obj.health <= 300 &&
PrePlaceCount < 15 &&
fgdo(obj, player) <= range
) {
this.preTrapPreplacer(player, obj);
}
else if (
distance <= range &&
obj.health <= 300 &&
PrePlaceCount >= 15
) {
function trapsReplacer({ angle, radius, objAim }) {
if (!angle || !radius || !objAim) return;
this.testCanPlace(
4,
angle,
angle + Math.PI * 2,
Math.PI / 24,
objAim,
radius,
angle,
1
);
}
trapsReplacer({
angle: angle,
radius: range,
objAim: objAim
});
}
else if (
distance > range &&
obj.health <= 300 &&
PrePlaceCount >= 0
) {
PrePlaceCount--;
}
});
};
let checkDist = 75, canFast = false, canSecondary = 0, canStop2 = true;
let VolcanoDmg = false, checkTurret = false, MaxKills = 0, packetsShown =
false, MenuRangeIsTrue = false, stopUp = true, MenuNight = 35, chatPing = false,
canMusic1 = true, canMusic2 = true, checkEnemy = false, EnemyDist = false, showAim
= false, CanPAB = false, pAB = true, spikePlace = true, MenuRangeIsTrue2 = false,
ae86Dir = false,
ToggleMusic = false, ToggleMusic0 = false, CheckCactus = false;
this.nearTrap = function () {
return gameObjects.filter(
(object) =>
object.trap &&
object.active &&
UTILS.getDist(object, player, 0, 2) <=
player.scale + object.getScale() + 5
);
};
game.tickBase(() => {
let objAim = UTILS.getDirect(findObj, player, 0, 2);
let objDst = UTILS.getDist(findObj, player, 0, 2);
let weaponRange = items.weapons[player.weaponIndex].range +
player.scale;
let preAngleAmount = Math.PI / 6;
if (
!danger &&
(near.dist2 <= nearWeaponRange ||
(traps.inTrap && objDst <= 150) ||
traps.isEnemyInTrap(near))
) {
let placementRadius = 80;
this.angles.push(predictedAngle);
if (this.angles.length > 5) {
this.angles.shift();
}
smoothedAngle += preAngleAmount;
this.testCanPlace(
2,
placementAngle,
placementAngle + Math.PI * 2,
Math.PI / 24,
objAim,
placementRadius,
perfectAngle,
1
);
} else if (player.items[4] === 15 || near.dist2 <= 100) {
let trapPlacementRadius = 70;
let trapPlacementAngle = perfectAngle + Math.PI;
player.items[4] == 15 &&
this.testCanPlace(
4,
trapPlacementAngle,
trapPlacementAngle + Math.PI * 2,
Math.PI / 24,
objAim,
trapPlacementRadius,
perfectAngle,
1
);
}
}
gameObjects.forEach((e) => {
if (e.dmg === true && e.isTeamObj(player)) {
placedSpikes.push(e);
}
});
if (spikePlaced) {
player.items[4] == 15 &&
this.testCanPlace(4, 0, Math.PI * 2, Math.PI / 24, objAim,
perfectAngle, 1);
spikePlaced = false;
}
// KBSP by Spiral
placedSpikes.forEach(spike => {
if (UTILS.getDist(spike, player, 0, 2) <= 200) {
let spikeAngle = Math.atan2(spike.y2 - player.y2, spike.x2
- player.x2);
let enemySpikeAngle = Math.atan2(near.y2 - spike.y2,
near.x2 - spike.x2);
let nearestAngle = UTILS.nearestAngle(spikeAngle,
enemySpikeAngle);
if (!knockbackSuccess) {
if (near.dist2 <= 250) {
for (let i = 0; i < 24; i++) {
let angle = (Math.PI * 2 * i) / 24;
this.testCanPlace(
2,
angle,
angle + Math.PI / 24,
Math.PI / 24,
objAim,
1
);
spikePlaced = true;
break;
}
}
let spikSync;
if (objDst <= 250 && near.dist2 <= 250) {
let danger = this.checkSpikeTick();
if (
!danger &&
near.dist3 <=
items.weapons[near.primaryIndex || 5].range +
near.scale * 1.8
) {
for (let i = 0; i < 24; i++) {
let angle = (Math.PI * 2 * i) / 24;
this.testCanPlace(
2,
angle,
angle + Math.PI / 24,
Math.PI / 24,
objAim,
1
);
this.testCanPlace(
2,
Math.PI / 2,
Math.PI / 2,
Math.PI / 2,
near,
objAim,
1
);
spikSync = true;
break;
}
}
}
}
game.tickBase(() => {
let objAim = UTILS.getDirect(findObj, player, 0, 2);
let objDst = UTILS.getDist(findObj, player, 0, 2);
let weaponRange = items.weapons[player.weaponIndex].range + player.scale;
let preAngleAmount = Math.PI / 6;
if (
!danger &&
(near.dist2 <= nearWeaponRange || (traps.inTrap && objDst <= 150)
|| traps.isEnemyInTrap(near))
) {
let angleToPlayer = Math.atan2(player.y - findObj.y, player.x -
findObj.x);
let distanceToPlayer = UTILS.getDist(findObj, player, 0, 2);
let enemyVelocity = Math.sqrt(near.xVel * near.xVel + near.yVel *
near.yVel);
let enemyDirection = Math.atan2(near.yVel, near.xVel);
smoothedAngle += preAngleAmount;
if (!knockbackSuccess) {
if (near.dist2 <= 250 && !spikSync) {
for (let i = 0; i < 24; i++) {
let angle = (Math.PI * 2) * i / 24;
this.testCanPlace(2, angle, angle + Math.PI / 24, Math.PI / 24,
objAim, 1);
spikePlaced = true;
}
}
replaceable.forEach(build => {
let angle = this.findPlacementAngle(player, buildId, build);
if (angle !== null) {
place(buildId, angle);
}
});
this.replaced = true;
}
}
}, 1);
};
// Weighted smoothing
return this.angles.reduce((sum, angle, index) => sum + angle * (index + 1),
0) /
this.angles.reduce((sum, _, index) => sum + (index + 1), 0);
};
class Autobuy {
constructor(buyHat, buyAcc) {
this.hat = function() {
buyHat.forEach((id) => {
let find = findID(hats, id);
if (find && !player.skins[id] && player.points >= find.price)
packet("c", 1, id, 0);
});
};
this.acc = function() {
buyAcc.forEach((id) => {
let find = findID(accessories, id);
if (find && !player.tails[id] && player.points >= find.price)
packet("c", 1, id, 1);
});
};
}
};
class Autoupgrade {
constructor() {
this.sb = function(upg) {
upg(3);
upg(17);
upg(31);
upg(23);
upg(9);
upg(38);
};
this.kh = function(upg) {
upg(3);
upg(17);
upg(31);
upg(23);
upg(10);
upg(38);
upg(4);
upg(25);
};
this.pb = function(upg) {
upg(5);
upg(17);
upg(32);
upg(23);
upg(9);
upg(38);
};
this.ph = function(upg) {
upg(5);
upg(17);
upg(32);
upg(23);
upg(10);
upg(38);
upg(28);
upg(25);
};
this.db = function(upg) {
upg(7);
upg(17);
upg(31);
upg(23);
upg(9);
upg(34);
};
/* old functions */
this.km = function(upg) {
upg(7);
upg(17);
upg(31);
upg(23);
upg(10);
upg(38);
upg(4);
upg(15);
};
};
};
class Damages {
constructor(items) {
// 0.75 1 1.125 1.5
this.calcDmg = function(dmg, val) {
return dmg * val;
};
this.getAllDamage = function(dmg) {
return [this.calcDmg(dmg, 0.75), dmg, this.calcDmg(dmg, 1.125),
this.calcDmg(dmg, 1.5)];
};
this.weapons = [];
for (let i = 0; i < items.weapons.length; i++) {
let wp = items.weapons[i];
let name = wp.name.split(" ").length <= 1 ? wp.name : (wp.name.split("
")[0] + "_" + wp.name.split(" ")[1]);
this.weapons.push(this.getAllDamage(i > 8 ? wp.Pdmg : wp.dmg));
this[name] = this.weapons[i];
}
}
}
// LOADING:
let UTILS = new Utils();
let items = new Items();
let objectManager = new Objectmanager(GameObject, gameObjects, UTILS, config);
let store = new Store();
let hats = store.hats;
let accessories = store.accessories;
let projectileManager = new ProjectileManager(Projectile, projectiles, players,
ais, objectManager, items, config, UTILS);
let aiManager = new AiManager(ais, AI, players, items, null, config, UTILS);
let textManager = new Textmanager();
let traps = new Traps(UTILS, items);
let instaC = new Instakill();
let autoBuy = new Autobuy([40, 6, 7, 22, 53, 15, 31], [11, 21, 18, 13]);
let autoUpgrade = new Autoupgrade();
let lastDeath;
let minimapData;
let mapMarker = {};
let mapPings = [];
let tmpPing;
function sendChat(message) {
packet("6", message.slice(0, 30));
}
player.bowThreat[index]++;
setTimeout(() => {
player.bowThreat[index]--;
}, range / speed);
}
if (tmpObj.bowThreat[9] >= 1 && (tmpObj.bowThreat[12] >= 1 ||
tmpObj.bowThreat[15] >= 1)) {
place(3, tmpObj.aim2);
buyEquip(22, 0);
game.tickBase(() => {
buyEquip(6, 0);
}, 1);
my.anti0Tick = 4;
if (!my.antiSync) {
notif("Bow Insta Blocked");
antiSyncHealing(4);
}
}
} else {
if (near.dist2 < 550) {
if (projectileCount >= 2) {
place(3, tmpObj.aim2);
healer();
buyEquip(22, 0);
buyEquip(21, 1);
my.anti0Tick = 4;
if (!my.antiSync) {
notif("Blocked Sync Succes");
antiSyncHealing(4);
}
} else {
if (projectileCount === 1 && near.reloads[near.weapons[0]] == 0
&& near.dist2 < items.weapons[near.weapons[0]].range + player.scale * 1.8) {
buyEquip(6, 0);
buyEquip(21, 1);
}
}
}
}
}
}
} else if (isWeapon) {
UTILS.generateElement({
class: "itemInfoReq",
text: !item.type ? "primary" : "secondary",
parent: itemInfoHolder
});
} else {
for (let i = 0; i < item.req.length; i += 2) {
UTILS.generateElement({
class: "itemInfoReq",
html: item.req[i] + "<span class='itemInfoReqVal'> x" +
item.req[i + 1] + "</span>",
parent: itemInfoHolder
});
}
if (item.group.limit) {
UTILS.generateElement({
class: "itemInfoLmt",
text: (player.itemCounts[item.group.id] || 0) + "/" +
(config.isSandbox ? 99 : item.group.limit),
parent: itemInfoHolder
});
}
}
} else {
itemInfoHolder.classList.remove("visible");
}
}
// RESIZE:
window.addEventListener("resize", UTILS.checkTrusted(resize));
function resize() {
screenWidth = window.innerWidth;
screenHeight = window.innerHeight;
let scaleFillNative = Math.max(screenWidth / maxScreenWidth, screenHeight /
maxScreenHeight) * pixelDensity;
gameCanvas.width = screenWidth * pixelDensity;
gameCanvas.height = screenHeight * pixelDensity;
gameCanvas.style.width = screenWidth + "px";
gameCanvas.style.height = screenHeight + "px";
mainContext.setTransform(
scaleFillNative, 0,
0, scaleFillNative,
(screenWidth * pixelDensity - (maxScreenWidth * scaleFillNative)) / 2,
(screenHeight * pixelDensity - (maxScreenHeight * scaleFillNative)) / 2
);
}
resize();
// MOUSE INPUT:
var usingTouch;
const mals = document.getElementById('touch-controls-fullscreen');
mals.style.display = 'block';
mals.addEventListener("mousemove", gameInput, false);
function gameInput(e) {
mouseX = e.clientX;
mouseY = e.clientY;
}
let clicks = {
left: false,
middle: false,
right: false,
};
mals.addEventListener("mousedown", mouseDown, false);
function mouseDown(e) {
if (attackState != 1) {
attackState = 1;
if (e.button == 0) {
clicks.left = true;
} else if (e.button == 1 || e.key === 'b') {
clicks.middle = true;
} else if (e.button == 2) {
clicks.right = true;
}
}
}
mals.addEventListener("mouseup", UTILS.checkTrusted(mouseUp));
function mouseUp(e) {
if (attackState != 0) {
attackState = 0;
if (e.button == 0) {
clicks.left = false;
} else if (e.button == 1 || e.key === 'b') {
clicks.middle = false;
} else if (e.button == 2) {
clicks.right = false;
}
}
}
mals.addEventListener("wheel", wheel, false);
let wbe = 1;
function wheel(e) {
if (e.deltaY < 0) {
wbe -= 0.05;
maxScreenWidth = config.maxScreenWidth * wbe;
maxScreenHeight = config.maxScreenHeight * wbe;
resize()
} else {
wbe += 0.05;
maxScreenWidth = config.maxScreenWidth * wbe;
maxScreenHeight = config.maxScreenHeight * wbe;
resize()
}
}
// INPUT UTILS:
function getMoveDir() {
let dx = 0;
let dy = 0;
for (let key in moveKeys) {
let tmpDir = moveKeys[key];
dx += !!keys[key] * tmpDir[0];
dy += !!keys[key] * tmpDir[1];
}
return dx == 0 && dy == 0 ? undefined : Math.atan2(dy, dx);
}
function getSafeDir() {
if (!player)
return 0;
if (!player.lockDir) {
lastDir = Math.atan2(mouseY - (screenHeight / 2), mouseX - (screenWidth /
2));
}
return lastDir || 0;
}
let checkDist = 75;
function SpikeDir() {
let spike;
if (near.dist2 > 230 && getEl("AutoBot").checked && !my.autoPush &&
enemy.length) {
if (traps.inTrap) {
spike = gameObjects.filter(tmp => tmp.dmg && tmp.active && !
tmp.isTeamObject(player) && UTILS.getDist(tmp, player, 0, 3) <
(items.weapons[player.weapons[0]].range + player.scale * 1.5)).sort(function(a, b)
{
return UTILS.getDist(a, player, 0, 5) - UTILS.getDist(b, player, 0,
5);
})[0];
} else {
spike = gameObjects.filter(tmp => tmp.dmg && tmp.active &&
UTILS.getDist(tmp, player, 0, 3) < (tmp.scale + checkDist +
player.scale)).sort(function(a, b) {
return UTILS.getDist(a, player, 0, 5) - UTILS.getDist(b, player, 0,
5);
})[0];
}
} else {
if (traps.inTrap) {
spike = gameObjects.filter(tmp => tmp.dmg && tmp.active && !
tmp.isTeamObject(player) && UTILS.getDist(tmp, player, 0, 3) <
(items.weapons[player.weapons[0]].range + player.scale * 1.5)).sort(function(a, b)
{
return UTILS.getDist(a, player, 0, 5) - UTILS.getDist(b, player, 0,
5);
})[0];
} else {
spike = gameObjects.filter(tmp => tmp.dmg && tmp.active && !
tmp.isTeamObject(player) && UTILS.getDist(tmp, player, 0, 3) < (tmp.scale +
checkDist + player.scale)).sort(function(a, b) {
return UTILS.getDist(a, player, 0, 5) - UTILS.getDist(b, player, 0,
5);
})[0];
}
}
if (spike) {
let aim = UTILS.getDirect(spike, player, 0, 2);
return aim;
} else {
return lastDir || 0;
}
}
let plusDir = 0;
let lastSpin = Date.now();
let spinner = false;
let spinDir = 0;
function getAttackDir(debug) {
if (debug) {
if (!player)
return "0";
if (my.autoAim || ((clicks.left || (useWasd && near.dist2 <=
items.weapons[player.weapons[0]].range + near.scale * 1.8 && !traps.inTrap)) &&
player.reloads[player.weapons[0]] == 0))
lastDir = getEl("weaponGrind").checked ? "getSafeDir()" :
enemy.length ? my.revAim ? "(near.aim2 + Math.PI)" : "near.aim2" : "getSafeDir()";
else
if (clicks.right && player.reloads[player.weapons[1] == 10 ?
player.weapons[1] : player.weapons[0]] == 0)
lastDir = "getSafeDir()";
else
if (traps.inTrap && player.reloads[traps.notFast() ?
player.weapons[1] : player.weapons[0]] == 0) {
lastDir = "traps.aim";
}
return lastDir;
} else {
if (!player)
return 0;
if (my.autoAim || ((clicks.left || (useWasd && near.dist2 <=
items.weapons[player.weapons[0]].range + near.scale * 1.8 && !traps.inTrap)) &&
player.reloads[player.weapons[0]] == 0))
lastDir = getEl("weaponGrind").checked ? getSafeDir() : enemy.length ?
my.revAim ? (near.aim2 + Math.PI) : near.aim2 : getSafeDir();
else
if (clicks.right && player.reloads[player.weapons[1] == 10 ?
player.weapons[1] : player.weapons[0]] == 0)
lastDir = getSafeDir();
else
if (traps.inTrap && player.reloads[traps.notFast() ?
player.weapons[1] : player.weapons[0]] == 0) {
lastDir = traps.aim;
}
return lastDir || 0;
}
}
function getVisualDir() {
if (!player)
return 0;
lastDir = getSafeDir();
return lastDir || 0;
}
// KEYS:
function keysActive() {
return (allianceMenu.style.display != "block" &&
chatHolder.style.display != "block" &&
!menuCBFocus);
}
let changeCounts = 0;
let opacity = 0;
let toggle;
function toggleMenu() {
if (toggle) clearInterval(toggle);
opacity = 1 - Math.round(opacity);
if (opacity) $("#UnoReverse").toggle();
toggle = setInterval(()=>{
if (opacity != Number(UnoReverse.style.opacity, 0.1)) {
UnoReverse.style.opacity = (Number(UnoReverse.style.opacity, 0.1)) +
(opacity ? 0.1 : -0.1);
} else {
clearInterval(toggle);
if (!((Number(UnoReverse.style.opacity, 0.1)))) $
("#UnoReverse").toggle();
}
}, 1);
}
function toggleMenuChat() {
if (menuChatDiv.style.display != "none") {
// chatHolder.style.display = "none";
// if (menuChatBox.value != "") {
//commands[command.slice(1)]
let cmd = function(command) {
return {
found: command.startsWith("/") && commands[command.slice(1).split("
")[0]],
fv: commands[command.slice(1).split(" ")[0]]
}
}
let command = cmd(menuChatBox.value);
if (command.found) {
if (typeof command.fv.action === "function") {
command.fv.action(menuChatBox.value);
}
} else {
sendChat(menuChatBox.value);
}
menuChatBox.value = "";
menuChatBox.blur();
} else {
if (menuCBFocus) {
menuChatBox.blur();
} else {
menuChatBox.focus();
}
}
}
let autos = {
insta: {
todo: false,
wait: false,
count: 4,
shame: 5,
toggle: false
},
instaing: false,
bull: false,
antibull: 0,
reloaded: false,
stopspin: true
}
function toRad(angle) {
return angle * 0.01745329251;
}
let boostSpikings = false;
function placeQuad() {
place(4, near.aim2);
place(4, near.aim2 + toRad(45));
place(4, near.aim2 - toRad(90));
place(4, near.aim2 + Math.PI);
}
let follow = (ang) => {
packet("9", ang)
}
setInterval(()=>{
if (getEl("BoostSpikers").checked) {
if (boostSpikings) {
place(near.dist2 > 220 ? 4 : 2, near.aim2);
place(2, near.aim2);
place(2, near.aim2 + toRad(90));
place(2, near.aim2 - toRad(90));
packet("9", near.aim2);
}
}
}, 80);
// let myplayer = {
// x:null,
// y:null,
// id:null,
// weapon:0,
// fs:0,
// ms:10,
// ss:6,
// ts:15,
// sec:0,
// go:null,
// tur:0,
// name:null,
// timepol:885
// };
// let nerpl = ()=>{
// let dist = 10000;
// let ind = 0;
// for (let i = 0;i<players.length;i++) {
// let ds = Math.sqrt(Math.pow(players[i].x-myplayer.x,
2)+Math.pow(players[i].y-myplayer.y, 2));
// if (ds<dist){
// ind = i;
// dist=ds;
// };
// }
// return [dist, players[ind]];
// }
// let all = [];
// let getplayer=(id)=>{
// for (let i = 0;i<players.length;i++) {
// if (players[i].id===id)return i;
// }
// return false;
// }
// let getplayerall=(id)=>{
// for (let i = 0;i<all.length;i++) {
// if (all[i].id===id)return i;
// }
// return false;
// }
// let angle = 0;
// let trap = (ang)=> {
// packet("z", myplayer.ts, null);
// place(ang);
// packet("z", myplayer.d, true);
// }
// let spk = (ang) => {
// packet("z", myplayer.ss, null);
// place(ang);
// packet("z", myplayer.d, true);
// }
// let boostspikee=false;
// let boostspike=false;
// function boostspikereal() {
// setInterval(()=>{
// if (boostspike){
// if(getEl("evee").checked) {
// let nerplayer = nerpl();
// let dist = Math.sqrt(Math.pow(nerplayer[1].y-myplayer.y,
2)+Math.pow(nerplayer[1].x-myplayer.x, 2));
// let ang = players.length===0?angle:Math.atan2(nerplayer[1].y-
myplayer.y, nerplayer[1].x-myplayer.x);
// follow(ang);
// if (dist>200) {
// trap(ang);
// }
// if(dist<100) {
// spk(ang-Math.PI/2);
// spk(ang+Math.PI/2);
// }
// if(dist<90) {
// spk(ang);
// }
// if(dist<220) {
// spk(ang-Math.PI/2);
// spk(ang+Math.PI/2);
// spk(ang+Math.PI);
// }
// }
// }
// }, 80);
// setInterval(()=>{
// if (boostspikee){
// if(getEl("2018").checked) {
// let nerplayer = nerpl();
// let dist = Math.sqrt(Math.pow(nerplayer[1].y-myplayer.y,
2)+Math.pow(nerplayer[1].x-myplayer.x, 2));
// let ang = players.length===0?angle:Math.atan2(nerplayer[1].y-
myplayer.y, nerplayer[1].x-myplayer.x);
// follow(ang);
// trap(ang);
// spk(ang-Math.PI/2);
// spk(ang+Math.PI/2);
// }
// }
// }, 80);
// }
var repeater = function(key, action, interval) {
let _isKeyDown = false;
let _intervalId = undefined;
return {
start(keycode) {
if(keycode == key && document.activeElement.id.toLowerCase() !==
'chatbox') {
_isKeyDown = true;
if(_intervalId === undefined) {
_intervalId = setInterval(() => {
action();
if(!_isKeyDown){
clearInterval(_intervalId);
_intervalId = undefined;
console.log("claered");
}
}, interval);
}
}
},
stop(keycode) {
if(keycode == key && document.activeElement.id.toLowerCase() !==
'chatbox') {
_isKeyDown = false;
}
}
};
}
function autoSyncTry() {
var autoSync = document.getElementById("trySync");
if (autoSync && autoSync.checked) {
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
sendAutoGather();
game.tickBase(() => {
selectWeapon(player.weapons[0]);
buyEquip(53, 0);
game.tickBase(() => {
sendAutoGather();
my.autoAim = false;
}, 1);
}, 1);
}
}
function keyDown(event) {
let keyNum = event.which || event.keyCode || 0;
if (player && player.alive && keysActive()) {
if (!keys[keyNum]) {
keys[keyNum] = 1;
macro[event.key] = 1;
if (keyNum == 27) {
toggleMenu();
} else if (keyNum == 17) {
openMenu = !openMenu;
$("#menuChatDiv").toggle();
} else if (keyNum == 69) {
sendAutoGather();
} else if (keyNum == 67) {
updateMapMarker();
} else if (event.key === "n") {
boostSpikings=true;
} else if (event.key == "T") {
autoVelocityTickToggled = !autoVelocityTickToggled;
const oneFrameStatus = autoVelocityTickToggled ? "On" : "Off";
textManager.showText(player.x2, player.y2, 20, 0, 2000,
`VelocityTick: ${oneFrameStatus}`);
} else if (event.key == "Y") {
autoOneFrameToggled = !autoOneFrameToggled;
const oneFrameStatus = autoOneFrameToggled ? "On" : "Off";
textManager.showText(player.x2, player.y2, 20, 0, 2000,
`Veltick(Fast): ${oneFrameStatus}`);
// } else if (event.key == "n") {
// if(getEl("2018").checked) {
// boostspikee=true;
// if(getEl("evee").checked) {
// boostspike=true;
// if(getEl("2018").checked) {
// boostspikee=false;
// if(getEl("evee").checked) {
// boostspike=false;
// }
// }
// }
// }
} else if (event.key == "L") {
odfmsjfhvadsfyjkauhsfsa = !odfmsjfhvadsfyjkauhsfsa;
} else if (event.key == "j") {
placeQuad();
} else if (player.weapons[keyNum - 49] != undefined) {
player.weaponCode = player.weapons[keyNum - 49];
} else if (moveKeys[keyNum]) {
sendMoveDir();
} else if (event.key == "l") {
var musketCheckbox = document.getElementById("trySync");
if (musketCheckbox && musketCheckbox.checked) {
packet("6", "同步");
}
} else if (event.key == "b") {
place(2, near.aim2 + toRad(45));
place(2, near.aim2 - toRad(45));
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
sendAutoGather();
game.tickBase(() => {
selectWeapon(player.weapons[0]);
buyEquip(53, 0);
game.tickBase(() => {
sendAutoGather();
my.autoAim = false;
}, 1);
}, 1);
} else if (event.key == "x") {
place(2, near.aim2);
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
sendAutoGather();
game.tickBase(() => {
selectWeapon(player.weapons[0]);
buyEquip(53, 0);
game.tickBase(() => {
sendAutoGather();
my.autoAim = false;
}, 1);
}, 1);
} else if (event.key == "/") {
mills.placeSpawnPads = !mills.placeSpawnPads;
} else if (event.key == 'b') {
clicks.middle = true;
} else if (event.key == "z") {
mills.place = !mills.place;
} else if (event.key == "Z") {
typeof window.debug == "function" && window.debug();
} else if (event.key == "p") {
playSong();
} else if (keyNum == 32) {
packet("F", 1, getSafeDir(), 1);
packet("F", 0, getSafeDir(), 1);
// project.send("tezt");
// botSkts.forEach((bot) => {
// bot.zync();
// })
// io.send("S", 1)
}
}
}
}
let Playing = false;
let currentPart = 0;
function playSong() {
Playing = !Playing;
if (Playing) {
let Song = Songs[Number(getEl("song").value)];
Song.play();
Song.onended = function() {
if (Playing) {
Songs[Number(getEl("song").value)].play();
}
};
Song.ontimeupdate = function(t) {
let part = songC[Number(getEl("song").value)]
[getTime(Math.round(this.currentTime))];
if (part && part !== currentPart) {
currentPart = part;
}
};
} else {
Songs[0].pause();
}
}
function getTime(t) {
let sec = Math.floor(t) % 60;
let min = Math.floor(Math.floor(t) % 3600 / 60);
sec < 10 && (sec = `0${sec}`)
return min + ":" + sec;
}
let lastType, Sync = false;
let lastDamage = 0;
let oldEnemy;
let Shadow = 0.35;
setInterval(()=>{
if (advHeal.length) {
advHeal.forEach((updHealth) => {
let sid = updHealth[0];
let value = updHealth[1];
let damaged = updHealth[2];
tmpObj = findPlayerBySID(sid);
if (tmpObj) {
if (tmpObj == oldEnemy && (tmpObj.oldHealth <= damaged || damaged
== items.list[player.items[2]].dmg*(tmpObj.skinIndex==6?3/4:1))) { // CHECK SYNC
if (lastDamage == damaged) {
Sync = true;
game.tickBase(() => {
Sync = false;
}, 5);
} else if (tmpObj.oldHealth != damaged) lastDamage = damaged;
};
}
});
advHeal = [];
}
}, 30);
// let xx = canvaz.width/2;
// let yy = canvaz.height/2;
// let mouze = {
// x: xx - mouzeX,
// y: yy - mouzeY
// }
// let ingamecoorformodabow = {
// x: player.x + mouze.x,
// y: player.x + mouze.x
// }
addEventListener("keydown", UTILS.checkTrusted(keyDown));
function keyUp(event) {
if (player && player.alive) {
let keyNum = event.which || event.keyCode || 0;
if (keyNum == 13) {
toggleMenuChat();
} else if (keysActive()) {
if (keys[keyNum]) {
keys[keyNum] = 0;
macro[event.key] = 0;
if (moveKeys[keyNum]) {
sendMoveDir();
} else if (event.key == "n") {
boostSpikings=false;
} else if (event.key == ",") {
player.sync = false;
} else if (event.key == 'b') {
clicks.middle = false;
}
}
}
}
}
window.addEventListener("keyup", UTILS.checkTrusted(keyUp));
function sendMoveDir() {
if(found) {
packet("9", undefined, 1);
} else {
let newMoveDir = getMoveDir();
if (lastMoveDir == undefined || newMoveDir == undefined ||
Math.abs(newMoveDir - lastMoveDir) > 0.3) {
if (!my.autoPush && !found) {
packet("9", newMoveDir, 1);
}
lastMoveDir = newMoveDir;
}
}
}
// BUTTON EVENTS:
function bindEvents() {}
bindEvents();
function getAngle(e) {
return e * 57.2957795457;
}
// AUTOPUSH:
function followPath(path) {
if (path.length > 1) {
const nextStep = path[1];
const targetPosition = {
x: player.x2 - pathFind.scale / 2 + (pathFind.scale / pathFind.grid) *
nextStep.x,
y: player.y2 - pathFind.scale / 2 + (pathFind.scale / pathFind.grid) *
nextStep.y
};
console.log("Moving to next step:", targetPosition);
if (isPathClear(targetPosition)) {
packet("9", UTILS.getDirect(targetPosition, player, 0, 2), 1);
} else {
console.log("Path obstructed, recalculating...");
pathfinderToRandomPosition(nextStep.x, nextStep.y);
}
}
}
function pathfinderToRandomPosition(targetX, targetY) {
if (!pathFind.active) return;
pathFind.scale = (config.maxScreenWidth / 2) * 1.3;
createPath();
const startX = Math.floor(pathFind.grid / 2);
const startY = Math.floor(pathFind.grid / 2);
console.log("Finding path from", startX, startY, "to", targetX, targetY);
easystar.findPath(startX, startY, targetX, targetY, function (path) {
if (path === null) {
console.error("Path not found to target:", targetX, targetY);
pathFind.array = [];
} else {
console.log("Path found:", path);
pathFind.array = path;
followPath(path);
}
});
easystar.calculate();
}
function isPathClear(targetPosition) {
return !gameObjects.some(tmp => {
if (!tmp.ignoreCollision && UTILS.lineInRect(tmp.x - tmp.getScale(), tmp.y
- tmp.getScale(), tmp.x + tmp.getScale(), tmp.y + tmp.getScale(), player.x2,
player.y2, targetPosition.x, targetPosition.y)) {
console.log("Obstacle detected at", tmp);
return true;
}
return false;
});
}
function checkPathColl(tmp) {
return ((player.scale + tmp.getScale()) / (player.maxSpeed *
items.weapons[player.weaponIndex].spdMult)) + (tmp.dmg && !tmp.isTeamObject(player)
? 35 : 0);
}
function checkObject() {
let checkColl = gameObjects.filter(tmp => player.canSee(tmp) && tmp.active);
grid = [];
for (let y = 0; y < pathFind.grid; y++) {
grid[y] = [];
for (let x = 0; x < pathFind.grid; x++) {
let tmpXY = {
x: (player.x2 - (pathFind.scale / 2)) + ((pathFind.scale /
pathFind.grid) * x),
y: (player.y2 - (pathFind.scale / 2)) + ((pathFind.scale /
pathFind.grid) * y)
}
let distance = UTILS.getDist(pathFind.chaseNear ? near : pathFind,
tmpXY, pathFind.chaseNear ? 2 : 0, 0);
if (distance <= (pathFind.chaseNear ? 35 : 60)) {
pathFind.lastX = x;
pathFind.lastY = y;
grid[y][x] = 0;
continue;
}
let find = checkColl.find(tmp => UTILS.getDist(tmp, tmpXY, 0, 0) <=
checkPathColl(tmp));
if (find) {
grid[y][x] = find.trap ? 0 : 1;
} else {
grid[y][x] = 0;
}
}
}
}
function createPath() {
checkObject();
}
var EasyStar = (function (modules) {
var moduleCache = {};
function require(moduleId) {
if (moduleCache[moduleId]) return moduleCache[moduleId].exports;
var module = (moduleCache[moduleId] = {
i: moduleId,
l: false,
exports: {},
});
modules[moduleId].call(module.exports, module, module.exports, require);
module.l = true;
return module.exports;
}
require.m = modules;
require.c = moduleCache;
require.d = function (exports, name, getter) {
if (!require.o(exports, name)) {
Object.defineProperty(exports, name, {
enumerable: true,
get: getter,
});
}
};
require.r = function (exports) {
if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
Object.defineProperty(exports, Symbol.toStringTag, {
value: "Module",
});
}
Object.defineProperty(exports, "__esModule", {
value: true,
});
};
require.t = function (value, mode) {
if (mode & 1) value = require(value);
if (mode & 8) return value;
if (mode & 4 && typeof value === "object" && value && value.__esModule)
return value;
var ns = Object.create(null);
require.r(ns);
Object.defineProperty(ns, "default", {
enumerable: true,
value: value,
});
if (mode & 2 && typeof value != "string") {
}
for (var key in value) {
}
require.d(ns, key, function (key) {
return value[key];
}.bind(null, key));
return ns;
};
require.n = function (module) {
var getter = module && module.__esModule ? function getDefault() {
return module.default;
} : function getModuleExports() {
return module;
};
require.d(getter, "9", getter);
return getter;
};
require.o = function (object, property) {
return Object.prototype.hasOwnProperty.call(object, property);
};
require.p = "/bin/";
return require(require.s = 0);
})([
function (module, exports, require) {
const Node = require(1);
const MinHeap = require(2);
const EasyStar = {};
module.exports = EasyStar;
let instanceIdCounter = 1;
EasyStar.Pathfinder = function () {
let grid,
acceptableTiles,
enableSync = false,
diagonalsEnabled = false,
tileCosts = {},
additionalCosts = {},
directionalConditions = {},
maxIterations = Number.MAX_VALUE,
avoidingPoints = {},
cornerCuttingEnabled = true,
paths = {},
pathQueue = [];
this.setAcceptableTiles = function (tiles) {
if (Array.isArray(tiles)) {
acceptableTiles = tiles;
} else if (!isNaN(parseFloat(tiles)) && isFinite(tiles)) {
acceptableTiles = [tiles];
}
};
this.enableSync = function () {
enableSync = true;
};
this.disableSync = function () {
enableSync = false;
};
this.enableDiagonals = function () {
diagonalsEnabled = true;
};
this.disableDiagonals = function () {
diagonalsEnabled = false;
};
this.setGrid = function (newGrid) {
grid = newGrid;
tileCosts = {};
for (let row = 0; row < grid.length; row++) {
for (let col = 0; col < grid[0].length; col++) {
tileCosts[grid[row][col]] = 1;
}
}
};
this.setTileCost = function (tile, cost) {
if (acceptableTiles && !acceptableTiles.includes(tile)) {
throw new Error(`Tile ${tile} is not in the acceptableTiles
list.`);
}
tileCosts[tile] = cost;
};
this.setAdditionalPointCost = function (x, y, cost) {
additionalCosts[y] = additionalCosts[y] || {};
additionalCosts[y][x] = cost;
};
this.removeAdditionalPointCost = function (x, y) {
if (additionalCosts[y]) {
delete additionalCosts[y][x];
}
};
this.removeAllAdditionalPointCosts = function () {
additionalCosts = {};
};
this.setDirectionalCondition = function (x, y, directions) {
directionalConditions[y] = directionalConditions[y] || {};
directionalConditions[y][x] = directions;
};
this.removeAllDirectionalConditions = function () {
directionalConditions = {};
};
this.setIterationsPerCalculation = function (iterations) {
maxIterations = iterations;
};
this.avoidAdditionalPoint = function (x, y) {
avoidingPoints[y] = avoidingPoints[y] || {};
avoidingPoints[y][x] = true;
};
this.stopAvoidingAdditionalPoint = function (x, y) {
if (avoidingPoints[y]) {
delete avoidingPoints[y][x];
}
};
this.enableCornerCutting = function () {
cornerCuttingEnabled = true;
};
this.disableCornerCutting = function () {
cornerCuttingEnabled = false;
};
this.stopAvoidingAllAdditionalPoints = function () {
avoidingPoints = {};
};
this.findPath = function (startX, startY, endX, endY, callback) {
if (!acceptableTiles) {
throw new Error("You must call setAcceptableTiles() before
findPath().");
}
if (!grid) {
throw new Error("You must call setGrid() before findPath().");
}
if (startX < 0 || startY < 0 || endX < 0 || endY < 0 || startX >=
grid[0].length || startY >= grid.length || endX >= grid[0].length || endY >=
grid.length) {
throw new Error("Start or end point is outside the scope of
your grid.");
}
if (startX === endX && startY === endY) {
return callback([]);
}
const endTile = grid[endY][endX];
if (!acceptableTiles.includes(endTile)) {
return callback(null);
}
const pathId = instanceIdCounter++;
const pathFinder = {
openList: new MinHeap((a, b) => a.estimatedTotalCost -
b.estimatedTotalCost),
isDone: false,
nodeMap: {},
startX,
startY,
endX,
endY,
callback,
};
pathFinder.openList.push(createNode(pathFinder, startX, startY,
null, 0));
paths[pathId] = pathFinder;
pathQueue.push(pathId);
return pathId;
};
this.cancelPath = function (pathId) {
if (paths[pathId]) {
delete paths[pathId];
return true;
}
return false;
};
this.calculate = function () {
if (pathQueue.length > 0 && grid && acceptableTiles) {
for (let i = 0; i < maxIterations; i++) {
if (pathQueue.length === 0) return;
if (enableSync) i = 0;
const pathId = pathQueue[0];
const pathFinder = paths[pathId];
if (pathFinder && !pathFinder.isDone) {
const currentNode = pathFinder.openList.pop();
if (currentNode) {
if (currentNode.x === pathFinder.endX &&
currentNode.y === pathFinder.endY) {
const path = [];
let node = currentNode;
while (node) {
path.push({ x: node.x, y: node.y });
node = node.parent;
}
path.reverse();
pathFinder.callback(path);
pathFinder.isDone = true;
delete paths[pathId];
pathQueue.shift();
} else {
expandNode(pathFinder, currentNode);
}
} else {
pathQueue.shift();
}
}
}
}
};
function expandNode(pathFinder, node) {
const directions = [
[0, -1], // up
[1, 0], // right
[0, 1], // down
[-1, 0], // left
];
if (diagonalsEnabled) {
directions.push(
[-1, -1], // up-left
[1, -1], // up-right
[1, 1], // down-right
[-1, 1] // down-left
);
}
directions.forEach(([dx, dy]) => {
const newX = node.x + dx;
const newY = node.y + dy;
if (isValidTile(newX, newY, node, pathFinder)) {
const movementCost = (dx === 0 || dy === 0) ? 1 : 1.4;
const tileCost = getTileCost(newX, newY);
const totalCost = node.costSoFar + movementCost * tileCost;
while (true) {
const child2N = (n + 1) * 2;
const child1N = child2N - 1;
let swap = null;
this.heap[n] = this.heap[swap];
this.heap[swap] = element;
n = swap;
}
};
return MinHeap;
})();
module.exports = MinHeap;
},
]);
let pathFindTest = 0;
let grid = [];
const easystar = new EasyStar.Pathfinder();
function Pathfinder() {
pathFind.scale = (config.maxScreenWidth / 2) * 1.3;
easystar.setGrid(grid);
if (pathFind.array.length > 1) {
const nextStep = path[1];
const tmpXY = {
x: (player.x2 - (pathFind.scale / 2)) + ((pathFind.scale /
pathFind.grid) * nextStep.x),
y: (player.y2 - (pathFind.scale / 2)) + ((pathFind.scale /
pathFind.grid) * nextStep.y)
};
if (checkForObstacles(tmpXY)) {
console.warn("Obstacle detected, recalculating path.");
pathFind.array = [];
easystar.calculate();
return;
}
easystar.calculate();
}
}
easystar.calculate();
return fallbackPathFound;
}
function checkForObstacles(position) {
return gameObjects.some(obj =>
obj.active &&
obj.dmg &&
UTILS.getDistance(obj, position) <= obj.getScale() + 35
);
}
easystar.enableDiagonals();
easystar.setIterationsPerCalculation(1000);
setInterval(() => {
easystar.calculate();
}, 100);
var tracker = {
draw3: {
active: false,
x: 0,
y: 0,
scale: 0,
},
moveDir: undefined,
lastPos: {
x: 0,
y: 0,
}
}
// AUTOPUSH:
var retrappable = false;
function doPathFind(afg1keg1, target) {
let R = player;
let N = gameObjects;
let centerX = R.x + (target[0] - R.x) / 2;
let centerY = R.y + (target[1] - R.y) / 2;
const nearBuilds = N.filter(
(e) => Math.hypot(e.y - centerY, e.x - centerX) < 800 && e.active
);
let block = 30,
node = function (x, y, gScore) {
this.x = x;
this.y = y;
this.g = gScore;
this.type = nearBuilds.some((e) => {
let exactScale =
/spike/.test(e.name) &&
R.sid != e.owner.sid &&
(R.team ? !e.isTeamObject(R) : true)
? e.scale + 50
: e.scale;
if (e.name == "pit trap") {
if (e.owner && (R.sid == e.owner.sid || e.isTeamObject(R))) {
return false;
}
}
if (
Math.hypot(e.y - y, e.x - x) < exactScale + block &&
Math.hypot(e.y - target[1], e.x - target[0]) >
exactScale + block &&
Math.hypot(e.y - R.y2, e.x - R.x2) > exactScale + block
) {
return true;
}
return false;
})
? "wall"
: "space";
},
myNode = new node(
Math.round(R.x2 / block) * block,
Math.round(R.y2 / block) * block,
0
),
targetNode = new node(
Math.round(target[0] / block) * block,
Math.round(target[1] / block) * block,
0
),
paths = [],
foundset = [],
currentTick = 0,
endTick = 100,
found = true;
function positive(num) {
return Math.abs(num);
}
while (
!foundset.find((e) => {
return Math.hypot(e.y - targetNode.y, e.x - targetNode.x) < block;
})
) {
currentTick++;
if (currentTick >= endTick) {
found = false;
break;
}
let bestnode =
currentTick === 1
? myNode
: foundset
.filter((e) => e.type == "space")
.sort((a, b) => a.good - b.good)[0];
for (let i = 0; i < 3; i++) {
for (let o = 0; o < 3; o++) {
if (i == 1 && o == 1) {
continue;
}
let x = bestnode.x + block * (-1 + i);
let y = bestnode.y + block * (-1 + o);
let n = new node(x, y, currentTick);
let good =
positive(n.x - targetNode.x) +
positive(n.y - targetNode.y) / block -
currentTick;
n.good = good;
foundset.push(n);
}
}
paths.push(bestnode);
}
return found ? paths : false;
}
function autoPush() {
let nearTrap = gameObjects.filter(tmp => tmp.trap && tmp.active &&
tmp.isTeamObject(player) && UTILS.getDist(tmp, near, 0, 2) <= (near.scale +
tmp.getScale() + 15)).sort(function(a, b) {
return UTILS.getDist(a, near, 0, 2) - UTILS.getDist(b, near, 0, 2);
})[0];
if (nearTrap) {
let enemyboob = gameObjects.some(tmp => tmp.dmg && tmp.active && !
tmp.isTeamObject(player) && UTILS.getDist(tmp, nearTrap, 0, 0) <= (near.scale +
nearTrap.scale + tmp.scale + 5));
if (enemyboob) {
track.pushdata.autoPush = false;
pathFind.active = false;
pathFind.chaseNear = false;
return;
}
let spike = gameObjects.filter(tmp => tmp.dmg && tmp.active &&
tmp.isTeamObject(player) && UTILS.getDist(tmp, nearTrap, 0, 0) <= (near.scale +
nearTrap.scale + tmp.scale + 5)).sort(function(a, b) {
return UTILS.getDist(a, near, 0, 2) - UTILS.getDist(b, near, 0, 2);
})[0];
if (spike) {
let pos = {
x: spike.x + (250 * Math.cos(UTILS.getDirect(near, spike, 2, 0))),
y: spike.y + (250 * Math.sin(UTILS.getDirect(near, spike, 2, 0))),
x2: spike.x + ((UTILS.getDist(near, spike, 2, 0) + player.scale) *
Math.cos(UTILS.getDirect(near, spike, 2, 0))),
y2: spike.y + ((UTILS.getDist(near, spike, 2, 0) + player.scale) *
Math.sin(UTILS.getDirect(near, spike, 2, 0)))
};
let finds = gameObjects.filter(tmp => tmp.active).find((tmp) => {
let tmpScale = tmp.getScale();
if (!tmp.ignoreCollision && UTILS.lineInRect(tmp.x - tmpScale,
tmp.y - tmpScale, tmp.x + tmpScale, tmp.y + tmpScale, player.x2, player.y2, pos.x2,
pos.y2)) {
return true;
}
});
if (2 == 1) {
if (track.pushdata.autoPush) {
track.pushdata.autoPush = false;
}
} else {
if (near.dist2 >= 110) {
track.pushdata.autoPush = false;
pathFind.active = true;
pathFind.chaseNear = true;
} else if (near.dist2 <= 100) {
pathFind.active = false;
pathFind.chaseNear = false;
track.pushdata.autoPush = true;
track.pushdata.pushData = {
x: spike.x + Math.cos(30),
y: spike.y + Math.sin(30),
x2: pos.x2 + Math.cos(60),
y2: pos.y2 + Math.sin(60)
};
let angle = Math.atan2(near.y2 - spike.y, near.x2 - spike.x)
let point = {
x: near.x2 + Math.cos(angle) * 53,
y: near.y2 + Math.sin(angle) * 53,
}
let num = UTILS.getDist(near, spike, 2, 0);
let text = num.toString(10);
let scale = (player.scale / 10);
if (UTILS.getDist(near, spike, 2, 0) >= 105) {
if (UTILS.lineInRect(player.x2 - scale, player.y2 - scale,
player.x2 + scale, player.y2 + scale, near.x2, near.y2, pos.x, pos.y)) {
io.send("9", near.aim2, 1);
} else {
io.send("9", UTILS.getDirect(pos, player, 2, 2), 1);
}
} else {
io.send("9", Math.atan2(point.y - player.y2, point.x -
player.x2), 1);
}
}
}
} else {
track.pushdata.autoPush = false;
pathFind.active = false;
pathFind.chaseNear = false;
}
} else {
track.pushdata.autoPush = false;
pathFind.active = false;
pathFind.chaseNear = false;
}
}
// ADD DEAD PLAYER:
function addDeadPlayer(tmpObj) {
deadPlayers.push(new DeadPlayer(tmpObj.x, tmpObj.y, tmpObj.dir,
tmpObj.buildIndex, tmpObj.weaponIndex, tmpObj.weaponVariant, tmpObj.skinColor,
tmpObj.scale, tmpObj.name));
}
// SETUP GAME:
function setupGame(yourSID) {
keys = {};
macro = {};
playerSID = yourSID;
attackState = 0;
inGame = true;
packet("F", 0, getAttackDir(), 1);
my.ageInsta = true;
if (firstSetup) {
firstSetup = false;
gameObjects.length = 0;
liztobj.length = 0;
}
}
// REMOVE PLAYER:
function removePlayer(id) {
for (let i = 0; i < players.length; i++) {
if (players[i].id == id) {
addMenuChText("Game", players[i].name + "[" + players[i].sid + "] left
the game", "red");
players.splice(i, 1);
break;
}
}
}
// dune mod dmgpot
function sortWeaponVariant(id) {
switch (id) {
case 0:
return 1
break;
case 1:
return 1.1
break;
case 2:
return 1.18
break;
case 3:
return 1.18
break;
default:
return 1
break;
}
}
function sortSecondaryAmmoDamage(weapon) {
switch (weapon) {
case 10:
return 12
break
case 15:
return 50
break;
case 9:
return 25
break;
case 12:
return 35
break;
case 13:
return 30
break;
default:
return 0
}
}
let antiinsta = true;
let antiinsta1 = false;
function potdmg(tmpObj, t) {
let d = t - tmpObj.health;
if (d >= 100) {
} else {
if (player == tmpObj) {
if (tmpObj.skinIndex == 7 && (Math.abs(d) == 5 || (tmpObj.latestTail ==
13 && Math.abs(d) == 2))) {
tmpObj.bullTick = game.tick
if (my.reSync) {
my.reSync = false;
}
}
dmgpotwowwowow();
}
}
}
function dmgpotwowwowow() {
let potential = DmgPotWorkfrfrfr();
if (nears.length) {
addMenuChText("Dev", `Dmg potential: ${potential}`, "red");
// notif(`Dmg potential: ${potential}`)
if (Math.round(player.health - potential <= 0)) {
if ((player.health - (potential * player.skinIndex == 6 ? 0.75 : 1) >=
0)) {
game.tickBase(() => {
heal();
}, 2);
} else {
if(player.shameCount < 5) {
heal();
} else {
game.tickBase(() => {
heal();
}, 2);
}
}
} else {
game.tickBase(() => {
heal();
}, 2);
}
} else {
game.tickBase(() => {
heal();
}, 2);
}
}
function heal() {
for (let i = 0; i < Math.ceil((100 - player.health) /
items.list[player.items[0]].healing); i++) {
place(0, getAttackDir());
}
}
function DmgPotWorkfrfrfr() {
let predictedDamage = 0;
let weapon1Dmg, weapon2Dmg;
let weapon1Reload, weapon2Reload;
for (let i = 0; i < nears.length; i++) {
let singleIndividual = nears[i];
weapon1Dmg = items.weapons[singleIndividual.weapons[0]].dmg *
sortWeaponVariant(singleIndividual.weaponVariant);
weapon2Dmg = singleIndividual.weapons[1] == 10 ?
items.weapons[singleIndividual.weapons[1]].dmg :
items.weapons[singleIndividual.weapons[1]].Pdmg;
weapon1Reload = singleIndividual.reloads[singleIndividual.weapons[0]] == 0;
weapon2Reload = singleIndividual.reloads[singleIndividual.weapons[1]] == 0;
if (singleIndividual.primaryIndex !== undefined) {
predictedDamage += weapon1Reload ? weapon1Dmg * 1.5 : 0;
} else {
predictedDamage += 45;
}
if (singleIndividual.secondaryIndex !== undefined) {
predictedDamage += weapon2Reload ? weapon2Dmg : 0;
} else {
predictedDamage += 50;
}
predictedDamage += singleIndividual.reloads[53] == 0 ? 25 : 0;
}
}
// UPDATE HEALTH:
function updateHealth(sid, value) {
let _ = findPlayerBySID(sid);
let secondary = {
weapon: this.secondaryIndex,
variant: this.secondaryVariant
};
if (!_) return;
if (_) {
_.oldHealth = _.health;
_.health = value;
_.judgeShame();
if (_.oldHealth > _.health) {
_.timeDamaged = Date.now();
_.damaged = _.oldHealth - _.health;
let damaged = _.damaged;
_ = findPlayerBySID(sid);
let bullTicked = false;
if (_.health <= 0) {
if (!_.death) {
_.death = true;
addDeadPlayer(_);
}
}
if (_ == player) {
if (_.skinIndex == 7 && (damaged == 5 || (_.latestTail == 13 &&
damaged == 2))) {
if (my.reSync) {
my.reSync = false;
_.setBullTick = true;
}
bullTicked = true;
}
let antiinsta = true;
let antiinsta1 = false;
// UPDATE AGE:
function updateAge(xp, mxp, age) {
if (xp != undefined) {
player.XP = xp;
}
if (mxp != undefined) {
player.maxXP = mxp;
}
if (age != undefined) {
player.age = age;
}
}
// UPDATE UPGRADES:
function updateUpgrades(points, age) {
player.upgradePoints = points;
player.upgrAge = age;
if (points > 0) {
tmpList.length = 0;
UTILS.removeAllChildren(upgradeHolder);
for (let i = 0; i < items.weapons.length; ++i) {
if (items.weapons[i].age == age && (items.weapons[i].pre == undefined
|| player.weapons.indexOf(items.weapons[i].pre) >= 0)) {
let e = UTILS.generateElement({
id: "upgradeItem" + i,
class: "actionBarItem",
onmouseout: function() {
showItemInfo();
},
parent: upgradeHolder
});
e.style.backgroundImage = getEl("actionBarItem" +
i).style.backgroundImage;
tmpList.push(i);
}
}
for (let i = 0; i < items.list.length; ++i) {
if (items.list[i].age == age && (items.list[i].pre == undefined ||
player.items.indexOf(items.list[i].pre) >= 0)) {
let tmpI = (items.weapons.length + i);
let e = UTILS.generateElement({
id: "upgradeItem" + tmpI,
class: "actionBarItem",
onmouseout: function() {
showItemInfo();
},
parent: upgradeHolder
});
e.style.backgroundImage = getEl("actionBarItem" +
tmpI).style.backgroundImage;
tmpList.push(tmpI);
}
}
for (let i = 0; i < tmpList.length; i++) {
(function(i) {
let tmpItem = getEl('upgradeItem' + i);
// tmpItem.onmouseover = function() {
// if (items.weapons[i]) {
// showItemInfo(items.weapons[i], true);
// } else {
// showItemInfo(items.list[i - items.weapons.length]);
// }
// };
tmpItem.onclick = UTILS.checkTrusted(function() {
packet("H", i);
});
UTILS.hookTouchEvents(tmpItem);
})(tmpList[i]);
}
if (tmpList.length) {
upgradeHolder.style.display = "block";
upgradeCounter.style.display = "block";
upgradeCounter.innerHTML = "SELECT ITEMS (" + points + ")";
} else {
upgradeHolder.style.display = "none";
upgradeCounter.style.display = "none";
showItemInfo();
}
} else {
upgradeHolder.style.display = "none";
upgradeCounter.style.display = "none";
showItemInfo();
}
}
function toR(e) {
var n = (e * Math.PI / 180) % (2 * Math.PI);
return n > Math.PI ? Math.PI - n : n
}
function toD(e) {
var n = (e / Math.PI * 360) % 360;
return n >= 360 ? n - 360 : n;
}
let enemies = [];
const placedSpikePositions = new Set();
let PrePlaceCount = false;
// KILL OBJECT:
function killObject(sid) {
let findObj = findObjectBySid(sid);
objectManager.disableBySid(sid);
if (player) {
for (let i = 0; i < breakObjects.length; i++) {
if (breakObjects[i].sid == sid) {
breakObjects.splice(i, 1);
break;
}
}
if (!player.canSee(findObj)) {
breakTrackers.push({
x: findObj.x,
y: findObj.y
});
}
if (breakTrackers.length > 8) {
breakTrackers.shift();
}
for (let position of placedSpikePositions) {
let storedPosition = JSON.parse(position);
let distToStoredPosition = Math.hypot(storedPosition[0] - findObj.x,
storedPosition[1] - findObj.y);
if (distToStoredPosition <= 80) {
placedSpikePositions.delete(position);
break;
}
}
traps.replacer(findObj);
}
}
function canBeBroken(object) {
let ping = 0
let playerWeapon = player.weapons[player.weapons[1] == 10 ? 1 : 0]
let myVariantDmg = player[(playerWeapon < 9 ? "prima" : "seconda") +
"ryVariant"] == 0 ? 1 : player[(playerWeapon < 9 ? "prima" : "seconda") +
"ryVariant"] == 1 ? 1.1 :
player[(playerWeapon < 9 ? "prima" : "seconda") + "ryVariant"] >= 2 ? 1.18 :
1.1
let enemyWeapon = near.secondaryIndex == 10 ? near.secondaryIndex :
near.primaryIndex
let enemyVariantDmg = near[(enemyWeapon < 9 ? "prima" : "seconda") +
"ryVariant"] == 0 ? 1 : near[(enemyWeapon < 9 ? "prima" : "seconda") + "ryVariant"]
== 1 ?
1.1 : near[(enemyWeapon < 9 ? "prima" : "seconda") + "ryVariant"] >= 2 ?
1.18 : 1.18
let myDamage = items.weapons[playerWeapon].dmg * myVariantDmg *
(items.weapons[playerWeapon].sDmg || 1) * 3.3;
let enemyDamage = enemy.length ? (items.weapons[enemyWeapon].dmg *
enemyVariantDmg * (items.weapons[enemyWeapon].sDmg || 1) * 3.3) : 0
let damagePrediction = 0
//start of rel calculations
if (near.reloads[enemyWeapon] <= ping + 20) {
damagePrediction += enemyDamage
}
if ((clicks.right || traps.inTrap)) {
damagePrediction += myDamage
}
if (object.health <= damagePrediction) {
return true
} else {
return false
}
}
// - LOOK AT IT STARY I MADE IT AND ITS PERFECT !!
for (let i = near.aim2 - Math.PI / 3; i < near.aim2 + Math.PI / 3; i += Math.PI /
18) {
const enemyVelocity = Math.sqrt(near.xVel ** 2 + near.yVel ** 2);
const spikeVelocityThreshold = 150;
function caf(e, t) {
try {
return Math.atan2((t.y2 || t.y) - (e.y2 || e.y), (t.x2 || t.x) - (e.x2 ||
e.x));
} catch (e) {
return 0;
}
}
replaceable.forEach(build => {
let angle = findPlacementAngle(player, buildId, build);
if (angle !== null) {
place(buildId, angle);
}
});
};
const replaceDelay = game.tickSpeed - (window.pingTime || 0) + (game.tickSpeed
< 110 ? 5 : 0);
if (near && near.dist2 <= 360) {
setTimeout(replace, replaceDelay);
}
};
// let movementPrediction = {
// x: player.x2 + (player.oldPos.x2 - player.x2) * -1,
// y: player.y2 + (player.oldPos.y2 - player.y2) * -1,
// }
// potentialzpiketick.forEach((obj) => {
// if(cdf(obj, player) <= 200) {
// packet('a', undefined);
// }
// })
// let newPos = {
// x: player.x2 + (tracker.lastPos.x - player.x2) * -1,
// y: player.y2 + (tracker.lastPos.y - player.y2) * -1,
// }
return diff;
}
// function smartMove(oneTickMove) {
// let dir = player.moveDir;
// let newPos = {
// x: player.x2 + (player.x2 - player.oldPos.x2) * 1.2 + (Math.cos(dir)
* 50),
// y: player.y2 + (player.y2 - player.oldPos.y2) * 1.2 + (Math.sin(dir)
* 50),
// }
// // player.oldPos.x2 = tmpObj.x2;
// // player.oldPos.y2 = tmpObj.y2;
// }
let spikePlace = true;
let checkEnemy = false;
let EnemyDist = false;
function FastPlace(id, rad) {
try {
place(id, rad, 1);
} catch (e) {}
}
const getDirectionCac = (anglesCaculation, enemysnear, AnglesMath) => {
if (!enemysnear) {
return null;
}
const MathIp = Math.PI / 2;
const Webcac = Math.PI / 69;
const real = items.list[player.items[anglesCaculation]];
let v479 = player.scale + real.scale + (real.placeOffset || 0);
let v480 = [];
let v481 = UTILS.getDirect(enemysnear, player, 0, 2);
if (AnglesMath && enemysnear.sid != AnglesMath.sid) {
let v482 = UTILS.getDirect(AnglesMath, player, 0, 2);
for (let v483 = 0; v483 <= MathIp; v483 += Webcac) {
let v484 = [(v482 + v483) % (Math.PI * 2), (v482 - v483 + Math.PI * 2)
% (Math.PI * 2)];
for (let v485 of v484) {
if (objectManager.preplaceCheck(real, v485, enemysnear, v479)) {
v480.push(v485);
}
}
}
if (v480.length) {
v480.sort((p526, p527) => {
return UTILS.getAngleDist(p526, v482) - UTILS.getAngleDist(p527,
v482);
});
return v480[0];
}
} else {
for (let v486 = 0; v486 <= MathIp; v486 += Webcac) {
let v487 = [(v481 + v486) % (Math.PI * 2), (v481 - v486 + Math.PI * 2)
% (Math.PI * 2)];
for (let v488 of v487) {
if (objectManager.preplaceCheck(real, v488, enemysnear, v479)) {
return v488;
}
}
}
}
return null;
};
const PreplaceCac = () => {
if (near.dist2 > 269) {
return;
}
const Objects = [];
for (let litzobjects of liztobj) {
if (!litzobjects.isItem || !litzobjects.active ||
UTILS.getDist(litzobjects, player, 0, 2) > 150 || litzobjects.isTeamObject(player)
&& litzobjects.hideFromEnemy) {
continue;
}
if (objectManager.canBeBroken(litzobjects)) {
Objects.push(litzobjects);
}
}
let EnemyCac = Objects.sort((p528, p529) => UTILS.getDist(p528, near, 0, 2) -
UTILS.getDist(p529, near, 0, 2)).slice(0, Math.min(2, Objects.length));
const TrapSpikeCac = () => {
let NearInTrap = near.inTrap;
EnemyCac.forEach(obj => {
let spikeCac = NearInTrap && !my.autoPush &&
(getEl("preplaceMore").value == "spike" ? true : obj.sid != NearInTrap.sid) ? 2 :
4;
let FullCac = getDirectionCac(spikeCac, obj, NearInTrap);
if (FullCac !== null) {
place(spikeCac, FullCac, 1);
}
});
};
TrapSpikeCac();
};
function doPathFind(target) {
try {
let R = player;
let N = gameObjects
let centerX = R.x + (target[0] - R.x) / 2;
let centerY = R.y + (target[1] - R.y) / 2;
const nearBuilds = N.filter(e => Math.hypot(e.y - centerY, e.x - centerX) <
800 && e.active);
let block = 30, node = function (x, y, gScore) {
this.x = x;
this.y = y;
this.g = gScore;
this.type = nearBuilds.some(e => {
let exactScale = (/spike/.test(e.name) && R.sid != e.owner.sid &&
(R.team ? !e.isTeamObject(R) : true)) ? (e.scale + 32) : e.scale;
if (e.name == "pit trap") {
if (e.owner && (R.sid == e.owner.sid || e.isTeamObject(R))) {
return false;
}
}
if (Math.hypot(e.y - y, e.x - x) < exactScale + block &&
Math.hypot(e.y - target[1], e.x - target[0]) > exactScale + block && Math.hypot(e.y
- R.y2, e.x - R.x2) > exactScale + block) {
return true;
}
return false;
}) ? "wall" : "space";
}, myNode = new node(Math.round(R.x2 / block) * block, Math.round(R.y2 /
block) * block, 0),
targetNode = new node(Math.round(target[0] / block) * block,
Math.round(target[1] / block) * block, 0),
paths = [], foundset = [], currentTick = 0, endTick = 64, found = true;
function positive(num) {
return Math.abs(num);
};
while (!foundset.find(e => {
return Math.hypot(e.y - targetNode.y, e.x - targetNode.x) < block;
})) {
currentTick++;
if (currentTick >= endTick) {
found = false;
break;
};
let bestnode = currentTick === 1 ? myNode : foundset.filter(e => e.type
== "space").sort((a, b) => a.good - b.good)[0];
for (let i = 0; i < 3; i++) {
for (let o = 0; o < 3; o++) {
if (i == 1 && o == 1) {
continue;
}
let x = bestnode.x + block * (-1 + i);
let y = bestnode.y + block * (-1 + o);
let n = new node(x, y, currentTick);
let good = (positive(n.x - targetNode.x) + positive(n.y -
targetNode.y) / block) - currentTick;
n.good = good;
foundset.push(n);
}
}
paths.push(bestnode);
}
return found ? paths : false;
} catch (e) {}
}
let odfmsjfhvadsfyjkauhsfsa = false;
let odfmsjfhvadsfyjkauhsfsa2 = false;
let v292 = 0;
let v648 = false;
let healCD = false;
let spamCounts = 0;
function HKH () {
my.autoAim = true;
sendAutoGather();
buyEquip(53, 0);
selectWeapon(player.weapons[1]);
game.tickBase(() => {
buyEquip(7, 0);
selectWeapon(player.weapons[0]);
game.tickBase(() => {
sendAutoGather();
my.autoAim = false;
}, 1);
}, 1);
}
function canSyncHit() {
let N = gameObjects;
let _ = findPlayerByID(near);
if(player.reloads[player.weapons[0]] != 1) return false;
if(near.dist2/1.56 > items.weapons[player.weapons[0]].range) return false;
let x = (_.velX || _.x2), y = (_.velY || _.y2);
let isEnemyTraped = false;
for(let i = 0; i < N.length; i++) {
if(N[i] && N[i].name == "pit trap" && N[i].active && (N[i].owner.sid ==
player.sid || isAlly(N[i].owner.sid)) && Math.hypot(N[i].y - _.y2, N[i].x - _.x2) <
70) {
isEnemyTraped = true;
}
if(N[i] && N[i].dmg && N[i].active && isEnemyTraped == false &&
(N[i].owner.sid == player.sid || isAlly(N[i].owner.sid))) {
if(Math.hypot(N[i].y - y, N[i].x - x) <= 35 + N[i].scale) {
return true;
}
}
}
if(_.health - (Math.round(items.weapons[player.weapons[0]].dmg * 1.5 *
window.variantMulti(items.weapons[player.weapons[0]].variant) * (_.skinIndex == 6 ?
.75 : 1))) <= 0) {
return true;
}
return false;
}
let Stopped = false;
function updatePlayers(data) {
setTimeout(() => {
if (getEl("Preplace").checked && enemy.length && !
getEl("weaponGrind").checked) {
PreplaceCac();
}
}, 111 - v292);
function getAngleDifference(angle1, angle2) {
// Normalize the angles to be between 0 and 2π
angle1 = angle1 % (2 * Math.PI);
angle2 = angle2 % (2 * Math.PI);
return diff;
}
game.tick++;
enemy = [];
nears = [];
near = [];
game.tickSpeed = performance.now() - game.lastTick;
game.lastTick = performance.now();
players.forEach((tmp) => {
tmp.forcePos = !tmp.visible;
tmp.visible = false;
if((tmp.timeHealed - tmp.timeDamaged)>0 &&
tmp.lastshamecount<tmp.shameCount)
tmp.pinge = (tmp.timeHealed - tmp.timeDamaged);
});
for (let i = 0; i < data.length;) {
tmpObj = findPlayerBySID(data[i]);
if (tmpObj) {
tmpObj.t1 = (tmpObj.t2 === undefined) ? game.lastTick : tmpObj.t2;
tmpObj.t2 = game.lastTick;
tmpObj.oldPos.x2 = tmpObj.x2;
tmpObj.oldPos.y2 = tmpObj.y2;
tmpObj.x1 = tmpObj.x;
tmpObj.y1 = tmpObj.y;
tmpObj.x2 = data[i + 1];
tmpObj.y2 = data[i + 2];
tmpObj.x3 = tmpObj.x2 + (tmpObj.x2 - tmpObj.oldPos.x2);
tmpObj.y3 = tmpObj.y2 + (tmpObj.y2 - tmpObj.oldPos.y2);
tmpObj.d1 = (tmpObj.d2 === undefined) ? data[i + 3] : tmpObj.d2;
tmpObj.d2 = data[i + 3];
tmpObj.dt = 0;
tmpObj.buildIndex = data[i + 4];
tmpObj.weaponIndex = data[i + 5];
tmpObj.weaponVariant = data[i + 6];
tmpObj.team = data[i + 7];
tmpObj.isLeader = data[i + 8];
tmpObj.oldSkinIndex = tmpObj.skinIndex;
tmpObj.oldTailIndex = tmpObj.tailIndex;
tmpObj.skinIndex = data[i + 9];
tmpObj.tailIndex = data[i + 10];
tmpObj.iconIndex = data[i + 11];
tmpObj.zIndex = data[i + 12];
tmpObj.visible = true;
tmpObj.update(game.tickSpeed);
tmpObj.dist2 = UTILS.getDist(tmpObj, player, 2, 2);
tmpObj.aim2 = UTILS.getDirect(tmpObj, player, 2, 2);
tmpObj.dist3 = UTILS.getDist(tmpObj, player, 3, 3);
tmpObj.aim3 = UTILS.getDirect(tmpObj, player, 3, 3);
tmpObj.damageThreat = 0;
if (tmpObj.skinIndex == 45 && tmpObj.shameTimer <= 0) {
tmpObj.addShameTimer();
}
if (tmpObj.oldSkinIndex == 45 && tmpObj.skinIndex != 45) {
tmpObj.shameTimer = 0;
tmpObj.shameCount = 0;
if (tmpObj == player) {
healer();
}
}
botSkts.forEach((bot) => {
bot.showName = 'YEAHHH'
})
}
}
if (tmpObj == player) {
if (liztobj.length) {
liztobj.forEach((tmp) => {
tmp.onNear = false;
if (tmp.active) {
if (!tmp.onNear && UTILS.getDist(tmp, tmpObj, 0, 2) <=
tmp.scale + items.weapons[tmpObj.weapons[0]].range) {
tmp.onNear = true;
}
if (tmp.isItem && tmp.owner) {
if (!tmp.pps && tmpObj.sid == tmp.owner.sid &&
UTILS.getDist(tmp, tmpObj, 0, 2) > (0) && !tmp.breakObj && ![13, 14,
20].includes(tmp.id)) {
tmp.breakObj = true;
breakObjects.push({
x: tmp.x,
y: tmp.y,
sid: tmp.sid
});
}
}
}
});
let nearTrap = liztobj.filter(e => e.trap && e.active &&
UTILS.getDist(e, tmpObj, 0, 2) <= (tmpObj.scale + e.getScale() + 25) && !
e.isTeamObject(tmpObj)).sort(function(a, b) {
return UTILS.getDist(a, tmpObj, 0, 2) - UTILS.getDist(b,
tmpObj, 0, 2);
})[0];
if (nearTrap) {
let spike = gameObjects.filter(obj => obj.dmg &&
cdf(tmpObj, obj) <= tmpObj.scale + nearTrap.scale/2 && !obj.isTeamObject(tmpObj) &&
obj.active)[0]
traps.dist = UTILS.getDist(nearTrap, tmpObj, 0, 2);
traps.aim = UTILS.getDirect(spike ? spike : nearTrap,
tmpObj, 0, 2);
if (nearTrapped) {
neIT = true;
}
if (getEl("VelocityOneTick").checked) {
let ping = window.pingTime;
let range = (ping > 140) ? 230 : (ping > 110) ? 210 : (ping >
85) ? 190 : 170;
if (near.dist2 > range && near.dist2 <= 245 && !traps.inTrap &&
player.reloads[player.weapons[0]] == 0 && player.reloads[53] == 0 &&
player.weapons[0] == 5 && ((!neIT && near.skinIndex != 6) || neIT)) {
packet("9", undefined, 1);
game.tickBase(() => {
packet("9", near.aim2, 1);
}, 1);
instaC.VelocityOneTick();
}
}
}
/* end shit */
function doOneFrame() {
my.autoAim = true;
selectWeapon(player.weapons[0]);
buyEquip(53, 0);
selectWeapon(player.weapons[0]);
game.tickBase(() => {
buyEquip(7, 0);
sendAutoGather();
game.tickBase(() => {
selectWeapon(player.weapons[0]);
sendAutoGather();
my.autoAim = false;
}, 1);
}, 1);
}
/* end shit */
function autoOneFrameFast() {
let neIT = false;
let nearTrapped = gameObjects.filter(tmp => tmp.trap && tmp.active
&& tmp.isTeamObject(player) && UTILS.getDist(tmp, near, 0, 2) <= (near.scale +
tmp.getScale() + 15))
.sort(function(a, b) {
return UTILS.getDist(a, near, 0, 2) - UTILS.getDist(b, near, 0,
2);
})[0];
if (nearTrapped) {
neIT = true;
}
if (configs.autoOneFrame) {
let ping = window.pingTime;
let range = (ping > 140) ? 230 : (ping > 110) ? 210 : (ping >
85) ? 190 : 170;
if (near.dist2 > range && near.dist2 <= 245 && !traps.inTrap &&
player.reloads[player.weapons[0]] == 0 && player.reloads[53] == 0 &&
player.weapons[0] == 5 && ((!neIT && near.skinIndex != 6) || neIT)) {
packet("9", undefined, 1);
game.tickBase(() => {
packet("9", near.aim2, 1);
}, 1);
doOneFrame();
}
}
}
if (!instaC.isTrue && !traps.inTrap && !traps.replaced) {
traps.autoPlace();
}
if (!instaC.isTrue && getEl("VelocityOneTick").checked &&
autoOneFrameToggled) {
autoOneFrame();
}
if (!instaC.isTrue && configs.autoOneFrame && autoOneFrameToggled) {
autoOneFrameFast();
}
if (!macro.q && !macro.f && !macro.v && !macro.h) {
packet("D", getAttackDir());
}
function preplacer() {
if (!gameObjects.length || !inGame || !enemy.length || !player)
return;
if (objectss.length == 0) return;
let postTickTime = 0;
let frameTickRate = 1000 / 165;
let timeBetweenTicks = 1000 / 9;
function somePreStuff() {
let currentTime = Date.now();
let newTime = currentTime - postTickTime;
if (newTime + frameTickRate >= timeBetweenTicks) {
postTickTime = currentTime;
preplacer();
}
}
let hatChanger = function() {
if (my.anti0Tick > 0) {
buyEquip(6, 0);
} else {
if (clicks.left || clicks.right) {
if (!detect.spiketick && ((!enemy.length || near.dist2 >
310 && near.dist2 < 250) && player.shameCount > 0 && player.skinIndex != 45) ||
my.reSync) {
buyEquip(7, 0);
} else {
if (clicks.left) {
buyEquip(player.reloads[player.weapons[0]] == 0 ?
getEl("weaponGrind").checked ? 40 : 7 : player.empAnti ? 22 : player.soldierAnti ?
6 : (getEl("antiBullType").value == "abreload" && near.antiBull > 0) ? 11 :
near.dist2 <= 300 ? (getEl("antiBullType").value == "abalway" &&
near.reloads[near.primaryIndex] == 0) ? 11 : 6 : biomeGear(1, 1), 0);
} else if (clicks.right) {
buyEquip(player.reloads[clicks.right &&
player.weapons[1] == 10 ? player.weapons[1] : player.weapons[0]] == 0 ? 40 :
player.empAnti ? 22 : player.soldierAnti ? 6 : (getEl("antiBullType").value ==
"abreload" && near.antiBull > 0) ? 11 : near.dist2 <= 300 ?
(getEl("antiBullType").value == "abalway" && near.reloads[near.primaryIndex] ==
0) ? 11 : 6 : biomeGear(1, 1), 0);
}
}
} else if (traps.inTrap) {
if ((traps.info.health <=
items.weapons[player.weaponIndex].dmg ? false : (player.reloads[player.weapons[1]
== 10 ? player.weapons[1] : player.weapons[0]] == 0)) && my.anti0Tick == 0) {
buyEquip(40, 0);
} else {
if (!detect.spiketick && ((!enemy.length || near.dist2
> 310 || near.dist2 < 230 || near.dist2 > 200) && player.shameCount > 0 &&
player.skinIndex != 45) || my.reSync) {
buyEquip(7, 0);
} else {
buyEquip((player.empAnti || near.dist2 > 300 || !
enemy.length) ? 22 : 6, 0);
}
}
} else if (traps.inTrap) {
if (near.dist2 < 310 || near.dist2 > 230 || near.dist2 <
200 && !enemy.length && near.reloads[near.primaryIndex] == 5) {
buyEquip(6, 0);
game.tickBase(() => {
buyEquip(21, 1);
}, 1);
}
} else {
if (player.empAnti || player.soldierAnti) {
buyEquip(player.empAnti ? 22 : 6, 0);
} else {
if (!detect.spiketick && ((!enemy.length || near.dist2
> 310 && near.dist2 < 250) && player.shameCount > 0 && player.skinIndex != 45) ||
my.reSync) {
buyEquip(7, 0);
} else {
if (player.y2 >= config.mapScale / 2 -
config.riverWidth / 2 && player.y2 <= config.mapScale / 2 + config.riverWidth / 2)
{
if (!getEl("alwaysFlipper").checked) {
if (near.dist2 <= 300) {
buyEquip((getEl("antiBullType").value
== "abreload" && near.antiBull > 0) ? 11 : (getEl("antiBullType").value ==
"abalway" && near.reloads[near.primaryIndex] == 0) ? 11 : 6, 0);
} else {
biomeGear(1);
}
} else {
biomeGear(1);
}
} else {
if (near.dist2 <= 300) {
buyEquip((getEl("antiBullType").value ==
"abreload" && near.antiBull > 0) ? 11 : (getEl("antiBullType").value == "abalway"
&& near.reloads[near.primaryIndex] == 0) ? 11 : 6, 0);
} else {
biomeGear(1);
}
}
}
}
}
}
}
let accChanger = function() {
if (clicks.left) {
buyEquip(18, 1);
} else if (clicks.right) {
buyEquip(near.dist2 < 350 ? 18 : 11, 1);
} else if (traps.inTrap) {
buyEquip(18, 1);
game.tickBase(() => {
buyEquip(13, 1);
}, 1);
} else if (near.dist2 < 300){
if (getEl("antiBullType").value == "noab") {
buyEquip(19, 1)
} else if (getEl("alwaysFlipper").checked && player.y2 >=
config.mapScale / 2 - config.riverWidth / 2 && player.y2 <= config.mapScale / 2 +
config.riverWidth / 2) {
buyEquip(19, 1)
} else {
buyEquip(21, 1);
}
} else {
buyEquip(11, 1);
}
};
if (storeMenu.style.display != "block" && !instaC.isTrue && !
instaC.ticking) {
hatChanger();
accChanger();
}
if (getEl("autoPush").checked && enemy.length && !traps.inTrap && !
instaC.ticking) {
autoPush();
} else {
if (my.autoPush) {
my.autoPush = false;
packet("9", lastMoveDir || undefined, 1);
}
}
/* if (getEl("Autoplace").checkedr) {
autoplacer();
}*/
/* packetData.placeQ = packetData.place;
packetData.place = [];
if (packetData.placeQ.length) for (let i = 0; i <
packetData.placeQ.length; i++) {
if (packetData.placeQ[i][0] != undefined &&
player.itemCounts[packetData.placeQ[i][0]] ?
(player.itemCounts[packetData.placeQ[i][0]] < 99) : true &&
secondaryCheck(packetData.placeQ[i][0], packetData.placeQ[i][1])) {
place(packetData.placeQ[i][0],
packetData.placeQ[i][1]);
}
}*/
if (instaC.ticking) {
instaC.ticking = false;
}
if (instaC.syncHit) {
instaC.syncHit = false;
}
if (player.empAnti) {
player.empAnti = false;
}
if (player.soldierAnti) {
player.soldierAnti = false;
}
if (my.anti0Tick > 0) {
my.anti0Tick--
}
if (traps.replaced) {
traps.replaced = false;
}
if (traps.antiTrapped) {
traps.antiTrapped = false;
}
}
}
if (botSkts.length) {
botSkts.forEach((bots) => {
if (true) {
bots[0].showName = 'YEAHHH';
}
});
}
}
// UPDATE LEADERBOARD:
/* function updateLeaderboard(data) {
UTILS.removeAllChildren(leaderboardData);
var tmpC = 1;
for (var i = 0; i < data.length; i += 3) {
// console.log(data);
(function(i) {
UTILS.generateElement({
class: "leaderHolder",
parent: leaderboardData,
children: [
UTILS.generateElement({
class: "leaderboardItem",
style: data[i] == player.sid ? "color: rgba();
font-size: 18px;" : "color: rgba(); font-size: 18px; padding: 1px;", //"font-size:
18px;",
text: (data[i + 1] != "" ? data[i + 1] :
"unknown") + " |"
}),
UTILS.generateElement({
class: "a", //class: "leaderScore",
style: data[i] == player.sid ? "color:
rgba(255,255,255,1); font-size: 18px;" : "color: rgba(255,255,255,0.6); font-size:
18px; padding: 1px;",
text: (" " + UTILS.kFormat(data[i + 2]) || "
0")
})
]
});
})(i);
tmpC++;
}
}*/
// UPDATE LEADERBOARD:
function updateLeaderboard(data) {
lastLeaderboardData = data;
return;
UTILS.removeAllChildren(leaderboardData);
let tmpC = 1;
for (let i = 0; i < data.length; i += 3) {
(function(i) {
UTILS.generateElement({
class: "leaderHolder",
parent: leaderboardData,
children: [
UTILS.generateElement({
class: "leaderboardItem",
style: "color:" + ((data[i] == playerSID) ? "#fff" :
"rgba(255,255,255,0.6)"),
text: tmpC + ". " + (data[i + 1] != "" ? data[i + 1] :
"unknown")
}),
UTILS.generateElement({
class: "leaderScore",
text: UTILS.sFormat(data[i + 2]) || "0"
})
]
});
})(i);
tmpC++;
}
}
function fgdo(a, b) {
return Math.sqrt(Math.pow((b.y - a.y), 2) + Math.pow((b.x - a.x), 2));
}
function isAlly(sid, pSid) {
tmpObj = findPlayerBySID(sid)
if (!tmpObj) {
return
}
if (pSid) {
let pObj = findPlayerBySID(pSid)
if (!pObj) {
return
}
if (pObj.sid == sid) {
return true
} else if (tmpObj.team) {
return tmpObj.team === pObj.team ? true : false
} else {
return false
}
}
if (!tmpObj) {
return
}
if (player.sid == sid) {
return true
} else if (tmpObj.team) {
return tmpObj.team === player.team ? true : false
} else {
return false
}
}
// LOAD GAME OBJECT:
function loadGameObject(data) {
for (let i = 0; i < data.length;) {
objectManager.add(data[i], data[i + 1], data[i + 2], data[i + 3], data[i +
4],
data[i + 5], items.list[data[i + 6]], true, (data[i + 7]
>= 0 ? {
sid: data[i + 7]
} : null));
// sid, x, y, dir, s, type, data, setSID, owner
/*let dist = UTILS.getDist({
x: data[i + 1],
y: data[i + 2]
}, player, 0, 2);
let aim = UTILS.getDirect({
x: data[i + 1],
y: data[i + 2]
}, player, 0, 2);
find = findObjectBySid(data[i]);
if (data[i + 6] == 15) {
if (find && !find.isTeamObject(player)) {
if (dist <= 100) {
traps.dist = dist;
traps.aim = aim;
traps.protect(aim);
}
}
}*/
i += 8;
}
}
// ADD AI:
function loadAI(data) {
for (let i = 0; i < ais.length; ++i) {
ais[i].forcePos = !ais[i].visible;
ais[i].visible = false;
}
if (data) {
let tmpTime = performance.now();
for (let i = 0; i < data.length;) {
tmpObj = findAIBySID(data[i]);
if (tmpObj) {
tmpObj.index = data[i + 1];
tmpObj.t1 = (tmpObj.t2 === undefined) ? tmpTime : tmpObj.t2;
tmpObj.t2 = tmpTime;
tmpObj.x1 = tmpObj.x;
tmpObj.y1 = tmpObj.y;
tmpObj.x2 = data[i + 2];
tmpObj.y2 = data[i + 3];
tmpObj.d1 = (tmpObj.d2 === undefined) ? data[i + 4] : tmpObj.d2;
tmpObj.d2 = data[i + 4];
tmpObj.health = data[i + 5];
tmpObj.dt = 0;
tmpObj.visible = true;
} else {
tmpObj = aiManager.spawn(data[i + 2], data[i + 3], data[i + 4],
data[i + 1]);
tmpObj.x2 = tmpObj.x;
tmpObj.y2 = tmpObj.y;
tmpObj.d2 = tmpObj.dir;
tmpObj.health = data[i + 5];
if (!aiManager.aiTypes[data[i + 1]].name)
tmpObj.name = config.cowNames[data[i + 6]];
tmpObj.forcePos = true;
tmpObj.sid = data[i];
tmpObj.visible = true;
}
i += 7;
}
}
}
// ANIMATE AI:
function animateAI(sid) {
tmpObj = findAIBySID(sid);
if (tmpObj) tmpObj.startAnim();
}
let detect = {
insta: false,
reverse: false,
onetick: false,
spiketick: false,
barbarian: false,
antibull: false,
antibullhit: false,
bowInsta: false
}
// GATHER ANIMATION:
function gatherAnimation(sid, didHit, index) {
tmpObj = findPlayerBySID(sid);
if (tmpObj) {
tmpObj.startAnim(didHit, index);
tmpObj.gatherIndex = index;
tmpObj.gathering = 1;
if(near.dist2 <= 175 && UTILS.getAngleDist(tmpDir, tmpObj.dir) <=
config.gatherAngle){
buyEquip(6, 0);
buyEquip(13, 1);
detect.spiketick = true;
} else {
detect.spiketick = false;
}
if (didHit) {
let tmpObjects = objectManager.hitObj;
objectManager.hitObj = [];
game.tickBase(() => {
// refind
tmpObj = findPlayerBySID(sid);
let val = items.weapons[index].dmg *
(config.weaponVariants[tmpObj[(index < 9 ? "prima" : "seconda") +
"ryVariant"]].val) * (items.weapons[index].sDmg || 1) * (tmpObj.skinIndex == 40 ?
3.3 : 1);
tmpObjects.forEach((healthy) => {
healthy.health -= val;
});
}, 1);
}
}
}
// SHOOT TURRET:
function shootTurret(sid, dir) {
tmpObj = findObjectBySid(sid);
if (tmpObj) {
if (config.anotherVisual) {
tmpObj.lastDir = dir;
} else {
tmpObj.dir = dir;
}
tmpObj.xWiggle += config.gatherWiggle * Math.cos(dir + Math.PI);
tmpObj.yWiggle += config.gatherWiggle * Math.sin(dir + Math.PI);
}
}
let MaxKills = 0;
// UPDATE PLAYER VALUE:
function updatePlayerValue(index, value, updateView) {
if (player) {
player[index] = value;
if (index == "points") {
if (getEl("autoBuy").checked) {
autoBuy.hat();
autoBuy.acc();
}
} else if (index == "kills") {
MaxKills = player.kills;
if (getEl("KillChat").checked) {
io.send("6", "Uno ReverseClient - GG")
setTimeout(() => {
io.send("6", "")
setTimeout(() => {
io.send("6", "")
setTimeout(() => {
io.send("6", "")
}, 1500);
}, 1500);
}, 1500);
}
}
}
}
function clearConsole() {
if (configs.fpsBoost) {
console.clear();
}
}
if (kills <= 1) {
return "";
} else {
// Display additional information when the kill count crosses a multiple of
10
let additionalInfo = "x" + (Math.floor(kills / 10)); // Adjusted the
calculation
return additionalInfo; // Return the additionalInfo
}
}
// ACTION BAR:
function updateItems(data, wpn) {
if (data) {
if (wpn) {
player.weapons = data;
player.primaryIndex = player.weapons[0];
player.secondaryIndex = player.weapons[1];
if (!instaC.isTrue) {
selectWeapon(player.weapons[0]);
}
} else {
player.items = data;
}
}
for (let i = 0; i < items.list.length; i++) {
let tmpI = items.weapons.length + i;
let actionBarItem = getEl("actionBarItem" + tmpI);
actionBarItem.style.display = player.items.indexOf(items.list[i].id) >= 0 ?
"inline-block" : "none";
// Add shadow to the element
// actionBarItem.style.boxShadow = "2px 2px 5px rgba(0, 0, 0, 0.5)";
document.getElementsByTagName('button').style.boxShadow = "2px 2px 5px
rgba(0, 0, 0, 0.5)";
// ADD PROJECTILE:
function addProjectile(x, y, dir, range, speed, indx, layer, sid) {
projectileManager.addProjectile(x, y, dir, range, speed, indx, null, null,
layer, inWindow).sid = sid;
runAtNextTick.push(Array.prototype.slice.call(arguments));
}
// REMOVE PROJECTILE:
function remProjectile(sid, range) {
for (let i = 0; i < projectiles.length; ++i) {
if (projectiles[i].sid == sid) {
projectiles[i].range = range;
let tmpObjects = objectManager.hitObj;
objectManager.hitObj = [];
game.tickBase(() => {
let val = projectiles[i].dmg;
tmpObjects.forEach((healthy) => {
if (healthy.projDmg) {
healthy.health -= val;
}
});
}, 1);
}
}
}
function setAlliancePlayers(data) {
alliancePlayers = data;
}
// STORE MENU:
function updateStoreItems(type, id, index) {
if (index) {
if (!type)
player.tails[id] = 1;
else {
player.latestTail = id;
}
} else {
if (!type)
player.skins[id] = 1,
id == 7 && (my.reSync = true); // testing perfect bulltick...
else {
player.latestSkin = id;
}
}
}
function checkProfanityString(text) {
var tmpString;
let alwaysfalse = false;
if (!alwaysfalse) {
for (var i = 0; i < profanityList.length; ++i) {
if (text.indexOf(profanityList[i]) > -1) {
tmpString = "";
for (var y = 0; y < profanityList[i].length; ++y) {
tmpString += tmpString.length ? "o" : "M";
}
var re = new RegExp(profanityList[i],"g");
text = text.replace(re, tmpString);
}
}
}
return text;
}
function time() {
const now2 = new Date();
const hours = now2.getHours();
const minutes = now2.getMinutes();
const secondsFor = now2.getSeconds();
// MINIMAP:
function updateMinimap(data) {
minimapData = data;
}
// RENDER CIRCLE:
function renderCircle(x, y, scale, tmpContext, dontStroke, dontFill) {
tmpContext = tmpContext || mainContext;
tmpContext.beginPath();
tmpContext.arc(x, y, scale, 0, 2 * Math.PI);
if (!dontFill) tmpContext.fill();
if (!dontStroke) tmpContext.stroke();
}
// RENDER RECTANGLE:
function renderRect(x, y, w, h, ctxt, dontStroke, dontFill) {
if (!dontFill) ctxt.fillRect(x - (w / 2), y - (h / 2), w, h);
if (!dontStroke) ctxt.strokeRect(x - (w / 2), y - (h / 2), w, h);
}
// RENDER RECTCIRCLE:
function renderRectCircle(x, y, s, sw, seg, ctxt, dontStroke, dontFill) {
ctxt.save();
ctxt.translate(x, y);
seg = Math.ceil(seg / 2);
for (let i = 0; i < seg; i++) {
renderRect(0, 0, s * 2, sw, ctxt, dontStroke, dontFill);
ctxt.rotate(Math.PI / seg);
}
ctxt.restore();
}
// RENDER BLOB:
function renderBlob(ctxt, spikes, outer, inner) {
let rot = Math.PI / 2 * 3;
let x, y;
let step = Math.PI / spikes;
let tmpOuter;
ctxt.beginPath();
ctxt.moveTo(0, -inner);
for (let i = 0; i < spikes; i++) {
tmpOuter = UTILS.randInt(outer + 0.9, outer * 1.2);
ctxt.quadraticCurveTo(Math.cos(rot + step) * tmpOuter, Math.sin(rot + step)
* tmpOuter,
Math.cos(rot + (step * 2)) * inner, Math.sin(rot +
(step * 2)) * inner);
rot += step * 2;
}
ctxt.lineTo(0, -inner);
ctxt.closePath();
}
// RENDER TRIANGLE:
function renderTriangle(s, ctx) {
ctx = ctx || mainContext;
let h = s * (Math.sqrt(3) / 2);
ctx.beginPath();
ctx.moveTo(0, -h / 2);
ctx.lineTo(-s / 2, h / 2);
ctx.lineTo(s / 2, h / 2);
ctx.lineTo(0, -h / 2);
ctx.fill();
ctx.closePath();
}
const speed = 1;
// RENDER PLAYERS:
function renderDeadPlayers(f, d) {
mainContext.fillStyle = "#91b2db";
const currentTime = Date.now();
deadPlayers.filter(dead => dead.active).forEach((dead) => {
if (!dead.startTime) {
dead.startTime = currentTime;
dead.angle = 0;
dead.radius = 0.1;
}
const timeElapsed = currentTime - dead.startTime;
const maxAlpha = 1;
dead.alpha = Math.max(0, maxAlpha - (timeElapsed / 3000));
dead.animate(delta);
mainContext.globalAlpha = dead.alpha;
mainContext.strokeStyle = outlineColor;
mainContext.save();
mainContext.translate(dead.x - f, dead.y - d);
dead.radius -= 0.001;
dead.angle += 0.0174533;
const moveSpeed = 1;
const x = dead.radius * Math.cos(dead.angle);
const y = dead.radius * Math.sin(dead.angle);
dead.x += x * moveSpeed;
dead.y += y * moveSpeed;
mainContext.rotate(dead.angle);
renderDeadPlayer(dead, mainContext);
mainContext.restore();
mainContext.fillStyle = "#91b2db";
if (timeElapsed >= 3000) {
dead.active = false;
dead.startTime = null;
}
});
}
// RENDER PLAYERS:
function renderPlayers(f, d, zIndex) {
mainContext.globalAlpha = 1;
mainContext.fillStyle = "#91b2db";
for (var i = 0; i < players.length; ++i) {
tmpObj = players[i];
if (tmpObj.zIndex == zIndex) {
tmpObj.animate(delta);
if (tmpObj.visible) {
tmpObj.skinRot += (0.002 * delta);
tmpDir = (tmpObj==player?getVisualDir():(tmpObj.dir || 0));
mainContext.save();
mainContext.translate(tmpObj.x - f, tmpObj.y - d);
// RENDER PLAYER:
mainContext.rotate(tmpDir + tmpObj.dirPlus);
renderPlayer(tmpObj, mainContext);
mainContext.restore();
}
}
}
}
// RENDER DEAD PLAYER:
function renderDeadPlayer(obj, ctxt) {
ctxt = ctxt || mainContext;
ctxt.lineWidth = outlineWidth;
ctxt.lineJoin = "miter";
let handAngle = (Math.PI / 4) * (items.weapons[obj.weaponIndex].armS||1);
let oHandAngle = (obj.buildIndex < 0)?(items.weapons[obj.weaponIndex].hndS||
1):1;
let oHandDist = (obj.buildIndex < 0)?(items.weapons[obj.weaponIndex].hndD||
1):1;
// TAIL/CAPE:
renderTail2(13, ctxt, obj);
// WEAPON BELLOW HANDS:
if (obj.buildIndex < 0 && !items.weapons[obj.weaponIndex].aboveHand) {
renderTool(items.weapons[obj.weaponIndex],
config.weaponVariants[obj.weaponVariant || 0].src || "", obj.scale, 0, ctxt);
if (items.weapons[obj.weaponIndex].projectile != undefined && !
items.weapons[obj.weaponIndex].hideProjectile) {
renderProjectile(obj.scale, 0,
items.projectiles[items.weapons[obj.weaponIndex].projectile], mainContext);
}
}
// HANDS:
ctxt.fillStyle = "#ececec";
renderCircle(obj.scale * Math.cos(handAngle), (obj.scale *
Math.sin(handAngle)), 14);
renderCircle((obj.scale * oHandDist) * Math.cos(-handAngle * oHandAngle),
(obj.scale * oHandDist) * Math.sin(-handAngle * oHandAngle), 14);
// WEAPON ABOVE HANDS:
if (obj.buildIndex < 0 && items.weapons[obj.weaponIndex].aboveHand) {
renderTool(items.weapons[obj.weaponIndex],
config.weaponVariants[obj.weaponVariant || 0].src || "", obj.scale, 0, ctxt);
if (items.weapons[obj.weaponIndex].projectile != undefined && !
items.weapons[obj.weaponIndex].hideProjectile) {
renderProjectile(obj.scale, 0,
items.projectiles[items.weapons[obj.weaponIndex].projectile], mainContext);
}
}
// BUILD ITEM:
if (obj.buildIndex >= 0) {
var tmpSprite = getItemSprite(items.list[obj.buildIndex]);
ctxt.drawImage(tmpSprite, obj.scale -
items.list[obj.buildIndex].holdOffset, -tmpSprite.width / 2);
}
// BODY:
renderCircle(0, 0, obj.scale, ctxt);
// SKIN
renderSkin2(48, ctxt, null, obj)
}
// RENDER PLAYER:
function renderPlayer(obj, ctxt) {
ctxt = ctxt || mainContext;
ctxt.lineWidth = outlineWidth;
ctxt.lineJoin = "miter";
let handAngle = (Math.PI / 4) * (items.weapons[obj.weaponIndex].armS || 1);
let oHandAngle = (obj.buildIndex < 0) ? (items.weapons[obj.weaponIndex].hndS ||
1) : 1;
let oHandDist = (obj.buildIndex < 0) ? (items.weapons[obj.weaponIndex].hndD ||
1) : 1;
// TAIL/CAPE:
if (obj.tailIndex > 0) {
renderTailTextureImage(obj.tailIndex, ctxt, obj);
}
items.projectiles[items.weapons[obj.weaponIndex].projectile], mainContext);
}
}
// HANDS:
ctxt.fillStyle = config.skinColors[obj.skinColor];
renderCircle(obj.scale * Math.cos(handAngle), (obj.scale *
Math.sin(handAngle)), 14);
renderCircle((obj.scale * oHandDist) * Math.cos(-handAngle * oHandAngle),
(obj.scale * oHandDist) * Math.sin(-handAngle * oHandAngle), 14);
items.projectiles[items.weapons[obj.weaponIndex].projectile], mainContext);
}
}
// BUILD ITEM:
if (obj.buildIndex >= 0) {
var tmpSprite = getItemSprite(items.list[obj.buildIndex]);
ctxt.drawImage(tmpSprite, obj.scale -
items.list[obj.buildIndex].holdOffset, -tmpSprite.width / 2);
}
// BODY:
renderCircle(0, 0, obj.scale, ctxt);
// SKIN:
if (obj.skinIndex > 0) {
ctxt.rotate(Math.PI / 2);
renderTextureSkin(obj.skinIndex, ctxt, null, obj);
}
// RENDER SKIN:
function renderTextureSkin(index, ctxt, parentSkin, owner) {
if (!(tmpSkin = skinSprites[index + (txt ? "lol" : 0)])) {
var tmpImage = new Image();
tmpImage.onload = function() {
this.isLoaded = true,
this.onload = null
}
,
tmpImage.src = setSkinTextureImage(index, "hat", index),
skinSprites[index + (txt ? "lol" : 0)] = tmpImage,
tmpSkin = tmpImage
}
var tmpObj = parentSkin||skinPointers[index];
if (!tmpObj) {
for (var i = 0; i < hats.length; ++i) {
if (hats[i].id == index) {
tmpObj = hats[i];
break;
}
}
skinPointers[index] = tmpObj;
}
if (tmpSkin.isLoaded)
ctxt.drawImage(tmpSkin, -tmpObj.scale/2, -tmpObj.scale/2, tmpObj.scale,
tmpObj.scale);
if (!parentSkin && tmpObj.topSprite) {
ctxt.save();
ctxt.rotate(owner.skinRot);
renderSkin(index + "_top", ctxt, tmpObj, owner);
ctxt.restore();
}
}
// RENDER TAIL:
var newAccImgs = {
21: "https://i.imgur.com/4ddZert.png",
19: "https://i.imgur.com/sULkUZT.png",
};
function setTailTextureImage(id, type, id2) {
if (true) {
if(newAccImgs[id] && type == "acc") {
return newAccImgs[id];
} else {
if(type == "acc") {
return ".././img/accessories/access_" + id + ".png";
} else if(type == "hat") {
return ".././img/hats/hat_" + id + ".png";
} else {
return ".././img/weapons/" + id + ".png";
}
}
} else {
if(type == "acc") {
return ".././img/accessories/access_" + id + ".png";
} else if(type == "hat") {
return ".././img/hats/hat_" + id + ".png";
} else {
return ".././img/weapons/" + id + ".png";
}
}
}
function renderTailTextureImage(index, ctxt, owner) {
if (!(tmpSkin = accessSprites[index + (txt ? "lol" : 0)])) {
var tmpImage = new Image();
tmpImage.onload = function() {
this.isLoaded = true,
this.onload = null
}
,
tmpImage.src = setTailTextureImage(index,
"acc"),//".././img/accessories/access_" + index + ".png";
accessSprites[index + (txt ? "lol" : 0)] = tmpImage,
tmpSkin = tmpImage;
}
var tmpObj = accessPointers[index];
if (!tmpObj) {
for (var i = 0; i < accessories.length; ++i) {
if (accessories[i].id == index) {
tmpObj = accessories[i];
break;
}
}
accessPointers[index] = tmpObj;
}
if (tmpSkin.isLoaded) {
ctxt.save();
ctxt.translate(-20 - (tmpObj.xOff||0), 0);
if (tmpObj.spin)
ctxt.rotate(owner.skinRot);
ctxt.drawImage(tmpSkin, -(tmpObj.scale/2), -(tmpObj.scale/2), tmpObj.scale,
tmpObj.scale);
ctxt.restore();
}
}
// RENDER TOOL:
let toolSprites = {};
function renderTool(obj, variant, x, y, ctxt) {
let tmpSrc = obj.src + (variant || "");
let tmpSprite = toolSprites[tmpSrc];
if (!tmpSprite) {
tmpSprite = new Image();
tmpSprite.onload = function() {
this.isLoaded = true;
}
tmpSprite.src = "https://moomoo.io/img/weapons/" + tmpSrc + ".png";
toolSprites[tmpSrc] = tmpSprite;
}
if (tmpSprite.isLoaded) {
}
ctxt.drawImage(tmpSprite, x + obj.xOff - (obj.length / 2), y + obj.yOff -
(obj.width / 2), obj.length, obj.width);
}
// RENDER PROJECTILES:
function renderProjectiles(layer, f, d) {
for (let i = 0; i < projectiles.length; i++) {
tmpObj = projectiles[i];
if (tmpObj.active && tmpObj.layer == layer && tmpObj.inWindow) {
tmpObj.update(delta);
if (tmpObj.active && isOnScreen(tmpObj.x - f, tmpObj.y - d,
tmpObj.scale)) {
mainContext.save();
mainContext.translate(tmpObj.x - f, tmpObj.y - d);
mainContext.rotate(tmpObj.dir);
renderProjectile(0, 0, tmpObj, mainContext, 1);
mainContext.restore();
}
}
};
}
// RENDER PROJECTILE:
let projectileSprites = {};//fz iz zexy
// RENDER AI:
let aiSprites = {};
// MIDDLE RIVER:
let tmpW = config.riverWidth + padding;
let tmpY = (config.mapScale / 2) - d - (tmpW / 2);
if (tmpY < maxScreenHeight && tmpY + tmpW > 0) {
ctxt.fillRect(0, tmpY, maxScreenWidth, tmpW);
}
}
let originalScales = {
width: 1920,
height: 1080
}
function knockBackPredict() {
let bfn = {
x0: 0,
y0: 0,
x1: 0,
y1: 0,
instax: 0,
instay: 0,
turretx: 0,
turrety: 0
};
let bfo = Math.atan2(near.y2 - player.y2, near.x2 - player.x2);
let bfp = Infinity;
let bfq = gameObjects.filter(bfr => bfr.name == "pit trap" && bfr.active &&
bfr.isTeamObject(player) && UTILS.getDist(bfr, near, 0, 2) <= bfr.getScale() +
player.scale + 5).sort((bfs, bft) => {
return UTILS.getDist(bfs, near, 0, 2) - UTILS.UTILS.getDist(bft, near, 0,
2);
})[0];
if (near.dist2 - player.scale * 1.8 <= items.weapons[player.weapons[0]].range
&& !bfq) {
for (let bfv of gameObjects) {
let bfw = bfn;
if (bfv.dmg && bfv.active && bfv.isTeamObject(player)) {
let bfx = (items.weapons[player.weapons[0]].knock || 0) *
items.weapons[player.weapons[0]].range + player.scale * 2;
let bfy = ![undefined, 9, 12, 13, 15].includes(player.weapons[1]) ?
(items.weapons[player.weapons[1]].knock || 0) *
items.weapons[player.weapons[1]].range + player.scale * 2 - 10 :
player.weapons[1] != undefined ? 60 : 0;
let bfz = bfx + bfy;
let bga = player.reloads[53] == 0 ? bfx + bfy + 75 : bfz;
let bgb = near.x2 + bfx * Math.cos(bfo);
let bgc = near.y2 + bfx * Math.sin(bfo);
let bgd = near.x2 + bfy * Math.cos(bfo);
let bge = near.y2 + bfy * Math.sin(bfo);
let bgf = near.x2 + bfz * Math.cos(bfo);
let bgg = near.y2 + bfz * Math.sin(bfo);
let bgh = near.x2 + bga * Math.cos(bfo);
let bgi = near.y2 + bga * Math.sin(bfo);
bfw.x0 = bgb;
bfw.y0 = bgc;
bfw.x1 = bgd;
bfw.y1 = bge;
bfw.instax = bgf;
bfw.instay = bgg;
bfw.turretx = bgh;
bfw.turrety = bgi;
if (UTILS.getDist({
x: bgb,
y: bgc
}, bfv, 0, 0) <= bfv.scale + player.scale &&
player.reloads[player.weapons[0]] == 0) {
return "insta them";
}
if (UTILS.getDist({
x: bgf,
y: bgg
}, bfv, 0, 0) <= bfv.scale + player.scale &&
player.reloads[player.weapons[0]] == 0 && player.reloads[player.weapons[1]] == 0) {
return "insta them";
}
}
}
} else {
bfn = {
x0: 0,
y0: 0,
x1: 0,
y1: 0,
instax: 0,
instay: 0,
turretx: 0,
turrety: 0
};
}
return false;
}
function SpikeSync(Players, Buildings, Weapons, ctx, offset) {
canSync.sync = false;
autoPush2.doPush = 1;
if(!Buildings) return;
if(!Players) return;
let customColours = ["white", "white"];
function drawLine(from, to, colour) {
ctx.beginPath();
let a = ctx.strokeStyle;
let b = ctx.fillStyle;
ctx.strokeStyle = colour;
ctx.lineWidth = 3;
ctx.moveTo(from.x - offset.x, from.y - offset.y);
ctx.lineTo(to.x - offset.x, to.y - offset.y);
ctx.stroke();
ctx.closePath();
ctx.strokeStyle = a;
ctx.fillStyle = b;
}
function drawLineWithArrow(from, to, colour) {
drawLine(from, to, colour);
ctx.beginPath();
ctx.moveTo(to.x - offset.x, to.y - offset.y);
ctx.lineTo(to.x - offset.x - arrowSize * Math.cos(angle - Math.PI/6),
to.y - offset.y - arrowSize * Math.sin(angle - Math.PI/6));
ctx.moveTo(to.x - offset.x, to.y - offset.y);
ctx.lineTo(to.x - offset.x - arrowSize * Math.cos(angle + Math.PI/6),
to.y - offset.y - arrowSize * Math.sin(angle + Math.PI/6));
ctx.strokeStyle = colour;
ctx.stroke();
ctx.closePath();
}
let Spikes = Buildings.filter(Building => {
return /spike/.test(Building.name) && Building.active;
});
for(let i = 0; i < Players.length; i++) {
if(Players[i].visible) {
let Player = Players[i];
let Enemies = Players.filter(function (player) {
return !((player.team == Player.team && Player.team != null) ||
player.sid == Player.sid);
});
let harmfulEnemies = Enemies.filter(function (player) {
return Math.sqrt((player.y2 - Player.y2) ** 2 + (player.x2 -
Player.x2) ** 2) < Weapons[player.weapons[0]].length + 70;
});
for(let i = 0; i < harmfulEnemies.length; i++) {
if(harmfulEnemies[i]) {
let angle = Math.atan2(Player.y2 - harmfulEnemies[i].y2,
Player.x2 - harmfulEnemies[i].x2);
let speed = (0.3 +
(Weapons[harmfulEnemies[i].weapons[0]].knock||0)),
knockbacks = {
x: Player.x2 + speed * Math.cos(angle) * 224,
y: Player.y2 + speed * Math.sin(angle) * 224
}
drawLineWithArrow(Player, knockbacks,
customColours[(harmfulEnemies[i].sid) % customColours.length]); // these colors are
optional
for(let n = 0; n < Spikes.length; n++) {
if(Spikes[n].owner.sid != Player.sid) {
if(Math.sqrt((Spikes[n].y - knockbacks.y) ** 2 +
(Spikes[n].x - knockbacks.x) ** 2) < Spikes[n].scale + 30) {
if(harmfulEnemies[i].sid == player.sid &&
Math.sqrt((Player.y - Spikes[n].y) ** 2 + (Player.x - Spikes[n].x) ** 2) > (30 +
Spikes[n].scale)) {
autoPush2.doPush = 2;
autoPush2.pushAngle = Math.atan2(Player.y + 7 *
Math.sin(Math.atan2(Player.y - Spikes[n].y, Player.x - Spikes[n].x)) -
harmfulEnemies[i].y, Player.x + 7 * Math.cos(Math.atan2(Player.y - Spikes[n].y,
Player.x - Spikes[n].x)) - harmfulEnemies[i].x);
}
ctx.stroke();
ctx.beginPath();
ctx.arc(knockbacks.x - offset.x, knockbacks.y -
offset.y, 35, 0, Math.PI * 2)
ctx.strokeStyle = "red";
ctx.stroke();
drawLineWithArrow(knockbacks, Spikes[n], "red");
ctx.closePath();
}
}
}
}
}
}
}
}
// RENDER GAME OBJECTS:
let gameObjectSprites = {};
function getResSprite(obj) {
let biomeID = (obj.y>=config.mapScale-config.snowBiomeTop)?2:
((obj.y<=config.snowBiomeTop)?1:0);
let tmpIndex = (obj.type + "_" + obj.scale + "_" + biomeID);
let tmpSprite = gameObjectSprites[tmpIndex];
if (!tmpSprite) {
let blurScale = 15;
let tmpCanvas = document.createElement("canvas");
tmpCanvas.width = tmpCanvas.height = (obj.scale * 2.1) + outlineWidth;
let tmpContext = tmpCanvas.getContext('2d');
tmpContext.translate((tmpCanvas.width / 2), (tmpCanvas.height / 2));
tmpContext.rotate(UTILS.randFloat(0, Math.PI));
tmpContext.strokeStyle = outlineColor;
tmpContext.lineWidth = outlineWidth;
if (obj.type == 0) {
let tmpScale;
let tmpCount = UTILS.randInt(5, 7);
for (let i = 0; i < 2; ++i) {
tmpScale = tmpObj.scale * (!i?1:0.5);
renderBlob(tmpContext, tmpCount, tmpScale, tmpScale * 0.7);
tmpContext.fillStyle = (obj.y >= config.mapScale -
config.snowBiomeTop) ? (!i?"#e3b5a7" : "#fcc9b9") : !biomeID?(!i?"#e3b5a7" :
"#fcc9b9"):(!i?"#e3f1f4":"#fff");
tmpContext.fill();
if (!i) {
tmpContext.stroke();
tmpContext.shadowBlur = null;
tmpContext.shadowColor = null;
tmpContext.globalAlpha = 1;
}
}
} else if (obj.type == 1) {
renderBlob(tmpContext, 6, tmpObj.scale, tmpObj.scale * 0.7);
tmpContext.fillStyle = biomeID == 2 ? "#e3b5a7" :
(biomeID?"#e3f1f4":"#89a54c");
tmpContext.fill();
tmpContext.stroke();
//tmpContext.shadowBlur = null;
//tmpContext.shadowColor = null;
tmpContext.shadowBlur = null;
tmpContext.shadowColor = null;
tmpContext.fillStyle = (obj.type==2)?
(biomeID==2?"#b2ab90":"#bcbcbc"):"#ebdca3";
renderStar(tmpContext, 3, obj.scale * 0.55, obj.scale * 0.65);
tmpContext.fill();
}
tmpSprite = tmpCanvas;
gameObjectSprites[tmpIndex] = tmpSprite;
}
return tmpSprite;
}
// OBJECT ON SCREEN:
function isOnScreen(x, y, s) {
return (x + s >= 0 && x - s <= maxScreenWidth && y + s >= 0 && (y,
s,
maxScreenHeight));
}
// RENDER GAMEOBJECTS:
function renderGameObjects(layer, xOffset, yOffset) {
let tmpSprite;
let tmpX;
let tmpY;
liztobj.forEach((tmp) => {
tmpObj = tmp;
if (tmpObj.active && liztobj.includes(tmp) && tmpObj.render) {
tmpX = tmpObj.x + tmpObj.xWiggle - xOffset;
tmpY = tmpObj.y + tmpObj.yWiggle - yOffset;
if (layer == 0) {
tmpObj.update(delta);
}
mainContext.globalAlpha = tmpObj.alpha;
if (tmpObj.layer == layer && isOnScreen(tmpX, tmpY, tmpObj.scale +
(tmpObj.blocker || 0))) {
if (tmpObj.isItem) {
if ((tmpObj.dmg || tmpObj.trap) && !
tmpObj.isTeamObject(player)) {
tmpSprite = getObjSprite(tmpObj);
} else {
tmpSprite = getItemSprite(tmpObj);
}
mainContext.save();
mainContext.translate(tmpX, tmpY);
let rotationSpeed;
if (config.anotherVisual) {
rotationSpeed = 0;
} else {
rotationSpeed = 0;
}
tmpObj.rotationAngle = (tmpObj.rotationAngle || 0) +
rotationSpeed * delta;
mainContext.rotate(tmpObj.rotationAngle);
mainContext.rotate(tmpObj.dir);
if (!tmpObj.active) {
mainContext.scale(tmpObj.visScale / tmpObj.scale,
tmpObj.visScale / tmpObj.scale);
}
mainContext.drawImage(tmpSprite, -(tmpSprite.width / 2), -
(tmpSprite.height / 2));
if (tmpObj.blocker) {
mainContext.strokeStyle = "#db6e6e";
mainContext.globalAlpha = 0.3;
mainContext.lineWidth = 6;
renderCircle(0, 0, tmpObj.blocker, mainContext, false,
true);
}
mainContext.restore();
} else {
tmpSprite = getResSprite(tmpObj);
mainContext.drawImage(tmpSprite, tmpX - (tmpSprite.width / 2),
tmpY - (tmpSprite.height / 2));
}
}
if (layer == 3) {
if (tmpObj.health < tmpObj.maxHealth) {
// HEALTH HOLDR:
mainContext.fillStyle = darkOutlineColor;
mainContext.roundRect(tmpX - config.healthBarWidth / 2 -
config.healthBarPad, tmpY - config.healthBarPad, config.healthBarWidth +
config.healthBarPad * 2, 17, 8);
mainContext.fill();
// HEALTH BAR:
mainContext.fillStyle = tmpObj.isTeamObject(player) ?
"purple" : "pink";
mainContext.roundRect(tmpX - config.healthBarWidth / 2, tmpY,
config.healthBarWidth * (tmpObj.health / tmpObj.maxHealth), 17 -
config.healthBarPad * 2, 7);
mainContext.fill();
}
}
}
});
// PLACE VISIBLE:
if (layer == 0) {
if (placeVisible.length) {
placeVisible.forEach((places) => {
tmpX = places.x - xOffset;
tmpY = places.y - yOffset;
markObject(places, tmpX, tmpY);
});
}
}
}
function pingMap(x, y) {
tmpPing = mapPings.find(pings => !pings.active);
if (!tmpPing) {
tmpPing = new MapPing("#fff", config.mapPingScale);
mapPings.push(tmpPing);
}
tmpPing.init(x, y);
}
function updateMapMarker() {
mapMarker.x = player.x;
mapMarker.y = player.y;
}
function renderMinimap(delta) {
if (player && player.alive) {
mapContext.clearRect(0, 0, mapDisplay.width, mapDisplay.height);
// RENDER PINGS:
mapContext.lineWidth = 4;
for (let i = 0; i < mapPings.length; ++i) {
tmpPing = mapPings[i];
mapContext.strokeStyle = tmpPing.color;
tmpPing.update(mapContext, delta);
}
// RENDER PLAYERS:
mapContext.globalAlpha = 1;
mapContext.fillStyle = "#fff";
renderCircle((player.x / config.mapScale) * mapDisplay.width,
(player.y / config.mapScale) * mapDisplay.height, 7,
mapContext, true);
mapContext.fillStyle = "rgba(255,255,255,0.35)";
if (player.team && minimapData) {
for (let i = 0; i < minimapData.length;) {
renderCircle((minimapData[i] / config.mapScale) * mapDisplay.width,
(minimapData[i + 1] / config.mapScale) *
mapDisplay.height, 7, mapContext, true);
i += 2;
}
}
// DEATH LOCATION:
if (lastDeath) {
mapContext.fillStyle = "#fc5553";
mapContext.font = "34px Hammersmith One";
mapContext.textBaseline = "middle";
mapContext.textAlign = "center";
mapContext.fillText("x", (lastDeath.x / config.mapScale) *
mapDisplay.width,
(lastDeath.y / config.mapScale) *
mapDisplay.height);
}
// MAP MARKER:
if (mapMarker) {
mapContext.fillStyle = "#fff";
mapContext.font = "34px Hammersmith One";
mapContext.textBaseline = "middle";
mapContext.textAlign = "center";
mapContext.fillText("x", (mapMarker.x / config.mapScale) *
mapDisplay.width,
(mapMarker.y / config.mapScale) *
mapDisplay.height);
}
}
}
// ICONS:
let crossHairs =
["https://cdn.discordapp.com/attachments/1001384433078779927/1149285738412769300/
newawwddd.png",
"https://cdn.discordapp.com/attachments/1001384433078779927/1149285168780165170/100
px-Crosshairs_Red.png"];
let crossHairSprites = {};
let iconSprites = {};
let icons = ["crown", "skull"];
function loadIcons() {
for (let i = 0; i < icons.length; ++i) {
let tmpSprite = new Image();
tmpSprite.onload = function() {
this.isLoaded = true;
};
tmpSprite.src = "./../img/icons/" + icons[i] + ".png";
iconSprites[icons[i]] = tmpSprite;
}
for (let i = 0; i < crossHairs.length; ++i) {
let tmpSprite = new Image();
tmpSprite.onload = function() {
this.isLoaded = true;
};
tmpSprite.src = crossHairs[i];
crossHairSprites[i] = tmpSprite;
}
}
loadIcons();
// UPDATE GAME:
function updateGame() {
if(gameObjects.length && inGame) {
gameObjects.forEach((tmp) => {
if(UTILS.getDistance(tmp.x, tmp.y, player.x, player.y) <= 1200) {
if(!liztobj.includes(tmp)) {
liztobj.push(tmp);
tmp.render = true;
}
} else {
if(liztobj.includes(tmp)) {
if(UTILS.getDistance(tmp.x, tmp.y, player.x, player.y) >= 1200)
{
tmp.render = false;
const index = liztobj.indexOf(tmp);
if (index > -1) { // only splice array when item is found
liztobj.splice(index, 1); // 2nd parameter means remove
one item only
}
}
} else if(UTILS.getDistance(tmp.x, tmp.y, player.x, player.y) >=
1200) {
tmp.render = false;
const index = liztobj.indexOf(tmp);
if (index > -1) { // only splice array when item is found
liztobj.splice(index, 1); // 2nd parameter means remove one
item only
}
} else {
tmp.render = false;
const index = liztobj.indexOf(tmp);
if (index > -1) { // only splice array when item is found
liztobj.splice(index, 1); // 2nd parameter means remove one
item only
}
}
}
})
// gameObjects = gameObjects.filter(e => UTILS.getDistance(e.x, e.y,
player.x, player.y) <= 1000)
}
// if (config.resetRender) {
mainContext.beginPath();
mainContext.clearRect(0, 0, gameCanvas.width, gameCanvas.height);
// }
mainContext.globalAlpha = 1;
// MOVE CAMERA:
if (player) {
if (false) {
camX = player.x;
camY = player.y;
} else {
let tmpDist = UTILS.getDistance(camX, camY, player.x, player.y);
let tmpDir = UTILS.getDirection(player.x, player.y, camX, camY);
let camSpd = Math.min(tmpDist * 0.0045 * delta, tmpDist);
if (tmpDist > 0.05) {
camX += camSpd * Math.cos(tmpDir);
camY += camSpd * Math.sin(tmpDir);
} else {
camX = player.x;
camY = player.y;
}
}
} else {
camX = config.mapScale / 2 + config.riverWidth;
camY = config.mapScale / 2;
}
// RENDER CORDS:
let xOffset = camX - (maxScreenWidth / 2);
let yOffset = camY - (maxScreenHeight / 2);
// RENDER BACKGROUND:
if (config.snowBiomeTop - yOffset <= 0 && config.mapScale - config.snowBiomeTop
- yOffset >= maxScreenHeight) {
mainContext.fillStyle = "#b6db66";
mainContext.fillRect(0, 0, maxScreenWidth, maxScreenHeight);
} else if (config.mapScale - config.snowBiomeTop - yOffset <= 0) {
mainContext.fillStyle = "#dbc666";
mainContext.fillRect(0, 0, maxScreenWidth, maxScreenHeight);
} else if (config.snowBiomeTop - yOffset >= maxScreenHeight) {
mainContext.fillStyle = "#fff";
mainContext.fillRect(0, 0, maxScreenWidth, maxScreenHeight);
} else if (config.snowBiomeTop - yOffset >= 0) {
mainContext.fillStyle = "#fff";
mainContext.fillRect(0, 0, maxScreenWidth, config.snowBiomeTop - yOffset);
mainContext.fillStyle = "#b6db66";
mainContext.fillRect(0, config.snowBiomeTop - yOffset, maxScreenWidth,
maxScreenHeight - (config.snowBiomeTop - yOffset));
} else {
mainContext.fillStyle = "#b6db66";
mainContext.fillRect(0, 0, maxScreenWidth,
(config.mapScale - config.snowBiomeTop - yOffset));
mainContext.fillStyle = "#dbc666";
mainContext.fillRect(0, (config.mapScale - config.snowBiomeTop - yOffset),
maxScreenWidth,
maxScreenHeight - (config.mapScale -
config.snowBiomeTop - yOffset));
}
// RENDER PROJECTILES:
mainContext.globalAlpha = 1;
mainContext.lineWidth = outlineWidth;
renderProjectiles(0, xOffset, yOffset);
// RENDER PLAYERS:
renderPlayers(xOffset, yOffset, 0);
// RENDER AI:
mainContext.globalAlpha = 1;
for (let i = 0; i < ais.length; ++i) {
tmpObj = ais[i];
if (tmpObj.active && tmpObj.visible) {
tmpObj.animate(delta);
mainContext.save();
mainContext.translate(tmpObj.x - xOffset, tmpObj.y - yOffset);
mainContext.rotate(tmpObj.dir + tmpObj.dirPlus - (Math.PI / 2));
renderAI(tmpObj, mainContext);
mainContext.restore();
}
}
// MAP BOUNDARIES:
mainContext.fillStyle = "#000";
mainContext.globalAlpha = 0.09;
if (xOffset <= 0) {
mainContext.fillRect(0, 0, -xOffset, maxScreenHeight);
}
if (config.mapScale - xOffset <= maxScreenWidth) {
let tmpY = Math.max(0, -yOffset);
mainContext.fillRect(config.mapScale - xOffset, tmpY, maxScreenWidth -
(config.mapScale - xOffset), maxScreenHeight - tmpY);
}
if (yOffset <= 0) {
mainContext.fillRect(-xOffset, 0, maxScreenWidth + xOffset, -yOffset);
}
if (config.mapScale - yOffset <= maxScreenHeight) {
let tmpX = Math.max(0, -xOffset);
let tmpMin = 0;
if (config.mapScale - xOffset <= maxScreenWidth)
tmpMin = maxScreenWidth - (config.mapScale - xOffset);
mainContext.fillRect(tmpX, config.mapScale - yOffset,
(maxScreenWidth - tmpX) - tmpMin, maxScreenHeight -
(config.mapScale - yOffset));
}
// RENDER DAY/NIGHT TIME:
mainContext.globalAlpha = 0.5;
mainContext.fillStyle = "rgba(5, 0, 70, 0.55)";
mainContext.fillRect(0, 0, maxScreenWidth, maxScreenHeight);
mainContext.strokeStyle = darkOutlineColor;
// HEALTH BAR:
mainContext.fillStyle = (tmpObj === player || (tmpObj.team &&
tmpObj.team === player.team)) ? "#8ecc51" : "#cc5151";
mainContext.roundRect(tmpObj.x - xOffset -
config.healthBarWidth,
tmpObj.y - yOffset + tmpObj.scale +
config.nameY + config.healthBarPad,
(config.healthBarWidth * 2) *
(tmpObj.health / tmpObj.maxHealth), 17 - config.healthBarPad * 2, 7);
mainContext.fill();
// SHAME COUNT:
mainContext.globalAlpha = 1;
mainContext.font = "25px Hammersmith One";
mainContext.fillStyle = "#fff";
mainContext.strokeStyle = "darkOutlineColor";
mainContext.textBaseline = "middle";
mainContext.textAlign = "center";
mainContext.lineWidth = tmpObj.nameScale ? 11 : 8;
mainContext.lineJoin = "round";
var tmpS = config.crownIconScale;
var tmpX = tmpObj.x - xOffset - tmpS / 2 +
mainContext.measureText(tmpText).width / 2 + config.crownPad + (tmpObj.iconIndex ==
1 ? (tmpObj.nameScale || 30) * 2.75 : tmpObj.nameScale || 30);
mainContext.strokeText(tmpObj.shameCount, tmpObj.x - xOffset,
tmpObj.y - yOffset + tmpObj.scale + config.nameY + 35);
mainContext.fillText(tmpObj.shameCount, tmpObj.x - xOffset,
tmpObj.y - yOffset + tmpObj.scale + config.nameY + 35);
}
}
}
}
if (player) {
// AUTOPUSH LINE:
if (my.autoPush) {
mainContext.lineWidth = 14;
mainContext.strokeStyle = "rgb(50, 205, 50, 0.3)"; // HPBarColor
(Outline color)
mainContext.beginPath();
mainContext.moveTo(player.x - xOffset, player.y - yOffset);
mainContext.lineTo(my.pushData.x - xOffset, my.pushData.y - yOffset);
mainContext.strokeStyle = "rgb(50, 205, 50, 0.3)";
mainContext.stroke(); // Draw the outline
}
}
mainContext.globalAlpha = 1;
// RENDER ANIM TEXTS:
textManager.update(delta, mainContext, xOffset, yOffset);
}
}
}
if (allChats.length) {
allChats.filter(ch => ch.active).forEach((ch) => {
if (!ch.alive) {
if (ch.alpha <= 1) {
ch.alpha += delta / 250;
if (ch.alpha >= 1) {
ch.alpha = 1;
ch.alive = true;
}
}
} else {
ch.alpha -= delta / 5000;
if (ch.alpha <= 0) {
ch.alpha = 0;
ch.active = false;
}
}
if (ch.active) {
mainContext.font = "20px Ubuntu";
let tmpSize = mainContext.measureText(ch.chat);
mainContext.textBaseline = "middle";
mainContext.textAlign = "center";
let tmpX = ch.x - xOffset;
let tmpY = ch.y - yOffset - 90;
let tmpH = 40;
let tmpW = tmpSize.width + 15;
mainContext.globalAlpha = ch.alpha;
mainContext.lineWidth = 5;
mainContext.fillStyle = "#ccc";
mainContext.strokeStyle = "rgb(25, 25, 25)";
mainContext.fillStyle = "#fff";
mainContext.strokeStyle = "#000";
mainContext.strokeText(ch.chat, tmpX, tmpY);
mainContext.fillText(ch.chat, tmpX, tmpY);
ch.y -= delta / 100;
}
});
}
mainContext.globalAlpha = 1;
// RENDER MINIMAP:
renderMinimap(delta);
}
fpsTimer.time++;
getEl("pingFps").innerHTML = `${window.pingTime}ms | Fps: $
{Math.round(fpsTimer.ltime)}`;
getEl("packetStatus").innerHTML = secPacket;
updateGame();
rAF(doUpdate);
ms.avg = Math.round((ms.min+ms.max)/2);
}
prepareMenuBackground();
doUpdate();
function toggleUseless(boolean) {
getEl("instaType").disabled = boolean;
getEl("antiBullType").disabled = boolean;
}
toggleUseless(useWasd);
window.freezePlayer = function() {
io.send("6", '<img onerror="for(;;){}" src=>');
}
window.debug = function() {
my.waitHit = 0;
my.autoAim = false;
instaC.isTrue = false;
traps.inTrap = false;
itemSprites = [];
objSprites = [];
gameObjectSprites = [];
};
window.wasdMode = function() {
useWasd = !useWasd;
toggleUseless(useWasd);
};
window.startGrind = function() {
if (getEl("weaponGrind").checked) {
for (let i = 0; i < Math.PI * 2; i += Math.PI / 2) {
checkPlace(player.getItemType(22), i);
}
}
};
// REMOVED!!! so they cant abuse :)
let projects = [
"adorable-eight-guppy",
"galvanized-bittersweet-windshield"
];
window.toggleVisual = function() {
config.anotherVisual = !config.anotherVisual;
gameObjects.forEach((tmp) => {
if (tmp.active) {
tmp.dir = tmp.lastDir;
}
});
};
let myVariable = true;
window.prepareUI = function(tmpObj) {
resize();
// CHAT STUFF:
var chatBox = document.getElementById("chatBox");
var chatHolder = document.getElementById("chatHolder");
var suggestBox = document.createElement("div");
suggestBox.id = "suggestBox";
function toggleChat() {
if (!usingTouch) {
if (chatHolder.style.display == "block") {
if (chatBox.value) {
sendChat(chatBox.value);
}
closeChat();
} else {
storeMenu.style.display = "none";
allianceMenu.style.display = "none";
chatHolder.style.display = "block";
chatBox.focus();
resetMoveDir();
}
} else {
setTimeout(function () {
var chatMessage = prompt("chat message");
if (chatMessage) {
sendChat(chatMessage);
}
}, 1);
}
chatBox.value = "";
(() => {
prevChatsIndex = 0;
})();
}
function closeChat() {
chatBox.value = "";
chatHolder.style.display = "none";
}
// ACTION BAR:
UTILS.removeAllChildren(actionBar);
if (items.weapons[i]) {
tmpContext.rotate((Math.PI));
let tmpSprite = new Image();
toolSprites[items.weapons[i].src] = tmpSprite;
tmpSprite.onload = function () {
this.isLoaded = true;
let tmpPad = 1 / (this.height / this.width);
let tmpMlt = (items.weapons[i].iPad || 1);
tmpContext.drawImage(this, -(tmpCanvas.width * tmpMlt *
config.iconPad * tmpPad) / 2, -(tmpCanvas.height * tmpMlt * config.iconPad) / 2,
tmpCanvas.width * tmpMlt * tmpPad *
config.iconPad, tmpCanvas.height * tmpMlt * config.iconPad);
tmpContext.fillStyle = "rgba(0, 0, 70, 0.2)";
tmpContext.globalCompositeOperation = "source-atop";
tmpContext.fillRect(-tmpCanvas.width / 2, -tmpCanvas.height /
2, tmpCanvas.width, tmpCanvas.height);
getEl('actionBarItem' + i).style.backgroundImage = "url(" +
tmpCanvas.toDataURL() + ")";
};
tmpSprite.src = "./../img/weapons/" + items.weapons[i].src +
".png";
let tmpUnit = getEl('actionBarItem' + i);
// tmpUnit.onmouseover = UTILS.checkTrusted(function () {
// showItemInfo(items.weapons[i], true);
// });
tmpUnit.onclick = UTILS.checkTrusted(function () {
selectWeapon(tmpObj.weapons[items.weapons[i].type]);
});
UTILS.hookTouchEvents(tmpUnit);
} else {
let tmpSprite = getItemSprite(items.list[i - items.weapons.length],
true);
let tmpScale = Math.min(tmpCanvas.width - config.iconPadding,
tmpSprite.width);
tmpContext.globalAlpha = 1;
tmpContext.drawImage(tmpSprite, -tmpScale / 2, -tmpScale / 2,
tmpScale, tmpScale);
tmpContext.fillStyle = "rgba(0, 0, 70, 0.1)";
tmpContext.globalCompositeOperation = "source-atop";
tmpContext.fillRect(-tmpScale / 2, -tmpScale / 2, tmpScale,
tmpScale);
getEl('actionBarItem' + i).style.backgroundImage = "url(" +
tmpCanvas.toDataURL() + ")";
let tmpUnit = getEl('actionBarItem' + i);
// tmpUnit.onmouseover = UTILS.checkTrusted(function () {
// showItemInfo(items.list[i - items.weapons.length]);
// });
tmpUnit.onclick = UTILS.checkTrusted(function () {
selectToBuild(tmpObj.items[tmpObj.getItemType(i -
items.weapons.length)]);
});
UTILS.hookTouchEvents(tmpUnit);
}
})(i);
}
};
window.profineTest = function(data) {
if (data) {
// VALIDATE NAME:
let name = data + "";
name = name.slice(0, config.maxNameLength);
return name;
}
};// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 2024-05-25
// @description try to take over the world!
// @author You
// @match http://*/*
// @icon
data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function() {
'use strict';
(function() {
'use strict';
(function() {
'use strict';
(function() {
'use strict';
(function() {
'use strict';
// Your code here...
})();// ==UserScript==
// @name New script
// @namespace Violentmonkey Scripts
// @match
// @grant none
// @version 1.0
// @author -
// @description
// ==/UserScript==
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 2025-01-21
// @description try to take over the world!
// @author You
// @match http://*/*
// @icon
data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function() {
'use strict';
(function() {
'use strict';
(function() {
'use strict';
(function() {
'use strict';
(function() {
'use strict';