치지직 앱으로 연동하고, 연동 확인된 ID만 접속할 수 있도록 수정, 개발용으로는 채널ID를 수동으로 접속할 수 있도록 변경.
최초 추천 고정 배치 추가.
This commit is contained in:
@@ -25,6 +25,8 @@ export type TurnResult = {
|
||||
message: string;
|
||||
/** 비행기 등: 즉시 이동할 칸 */
|
||||
teleportTo?: number;
|
||||
/** 비행기: 도착 칸을 플레이어가 직접 고름 */
|
||||
chooseDestination?: boolean;
|
||||
};
|
||||
|
||||
export interface CellEvent {
|
||||
@@ -54,20 +56,14 @@ export class ReverseEvent implements CellEvent {
|
||||
}
|
||||
}
|
||||
|
||||
/** 비행기: 지정한 칸으로 즉시 이동 */
|
||||
/** 비행기: 원하는 칸을 고른 뒤 그곳으로 이동 */
|
||||
export class AirplaneEvent implements CellEvent {
|
||||
readonly id = 'airplane';
|
||||
|
||||
constructor(private readonly targetIndex: number) {}
|
||||
|
||||
apply(ctx: TurnContext): TurnResult {
|
||||
const target =
|
||||
((this.targetIndex % ctx.board.length) + ctx.board.length) % ctx.board.length;
|
||||
ctx.chessman.teleport(target);
|
||||
const dest = ctx.board[target];
|
||||
apply(_ctx: TurnContext): TurnResult {
|
||||
return {
|
||||
message: `비행기! → ${dest?.type ?? target}`,
|
||||
teleportTo: target,
|
||||
message: '원하는 곳을 클릭해주세요',
|
||||
chooseDestination: true,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -75,8 +71,7 @@ export class AirplaneEvent implements CellEvent {
|
||||
export const CELL_EVENTS: Record<string, CellEvent> = {
|
||||
island: new IslandEvent(),
|
||||
reverse: new ReverseEvent(),
|
||||
// 기본 도착지는 시작(0). 판 생성 시 덮어쓸 수 있다.
|
||||
airplane: new AirplaneEvent(0),
|
||||
airplane: new AirplaneEvent(),
|
||||
};
|
||||
|
||||
export function getCellEvent(eventId: string | null | undefined): CellEvent | null {
|
||||
|
||||
Reference in New Issue
Block a user