enefel 1.0.83 → 1.0.87
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/index.js +30 -5
- package/meteo.js +69 -23
- package/package.json +1 -1
- package/skill.js +12 -3
package/index.js
CHANGED
|
@@ -9,7 +9,11 @@ const {
|
|
|
9
9
|
hasStatusCanFaceup,
|
|
10
10
|
hasStatusCanStandup,
|
|
11
11
|
} = require("./status");
|
|
12
|
-
|
|
12
|
+
const {
|
|
13
|
+
meteoAttackerStrengthBlitz,
|
|
14
|
+
meteoMaxPassDistance,
|
|
15
|
+
METEO,
|
|
16
|
+
} = require("./meteo");
|
|
13
17
|
const INITIAL_REROLL = 2;
|
|
14
18
|
const POSTULATION_HOURS = 24;
|
|
15
19
|
const INACTIVE_DAYS = 10;
|
|
@@ -590,7 +594,7 @@ const isOnLine = (A, B, C) => {
|
|
|
590
594
|
return AC + BC >= AB - 0.1 && AC + BC <= AB + 0.7 && AC < AB;
|
|
591
595
|
};
|
|
592
596
|
|
|
593
|
-
const getThrowingBonus = (p1, p2) => {
|
|
597
|
+
const getThrowingBonus = (p1, p2, game) => {
|
|
594
598
|
if (
|
|
595
599
|
!(
|
|
596
600
|
Number.isInteger(p1.x) &&
|
|
@@ -614,7 +618,7 @@ const getThrowingBonus = (p1, p2) => {
|
|
|
614
618
|
//empireoublie.free.fr/docs/table_intercept.pdf
|
|
615
619
|
//https://play.google.com/store/apps/details?id=com.cyberedelf.interception
|
|
616
620
|
|
|
617
|
-
if (dist < 1 || dist >=
|
|
621
|
+
if (dist < 1 || dist >= meteoMaxPassDistance(game.meteo)) {
|
|
618
622
|
return null;
|
|
619
623
|
}
|
|
620
624
|
if (dist >= 1 && dist < 3.5) {
|
|
@@ -846,16 +850,38 @@ const getMoralModifier = (player) => {
|
|
|
846
850
|
return race.cost / 10 + range;
|
|
847
851
|
};
|
|
848
852
|
|
|
853
|
+
const getAttackerStrength = (
|
|
854
|
+
player,
|
|
855
|
+
isBlitz = false,
|
|
856
|
+
meteoValue = METEO.PERFECT_CONDITION
|
|
857
|
+
) => {
|
|
858
|
+
try {
|
|
859
|
+
let bonus = isBlitz ? meteoAttackerStrengthBlitz(meteoValue) : 0;
|
|
860
|
+
const hasHorn = hasSkill(player, SKILL_NAMES.HORNS);
|
|
861
|
+
bonus += isBlitz && hasHorn ? 1 : 0;
|
|
862
|
+
return player.current_ST + bonus;
|
|
863
|
+
} catch (e) {
|
|
864
|
+
throw new Error(`Error in getAttackerStrength: ${e}`);
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
const getDefenderStrength = (player) => {
|
|
869
|
+
return player.current_ST;
|
|
870
|
+
};
|
|
871
|
+
|
|
849
872
|
module.exports = {
|
|
873
|
+
getDefenderStrength,
|
|
850
874
|
addSeconds,
|
|
851
875
|
availableSquaresToPushBack,
|
|
852
876
|
canBlock,
|
|
877
|
+
canEndTurn,
|
|
853
878
|
canFaceUp,
|
|
854
879
|
canFoul,
|
|
855
880
|
canMove,
|
|
856
881
|
canPass,
|
|
857
882
|
canPlayerIntercepts,
|
|
858
883
|
canStandup,
|
|
884
|
+
canThrowTeamMate,
|
|
859
885
|
canTransmit,
|
|
860
886
|
distance,
|
|
861
887
|
FORMATION_DEFAULT_NAME,
|
|
@@ -863,6 +889,7 @@ module.exports = {
|
|
|
863
889
|
GAME_HISTORY_TYPE,
|
|
864
890
|
GAME_STATUS,
|
|
865
891
|
GAME_TYPE,
|
|
892
|
+
getAttackerStrength,
|
|
866
893
|
getBestInterceptor,
|
|
867
894
|
getBlockAssistance,
|
|
868
895
|
getCareers,
|
|
@@ -892,7 +919,5 @@ module.exports = {
|
|
|
892
919
|
PLAYER_STAT,
|
|
893
920
|
POSTULATION_HOURS,
|
|
894
921
|
shuffleArray,
|
|
895
|
-
canThrowTeamMate,
|
|
896
|
-
canEndTurn,
|
|
897
922
|
TAKE_BALL_TYPE,
|
|
898
923
|
};
|
package/meteo.js
CHANGED
|
@@ -3,7 +3,11 @@ const METEO = {
|
|
|
3
3
|
AUTUMNAL_CHILL: 2,
|
|
4
4
|
POURING_RAIN: 3,
|
|
5
5
|
STRONG_WINDS: 4,
|
|
6
|
+
COLD_WINDS: 5,
|
|
7
|
+
FREEZING: 6,
|
|
6
8
|
PERFECT_CONDITION: 7,
|
|
9
|
+
HEAVY_SNOW: 8,
|
|
10
|
+
BLIZZARD: 9,
|
|
7
11
|
};
|
|
8
12
|
|
|
9
13
|
const SEASON = {
|
|
@@ -14,11 +18,26 @@ const SEASON = {
|
|
|
14
18
|
};
|
|
15
19
|
|
|
16
20
|
const getSeason = () => {
|
|
17
|
-
return SEASON.
|
|
21
|
+
return SEASON.WINTER;
|
|
22
|
+
// return SEASON.AUTUMN;
|
|
18
23
|
};
|
|
19
24
|
|
|
20
25
|
const getMeteo = (value) => {
|
|
21
26
|
const season = getSeason();
|
|
27
|
+
if (season === SEASON.WINTER) {
|
|
28
|
+
switch (value) {
|
|
29
|
+
case 2:
|
|
30
|
+
return METEO.COLD_WINDS;
|
|
31
|
+
case 3:
|
|
32
|
+
return METEO.FREEZING;
|
|
33
|
+
case 11:
|
|
34
|
+
return METEO.HEAVY_SNOW;
|
|
35
|
+
case 12:
|
|
36
|
+
return METEO.BLIZZARD;
|
|
37
|
+
default:
|
|
38
|
+
return METEO.PERFECT_CONDITION;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
22
41
|
if (season === SEASON.AUTUMN) {
|
|
23
42
|
switch (value) {
|
|
24
43
|
case 2:
|
|
@@ -36,62 +55,89 @@ const getMeteo = (value) => {
|
|
|
36
55
|
return METEO.PERFECT_CONDITION;
|
|
37
56
|
};
|
|
38
57
|
|
|
58
|
+
const meteoAttackerStrengthBlitz = (meteoValue) => {
|
|
59
|
+
let modif = 0;
|
|
60
|
+
if (meteoValue === METEO.HEAVY_SNOW) {
|
|
61
|
+
modif = -1;
|
|
62
|
+
}
|
|
63
|
+
return modif;
|
|
64
|
+
};
|
|
65
|
+
|
|
39
66
|
const meteoPlayerFall = (meteoValue) => {
|
|
40
67
|
let modif = 0;
|
|
41
|
-
if (meteoValue) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
68
|
+
if (meteoValue === METEO.AUTUMN_LEAF_STREWN_PITCH) {
|
|
69
|
+
modif = -1;
|
|
70
|
+
}
|
|
71
|
+
if (meteoValue === METEO.FREEZING) {
|
|
72
|
+
modif = 1;
|
|
45
73
|
}
|
|
46
74
|
return modif;
|
|
47
75
|
};
|
|
48
76
|
|
|
49
77
|
const meteoKO = (meteoValue) => {
|
|
50
78
|
let modif = 0;
|
|
51
|
-
if (meteoValue) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
79
|
+
if (meteoValue === METEO.AUTUMNAL_CHILL) {
|
|
80
|
+
modif = -1;
|
|
81
|
+
}
|
|
82
|
+
if (meteoValue === METEO.COLD_WINDS) {
|
|
83
|
+
modif = -1;
|
|
55
84
|
}
|
|
56
85
|
return modif;
|
|
57
86
|
};
|
|
58
87
|
|
|
59
88
|
const meteoTakeBall = (meteoValue) => {
|
|
60
89
|
let modif = 0;
|
|
61
|
-
if (meteoValue) {
|
|
62
|
-
|
|
63
|
-
modif = -1;
|
|
64
|
-
}
|
|
90
|
+
if (meteoValue === METEO.POURING_RAIN) {
|
|
91
|
+
modif = -1;
|
|
65
92
|
}
|
|
66
93
|
return modif;
|
|
67
94
|
};
|
|
68
95
|
|
|
69
96
|
const meteoPassRebound = (meteoValue) => {
|
|
70
97
|
let modif = 0;
|
|
71
|
-
if (meteoValue) {
|
|
72
|
-
|
|
73
|
-
modif = 3;
|
|
74
|
-
}
|
|
98
|
+
if (meteoValue === METEO.STRONG_WINDS) {
|
|
99
|
+
modif = 3;
|
|
75
100
|
}
|
|
76
101
|
return modif;
|
|
77
102
|
};
|
|
78
103
|
|
|
79
104
|
const meteoPassBonus = (meteoValue) => {
|
|
80
105
|
let modif = 0;
|
|
81
|
-
if (meteoValue) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
106
|
+
if (meteoValue === METEO.STRONG_WINDS) {
|
|
107
|
+
modif = -1;
|
|
108
|
+
}
|
|
109
|
+
if (meteoValue === METEO.COLD_WINDS) {
|
|
110
|
+
modif = -1;
|
|
85
111
|
}
|
|
86
112
|
return modif;
|
|
87
113
|
};
|
|
88
114
|
|
|
115
|
+
const meteoGfi = (meteoValue) => {
|
|
116
|
+
let modif = 0;
|
|
117
|
+
if (meteoValue === METEO.BLIZZARD) {
|
|
118
|
+
modif = -1;
|
|
119
|
+
}
|
|
120
|
+
return modif;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const meteoMaxPassDistance = (meteoValue) => {
|
|
124
|
+
// 3.5, 7, 10.2, 13.1
|
|
125
|
+
let max = 14;
|
|
126
|
+
if (meteoValue === METEO.BLIZZARD) {
|
|
127
|
+
max = 7;
|
|
128
|
+
}
|
|
129
|
+
return max;
|
|
130
|
+
};
|
|
131
|
+
|
|
89
132
|
const tools = {
|
|
90
|
-
meteoPassBonus,
|
|
91
|
-
meteoPassRebound,
|
|
92
133
|
getMeteo,
|
|
93
134
|
METEO,
|
|
135
|
+
meteoAttackerStrengthBlitz,
|
|
136
|
+
meteoGfi,
|
|
94
137
|
meteoKO,
|
|
138
|
+
meteoMaxPassDistance,
|
|
139
|
+
meteoPassBonus,
|
|
140
|
+
meteoPassRebound,
|
|
95
141
|
meteoPlayerFall,
|
|
96
142
|
meteoTakeBall,
|
|
97
143
|
};
|
package/package.json
CHANGED
package/skill.js
CHANGED
|
@@ -28,8 +28,10 @@ const SKILL_NAMES = {
|
|
|
28
28
|
DUMP_OFF: "dump-off",
|
|
29
29
|
FEND: "fend",
|
|
30
30
|
FRENZY: "frenzy",
|
|
31
|
+
FUMBLEROOSKIE: "fumblerooskie",
|
|
31
32
|
GUARD: "guard",
|
|
32
33
|
HORNS: "horns",
|
|
34
|
+
IRON_HARD_SKIN: "iron-hard-skin",
|
|
33
35
|
JUGGERNAUT: "juggernaut",
|
|
34
36
|
JUMP_UP: "jump-up",
|
|
35
37
|
LEAP: "leap",
|
|
@@ -56,6 +58,7 @@ const SKILL_NAMES = {
|
|
|
56
58
|
SURE_FEET: "sure-feet",
|
|
57
59
|
SURE_HANDS: "sure-hands",
|
|
58
60
|
TACKLE: "tackle",
|
|
61
|
+
TENTACLES: "tentacles",
|
|
59
62
|
THICK_SKULL: "thick-skull",
|
|
60
63
|
THROW_TEAM_MATE: "throw-team-mate",
|
|
61
64
|
TWO_HEADS: "two-heads",
|
|
@@ -99,8 +102,10 @@ const SKILLS = {
|
|
|
99
102
|
[SKILL_NAMES.DUMP_OFF]: SKILL_TYPE.PASSING,
|
|
100
103
|
[SKILL_NAMES.FEND]: SKILL_TYPE.GENERAL,
|
|
101
104
|
[SKILL_NAMES.FRENZY]: SKILL_TYPE.GENERAL,
|
|
105
|
+
[SKILL_NAMES.FUMBLEROOSKIE]: SKILL_TYPE.PASSING,
|
|
102
106
|
[SKILL_NAMES.GUARD]: SKILL_TYPE.STRENGTH,
|
|
103
107
|
[SKILL_NAMES.HORNS]: SKILL_TYPE.MUTATION,
|
|
108
|
+
[SKILL_NAMES.IRON_HARD_SKIN]: SKILL_TYPE.MUTATION,
|
|
104
109
|
[SKILL_NAMES.JUGGERNAUT]: SKILL_TYPE.STRENGTH,
|
|
105
110
|
[SKILL_NAMES.JUMP_UP]: SKILL_TYPE.AGILITY,
|
|
106
111
|
[SKILL_NAMES.LEAP]: SKILL_TYPE.AGILITY,
|
|
@@ -127,6 +132,7 @@ const SKILLS = {
|
|
|
127
132
|
[SKILL_NAMES.SURE_FEET]: SKILL_TYPE.AGILITY,
|
|
128
133
|
[SKILL_NAMES.SURE_HANDS]: SKILL_TYPE.GENERAL,
|
|
129
134
|
[SKILL_NAMES.TACKLE]: SKILL_TYPE.GENERAL,
|
|
135
|
+
[SKILL_NAMES.TENTACLES]: SKILL_TYPE.MUTATION,
|
|
130
136
|
[SKILL_NAMES.THICK_SKULL]: SKILL_TYPE.STRENGTH,
|
|
131
137
|
[SKILL_NAMES.THROW_TEAM_MATE]: SKILL_TYPE.EXTRAORDINARY,
|
|
132
138
|
[SKILL_NAMES.TWO_HEADS]: SKILL_TYPE.MUTATION,
|
|
@@ -146,7 +152,9 @@ function useSkill(player, skillId, date = -1, info = null) {
|
|
|
146
152
|
}
|
|
147
153
|
const skill = playerSkills.find((s) => s.skill_id === skillId);
|
|
148
154
|
skill.date_next =
|
|
149
|
-
date === -1
|
|
155
|
+
date === -1
|
|
156
|
+
? new Date(Date.now() + getTime(TYPE_TIMER.ACTION) * 1000)
|
|
157
|
+
: date;
|
|
150
158
|
skill.info = info;
|
|
151
159
|
}
|
|
152
160
|
|
|
@@ -197,11 +205,12 @@ const getPlayersWithSkill = (players, skillId) => {
|
|
|
197
205
|
|
|
198
206
|
const isActivableSkills = (skill) => {
|
|
199
207
|
const activables = [
|
|
200
|
-
SKILL_NAMES.
|
|
208
|
+
SKILL_NAMES.BRAWLER,
|
|
201
209
|
SKILL_NAMES.DUMP_OFF,
|
|
202
210
|
SKILL_NAMES.JUGGERNAUT,
|
|
203
|
-
SKILL_NAMES.BRAWLER,
|
|
204
211
|
SKILL_NAMES.PILE_DRIVER,
|
|
212
|
+
SKILL_NAMES.TENTACLES,
|
|
213
|
+
SKILL_NAMES.WRESTLE,
|
|
205
214
|
];
|
|
206
215
|
return activables.includes(skill);
|
|
207
216
|
};
|