enefel 1.2.8 → 2.0.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/avatars.d.ts +102 -0
- package/dist/avatarsDefault.d.ts +115 -0
- package/dist/badge.d.ts +22 -0
- package/dist/block.d.ts +11 -0
- package/dist/calcul.d.ts +3 -0
- package/dist/canUseSkills.d.ts +6 -0
- package/dist/card.d.ts +15 -0
- package/dist/career.d.ts +176 -0
- package/dist/color.d.ts +7 -0
- package/dist/date.d.ts +4 -0
- package/dist/dice.d.ts +5 -0
- package/dist/elo.d.ts +6 -0
- package/dist/game.d.ts +25 -0
- package/dist/improvement.d.ts +19 -0
- package/dist/index.d.ts +246 -0
- package/dist/inducement.d.ts +8 -0
- package/dist/item.d.ts +23 -0
- package/dist/jest.config.d.ts +0 -0
- package/dist/league.d.ts +33 -0
- package/dist/meteo.d.ts +36 -0
- package/dist/moral.d.ts +3 -0
- package/dist/move.d.ts +7 -0
- package/dist/package.json +2 -3
- package/dist/pitch.d.ts +31 -0
- package/dist/player.d.ts +40 -0
- package/dist/position.d.ts +4 -0
- package/dist/race.d.ts +93 -0
- package/dist/random.d.ts +7 -0
- package/dist/right.d.ts +10 -0
- package/dist/skill.d.ts +151 -0
- package/dist/skillCoach.d.ts +17 -0
- package/dist/stadium.d.ts +121 -0
- package/dist/state.d.ts +30 -0
- package/dist/status.d.ts +20 -0
- package/dist/store.d.ts +95 -0
- package/dist/time.d.ts +18 -0
- package/dist/tsconfig.json +2 -1
- package/dist/types/models.d.ts +368 -0
- package/dist/validator.d.ts +24 -0
- package/dist/version.d.ts +2 -0
- package/package.json +2 -3
- package/tsconfig.json +2 -1
- package/.npmrc-example +0 -8
- package/.yarn/plugins/@yarnpkg/plugin-version.cjs +0 -550
- package/dist/package-lock.json +0 -6658
- /package/{.yarn/versions/1a40c070.yml → dist/iconMap.d.ts} +0 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { Game, Player, PlayerWithSkill, Point, Team } from "types/models";
|
|
2
|
+
import { METEO } from "./meteo";
|
|
3
|
+
import version from "./version";
|
|
4
|
+
declare const POSTULATION_HOURS = 24;
|
|
5
|
+
declare const INACTIVE_DAYS = 10;
|
|
6
|
+
declare const MAX_PLAYER_USER = 2;
|
|
7
|
+
declare const MAX_PLAYER_TEAM = 16;
|
|
8
|
+
declare const LAST_SEASON_ALPHA = 2;
|
|
9
|
+
declare const FORMATION_DEFAULT_NAME = "last-76a0754a5a5005e4a1";
|
|
10
|
+
declare const PLAYER_STAT: {
|
|
11
|
+
BLITZ: string;
|
|
12
|
+
BLOCK_1D: string;
|
|
13
|
+
BLOCK_2D: string;
|
|
14
|
+
BLOCK_3D: string;
|
|
15
|
+
BLOCK_ARMOR_FAIL: string;
|
|
16
|
+
BLOCK_ARMOR_SUCCESS: string;
|
|
17
|
+
BLOCK_ASSISTANCE_ATTACK: string;
|
|
18
|
+
BLOCK_ASSISTANCE_DEFENSE: string;
|
|
19
|
+
BLOCK_M2D: string;
|
|
20
|
+
BLOCK_M3D: string;
|
|
21
|
+
BLOCK_RESULT_1: string;
|
|
22
|
+
BLOCK_RESULT_2: string;
|
|
23
|
+
BLOCK_RESULT_3: string;
|
|
24
|
+
BLOCK_RESULT_4: string;
|
|
25
|
+
BLOCK_RESULT_5: string;
|
|
26
|
+
CASUALTY_BADLY_HURT: string;
|
|
27
|
+
CASUALTY_DEAD: string;
|
|
28
|
+
CASUALTY_LASTING_INJURY: string;
|
|
29
|
+
CASUALTY_RECEIVE_BADLY_HURT: string;
|
|
30
|
+
CASUALTY_RECEIVE_DEAD_FULL_MOON: string;
|
|
31
|
+
CASUALTY_RECEIVE_DEAD: string;
|
|
32
|
+
CASUALTY_RECEIVE_LASTING_INJURY: string;
|
|
33
|
+
CASUALTY_RECEIVE_SERIOUS_INJURY: string;
|
|
34
|
+
CASUALTY_RECEIVE_SERIOUSLY_HURT: string;
|
|
35
|
+
CASUALTY_SERIOUS_INJURY: string;
|
|
36
|
+
CASUALTY_SERIOUSLY_HURT: string;
|
|
37
|
+
DODGE_FAIL: string;
|
|
38
|
+
DODGE_SUCCESS: string;
|
|
39
|
+
EXPERIENCE_COACH: string;
|
|
40
|
+
EXPERIENCE: string;
|
|
41
|
+
FACEUP: string;
|
|
42
|
+
FOUL_ASSISTANCE_ATTACK: string;
|
|
43
|
+
FOUL_ASSISTANCE_DEFENSE: string;
|
|
44
|
+
FOUL_FAIL: string;
|
|
45
|
+
FOUL_RECEIVE: string;
|
|
46
|
+
FOUL_SENDOFF: string;
|
|
47
|
+
FOUL_SUCCESS: string;
|
|
48
|
+
GAME_DRAW: string;
|
|
49
|
+
GAME_LOSS: string;
|
|
50
|
+
GAME_PLAYED: string;
|
|
51
|
+
GAME_VICTORY: string;
|
|
52
|
+
GAME: string;
|
|
53
|
+
GO_FOR_IT_1_FAIL: string;
|
|
54
|
+
GO_FOR_IT_1_SUCCESS: string;
|
|
55
|
+
HANDING_OFF_FAIL: string;
|
|
56
|
+
HANDING_OFF_SUCCESS: string;
|
|
57
|
+
INJURY_CASUALTY: string;
|
|
58
|
+
INJURY_KNOCKED_DOWN: string;
|
|
59
|
+
INJURY_KO: string;
|
|
60
|
+
INTERCEPTION_FAIL: string;
|
|
61
|
+
INTERCEPTION_SUCCESS: string;
|
|
62
|
+
JUMP_FAIL: string;
|
|
63
|
+
JUMP_SUCCESS: string;
|
|
64
|
+
MOVE: string;
|
|
65
|
+
PASS_COMPLETED: string;
|
|
66
|
+
PASS_FAIL: string;
|
|
67
|
+
PASS_FUMBLE: string;
|
|
68
|
+
PASS_INTERCEPTED: string;
|
|
69
|
+
PASS_NOT_COMPLETED: string;
|
|
70
|
+
PASS_PERFECT_COMPLETED: string;
|
|
71
|
+
PASS_PERFECT: string;
|
|
72
|
+
RECEIVE_ARMOR_FAIL: string;
|
|
73
|
+
RECEIVE_ARMOR_SUCCESS: string;
|
|
74
|
+
RECEIVE_BLITZ: string;
|
|
75
|
+
RECEIVE_BLOCK_1D: string;
|
|
76
|
+
RECEIVE_BLOCK_2D: string;
|
|
77
|
+
RECEIVE_BLOCK_3D: string;
|
|
78
|
+
RECEIVE_BLOCK_ARMOR_FAIL: string;
|
|
79
|
+
RECEIVE_BLOCK_ARMOR_SUCCESS: string;
|
|
80
|
+
RECEIVE_BLOCK_M2D: string;
|
|
81
|
+
RECEIVE_BLOCK_M3D: string;
|
|
82
|
+
RECEIVE_BLOCK_RESULT_1: string;
|
|
83
|
+
RECEIVE_BLOCK_RESULT_2: string;
|
|
84
|
+
RECEIVE_BLOCK_RESULT_3: string;
|
|
85
|
+
RECEIVE_BLOCK_RESULT_4: string;
|
|
86
|
+
RECEIVE_BLOCK_RESULT_5: string;
|
|
87
|
+
RECEIVE_INJURY_CASUALTY: string;
|
|
88
|
+
RECEIVE_INJURY_KNOCKED_DOWN: string;
|
|
89
|
+
RECEIVE_INJURY_KO: string;
|
|
90
|
+
REROLL: string;
|
|
91
|
+
STANDUP: string;
|
|
92
|
+
TAKE_BALL_FAIL: string;
|
|
93
|
+
TAKE_BALL_REBOND_FAIL: string;
|
|
94
|
+
TAKE_BALL_REBOND_SUCCESS: string;
|
|
95
|
+
TAKE_BALL_SUCCESS: string;
|
|
96
|
+
TD: string;
|
|
97
|
+
TURNOVER: string;
|
|
98
|
+
};
|
|
99
|
+
declare const GAME_HISTORY_TYPE: {
|
|
100
|
+
BLOCK: string;
|
|
101
|
+
END_TURN: string;
|
|
102
|
+
END: string;
|
|
103
|
+
FACEUP: string;
|
|
104
|
+
FOUL: string;
|
|
105
|
+
KICKOFF: string;
|
|
106
|
+
MOVE: string;
|
|
107
|
+
PASS: string;
|
|
108
|
+
SETUP: string;
|
|
109
|
+
SETUP_POSITION: string;
|
|
110
|
+
STANDUP: string;
|
|
111
|
+
START: string;
|
|
112
|
+
TRANSMISSION: string;
|
|
113
|
+
VOMIT: string;
|
|
114
|
+
EVENT: string;
|
|
115
|
+
};
|
|
116
|
+
declare const GAME_HISTORY_INFO: {
|
|
117
|
+
APO: string;
|
|
118
|
+
ARMOR: string;
|
|
119
|
+
BALL: string;
|
|
120
|
+
BLOCK: string;
|
|
121
|
+
BRIBE: string;
|
|
122
|
+
CARAC_CHANGE: string;
|
|
123
|
+
CASUALTY: string;
|
|
124
|
+
DODGE: string;
|
|
125
|
+
END_PO: string;
|
|
126
|
+
END_POP: string;
|
|
127
|
+
END_TURN: string;
|
|
128
|
+
EXP: string;
|
|
129
|
+
FOUL: string;
|
|
130
|
+
GO_FOR_IT: string;
|
|
131
|
+
HANDICAP: string;
|
|
132
|
+
HANDING_OFF: string;
|
|
133
|
+
INDUCEMENT_HALFLING_MASTER_CHEF: string;
|
|
134
|
+
INJURY: string;
|
|
135
|
+
INTERCEPTION: string;
|
|
136
|
+
JUMP_UP: string;
|
|
137
|
+
KICKOFF: string;
|
|
138
|
+
KO: string;
|
|
139
|
+
LANDING: string;
|
|
140
|
+
JUMP: string;
|
|
141
|
+
LEAP: string;
|
|
142
|
+
METEO: string;
|
|
143
|
+
MOVE: string;
|
|
144
|
+
PASS: string;
|
|
145
|
+
REJECTION: string;
|
|
146
|
+
REROLL_COACH: string;
|
|
147
|
+
REROLL_INITIAL: string;
|
|
148
|
+
REROLL_METEO: string;
|
|
149
|
+
REROLL_RACE_MALUS: string;
|
|
150
|
+
REROLL: string;
|
|
151
|
+
SCATTER: string;
|
|
152
|
+
SKILL_GAIN: string;
|
|
153
|
+
SKILL_LOSS: string;
|
|
154
|
+
SKILL: string;
|
|
155
|
+
SPY: string;
|
|
156
|
+
STANDUP: string;
|
|
157
|
+
START_FAN: string;
|
|
158
|
+
STATUS: string;
|
|
159
|
+
TAKE_BALL: string;
|
|
160
|
+
TD: string;
|
|
161
|
+
THREATENING: string;
|
|
162
|
+
THROW_TEAM_MATE: string;
|
|
163
|
+
TURNOVER: string;
|
|
164
|
+
};
|
|
165
|
+
declare const PLAYER_HISTORY_TYPE: {
|
|
166
|
+
AGING: string;
|
|
167
|
+
APOTHECARY: string;
|
|
168
|
+
COACH_SKILL: string;
|
|
169
|
+
CREATE_TEAM: string;
|
|
170
|
+
CREATED: string;
|
|
171
|
+
DEAD: string;
|
|
172
|
+
EXP: string;
|
|
173
|
+
INACTIVE: string;
|
|
174
|
+
JOIN_TEAM: string;
|
|
175
|
+
NEW_COACH: string;
|
|
176
|
+
NI: string;
|
|
177
|
+
POP: string;
|
|
178
|
+
QUIT_COACH: string;
|
|
179
|
+
QUIT_TEAM: string;
|
|
180
|
+
RAZ: string;
|
|
181
|
+
REDUCTION: string;
|
|
182
|
+
REMOVE_FROM_TEAM: string;
|
|
183
|
+
RETIRED_END: string;
|
|
184
|
+
RETIRED: string;
|
|
185
|
+
SKILL: string;
|
|
186
|
+
};
|
|
187
|
+
declare const PLAYER_HISTORY_INFO: {
|
|
188
|
+
EXP_ASSIST: string;
|
|
189
|
+
EXP_BONUS: string;
|
|
190
|
+
EXP_CAS: string;
|
|
191
|
+
EXP_COACH: string;
|
|
192
|
+
EXP_COMP: string;
|
|
193
|
+
EXP_FALL: string;
|
|
194
|
+
EXP_INT: string;
|
|
195
|
+
EXP_KO: string;
|
|
196
|
+
EXP_TD: string;
|
|
197
|
+
};
|
|
198
|
+
declare const TAKE_BALL_TYPE: {
|
|
199
|
+
CATCH_PASS: string;
|
|
200
|
+
CATCH_HANDOFF: string;
|
|
201
|
+
PICKUP: string;
|
|
202
|
+
CATCH_BOUNCE: string;
|
|
203
|
+
};
|
|
204
|
+
declare const p: (x: number, y: number) => Point;
|
|
205
|
+
declare function addSeconds(date: Date, days: number): Date;
|
|
206
|
+
declare const isSquareValidToPushBack: (availableSquares: Point[], targetIndex: number, players: Player[], w: number, h: number, busy?: Point[]) => boolean;
|
|
207
|
+
declare const getPlayerOnCell: (x: number, y: number, players: Player[]) => Player | undefined;
|
|
208
|
+
declare const getHypnoticGazeMalus: (player: Player, target: Player, players: Player[]) => number;
|
|
209
|
+
declare const getBlockAssistance: (attackerPlayer: PlayerWithSkill, defenderPlayer: PlayerWithSkill, players: PlayerWithSkill[], isAttacker?: boolean) => PlayerWithSkill[];
|
|
210
|
+
declare const getDicesBlock: (attackerStrength: number, defenderStrength: number) => 2 | 1 | 3;
|
|
211
|
+
declare const haveSameTeam: (p1: Player, p2: Player) => boolean;
|
|
212
|
+
declare const isSamePlayer: (p1: Player, p2: Player) => boolean;
|
|
213
|
+
declare const availableSquaresToPushBack: (p1: Point, p2: Point) => {
|
|
214
|
+
x: number;
|
|
215
|
+
y: number;
|
|
216
|
+
d: number;
|
|
217
|
+
}[] | undefined;
|
|
218
|
+
declare const isOnLine: (A: Point, B: Point, C: Point) => boolean;
|
|
219
|
+
declare const getThrowingBonus: (p1: Point, p2: Point, game: Game) => 0 | 1 | -1 | -2 | null;
|
|
220
|
+
declare const isOnField: (x: number, y: number, w: number, h: number) => boolean;
|
|
221
|
+
declare const canPlayerIntercepts: (playerFrom: PlayerWithSkill, player: PlayerWithSkill, pointTo: Point) => boolean;
|
|
222
|
+
declare const getBestInterceptor: (playerFrom: PlayerWithSkill, pointTo: Point, players: PlayerWithSkill[]) => null;
|
|
223
|
+
declare function canBlock(attacker: PlayerWithSkill, defender: PlayerWithSkill, attackerTeam: Team, game: Game, withModif?: boolean, checkBlitz?: boolean): boolean;
|
|
224
|
+
declare function canFoul(attacker: PlayerWithSkill, defender: PlayerWithSkill, attackerTeam: Team): boolean;
|
|
225
|
+
declare function canPass(player: PlayerWithSkill, playerTeam: Team, playerIdWithBall: string): boolean;
|
|
226
|
+
declare function canEndTurn(player: PlayerWithSkill, game: Game): boolean;
|
|
227
|
+
declare function canThrowTeamMate(player: PlayerWithSkill, target: PlayerWithSkill, playerTeam: Team): boolean;
|
|
228
|
+
declare function canMove(player: PlayerWithSkill, nbTile?: number): boolean;
|
|
229
|
+
declare function canTransmit(player: PlayerWithSkill, target: PlayerWithSkill, playerTeam: Team, playerIdWithBall: string): boolean;
|
|
230
|
+
declare function canStandup(player: Player): boolean;
|
|
231
|
+
declare function canFaceUp(player: Player): boolean;
|
|
232
|
+
declare function isGameRunning(game: Game): boolean;
|
|
233
|
+
declare function isSetUp(game: Game): boolean;
|
|
234
|
+
declare function getTeamColor(game: Game, side: number): string | null;
|
|
235
|
+
declare const isCoach: (player: Player, team?: Team | null) => boolean | null;
|
|
236
|
+
declare const getMoralModifier: (player: Player) => number;
|
|
237
|
+
declare const getTeamXP: (team: Team) => number;
|
|
238
|
+
declare const getTeamMoral: (team: Team) => number;
|
|
239
|
+
declare const getTeamMoralByPlayer: (team: Team) => number;
|
|
240
|
+
declare const getAttackerStrength: (player: PlayerWithSkill, isBlitz?: boolean, meteoValue?: METEO) => number;
|
|
241
|
+
declare const getDefenderStrength: (player: PlayerWithSkill) => number;
|
|
242
|
+
declare const arrayMove: (arr: any[], old_index: number, new_index: number) => any[];
|
|
243
|
+
declare const swapArrayLocs: (arr: any[], index1: number, index2: number) => any[];
|
|
244
|
+
declare const getInactiveDays: (isDev?: boolean) => 10 | 10000;
|
|
245
|
+
declare const getMaxPlayers: (isDev?: boolean) => number;
|
|
246
|
+
export { addSeconds, arrayMove, availableSquaresToPushBack, canBlock, canEndTurn, canFaceUp, canFoul, canMove, canPass, canPlayerIntercepts, canStandup, canThrowTeamMate, canTransmit, FORMATION_DEFAULT_NAME, GAME_HISTORY_INFO, GAME_HISTORY_TYPE, 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, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Game, Inducement, Team } from "./types/models";
|
|
2
|
+
declare const MAX_INDUCEMENT = 5;
|
|
3
|
+
declare const INDUCEMENT: Record<string, Inducement>;
|
|
4
|
+
declare const getInducements: (_team: Team, inducementList: string[]) => string | null;
|
|
5
|
+
declare const getGameInducements: (game: Game) => [string | null, string[]];
|
|
6
|
+
declare const hasInducement: (game: Game, currentTeamId: string, inducement: Inducement) => boolean;
|
|
7
|
+
declare const burnInducement: (game: Game, inducementKey: string) => Game | undefined;
|
|
8
|
+
export { burnInducement, getGameInducements, getInducements, hasInducement, INDUCEMENT, MAX_INDUCEMENT, };
|
package/dist/item.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare enum RARITY {
|
|
2
|
+
COMMUN = "c",
|
|
3
|
+
UNCOMMUN = "u",
|
|
4
|
+
RARE = "r",
|
|
5
|
+
EPIC = "e",
|
|
6
|
+
LEGENDARY = "l"
|
|
7
|
+
}
|
|
8
|
+
declare enum ITEM_ID {
|
|
9
|
+
BEER = "beer",
|
|
10
|
+
CHAINSAW = "chainsaw",
|
|
11
|
+
RUSTED_CHAINSAW = "rusted-chainsaw",
|
|
12
|
+
DRUG = "drug",
|
|
13
|
+
GREEN_PILL = "green-pill",
|
|
14
|
+
NEWSPAPER = "newspaper",
|
|
15
|
+
BOOSTER = "booster"
|
|
16
|
+
}
|
|
17
|
+
declare enum ITEM_TYPE {
|
|
18
|
+
CONSUMABLE = "consumable",
|
|
19
|
+
WEAPON = "weapon",
|
|
20
|
+
FILE = "file"
|
|
21
|
+
}
|
|
22
|
+
declare const getQteFromRarity: (rarity: RARITY) => 1 | 10 | 100 | 1000 | 10000 | undefined;
|
|
23
|
+
export { getQteFromRarity, ITEM_ID, ITEM_TYPE, RARITY };
|
|
File without changes
|
package/dist/league.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Team } from "./types/models";
|
|
2
|
+
declare const MIN_OPEN_SIZE = 4;
|
|
3
|
+
declare const GROUP_SIZE = 0;
|
|
4
|
+
declare const HAS_NEXT_SEASON_PLAYOFF = false;
|
|
5
|
+
declare const CAN_CHOOSE_TO_PARTICIPATE = false;
|
|
6
|
+
declare const HOME_AND_AWAY = false;
|
|
7
|
+
declare const NUMBER_TEAM_CHANGE = 2;
|
|
8
|
+
interface Division {
|
|
9
|
+
name: string;
|
|
10
|
+
teams: Team[];
|
|
11
|
+
}
|
|
12
|
+
interface Season {
|
|
13
|
+
id: string;
|
|
14
|
+
truceDate: Date;
|
|
15
|
+
playoff: boolean;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
}
|
|
19
|
+
declare const calculateTeamsStandingForPlayoff: (flatTeams: Team[], division: Division[]) => Team[];
|
|
20
|
+
declare const calculateTeamsStandingForNextSeason: (division: Division[], currentSeason: Season) => Team[];
|
|
21
|
+
declare const forcastNextSeason: (flatTeams: Team[]) => {
|
|
22
|
+
hasPlayoffs: boolean;
|
|
23
|
+
groups: Team[][];
|
|
24
|
+
};
|
|
25
|
+
declare const playoffNextSeason: (flatTeams: any[]) => {
|
|
26
|
+
hasPlayoffs: boolean;
|
|
27
|
+
groups: any[];
|
|
28
|
+
};
|
|
29
|
+
declare function round(r: number, teams: any[]): any[];
|
|
30
|
+
declare function tournament(teams: any[]): any[];
|
|
31
|
+
declare function hasCalendar(league: Division): boolean;
|
|
32
|
+
declare function sortLeagues(a: Division, b: Division): number;
|
|
33
|
+
export { calculateTeamsStandingForNextSeason, calculateTeamsStandingForPlayoff, CAN_CHOOSE_TO_PARTICIPATE, forcastNextSeason, GROUP_SIZE, HAS_NEXT_SEASON_PLAYOFF, hasCalendar, HOME_AND_AWAY, MIN_OPEN_SIZE, NUMBER_TEAM_CHANGE, playoffNextSeason, round, sortLeagues, tournament, };
|
package/dist/meteo.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare enum METEO {
|
|
2
|
+
AUTUMN_LEAF_STREWN_PITCH = 1,
|
|
3
|
+
AUTUMNAL_CHILL = 2,
|
|
4
|
+
POURING_RAIN = 3,
|
|
5
|
+
STRONG_WINDS = 4,
|
|
6
|
+
COLD_WINDS = 5,
|
|
7
|
+
FREEZING = 6,
|
|
8
|
+
PERFECT_CONDITION = 7,
|
|
9
|
+
HEAVY_SNOW = 8,
|
|
10
|
+
BLIZZARD = 9,
|
|
11
|
+
MORNING_DEW = 10,
|
|
12
|
+
BLOSSOMING_FLOWERS = 11,
|
|
13
|
+
MISTY_MORNING = 12,
|
|
14
|
+
HIGH_WINDS = 13
|
|
15
|
+
}
|
|
16
|
+
declare enum SEASON {
|
|
17
|
+
WINTER = 1,
|
|
18
|
+
SPRING = 2,
|
|
19
|
+
SUMMER = 3,
|
|
20
|
+
AUTUMN = 4
|
|
21
|
+
}
|
|
22
|
+
declare const getSeason: () => SEASON | null;
|
|
23
|
+
declare const getMeteo: (value: number) => METEO;
|
|
24
|
+
declare const meteoAttackerStrengthBlitz: (meteoValue: number) => number;
|
|
25
|
+
declare const meteoPlayerFall: (meteoValue: number) => number;
|
|
26
|
+
declare const meteoKO: (meteoValue: number) => number;
|
|
27
|
+
declare const meteoPickUpBall: (meteoValue: number) => number;
|
|
28
|
+
declare const meteoTakeBall: (meteoValue: number) => number;
|
|
29
|
+
declare const meteoPassRebound: (meteoValue: number) => number;
|
|
30
|
+
declare const meteoPassBonus: (meteoValue: number) => number;
|
|
31
|
+
declare const meteoGfi: (meteoValue: number) => number;
|
|
32
|
+
declare const meteoMaxPassDistance: (meteoValue: number) => number;
|
|
33
|
+
declare const meteoHasExpulsion: (meteoValue: number) => boolean;
|
|
34
|
+
declare const meteoMaxMA: (meteoValue: number) => number;
|
|
35
|
+
declare const meteoRerollRoll: (meteoValue: number) => 2 | 1;
|
|
36
|
+
export { getMeteo, getSeason, METEO, meteoAttackerStrengthBlitz, meteoGfi, meteoHasExpulsion, meteoKO, meteoMaxMA, meteoMaxPassDistance, meteoPassBonus, meteoPassRebound, meteoPickUpBall, meteoPlayerFall, meteoRerollRoll, meteoTakeBall, };
|
package/dist/moral.d.ts
ADDED
package/dist/move.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PlayerWithSkill, Point } from "./types/models";
|
|
2
|
+
declare function bonusDodge(player: PlayerWithSkill, adjEnemies: PlayerWithSkill[], adjDestinationEnemies: PlayerWithSkill[]): number;
|
|
3
|
+
declare function modifJumping(player: PlayerWithSkill, destination: Point, playerTeamId: string, players: Record<string, PlayerWithSkill>): {
|
|
4
|
+
modif: number;
|
|
5
|
+
enemies: PlayerWithSkill[];
|
|
6
|
+
};
|
|
7
|
+
export { bonusDodge, modifJumping };
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "enefel",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Blood Bowl
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Blood Bowl 3 game engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"seedrandom": "3.0.5",
|
|
30
30
|
"yup": "^0.29.3"
|
|
31
31
|
},
|
|
32
|
-
"packageManager": "yarn@3.6.4+sha512.e70835d4d6d62c07be76b3c1529cb640c7443f0fe434ef4b6478a5a399218cbaf1511b396b3c56eb03bc86424cff2320f6167ad2fde273aa0df6e60b7754029f",
|
|
33
32
|
"devDependencies": {
|
|
34
33
|
"@jest/globals": "^29.7.0",
|
|
35
34
|
"@types/jest": "^29.5.14",
|
package/dist/pitch.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Game, Player } from "types/models";
|
|
2
|
+
declare enum TILES {
|
|
3
|
+
TD1 = "b",
|
|
4
|
+
CENTRE1 = "c",
|
|
5
|
+
SCRIMMAGE1 = "j",
|
|
6
|
+
LATERALA1 = "d",
|
|
7
|
+
LATERALB1 = "e",
|
|
8
|
+
TD2 = "f",
|
|
9
|
+
CENTRE2 = "g",
|
|
10
|
+
SCRIMMAGE2 = "k",
|
|
11
|
+
LATERALA2 = "h",
|
|
12
|
+
LATERALB2 = "i",
|
|
13
|
+
NEUTRAL = "a"
|
|
14
|
+
}
|
|
15
|
+
declare function coordinatesConvertorY(y: number, isDev?: boolean): string | number;
|
|
16
|
+
declare function coordinatesConvertorX(x: number, isDev?: boolean): number;
|
|
17
|
+
declare function getScrimmageTile(teamNumber: number): TILES.SCRIMMAGE1 | TILES.SCRIMMAGE2;
|
|
18
|
+
declare function getLateralATile(teamNumber: number): TILES.LATERALA1 | TILES.LATERALA2;
|
|
19
|
+
declare function getLateralBTile(teamNumber: number): TILES.LATERALB1 | TILES.LATERALB2;
|
|
20
|
+
declare function getTdTile(teamNumber: number): TILES.TD1 | TILES.TD2;
|
|
21
|
+
declare function getCenterTile(teamNumber: number): TILES.CENTRE1 | TILES.CENTRE2;
|
|
22
|
+
declare function getTile(game: Game, x: number, y: number): string;
|
|
23
|
+
declare function getIndexFromXY(x: number, y: number, width: number): number;
|
|
24
|
+
declare function getHalfStadium(side: number, width: number): import("types/models").Point;
|
|
25
|
+
declare function getNumberPlayerZone(teamNumber: number, players: Player[], game: Game): {
|
|
26
|
+
playerScrimmage: number;
|
|
27
|
+
playerLateralA: number;
|
|
28
|
+
playerLateralB: number;
|
|
29
|
+
playerCenter: number;
|
|
30
|
+
};
|
|
31
|
+
export { coordinatesConvertorX, coordinatesConvertorY, getCenterTile, getHalfStadium, getIndexFromXY, getLateralATile, getLateralBTile, getNumberPlayerZone, getScrimmageTile, getTdTile, getTile, TILES, };
|
package/dist/player.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Game, Player, PlayerWithSkill, Team } from "./types/models";
|
|
2
|
+
declare enum PLAYER_INJURY {
|
|
3
|
+
BADLY_HURT = "badly-hurt",
|
|
4
|
+
SERIOUSLY_HURT = "seriously-hurt",
|
|
5
|
+
SERIOUS = "serious",
|
|
6
|
+
LASTING = "lasting",
|
|
7
|
+
DEAD = "dead"
|
|
8
|
+
}
|
|
9
|
+
declare enum PLAYER_CARAC {
|
|
10
|
+
AG = "AG",
|
|
11
|
+
AV = "AV",
|
|
12
|
+
MA = "MA",
|
|
13
|
+
ST = "ST"
|
|
14
|
+
}
|
|
15
|
+
declare function hasMove(player: PlayerWithSkill, game: Game): boolean;
|
|
16
|
+
declare function arePlayingSameGame(p1: Player, p2: Player): boolean;
|
|
17
|
+
declare function hasTeam(player: Player): boolean;
|
|
18
|
+
declare function areFromSameTeam(p1: Player, p2: Player): boolean;
|
|
19
|
+
declare function isPlaying(player: Player): boolean;
|
|
20
|
+
declare function isPlayingGame(player: Player, game: Game): boolean;
|
|
21
|
+
declare function isTeamPlaying(team: Team): boolean;
|
|
22
|
+
declare function isTeamPlayingGame(team: Team, game: Game): boolean;
|
|
23
|
+
declare function isTeam1(player: Player, game: Game): boolean;
|
|
24
|
+
declare function isRookie(player: Player): boolean;
|
|
25
|
+
declare function getCareerBaseCarac(player: Player, carac: PLAYER_CARAC): number;
|
|
26
|
+
declare function getCareerBaseCaracLimit(player: Player, value: number, carac: PLAYER_CARAC): number;
|
|
27
|
+
declare function getMaxCarac(player: Player, carac: PLAYER_CARAC, game: Game): number;
|
|
28
|
+
declare function getMaxCommun(player: Player, carac: PLAYER_CARAC, _game: Game): number;
|
|
29
|
+
declare function getMaxAV(player: Player, game: Game): number;
|
|
30
|
+
declare function getMaxST(player: Player, game: Game): number;
|
|
31
|
+
declare function getMaxAG(player: Player, game: Game): number;
|
|
32
|
+
declare function getMaxMA(player: Player, game: Game): number;
|
|
33
|
+
declare function getMaxGfi(player: PlayerWithSkill): 2 | 3;
|
|
34
|
+
declare const AGING_SIZE_RANGE = 5;
|
|
35
|
+
declare function gamesforAgingRoll(totalGames: number): number;
|
|
36
|
+
declare const AGING_INITIAL_BONUS = 5;
|
|
37
|
+
declare const AGING_MIN_BONUS = -3;
|
|
38
|
+
declare function getAgingBonus(player: Player, totalGames: number): number | null;
|
|
39
|
+
declare function BB2020Carac(value: number, carac: PLAYER_CARAC): string | number;
|
|
40
|
+
export { AGING_INITIAL_BONUS, AGING_MIN_BONUS, AGING_SIZE_RANGE, areFromSameTeam, arePlayingSameGame, BB2020Carac, gamesforAgingRoll, getAgingBonus, getCareerBaseCarac, getCareerBaseCaracLimit, getMaxAG, getMaxAV, getMaxCarac, getMaxCommun, getMaxGfi, getMaxMA, getMaxST, hasMove, hasTeam, isPlaying, isPlayingGame, isRookie, isTeam1, isTeamPlaying, isTeamPlayingGame, PLAYER_CARAC, PLAYER_INJURY, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PlayerWithSkill, Point } from "./types/models";
|
|
2
|
+
declare const isAdjacent: (p1: Point, p2: Point) => boolean;
|
|
3
|
+
declare function getEnemyTackleZones(location: Point, teamId: string, players: Record<string, PlayerWithSkill>): PlayerWithSkill[];
|
|
4
|
+
export { getEnemyTackleZones, isAdjacent };
|
package/dist/race.d.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { AVATAR, CAREER_ID, RACE } from "./career";
|
|
2
|
+
import { Player, Team, User } from "./types/models";
|
|
3
|
+
declare const ANIMOSITY_NUMBER = 2;
|
|
4
|
+
declare const isPrivateRace: (race: RACE) => boolean;
|
|
5
|
+
declare const hasUnlockRace: (user: User, race: RACE) => boolean;
|
|
6
|
+
declare const hasUnlockCareer: (user: User, careerId: string) => boolean;
|
|
7
|
+
declare const getCareerFromKey: (key: CAREER_ID) => {
|
|
8
|
+
MA: number;
|
|
9
|
+
ST: number;
|
|
10
|
+
AG: number;
|
|
11
|
+
AV: number;
|
|
12
|
+
normal: string;
|
|
13
|
+
double: string;
|
|
14
|
+
normalCoach: string;
|
|
15
|
+
icons: string[];
|
|
16
|
+
skills: (import("./skill").SKILL_NAMES | [import("./skill").SKILL_NAMES, number])[];
|
|
17
|
+
avatars: AVATAR[];
|
|
18
|
+
badge: RACE;
|
|
19
|
+
range: number;
|
|
20
|
+
cost: number;
|
|
21
|
+
hasSprite?: boolean;
|
|
22
|
+
};
|
|
23
|
+
declare const getCareerKeyFromPlayer: (player: Player) => CAREER_ID;
|
|
24
|
+
declare const getCareerFromPlayer: (player: Player) => {
|
|
25
|
+
MA: number;
|
|
26
|
+
ST: number;
|
|
27
|
+
AG: number;
|
|
28
|
+
AV: number;
|
|
29
|
+
normal: string;
|
|
30
|
+
double: string;
|
|
31
|
+
normalCoach: string;
|
|
32
|
+
icons: string[];
|
|
33
|
+
skills: (import("./skill").SKILL_NAMES | [import("./skill").SKILL_NAMES, number])[];
|
|
34
|
+
avatars: AVATAR[];
|
|
35
|
+
badge: RACE;
|
|
36
|
+
range: number;
|
|
37
|
+
cost: number;
|
|
38
|
+
hasSprite?: boolean;
|
|
39
|
+
};
|
|
40
|
+
declare const getCareerFromIcon: (nameIcon: string) => {
|
|
41
|
+
MA: number;
|
|
42
|
+
ST: number;
|
|
43
|
+
AG: number;
|
|
44
|
+
AV: number;
|
|
45
|
+
normal: string;
|
|
46
|
+
double: string;
|
|
47
|
+
normalCoach: string;
|
|
48
|
+
icons: string[];
|
|
49
|
+
skills: (import("./skill").SKILL_NAMES | [import("./skill").SKILL_NAMES, number])[];
|
|
50
|
+
avatars: AVATAR[];
|
|
51
|
+
badge: RACE;
|
|
52
|
+
range: number;
|
|
53
|
+
cost: number;
|
|
54
|
+
hasSprite?: boolean;
|
|
55
|
+
} | null;
|
|
56
|
+
declare const getPlayerAvatarDefault: (player: Player) => string | null;
|
|
57
|
+
declare const getPlayerAvatar: (player: Player) => string | null;
|
|
58
|
+
declare const getPlayerAvatarPath: (player: Player) => "tile/shop/avatar" | "tile/shop/avatar-default" | null;
|
|
59
|
+
declare const getRaceFromCareer: (careerId: CAREER_ID) => RACE;
|
|
60
|
+
declare const getAvatarTypeFromPlayer: (player: Player, avatarFile: string) => AVATAR | null;
|
|
61
|
+
declare const getRaceFromPlayer: (player: Player) => RACE;
|
|
62
|
+
declare const getCareersByRace: () => any;
|
|
63
|
+
declare const GAIN_CAREER_POINT = 2;
|
|
64
|
+
declare const GAIN_CAREER_POINT_FRIENDLY = 2;
|
|
65
|
+
declare enum GROUP_NAME {
|
|
66
|
+
AGILE = "group-agile",
|
|
67
|
+
CHAOTIC = "group-chaotic",
|
|
68
|
+
EXOTIC = "group-exotic",
|
|
69
|
+
NEUTRAL = "group-neutral",
|
|
70
|
+
VICIOUS = "group-vicious"
|
|
71
|
+
}
|
|
72
|
+
type CompatibilityType = {
|
|
73
|
+
[key in GROUP_NAME]: readonly RACE[];
|
|
74
|
+
};
|
|
75
|
+
declare const COMPATIBILITY: CompatibilityType;
|
|
76
|
+
declare const getPlayerGroup: (player: Player) => GROUP_NAME | undefined;
|
|
77
|
+
declare const getRaceGroup: (race: RACE) => GROUP_NAME | undefined;
|
|
78
|
+
declare const getRaceCompatibility: (race1: RACE, race2: RACE) => boolean;
|
|
79
|
+
declare const getPlayerCompatibility: (player1: Player, player2: Player) => void;
|
|
80
|
+
declare function getCareerRanges(): number[];
|
|
81
|
+
declare function getPlayersAvailableForPromo(players?: never[]): Player[];
|
|
82
|
+
declare function getPromoCareer(careerId: CAREER_ID, userPlayers: Player[]): number;
|
|
83
|
+
declare function getPriceCareer(careerId: CAREER_ID): number;
|
|
84
|
+
declare function getTeamGroups(team: Team): any;
|
|
85
|
+
declare function isPlayerNeutralGroup(player: Player): boolean;
|
|
86
|
+
declare function isNeutralGroup(group: string): boolean;
|
|
87
|
+
declare function getTeamIncompatibleGroups(team: Team): [string, unknown][];
|
|
88
|
+
declare const getPlayersByState: (players: Player[]) => {
|
|
89
|
+
actives: Player[];
|
|
90
|
+
inactives: Player[];
|
|
91
|
+
lastRetired: Player[];
|
|
92
|
+
};
|
|
93
|
+
export { ANIMOSITY_NUMBER, COMPATIBILITY, GAIN_CAREER_POINT, GAIN_CAREER_POINT_FRIENDLY, getAvatarTypeFromPlayer, getCareerFromIcon, getCareerFromKey, getCareerFromPlayer, getCareerKeyFromPlayer, getCareerRanges, getCareersByRace, getPlayerAvatar, getPlayerAvatarDefault, getPlayerAvatarPath, getPlayerCompatibility, getPlayerGroup, getPlayersAvailableForPromo, getPlayersByState, getPriceCareer, getPromoCareer, getRaceCompatibility, getRaceFromCareer, getRaceFromPlayer, getRaceGroup, getTeamGroups, getTeamIncompatibleGroups, GROUP_NAME, hasUnlockCareer, hasUnlockRace, isNeutralGroup, isPlayerNeutralGroup, isPrivateRace, };
|
package/dist/random.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare function shuffleArray(array: any[]): any[];
|
|
2
|
+
declare function getRandomItem(arr: any[]): any;
|
|
3
|
+
declare function getRandomNumber(min: number, max: number, r?: () => number): number;
|
|
4
|
+
declare function d8(quantity?: number, max?: number): number;
|
|
5
|
+
declare function d6(quantity?: number, max?: number): number;
|
|
6
|
+
declare function d3(quantity?: number, max?: number): number;
|
|
7
|
+
export { d3, d6, d8, getRandomItem, getRandomNumber, shuffleArray };
|
package/dist/right.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Game, Player, PlayerWithSkill, Team } from "types/models";
|
|
2
|
+
declare function canJoinTeam(player: PlayerWithSkill, team: Team): boolean;
|
|
3
|
+
declare function canCreateTeam(player: Player): boolean;
|
|
4
|
+
declare function canQuitTeam(player: Player): boolean | "";
|
|
5
|
+
declare function canRemovePlayer(player: Player, coach: Player): boolean | "";
|
|
6
|
+
declare function canPayPlayer(player: Player, coach: Player, team: Team): boolean | "";
|
|
7
|
+
declare function canChangeCoach(player: Player, coach: Player): boolean;
|
|
8
|
+
declare function canCancelGame(game: Game, player: Player): boolean;
|
|
9
|
+
declare function canRetirement(player: Player): boolean;
|
|
10
|
+
export { canCancelGame, canChangeCoach, canCreateTeam, canJoinTeam, canPayPlayer, canQuitTeam, canRemovePlayer, canRetirement, };
|