Skip to content

Commit 0012800

Browse files
committed
feat: update oasw rules
1 parent 0c40e6c commit 0012800

File tree

1 file changed

+67
-7
lines changed

1 file changed

+67
-7
lines changed

views/utils/oasw.es

+67-7
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const shipIdIs = (n) => (ship) => ship.api_ship_id === n
55
const hasSome = (pred) => (xs) => xs.some(pred)
66
const hasMoreThan = (num) => (pred) => (xs) => xs.filter(pred).length >= num
77

8+
const isDepthCharge = iconIs(17)
89
const isSonar = iconIs(18)
910

1011
const isDiveBomber = (equip) => equip.api_type[2] === 7
1112
const isTorpedoBomber = (equip) => equip.api_type[2] === 8
12-
const isLargeSonar = (equip) => equip.api_type[2] === 40
1313
const taisenAbove = (value) => (ship) => ship.api_taisen[0] >= value
1414

1515
const isDE = (ship) => ship.api_stype === 1
@@ -19,6 +19,7 @@ const isJClassKai = _.overSome([shipIdIs(394), shipIdIs(893), shipIdIs(906)])
1919
const isTatsutaKai = shipIdIs(478)
2020
const isSamuelKai = shipIdIs(681)
2121
const isSamuelKaiNi = shipIdIs(920)
22+
const isFusoClassKaiNi = _.overSome([shipIdIs(411), shipIdIs(412)])
2223
const isFletcherClassOrKai = _.overSome([
2324
shipIdIs(562), // Johnston
2425
shipIdIs(689), // Johnston Kai
@@ -31,6 +32,7 @@ const isFletcherClassOrKai = _.overSome([
3132

3233
const isTaiyouClassKai = _.overSome([shipIdIs(380), shipIdIs(381)])
3334
const isTaiyouClassKaiNi = _.overSome([shipIdIs(529), shipIdIs(536)])
35+
const isMogamiClassKouKaiNi = _.overSome([shipIdIs(508), shipIdIs(509)])
3436

3537
const isHyugaKaiNi = shipIdIs(554)
3638

@@ -40,6 +42,10 @@ const isKagaKaiNiGo = shipIdIs(646)
4042

4143
const isShinShuMaruKai = shipIdIs(626)
4244

45+
const isYamatoKaiNiJuu = shipIdIs(916)
46+
47+
const isKumanomaru = _.overSome([shipIdIs(943), shipIdIs(948)])
48+
4349
const isFixedWingASWAircraft = (equip) =>
4450
// 対潜哨戒機 (e.g. 三式指揮連絡機(対潜))
4551
equip.api_type[2] === 26
@@ -125,8 +131,8 @@ export const isOASWWith = (allCVEIds) =>
125131
_.overSome(
126132
// 対潜値1以上の艦攻
127133
_.overEvery(isTorpedoBomber, equipTaisAbove(1)),
128-
// 艦爆
129-
isDiveBomber,
134+
// 対潜値1以上の艦爆
135+
_.overEvery(isDiveBomber, equipTaisAbove(1)),
130136
// 三式指揮連絡機(対潜) / カ号観測機
131137
isASWAircraft,
132138
),
@@ -135,7 +141,11 @@ export const isOASWWith = (allCVEIds) =>
135141
),
136142
// 護衛空母 (excluding 大鷹改 大鷹改二)
137143
_.overEvery(
138-
(s) => !isTaiyouClassKai(s) && !isTaiyouClassKaiNi(s) && allCVEIds.includes(s.api_ship_id),
144+
(s) =>
145+
!isTaiyouClassKai(s) &&
146+
!isTaiyouClassKaiNi(s) &&
147+
!isMogamiClassKouKaiNi(s) &&
148+
allCVEIds.includes(s.api_ship_id),
139149
_.overSome(
140150
_.overEvery(
141151
taisenAbove(65),
@@ -152,7 +162,7 @@ export const isOASWWith = (allCVEIds) =>
152162
),
153163
_.overEvery(
154164
taisenAbove(50),
155-
overEquips(hasSome(isLargeSonar)),
165+
overEquips(hasSome(isSonar)),
156166
overEquips(
157167
hasSome(
158168
_.overSome(
@@ -164,6 +174,20 @@ export const isOASWWith = (allCVEIds) =>
164174
),
165175
),
166176
),
177+
_.overEvery(
178+
taisenAbove(100),
179+
overEquips(hasSome(isSonar)),
180+
overEquips(
181+
hasSome(
182+
_.overSome(
183+
// 対潜値1以上の艦攻
184+
_.overEvery(isTorpedoBomber, equipTaisAbove(1)),
185+
// 対潜値1以上の艦爆
186+
_.overEvery(isDiveBomber, equipTaisAbove(1)),
187+
),
188+
),
189+
),
190+
),
167191
),
168192
),
169193
// 日向改二
@@ -176,9 +200,9 @@ export const isOASWWith = (allCVEIds) =>
176200
overEquips(hasMoreThan(2)(isAutogyro)),
177201
),
178202
),
179-
// 神州丸改
203+
// 神州丸改 大和改二重
180204
_.overEvery(
181-
isShinShuMaruKai,
205+
_.overSome(isShinShuMaruKai, isYamatoKaiNiJuu),
182206
taisenAbove(100),
183207
overEquips(
184208
hasSome(
@@ -192,4 +216,40 @@ export const isOASWWith = (allCVEIds) =>
192216
),
193217
overEquips(hasSome(isSonar)),
194218
),
219+
// 熊野丸/改
220+
_.overEvery(
221+
_.overSome(isKumanomaru),
222+
taisenAbove(100),
223+
overEquips(hasSome(isSonar)),
224+
overEquips(
225+
hasSome(
226+
_.overSome(
227+
// 対潜値1以上の艦爆
228+
_.overEvery(isDiveBomber, equipTaisAbove(1)),
229+
// オートジャイロ機
230+
isAutogyro,
231+
// 対潜哨戒機
232+
isFixedWingASWAircraft,
233+
),
234+
),
235+
),
236+
),
237+
// 扶桑改二 山城改二
238+
_.overEvery(
239+
_.overSome(isFusoClassKaiNi),
240+
taisenAbove(100),
241+
overEquips(hasSome(isSonar)),
242+
overEquips(
243+
hasSome(
244+
_.overSome(
245+
// 水上爆撃機
246+
isSeaplaneBomber,
247+
// オートジャイロ機
248+
isAutogyro,
249+
// 爆雷投射機/爆雷
250+
isDepthCharge,
251+
),
252+
),
253+
),
254+
),
195255
)

0 commit comments

Comments
 (0)