Skip to content

Commit 3d0764d

Browse files
committed
impactの計算式を修正した。
1 parent 750db0f commit 3d0764d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/chokudAI.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ fn chokud_ai(resp: &Response, id: &i32, my_role: &i32, e_data: &mut EnemyData, p
178178
if maxlen == 0 { maxlen = 1; minlen = 1;}
179179

180180
let attack = myship.status.power.min(myship.max_heat - myship.heat);
181-
let impact = ((attack * 3 + 1) * (maxlen - 2 * minlen) / maxlen - maxlen).max(0);
181+
let impact = ((attack * 3 + 1) * (maxlen - 2 * minlen).abs() / maxlen - maxlen).max(0);
182182
let eattack = enemyship.status.power.min(enemyship.max_heat - enemyship.heat);
183-
let eimpact = ((eattack * 3 + 1) * (maxlen - 2 * minlen) / maxlen - maxlen).max(0);
183+
let eimpact = ((eattack * 3 + 1) * (maxlen - 2 * minlen).abs() / maxlen - maxlen).max(0);
184184

185185
if eimpact >= 40 {
186186
if addx == 0 && addy == 0 {

0 commit comments

Comments
 (0)