enefel 2.13.0 → 2.15.0

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/dist/index.d.ts CHANGED
@@ -123,6 +123,7 @@ declare const GAME_HISTORY_INFO: {
123
123
  BRIBE: string;
124
124
  CARAC_CHANGE: string;
125
125
  CASUALTY: string;
126
+ CROWD_SURF: string;
126
127
  DODGE: string;
127
128
  END_PO: string;
128
129
  END_POP: string;
@@ -227,6 +228,11 @@ declare const availableSquaresToPushBack: (p1: Point, p2: Point) => {
227
228
  y: number;
228
229
  d: number;
229
230
  }[] | undefined;
231
+ declare const allAdjacentSquaresToPushBack: (p2: Point) => {
232
+ x: number;
233
+ y: number;
234
+ d: number;
235
+ }[];
230
236
  declare const isOnLine: (A: Point, B: Point, C: Point) => boolean;
231
237
  declare const getThrowingBonus: (p1: Point, p2: Point, game: Game) => 0 | 1 | -1 | -2 | null;
232
238
  declare const isOnField: (x: number, y: number, w: number, h: number) => boolean;
@@ -255,7 +261,7 @@ declare const arrayMove: (arr: any[], old_index: number, new_index: number) => a
255
261
  declare const swapArrayLocs: (arr: any[], index1: number, index2: number) => any[];
256
262
  declare const getInactiveDays: (isDev?: boolean) => 10 | 10000;
257
263
  declare const getMaxPlayers: (isDev?: boolean) => number;
258
- export { addSeconds, arrayMove, availableSquaresToPushBack, canBlock, canEndTurn, canFaceUp, canFoul, canMove, canPass, canPlayerIntercepts, canStandup, canThrowTeamMate, canTransmit, FORMATION_DEFAULT_NAME, GAME_HISTORY_INFO, GAME_HISTORY_TYPE, getAllAdjacentSquares, getAttackerStrength, getBestInterceptor, getBlockAssistance, getDefenderStrength, getDicesBlock, getHypnoticGazeMalus, getInactiveDays, getMaxPlayers, getMoralModifier, getPlayerOnCell, getTeamColor, getTeamMoral, getTeamMoralByPlayer, getTeamXP, getThrowingBonus, haveSameTeam, INACTIVE_DAYS, isCoach, isGameRunning, isOnField, isOnLine, isSamePlayer, isSetUp, isSquareValidToPushBack, LAST_SEASON_ALPHA, MAX_PLAYER_TEAM, MAX_PLAYER_USER, p, PLAYER_HISTORY_INFO, PLAYER_HISTORY_TYPE, PLAYER_STAT, POSTULATION_HOURS, swapArrayLocs, TAKE_BALL_TYPE, version, };
264
+ export { addSeconds, arrayMove, availableSquaresToPushBack, canBlock, canEndTurn, canFaceUp, canFoul, canMove, canPass, canPlayerIntercepts, canStandup, canThrowTeamMate, canTransmit, FORMATION_DEFAULT_NAME, GAME_HISTORY_INFO, GAME_HISTORY_TYPE, getAllAdjacentSquares, getAttackerStrength, getBestInterceptor, getBlockAssistance, getDefenderStrength, getDicesBlock, getHypnoticGazeMalus, getInactiveDays, getMaxPlayers, getMoralModifier, getPlayerOnCell, getTeamColor, getTeamMoral, getTeamMoralByPlayer, getTeamXP, getThrowingBonus, haveSameTeam, INACTIVE_DAYS, isCoach, isGameRunning, isOnField, isOnLine, isSamePlayer, isSetUp, allAdjacentSquaresToPushBack, isSquareValidToPushBack, LAST_SEASON_ALPHA, MAX_PLAYER_TEAM, MAX_PLAYER_USER, p, PLAYER_HISTORY_INFO, PLAYER_HISTORY_TYPE, PLAYER_STAT, POSTULATION_HOURS, swapArrayLocs, TAKE_BALL_TYPE, version, };
259
265
  export { SidestepMode, SidestepStrategy, SidestepPreference, } from "./skills/sidestep";
260
266
  export { HitAndRunMode, HitAndRunStrategy, HitAndRunPreference, } from "./skills/hitAndRun";
261
267
  export { SafePairOfHandsMode, SafePairOfHandsStrategy, SafePairOfHandsPreference, } from "./skills/safePairOfHands";
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SafePairOfHandsStrategy = exports.SafePairOfHandsMode = exports.HitAndRunStrategy = exports.HitAndRunMode = exports.SidestepStrategy = exports.SidestepMode = exports.version = exports.TAKE_BALL_TYPE = exports.swapArrayLocs = exports.POSTULATION_HOURS = exports.PLAYER_STAT = exports.PLAYER_HISTORY_TYPE = exports.PLAYER_HISTORY_INFO = exports.p = exports.MAX_PLAYER_USER = exports.MAX_PLAYER_TEAM = exports.LAST_SEASON_ALPHA = exports.isSquareValidToPushBack = exports.isSamePlayer = exports.isOnLine = exports.isOnField = exports.isCoach = exports.INACTIVE_DAYS = exports.haveSameTeam = exports.getThrowingBonus = exports.getTeamXP = exports.getTeamMoralByPlayer = exports.getTeamMoral = exports.getPlayerOnCell = exports.getMoralModifier = exports.getMaxPlayers = exports.getInactiveDays = exports.getHypnoticGazeMalus = exports.getDicesBlock = exports.getDefenderStrength = exports.getBlockAssistance = exports.getBestInterceptor = exports.getAttackerStrength = exports.getAllAdjacentSquares = exports.GAME_HISTORY_TYPE = exports.GAME_HISTORY_INFO = exports.FORMATION_DEFAULT_NAME = exports.canPlayerIntercepts = exports.availableSquaresToPushBack = exports.arrayMove = void 0;
6
+ exports.SafePairOfHandsStrategy = exports.SafePairOfHandsMode = exports.HitAndRunStrategy = exports.HitAndRunMode = exports.SidestepStrategy = exports.SidestepMode = exports.version = exports.TAKE_BALL_TYPE = exports.swapArrayLocs = exports.POSTULATION_HOURS = exports.PLAYER_STAT = exports.PLAYER_HISTORY_TYPE = exports.PLAYER_HISTORY_INFO = exports.p = exports.MAX_PLAYER_USER = exports.MAX_PLAYER_TEAM = exports.LAST_SEASON_ALPHA = exports.isSquareValidToPushBack = exports.allAdjacentSquaresToPushBack = exports.isSamePlayer = exports.isOnLine = exports.isOnField = exports.isCoach = exports.INACTIVE_DAYS = exports.haveSameTeam = exports.getThrowingBonus = exports.getTeamXP = exports.getTeamMoralByPlayer = exports.getTeamMoral = exports.getPlayerOnCell = exports.getMoralModifier = exports.getMaxPlayers = exports.getInactiveDays = exports.getHypnoticGazeMalus = exports.getDicesBlock = exports.getDefenderStrength = exports.getBlockAssistance = exports.getBestInterceptor = exports.getAttackerStrength = exports.getAllAdjacentSquares = exports.GAME_HISTORY_TYPE = exports.GAME_HISTORY_INFO = exports.FORMATION_DEFAULT_NAME = exports.canPlayerIntercepts = exports.availableSquaresToPushBack = exports.arrayMove = void 0;
7
7
  exports.addSeconds = addSeconds;
8
8
  exports.canBlock = canBlock;
9
9
  exports.canEndTurn = canEndTurn;
@@ -158,6 +158,7 @@ const GAME_HISTORY_INFO = {
158
158
  BRIBE: "br",
159
159
  CARAC_CHANGE: "cc",
160
160
  CASUALTY: "ca",
161
+ CROWD_SURF: "crs",
161
162
  DODGE: "d",
162
163
  END_PO: "endpo",
163
164
  END_POP: "endpop",
@@ -563,6 +564,23 @@ const availableSquaresToPushBack = (p1, p2) => {
563
564
  }
564
565
  };
565
566
  exports.availableSquaresToPushBack = availableSquaresToPushBack;
567
+ // Returns all 8 adjacent squares around the target for GRAB skill
568
+ const allAdjacentSquaresToPushBack = (p2) => {
569
+ if (p2.x === null || p2.y === null) {
570
+ return [];
571
+ }
572
+ return [
573
+ { x: p2.x - 1, y: p2.y - 1, d: 1 },
574
+ { x: p2.x, y: p2.y - 1, d: 2 },
575
+ { x: p2.x + 1, y: p2.y - 1, d: 3 },
576
+ { x: p2.x - 1, y: p2.y, d: 4 },
577
+ { x: p2.x + 1, y: p2.y, d: 5 },
578
+ { x: p2.x - 1, y: p2.y + 1, d: 6 },
579
+ { x: p2.x, y: p2.y + 1, d: 7 },
580
+ { x: p2.x + 1, y: p2.y + 1, d: 8 },
581
+ ];
582
+ };
583
+ exports.allAdjacentSquaresToPushBack = allAdjacentSquaresToPushBack;
566
584
  // playerFrom, pointTo, foe
567
585
  const isOnLine = (A, B, C) => {
568
586
  // Interception table reference
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "enefel",
3
- "version": "2.13.0",
3
+ "version": "2.15.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "enefel",
9
- "version": "2.13.0",
9
+ "version": "2.15.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "csv-parse": "^6.1.0",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enefel",
3
- "version": "2.13.0",
3
+ "version": "2.15.0",
4
4
  "description": "Fantasy Football game engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/dist/skill.d.ts CHANGED
@@ -22,6 +22,7 @@ declare enum SKILL_NAMES {
22
22
  BRAWLER = "brawler",
23
23
  BREATHE_FIRE = "breathe-fire",
24
24
  BREAK_TACKLE = "break-tackle",
25
+ BULLSEYE = "bullseye",
25
26
  CANNONEER = "cannoneer",
26
27
  CATCH = "catch",
27
28
  CHAINSAW = "chainsaw",
@@ -42,6 +43,7 @@ declare enum SKILL_NAMES {
42
43
  FOUL_APPEARANCE = "foul-appearance",
43
44
  FRENZY = "frenzy",
44
45
  FUMBLEROOSKIE = "fumblerooskie",
46
+ GRAB = "grab",
45
47
  HAIL_MARY_PASS = "hail-mary-pass",
46
48
  GUARD = "guard",
47
49
  HIT_AND_RUN = "hit-and-run",
package/dist/skill.js CHANGED
@@ -53,7 +53,7 @@ var SKILL_NAMES;
53
53
  SKILL_NAMES["BRAWLER"] = "brawler";
54
54
  SKILL_NAMES["BREATHE_FIRE"] = "breathe-fire";
55
55
  SKILL_NAMES["BREAK_TACKLE"] = "break-tackle";
56
- // BULLSEYE = "bullseye",
56
+ SKILL_NAMES["BULLSEYE"] = "bullseye";
57
57
  SKILL_NAMES["CANNONEER"] = "cannoneer";
58
58
  SKILL_NAMES["CATCH"] = "catch";
59
59
  SKILL_NAMES["CHAINSAW"] = "chainsaw";
@@ -74,7 +74,7 @@ var SKILL_NAMES;
74
74
  SKILL_NAMES["FOUL_APPEARANCE"] = "foul-appearance";
75
75
  SKILL_NAMES["FRENZY"] = "frenzy";
76
76
  SKILL_NAMES["FUMBLEROOSKIE"] = "fumblerooskie";
77
- // GRAB = "grab",
77
+ SKILL_NAMES["GRAB"] = "grab";
78
78
  SKILL_NAMES["HAIL_MARY_PASS"] = "hail-mary-pass";
79
79
  // HATRED = "hatred",
80
80
  SKILL_NAMES["GUARD"] = "guard";
@@ -259,8 +259,8 @@ const SKILL_STRENGTH = [
259
259
  SKILL_NAMES.ARM_BAR,
260
260
  SKILL_NAMES.BRAWLER,
261
261
  SKILL_NAMES.BREAK_TACKLE,
262
- // SKILL_NAMES.BULLSEYE,
263
- // SKILL_NAMES.GRAB,
262
+ SKILL_NAMES.BULLSEYE,
263
+ SKILL_NAMES.GRAB,
264
264
  SKILL_NAMES.GUARD,
265
265
  SKILL_NAMES.JUGGERNAUT,
266
266
  SKILL_NAMES.MIGHTY_BLOW,
package/index.ts CHANGED
@@ -148,6 +148,7 @@ const GAME_HISTORY_INFO = {
148
148
  BRIBE: "br",
149
149
  CARAC_CHANGE: "cc",
150
150
  CASUALTY: "ca",
151
+ CROWD_SURF: "crs",
151
152
  DODGE: "d",
152
153
  END_PO: "endpo",
153
154
  END_POP: "endpop",
@@ -615,6 +616,23 @@ const availableSquaresToPushBack = (p1: Point, p2: Point) => {
615
616
  }
616
617
  };
617
618
 
619
+ // Returns all 8 adjacent squares around the target for GRAB skill
620
+ const allAdjacentSquaresToPushBack = (p2: Point) => {
621
+ if (p2.x === null || p2.y === null) {
622
+ return [];
623
+ }
624
+ return [
625
+ { x: p2.x - 1, y: p2.y - 1, d: 1 },
626
+ { x: p2.x, y: p2.y - 1, d: 2 },
627
+ { x: p2.x + 1, y: p2.y - 1, d: 3 },
628
+ { x: p2.x - 1, y: p2.y, d: 4 },
629
+ { x: p2.x + 1, y: p2.y, d: 5 },
630
+ { x: p2.x - 1, y: p2.y + 1, d: 6 },
631
+ { x: p2.x, y: p2.y + 1, d: 7 },
632
+ { x: p2.x + 1, y: p2.y + 1, d: 8 },
633
+ ];
634
+ };
635
+
618
636
  // playerFrom, pointTo, foe
619
637
  const isOnLine = (A: Point, B: Point, C: Point) => {
620
638
  // Interception table reference
@@ -1074,6 +1092,7 @@ export {
1074
1092
  isOnLine,
1075
1093
  isSamePlayer,
1076
1094
  isSetUp,
1095
+ allAdjacentSquaresToPushBack,
1077
1096
  isSquareValidToPushBack,
1078
1097
  LAST_SEASON_ALPHA,
1079
1098
  MAX_PLAYER_TEAM,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enefel",
3
- "version": "2.13.0",
3
+ "version": "2.15.0",
4
4
  "description": "Fantasy Football game engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/skill.ts CHANGED
@@ -40,7 +40,7 @@ enum SKILL_NAMES {
40
40
  BRAWLER = "brawler",
41
41
  BREATHE_FIRE = "breathe-fire",
42
42
  BREAK_TACKLE = "break-tackle",
43
- // BULLSEYE = "bullseye",
43
+ BULLSEYE = "bullseye",
44
44
  CANNONEER = "cannoneer",
45
45
  CATCH = "catch",
46
46
  CHAINSAW = "chainsaw",
@@ -61,7 +61,7 @@ enum SKILL_NAMES {
61
61
  FOUL_APPEARANCE = "foul-appearance",
62
62
  FRENZY = "frenzy",
63
63
  FUMBLEROOSKIE = "fumblerooskie",
64
- // GRAB = "grab",
64
+ GRAB = "grab",
65
65
  HAIL_MARY_PASS = "hail-mary-pass",
66
66
  // HATRED = "hatred",
67
67
  GUARD = "guard",
@@ -252,8 +252,8 @@ const SKILL_STRENGTH: SKILL_NAMES[] = [
252
252
  SKILL_NAMES.ARM_BAR,
253
253
  SKILL_NAMES.BRAWLER,
254
254
  SKILL_NAMES.BREAK_TACKLE,
255
- // SKILL_NAMES.BULLSEYE,
256
- // SKILL_NAMES.GRAB,
255
+ SKILL_NAMES.BULLSEYE,
256
+ SKILL_NAMES.GRAB,
257
257
  SKILL_NAMES.GUARD,
258
258
  SKILL_NAMES.JUGGERNAUT,
259
259
  SKILL_NAMES.MIGHTY_BLOW,