enefel 2.14.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
@@ -228,6 +228,11 @@ declare const availableSquaresToPushBack: (p1: Point, p2: Point) => {
228
228
  y: number;
229
229
  d: number;
230
230
  }[] | undefined;
231
+ declare const allAdjacentSquaresToPushBack: (p2: Point) => {
232
+ x: number;
233
+ y: number;
234
+ d: number;
235
+ }[];
231
236
  declare const isOnLine: (A: Point, B: Point, C: Point) => boolean;
232
237
  declare const getThrowingBonus: (p1: Point, p2: Point, game: Game) => 0 | 1 | -1 | -2 | null;
233
238
  declare const isOnField: (x: number, y: number, w: number, h: number) => boolean;
@@ -256,7 +261,7 @@ declare const arrayMove: (arr: any[], old_index: number, new_index: number) => a
256
261
  declare const swapArrayLocs: (arr: any[], index1: number, index2: number) => any[];
257
262
  declare const getInactiveDays: (isDev?: boolean) => 10 | 10000;
258
263
  declare const getMaxPlayers: (isDev?: boolean) => number;
259
- 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, };
260
265
  export { SidestepMode, SidestepStrategy, SidestepPreference, } from "./skills/sidestep";
261
266
  export { HitAndRunMode, HitAndRunStrategy, HitAndRunPreference, } from "./skills/hitAndRun";
262
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;
@@ -564,6 +564,23 @@ const availableSquaresToPushBack = (p1, p2) => {
564
564
  }
565
565
  };
566
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;
567
584
  // playerFrom, pointTo, foe
568
585
  const isOnLine = (A, B, C) => {
569
586
  // Interception table reference
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "enefel",
3
- "version": "2.14.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.14.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.14.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
@@ -43,6 +43,7 @@ declare enum SKILL_NAMES {
43
43
  FOUL_APPEARANCE = "foul-appearance",
44
44
  FRENZY = "frenzy",
45
45
  FUMBLEROOSKIE = "fumblerooskie",
46
+ GRAB = "grab",
46
47
  HAIL_MARY_PASS = "hail-mary-pass",
47
48
  GUARD = "guard",
48
49
  HIT_AND_RUN = "hit-and-run",
package/dist/skill.js CHANGED
@@ -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";
@@ -260,7 +260,7 @@ const SKILL_STRENGTH = [
260
260
  SKILL_NAMES.BRAWLER,
261
261
  SKILL_NAMES.BREAK_TACKLE,
262
262
  SKILL_NAMES.BULLSEYE,
263
- // SKILL_NAMES.GRAB,
263
+ SKILL_NAMES.GRAB,
264
264
  SKILL_NAMES.GUARD,
265
265
  SKILL_NAMES.JUGGERNAUT,
266
266
  SKILL_NAMES.MIGHTY_BLOW,
package/index.ts CHANGED
@@ -616,6 +616,23 @@ const availableSquaresToPushBack = (p1: Point, p2: Point) => {
616
616
  }
617
617
  };
618
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
+
619
636
  // playerFrom, pointTo, foe
620
637
  const isOnLine = (A: Point, B: Point, C: Point) => {
621
638
  // Interception table reference
@@ -1075,6 +1092,7 @@ export {
1075
1092
  isOnLine,
1076
1093
  isSamePlayer,
1077
1094
  isSetUp,
1095
+ allAdjacentSquaresToPushBack,
1078
1096
  isSquareValidToPushBack,
1079
1097
  LAST_SEASON_ALPHA,
1080
1098
  MAX_PLAYER_TEAM,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enefel",
3
- "version": "2.14.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
@@ -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",
@@ -253,7 +253,7 @@ const SKILL_STRENGTH: SKILL_NAMES[] = [
253
253
  SKILL_NAMES.BRAWLER,
254
254
  SKILL_NAMES.BREAK_TACKLE,
255
255
  SKILL_NAMES.BULLSEYE,
256
- // SKILL_NAMES.GRAB,
256
+ SKILL_NAMES.GRAB,
257
257
  SKILL_NAMES.GUARD,
258
258
  SKILL_NAMES.JUGGERNAUT,
259
259
  SKILL_NAMES.MIGHTY_BLOW,