enefel 1.2.0 → 1.2.2
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/.yarnrc.yml +5 -0
- package/dist/avatars.js +587 -0
- package/dist/avatarsDefault.js +136 -0
- package/dist/badge.js +60 -0
- package/dist/block.js +104 -0
- package/dist/calcul.js +11 -0
- package/dist/canUseSkills.js +46 -0
- package/dist/card.js +20 -0
- package/dist/career.js +1935 -0
- package/dist/color.js +112 -0
- package/dist/date.js +62 -0
- package/dist/dice.js +13 -0
- package/dist/elo.js +30 -0
- package/dist/game.js +64 -0
- package/dist/iconMap.js +261 -0
- package/dist/improvement.js +103 -0
- package/dist/inducement.js +59 -0
- package/dist/item.js +45 -0
- package/dist/jest.config.js +11 -0
- package/dist/league.js +250 -0
- package/dist/meteo.js +234 -0
- package/dist/moral.js +38 -0
- package/dist/move.js +70 -0
- package/dist/package-lock.json +6658 -0
- package/dist/package.json +43 -0
- package/dist/pitch.js +113 -0
- package/dist/player.js +244 -0
- package/dist/position.js +23 -0
- package/dist/race.js +355 -0
- package/dist/random.js +35 -0
- package/dist/right.js +62 -0
- package/dist/skill.js +421 -0
- package/dist/skillCoach.js +51 -0
- package/dist/stadium.js +320 -0
- package/dist/state.js +91 -0
- package/dist/status.js +52 -0
- package/dist/store.js +104 -0
- package/dist/time.js +80 -0
- package/dist/tsconfig.json +25 -0
- package/dist/types/models.js +2 -0
- package/dist/validator.js +96 -0
- package/dist/version.js +4 -0
- package/package.json +2 -2
- package/.npmrc +0 -1
- package/package-lock.json +0 -6658
package/dist/move.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bonusDodge = bonusDodge;
|
|
4
|
+
exports.modifJumping = modifJumping;
|
|
5
|
+
const position_1 = require("./position");
|
|
6
|
+
const skill_1 = require("./skill");
|
|
7
|
+
function bonusDodge(player, adjEnemies, adjDestinationEnemies) {
|
|
8
|
+
let bonus = 1;
|
|
9
|
+
if ((0, skill_1.hasSkill)(player, skill_1.SKILL_NAMES.TWO_HEADS)) {
|
|
10
|
+
bonus += 1;
|
|
11
|
+
}
|
|
12
|
+
if ((0, skill_1.hasSkill)(player, skill_1.SKILL_NAMES.TITCHY)) {
|
|
13
|
+
bonus += 1;
|
|
14
|
+
}
|
|
15
|
+
if (adjEnemies.find((p) => (0, skill_1.hasSkill)(p, skill_1.SKILL_NAMES.PREHENSILE_TAIL))) {
|
|
16
|
+
bonus -= 1;
|
|
17
|
+
}
|
|
18
|
+
// STUNTY should not be valid if it has a special weapon
|
|
19
|
+
if (!(0, skill_1.hasSkill)(player, skill_1.SKILL_NAMES.STUNTY)) {
|
|
20
|
+
bonus -= adjDestinationEnemies.filter((p) => !(0, skill_1.hasSkill)(p, skill_1.SKILL_NAMES.TITCHY)).length;
|
|
21
|
+
}
|
|
22
|
+
return bonus;
|
|
23
|
+
}
|
|
24
|
+
function malusJumpingLocation(destination, playerTeamId, players, isCurrentLocation = false) {
|
|
25
|
+
const enemies = (0, position_1.getEnemyTackleZones)(destination, playerTeamId, players);
|
|
26
|
+
let malus = 0;
|
|
27
|
+
malus += enemies.length;
|
|
28
|
+
if (isCurrentLocation) {
|
|
29
|
+
// Prehensile Tail : When an active opposition player attempts to Dodge, Jump or Leap in order to vacate a square in which they are being Marked by this player
|
|
30
|
+
if (enemies.find((p) => (0, skill_1.hasSkill)(p, skill_1.SKILL_NAMES.PREHENSILE_TAIL))) {
|
|
31
|
+
malus += 1;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return malus;
|
|
35
|
+
}
|
|
36
|
+
function modifJumping(player, destination, playerTeamId, players) {
|
|
37
|
+
let malusCurrent = malusJumpingLocation(player, playerTeamId, players, true);
|
|
38
|
+
let malusDestination = malusJumpingLocation(destination, playerTeamId, players);
|
|
39
|
+
// Apply a negative modifier equal to the number of players that were Marking
|
|
40
|
+
// the jumping player in the square they jumped from or equal to the number of players that are Marking
|
|
41
|
+
// the jumping player in the square they have jumped into, whichever is the greatest.
|
|
42
|
+
let modif = -Math.max(malusCurrent, malusDestination);
|
|
43
|
+
let enemies = malusCurrent > malusDestination
|
|
44
|
+
? // malusCurrent.length > malusDestination.length TODO : Check if this is correct
|
|
45
|
+
(0, position_1.getEnemyTackleZones)(player, playerTeamId, players)
|
|
46
|
+
: (0, position_1.getEnemyTackleZones)(destination, playerTeamId, players);
|
|
47
|
+
if ((0, skill_1.hasSkill)(player, skill_1.SKILL_NAMES.POGO_STICK)) {
|
|
48
|
+
// when this player makes an Agility test to Jump over a Prone or Stunned player, or to Leap over an empty square or a square occupied by a Standing player,
|
|
49
|
+
// they may ignore any negative modifiers that would normally be applied for being Marked in the square they jumped or leaped from and/or for being Marked in the square they have jumped or leaped into.
|
|
50
|
+
modif = 0;
|
|
51
|
+
// A player with this Trait cannot also have the Leap skill.
|
|
52
|
+
}
|
|
53
|
+
else if ((0, skill_1.hasSkill)(player, skill_1.SKILL_NAMES.LEAP)) {
|
|
54
|
+
// This player may reduce any negative modifier applied to the Agility test
|
|
55
|
+
// (when they attempt to Jump over a Prone or Stunned player, or to Leap over an empty square or a square occupied by a Standing player)
|
|
56
|
+
// by 1, to a minimum of -1.
|
|
57
|
+
if (modif < -1) {
|
|
58
|
+
modif += 1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// This player may reduce any negative modifier applied to the Agility test
|
|
62
|
+
// (when they attempt to Jump over a Prone or Stunned player (or to Leap over an empty square or a square occupied by a Standing player, if this player has the Leap skill)
|
|
63
|
+
// by 1, to a minimum of -1.
|
|
64
|
+
if ((0, skill_1.hasSkill)(player, skill_1.SKILL_NAMES.VERY_LONG_LEGS)) {
|
|
65
|
+
if (modif < -1) {
|
|
66
|
+
modif += 1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return { modif, enemies };
|
|
70
|
+
}
|