Skip to content

Commit

Permalink
Fixed jab reset detection in combos (#125)
Browse files Browse the repository at this point in the history
* added jab reset states to isDamaged check

* fixed typo

* yarn linting
  • Loading branch information
Walnut356 authored Mar 21, 2023
1 parent c5d403d commit 045ca67
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/SlippiGame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ import type {
PostFrameUpdateType,
RollbackFrames,
} from "./types";
import { GameMode, GameEndMethod } from "./types";
import { GameEndMethod, GameMode } from "./types";
import { getWinners } from "./utils/getWinners";
import { extractDistanceInfoFromFrame } from "./utils/homeRunDistance";
import { SlpParser, SlpParserEvent } from "./utils/slpParser";
import type { SlpFileType, SlpReadInput } from "./utils/slpReader";
import {
closeSlpFile,
extractFinalPostFrameUpdates,
getGameEnd,
getMetadata,
iterateEvents,
openSlpFile,
SlpInputSource,
extractFinalPostFrameUpdates,
} from "./utils/slpReader";

/**
Expand Down
9 changes: 8 additions & 1 deletion src/stats/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ export enum State {
ACTION_KNEE_BEND = 0x18,
GUARD_ON = 0xb2,
TECH_MISS_UP = 0xb7,
JAB_RESET_UP = 0xb9,
TECH_MISS_DOWN = 0xbf,
JAB_RESET_DOWN = 0xc1,
NEUTRAL_TECH = 0xc7,
FORWARD_TECH = 0xc8,
BACKWARD_TECH = 0xc9,
Expand Down Expand Up @@ -307,7 +309,12 @@ export function isDown(state: number): boolean {
}

export function isDamaged(state: number): boolean {
return (state >= State.DAMAGE_START && state <= State.DAMAGE_END) || state === State.DAMAGE_FALL;
return (
(state >= State.DAMAGE_START && state <= State.DAMAGE_END) ||
state === State.DAMAGE_FALL ||
state === State.JAB_RESET_UP ||
state === State.JAB_RESET_DOWN
);
}

export function isGrabbed(state: number): boolean {
Expand Down

0 comments on commit 045ca67

Please sign in to comment.