Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random normal always random #10165

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions sim/battle-actions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Dex, toID} from './dex';

const CHOOSABLE_TARGETS = new Set(['normal', 'any', 'adjacentAlly', 'adjacentAllyOrSelf', 'adjacentFoe']);
const CHOOSABLE_TARGETS = new Set(['normal', 'any', 'adjacentAlly', 'adjacentAllyOrSelf', 'adjacentFoe','randomNormal']);

Check warning on line 3 in sim/battle-actions.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

This line has a length of 121. Maximum allowed is 120

Check failure on line 3 in sim/battle-actions.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

A space is required after ','

export class BattleActions {
battle: Battle;
Expand Down Expand Up @@ -224,7 +224,7 @@
zMove?: string, externalMove?: boolean, maxMove?: string, originalTarget?: Pokemon
) {
pokemon.activeMoveActions++;
let target = this.battle.getTarget(pokemon, maxMove || zMove || moveOrMoveName, targetLoc, originalTarget);
let target = this.battle.getTarget(pokemon, maxMove || zMove || moveOrMoveName, targetLoc, originalTarget);

Check failure on line 227 in sim/battle-actions.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Trailing spaces not allowed
let baseMove = this.dex.getActiveMove(moveOrMoveName);
const pranksterBoosted = baseMove.pranksterBoosted;
if (baseMove.id !== 'struggle' && !zMove && !maxMove && !externalMove) {
Expand All @@ -242,6 +242,10 @@
move = this.getActiveMaxMove(baseMove, pokemon);
}

if (move.target === 'randomNormal'){

Check failure on line 245 in sim/battle-actions.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing space before opening brace
target = this.battle.getRandomTarget(pokemon, move);
}

Check failure on line 248 in sim/battle-actions.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Trailing spaces not allowed
move.isExternal = externalMove;

this.battle.setActiveMove(move, pokemon, target);
Expand Down
Loading