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

Added taunt count to action counts #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions src/stats/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class ActionsComputer implements StatComputer<ActionCountsType[]> {
spotDodgeCount: 0,
ledgegrabCount: 0,
rollCount: 0,
tauntCount: 0,
lCancelCount: {
success: 0,
fail: 0,
Expand Down Expand Up @@ -137,6 +138,17 @@ function didStartLedgegrab(currentAnimation: State, previousAnimation: State): b
return isCurrentlyGrabbingLedge && !wasPreviouslyGrabbingLedge;
}

function isTaunting(animation: State): boolean {
return animation === State.TAUNT_LEFT || animation === State.TAUNT_RIGHT;
}

function didStartTaunt(currentAnimation: State, previousAnimation: State): boolean {
const isCurrentlyTaunting = isTaunting(currentAnimation);
const wasPreviouslyTaunting = isTaunting(previousAnimation);

return isCurrentlyTaunting && !wasPreviouslyTaunting;
}

function handleActionCompute(state: PlayerActionState, indices: PlayerIndexedType, frame: FrameEntryType): void {
const playerFrame = frame.players[indices.playerIndex]!.post;
const opponentFrame = frame.players[indices.opponentIndex]!.post;
Expand Down Expand Up @@ -174,6 +186,9 @@ function handleActionCompute(state: PlayerActionState, indices: PlayerIndexedTyp
const didGrabLedge = didStartLedgegrab(currentAnimation, prevAnimation);
incrementCount("ledgegrabCount", didGrabLedge);

const didTuant = didStartTaunt(currentAnimation, prevAnimation);
incrementCount("tauntCount", didTuant);

const didGrabSucceed = didStartGrabSuccess(currentAnimation, prevAnimation);
incrementCount("grabCount.success", didGrabSucceed);
const didGrabFail = didStartGrabFail(currentAnimation, prevAnimation);
Expand Down
4 changes: 4 additions & 0 deletions src/stats/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ export enum State {

COMMAND_GRAB_RANGE2_START = 0x147,
COMMAND_GRAB_RANGE2_END = 0x152,

// Taunts
TAUNT_RIGHT = 0x108
TAUNT_LEFT = 0x109
}

export const Timers = {
Expand Down