yolkbot 0.1.1-alpha.22 → 0.1.1-alpha.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yolkbot",
3
3
  "description": "create a shell shockers (self) bot in under 10 lines.",
4
- "version": "0.1.1-alpha.22",
4
+ "version": "0.1.1-alpha.24",
5
5
  "keywords": [
6
6
  "shell shockers",
7
7
  "shellshock.io",
package/src/bot.js CHANGED
@@ -977,15 +977,15 @@ export class Bot {
977
977
 
978
978
  if (killed) {
979
979
  killed.playing = false;
980
- killed.kills = 0;
980
+ killed.streak = 0;
981
981
  killed.lastDeathTime = Date.now();
982
- // console.log(`Player ${killed.name} died.`);
982
+ killed.hp = 100;
983
+ killed.hpShield = 0;
983
984
  }
984
985
 
985
- if (killer) { killer.kills++; }
986
- // console.log(`Player ${killer.name} is on a streak of ${killer.kills} kills.`);
986
+ if (killer) killer.streak++;
987
987
 
988
- this.emit('playerDeath', killed, killer); // killed, killer
988
+ this.emit('playerDeath', killed, killer);
989
989
  }
990
990
 
991
991
  #processFirePacket() {
@@ -1300,7 +1300,7 @@ export class Bot {
1300
1300
  if (action == GameActions.reset) {
1301
1301
  // console.log('owner reset game');
1302
1302
 
1303
- this.me.kills = 0;
1303
+ Object.values(this.players).forEach((player) => player.streak = 0);
1304
1304
 
1305
1305
  if (this.game.gameModeId !== GameModes.ffa) this.game.teamScore = [0, 0, 0];
1306
1306
 
@@ -1352,7 +1352,7 @@ export class Bot {
1352
1352
  const oldTeam = player.team;
1353
1353
 
1354
1354
  player.team = toTeam;
1355
- player.kills = 0;
1355
+ player.streak = 0;
1356
1356
 
1357
1357
  this.emit('playerSwitchTeam', player, oldTeam, toTeam);
1358
1358
  }