feat(cheat) : adding 2 new functions from hell
This commit is contained in:
parent
5344f908fb
commit
d520ccca1d
2 changed files with 40 additions and 4 deletions
|
@ -54,6 +54,8 @@
|
||||||
<a onclick="window.parent.Lester(5,null)" class="button blue" width="50%">COLLISIONS</a>
|
<a onclick="window.parent.Lester(5,null)" class="button blue" width="50%">COLLISIONS</a>
|
||||||
<a onclick="window.parent.Lester(2,null)" class="button yellow">FULL LIFE</a>
|
<a onclick="window.parent.Lester(2,null)" class="button yellow">FULL LIFE</a>
|
||||||
<a onclick="window.parent.Lester(6,null)" class="button yellow">GOD MOD</a>
|
<a onclick="window.parent.Lester(6,null)" class="button yellow">GOD MOD</a>
|
||||||
|
<a onclick="window.parent.Lester(7,null)" class="button yellow">AK-47</a>
|
||||||
|
<a onclick="window.parent.Lester(8,null)" class="button yellow">TP sur clique gauche</a>
|
||||||
<a onclick="window.parent.Lester(1,[363,282,5])" class="button green">SAFE ZONE</a>
|
<a onclick="window.parent.Lester(1,[363,282,5])" class="button green">SAFE ZONE</a>
|
||||||
<a onclick="window.parent.Lester(1,[200,100,0])" class="button green">MAP 0</a>
|
<a onclick="window.parent.Lester(1,[200,100,0])" class="button green">MAP 0</a>
|
||||||
<a onclick="window.parent.Lester(1,[516,789,1])" class="button green">MAP 1</a>
|
<a onclick="window.parent.Lester(1,[516,789,1])" class="button green">MAP 1</a>
|
||||||
|
|
|
@ -198,12 +198,40 @@ function Donjon() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
god_mode = false;
|
cheat_god_mode = false;
|
||||||
|
cheat_tp = false;
|
||||||
|
cheat_ak_47 = false;
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
if(god_mode) {
|
if(cheat_god_mode) {
|
||||||
player.health = 10;
|
player.health = 10;
|
||||||
}
|
}
|
||||||
}, 20);
|
}, 20);
|
||||||
|
setInterval(() => {
|
||||||
|
if(cheat_ak_47) {
|
||||||
|
for(let i=0;i<players.length;++i) {
|
||||||
|
if(players[i].z == player.z) {
|
||||||
|
let mouseX = players[i].x;
|
||||||
|
let mouseY = players[i].y;
|
||||||
|
let dx = mouseX-player.x;
|
||||||
|
let dy = mouseY-player.y;
|
||||||
|
let norm = Math.sqrt(dx*dx+dy*dy);
|
||||||
|
let b = new Bullet(player.x,player.y,player.z,dx/norm,dy/norm,player.id,true);
|
||||||
|
bullets.push(b);
|
||||||
|
net.newBullet(b.x,b.y,b.z,b.dx,b.dy,b.shooterId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
document.getElementById("canvas").addEventListener("contextmenu", (e) => {
|
||||||
|
if(tp) {
|
||||||
|
e.preventDefault();
|
||||||
|
let bounds = this.canvas.getBoundingClientRect();
|
||||||
|
player.x=(e.clientX - bounds.x)*document.getElementById("canvas").width/bounds.width;
|
||||||
|
player.y=(e.clientY - bounds.y)*document.getElementById("canvas").height/bounds.height;
|
||||||
|
net.update(player);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},false);
|
||||||
function Lester(type, data) {
|
function Lester(type, data) {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -235,8 +263,14 @@ function Lester(type, data) {
|
||||||
drawCollisions=true;
|
drawCollisions=true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6: // god mode
|
||||||
if(god_mode) { god_mode = false; } else { god_mode = true; }
|
if(cheat_god_mode) { cheat_god_mode = false; } else { cheat_god_mode = true; }
|
||||||
|
break;
|
||||||
|
case 7: // AK-47
|
||||||
|
if(cheat_ak_47) { cheat_ak_47 = false; } else { cheat_ak_47 = true; }
|
||||||
|
break;
|
||||||
|
case 8: // TP right_click
|
||||||
|
if(cheat_tp) { cheat_tp = false; } else { cheat_tp = true; }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue