mirror of
https://github.com/motajs/template.git
synced 2026-11-01 06:04:30 +08:00
feat: Adding should replay flag
This commit is contained in:
1 parent
7743795948
commit
d74cc35c8e
16 files changed
+86
-186
No files matched your search
@@ -23,6 +23,7 @@ import {
|
||||
IReadonlyEnemy,
|
||||
IStateBase
|
||||
} from '@user/data-base';
|
||||
import { shouldReplay } from '@user/data-common';
|
||||
|
||||
export class CombatFlow<TEnemy, THero>
|
||||
extends Hookable<ICombatFlowHooks<TEnemy, THero>>
|
||||
@@ -193,6 +194,7 @@ export class CombatFlow<TEnemy, THero>
|
||||
return damage;
|
||||
}
|
||||
|
||||
@shouldReplay('Battle with enemy should be replayed.')
|
||||
battle(
|
||||
enemy: IEnemyView<TEnemy>
|
||||
): Promise<IEnemyDamageInfo<TEnemy, THero> | null> {
|
||||
@@ -214,6 +216,7 @@ export class CombatFlow<TEnemy, THero>
|
||||
return this.combatFlow(handler, eHandler);
|
||||
}
|
||||
|
||||
@shouldReplay('Battle with enemy should be replayed.')
|
||||
battleComputed(
|
||||
enemy: IReadonlyEnemy<TEnemy>
|
||||
): Promise<IEnemyDamageInfo<TEnemy, THero> | null> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { logger } from '@motajs/common';
|
||||
import { IGameEventStore, ignoreReplay } from '@user/data-common';
|
||||
import { IGameEventStore, shouldReplay } from '@user/data-common';
|
||||
import { AnonTokyoInterpreter } from '@motajs/anon-tokyo';
|
||||
import {
|
||||
EventExecuteMode,
|
||||
@@ -52,8 +52,7 @@ export class EventExecutor implements IGameEventExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
// @ts-expect-error 泛型无法推导
|
||||
@ignoreReplay('事件一般由其他动作被动触发,不应计入录像')
|
||||
@shouldReplay('Executing event should be replayed.')
|
||||
async execute<R = void>(
|
||||
events: IGameEventInvocation[],
|
||||
param: IBlockEventParam
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ITileLocator, logger } from '@motajs/common';
|
||||
import { IObjectMovable, IObjectMover } from '@user/data-common';
|
||||
import { IObjectMovable, IObjectMover, shouldReplay } from '@user/data-common';
|
||||
import { IStateBase } from '@user/data-base';
|
||||
import { PathFinder } from './finder';
|
||||
import {
|
||||
@@ -79,12 +79,14 @@ export class PathfindingSystem implements IPathfindingSystem {
|
||||
return result;
|
||||
}
|
||||
|
||||
@shouldReplay('Moving hero by path finding system should be replayed.')
|
||||
moveTo(target: ITileLocator): IPathfindingController | null {
|
||||
const path = this.getPath(target);
|
||||
if (path.status !== PathfindingStatus.Success) return null;
|
||||
return this.startMove(path, false);
|
||||
}
|
||||
|
||||
@shouldReplay('Teleporting hero by path finding system should be replayed.')
|
||||
teleportTo(target: ITileLocator): IPathfindingController | null {
|
||||
const path = this.getPath(target);
|
||||
if (path.status !== PathfindingStatus.Success) return null;
|
||||
|
||||
Reference in new issue
Block a user