yolkbot 0.1.1-alpha.21 → 0.1.1-alpha.23

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.21",
4
+ "version": "0.1.1-alpha.23",
5
5
  "keywords": [
6
6
  "shell shockers",
7
7
  "shellshock.io",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "type": "module",
24
24
  "files": [
25
- "build/*.js",
25
+ "browser/build/*.js",
26
26
  "data/*.*",
27
27
  "src/**/*",
28
28
  "package.json",
@@ -35,7 +35,7 @@
35
35
  "import": "./src/api.js",
36
36
  "types": "./src/types/api.d.ts"
37
37
  },
38
- "./browser": "./build/browser.js",
38
+ "./browser": "./browser/build/module.js",
39
39
  "./comm": "./src/comm/index.js",
40
40
  "./matchmaker": {
41
41
  "import": "./src/matchmaker.js",
package/src/bot.js CHANGED
@@ -977,13 +977,13 @@ 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
982
  // console.log(`Player ${killed.name} died.`);
983
983
  }
984
984
 
985
- if (killer) { killer.kills++; }
986
- // console.log(`Player ${killer.name} is on a streak of ${killer.kills} kills.`);
985
+ if (killer) killer.streak++;
986
+ // console.log(`Player ${killer.name} is on a streak of ${killer.streak} kills.`);
987
987
 
988
988
  this.emit('playerDeath', killed, killer); // killed, killer
989
989
  }
@@ -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
  }
package/src/browser.js DELETED
@@ -1,43 +0,0 @@
1
- import { Bot } from './bot.js';
2
- import { GamePlayer } from './bot/GamePlayer.js';
3
-
4
- import { Matchmaker } from './matchmaker.js';
5
-
6
- import { default as Dispatches } from './dispatches/index.js';
7
-
8
- import * as API from './api.js';
9
- import * as Comm from './comm/index.js';
10
- import * as Packet from './packet.js';
11
-
12
- import * as Constants from './constants/index.js';
13
- import * as Guns from './constants/guns.js';
14
- import { Items } from './constants/items.js';
15
- import { Maps } from './constants/maps.js';
16
-
17
- const yolkbot = {
18
- Bot,
19
- GamePlayer,
20
- Matchmaker,
21
- Dispatches,
22
- API,
23
- Comm,
24
- Packet,
25
- Constants,
26
- Guns,
27
- Items,
28
- Maps
29
- };
30
-
31
- window.yolkbot = yolkbot;
32
-
33
- export { Bot };
34
- export { GamePlayer };
35
- export { Matchmaker };
36
- export { Dispatches };
37
- export { API };
38
- export { Comm };
39
- export { Packet };
40
- export { Constants };
41
- export { Guns };
42
- export { Items };
43
- export { Maps };