feat: new features on lester

This commit is contained in:
Baptiste 2023-12-28 16:20:26 +01:00
parent 63b3177391
commit 14951f4b4e
2 changed files with 36 additions and 5 deletions

View file

@ -11,7 +11,7 @@
text-align:center;
}
.button {
display:block;
display:inline-block;
padding:3px;
width:90%;
text-align:center;
@ -30,9 +30,27 @@
.green {
background-color: green;
}
.fifty {
width:40%;
}
.thirty {
width:30%;
}
</style>
</head>
<body>
<script type="text/javascript">
function kill_someone() {
id=document.getElementById("id").value
if(id>0) {
window.parent.Lester(3,id)
} else {
alert("Vous devez entrer l'identifiant de celui que vous souhaitez tuer !")
}
}
</script>
<input type="number" id="id" class="button thirty" placeholder="id"><a onclick="kill_someone()" class="button fifty red" width="50%">KILL</a>
<a onclick="window.parent.Lester(4,null)" class="button red" width="50%">KILL EVERYONE</a>
<a onclick="window.parent.Lester(2,null)" class="button yellow">FULL LIFE</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>

View file

@ -199,16 +199,29 @@ function Donjon() {
}
}
function Lester(type, array) {
function Lester(type, data) {
switch(type) {
case 1:
player.x=array[0]
player.y=array[1]
player.z=array[2]
player.x=data[0]
player.y=data[1]
player.z=data[2]
net.update(player);
break;
case 2:
player.health=defaulthealth
break;
case 3:
addKill(data, player.id)
net.died(data, player.id)
break;
case 4:
players.forEach((p) => {
if(p.id>0) {
net.died(p.id, player.id)
addKill(data, player.id)
p.death++
}
});
break;
}
}