point-click-lib 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/point-click-lib.cjs +14 -14
- package/dist/point-click-lib.d.ts +86 -0
- package/dist/point-click-lib.iife.js +14 -14
- package/dist/point-click-lib.js +4732 -4142
- package/dist/point-click-lib.umd.cjs +16 -16
- package/package.json +1 -1
|
@@ -239,6 +239,8 @@ declare const actStepSchema: z.ZodObject<{
|
|
|
239
239
|
timeElapsed?: number | undefined;
|
|
240
240
|
}>;
|
|
241
241
|
|
|
242
|
+
export declare const advanceTimeOneStep: (props: GameRunnerProps, eventReporter: InGameEventReporter, debugLogger: LogToDebug) => (state: GameData) => void;
|
|
243
|
+
|
|
242
244
|
export declare const AmbientNoiseConsequenceSchema: z.ZodObject<{
|
|
243
245
|
type: z.ZodLiteral<"ambientNoise">;
|
|
244
246
|
sound: z.ZodOptional<z.ZodString>;
|
|
@@ -393,6 +395,8 @@ export declare type BoardProgression = z.infer<typeof BoardProgressionSchema>;
|
|
|
393
395
|
|
|
394
396
|
export declare const BoardProgressionSchema: z.ZodEnum<["sound", "buttons"]>;
|
|
395
397
|
|
|
398
|
+
export declare const CELL_SIZE = 5;
|
|
399
|
+
|
|
396
400
|
export declare type CellMatrix = default_2.infer<typeof cellMatrixSchema>;
|
|
397
401
|
|
|
398
402
|
export declare const cellMatrixSchema: default_2.ZodArray<default_2.ZodArray<default_2.ZodUnion<[default_2.ZodLiteral<0>, default_2.ZodLiteral<1>]>, "many">, "many">;
|
|
@@ -3513,6 +3517,13 @@ export declare const consequenceTypes: ConsequenceType[];
|
|
|
3513
3517
|
|
|
3514
3518
|
export declare type ConsequenceWithDeprecated = z.infer<typeof ConsequenceSchemaWithDeprecated>;
|
|
3515
3519
|
|
|
3520
|
+
/**
|
|
3521
|
+
* Takes the next step in the sequence, shifting stages the array
|
|
3522
|
+
* when the stage is complete, until the sequence has finished
|
|
3523
|
+
* @returns a partial state
|
|
3524
|
+
*/
|
|
3525
|
+
export declare const continueSequence: (props: GameRunnerProps, eventReporter: InGameEventReporter, debugLogger: LogToDebug) => (state: GameData) => Partial<GameData>;
|
|
3526
|
+
|
|
3516
3527
|
export declare type Conversation = z.infer<typeof ConversationSchema>;
|
|
3517
3528
|
|
|
3518
3529
|
export declare type ConversationBranch = z.infer<typeof ConversationBranchSchema>;
|
|
@@ -12545,6 +12556,18 @@ export declare type ConversationWithDeprecatedConsequences = z.infer<typeof Conv
|
|
|
12545
12556
|
|
|
12546
12557
|
export declare const DB_VERSION = 4;
|
|
12547
12558
|
|
|
12559
|
+
export declare const DEFAULT_ANIMATION: {
|
|
12560
|
+
readonly say: "talk";
|
|
12561
|
+
readonly move: "walk";
|
|
12562
|
+
readonly goTo: "walk";
|
|
12563
|
+
readonly wait: "default";
|
|
12564
|
+
readonly act: "default";
|
|
12565
|
+
};
|
|
12566
|
+
|
|
12567
|
+
export declare const DEFAULT_TALK_TIME = 200;
|
|
12568
|
+
|
|
12569
|
+
export declare const describeCommand: (command: Command, useNames?: boolean) => string;
|
|
12570
|
+
|
|
12548
12571
|
declare type DesignParseResult = {
|
|
12549
12572
|
success: true;
|
|
12550
12573
|
gameDesign: GameDesign;
|
|
@@ -12619,6 +12642,11 @@ export declare const EndingSchema: z.ZodObject<{
|
|
|
12619
12642
|
|
|
12620
12643
|
export declare function findPath(start: XY, goal: XY, matrix: CellMatrix, cellSize: number): XY[];
|
|
12621
12644
|
|
|
12645
|
+
export declare function findTarget(ids: {
|
|
12646
|
+
targetId?: string;
|
|
12647
|
+
roomId?: string;
|
|
12648
|
+
}, gameContents: GameContents, excludeItems?: boolean): CommandTarget | undefined;
|
|
12649
|
+
|
|
12622
12650
|
export declare type FixedGameInfo = z.infer<typeof FixedGameInfoSchema>;
|
|
12623
12651
|
|
|
12624
12652
|
export declare const FixedGameInfoSchema: z.ZodObject<{
|
|
@@ -27976,6 +28004,8 @@ export declare const GameDataSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
27976
28004
|
}>>;
|
|
27977
28005
|
gameNotBegun: z.ZodBoolean;
|
|
27978
28006
|
cellMatrix: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>, "many">, "many">>;
|
|
28007
|
+
viewAngleX: z.ZodNumber;
|
|
28008
|
+
viewAngleY: z.ZodNumber;
|
|
27979
28009
|
}, "strip", z.ZodTypeAny, {
|
|
27980
28010
|
actorOrders: Record<string, ({
|
|
27981
28011
|
type: "move";
|
|
@@ -28036,6 +28066,8 @@ export declare const GameDataSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
28036
28066
|
endStatus?: string | undefined;
|
|
28037
28067
|
})[]>;
|
|
28038
28068
|
gameNotBegun: boolean;
|
|
28069
|
+
viewAngleX: number;
|
|
28070
|
+
viewAngleY: number;
|
|
28039
28071
|
sequenceRunning?: {
|
|
28040
28072
|
id: string;
|
|
28041
28073
|
stages: {
|
|
@@ -28465,6 +28497,8 @@ export declare const GameDataSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
28465
28497
|
endStatus?: string | undefined;
|
|
28466
28498
|
})[]>;
|
|
28467
28499
|
gameNotBegun: boolean;
|
|
28500
|
+
viewAngleX: number;
|
|
28501
|
+
viewAngleY: number;
|
|
28468
28502
|
sequenceRunning?: {
|
|
28469
28503
|
id: string;
|
|
28470
28504
|
stages: {
|
|
@@ -38897,6 +38931,8 @@ export declare const GameHappeningsSchema: z.ZodObject<{
|
|
|
38897
38931
|
}>>;
|
|
38898
38932
|
gameNotBegun: z.ZodBoolean;
|
|
38899
38933
|
cellMatrix: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>, "many">, "many">>;
|
|
38934
|
+
viewAngleX: z.ZodNumber;
|
|
38935
|
+
viewAngleY: z.ZodNumber;
|
|
38900
38936
|
}, "strip", z.ZodTypeAny, {
|
|
38901
38937
|
actorOrders: Record<string, ({
|
|
38902
38938
|
type: "move";
|
|
@@ -38957,6 +38993,8 @@ export declare const GameHappeningsSchema: z.ZodObject<{
|
|
|
38957
38993
|
endStatus?: string | undefined;
|
|
38958
38994
|
})[]>;
|
|
38959
38995
|
gameNotBegun: boolean;
|
|
38996
|
+
viewAngleX: number;
|
|
38997
|
+
viewAngleY: number;
|
|
38960
38998
|
sequenceRunning?: {
|
|
38961
38999
|
id: string;
|
|
38962
39000
|
stages: {
|
|
@@ -39386,6 +39424,8 @@ export declare const GameHappeningsSchema: z.ZodObject<{
|
|
|
39386
39424
|
endStatus?: string | undefined;
|
|
39387
39425
|
})[]>;
|
|
39388
39426
|
gameNotBegun: boolean;
|
|
39427
|
+
viewAngleX: number;
|
|
39428
|
+
viewAngleY: number;
|
|
39389
39429
|
sequenceRunning?: {
|
|
39390
39430
|
id: string;
|
|
39391
39431
|
stages: {
|
|
@@ -39757,8 +39797,26 @@ export declare const GameHappeningsSchema: z.ZodObject<{
|
|
|
39757
39797
|
cellMatrix?: (0 | 1)[][] | undefined;
|
|
39758
39798
|
}>;
|
|
39759
39799
|
|
|
39800
|
+
export declare type GameRunnerProps = GameDesign & GameRuntimeOptions;
|
|
39801
|
+
|
|
39802
|
+
export declare type GameRuntimeOptions = {
|
|
39803
|
+
instantMode?: boolean;
|
|
39804
|
+
orderSpeed?: number;
|
|
39805
|
+
playSound: PlaySound;
|
|
39806
|
+
cellSize: number;
|
|
39807
|
+
defaultTalkTime: number;
|
|
39808
|
+
};
|
|
39809
|
+
|
|
39760
39810
|
export declare function generateCellMatrix(roomData: RoomData, cellSize: number): CellMatrix;
|
|
39761
39811
|
|
|
39812
|
+
export declare function getDefaultResponseText(command: Command, unreachable: boolean): string;
|
|
39813
|
+
|
|
39814
|
+
export declare function getTargetPoint(target: ActorData | HotspotZone, roomData: RoomData): XY;
|
|
39815
|
+
|
|
39816
|
+
export declare function getViewAngleXCenteredOn(xPosition: number, roomData: RoomData): number;
|
|
39817
|
+
|
|
39818
|
+
export declare function getViewAngleYCenteredOn(yPosition: number, roomData: RoomData): number;
|
|
39819
|
+
|
|
39762
39820
|
export declare type GotoOrder = z.infer<typeof GotoOrderSchema>;
|
|
39763
39821
|
|
|
39764
39822
|
export declare const GotoOrderSchema: z.ZodObject<{
|
|
@@ -39804,6 +39862,8 @@ export declare const GotoOrderSchema: z.ZodObject<{
|
|
|
39804
39862
|
speed?: number | undefined;
|
|
39805
39863
|
}>;
|
|
39806
39864
|
|
|
39865
|
+
export declare const handleConversationChoice: ({ sequences, defaultTalkTime }: GameRunnerProps, debugLogger: LogToDebug) => (state: GameData, choice: ConversationChoice) => GameData;
|
|
39866
|
+
|
|
39807
39867
|
export declare type HotspotZone = z.infer<typeof HotspotZoneSchema>;
|
|
39808
39868
|
|
|
39809
39869
|
export declare const HotspotZoneSchema: z.ZodObject<{
|
|
@@ -40658,6 +40718,14 @@ export declare const ImmediateConsequenceSchemaWithDeprecated: z.ZodUnion<[z.Zod
|
|
|
40658
40718
|
|
|
40659
40719
|
export declare const immediateConsequenceTypes: ConsequenceType[];
|
|
40660
40720
|
|
|
40721
|
+
export declare interface InGameEventReporter {
|
|
40722
|
+
reportConsequence: (consequence: Consequence, success: boolean, offscreen: boolean) => void;
|
|
40723
|
+
reportCommand: (command: Command) => void;
|
|
40724
|
+
reportOrder: (order: Order, actor: ActorData) => void;
|
|
40725
|
+
reportStage: (stage: Stage) => void;
|
|
40726
|
+
reportCurrentConversation: () => void;
|
|
40727
|
+
}
|
|
40728
|
+
|
|
40661
40729
|
export declare type Interaction = z.infer<typeof InteractionSchema>;
|
|
40662
40730
|
|
|
40663
40731
|
export declare const InteractionSchema: z.ZodObject<{
|
|
@@ -43011,6 +43079,8 @@ export declare const InventoryConsequenceSchema: z.ZodObject<{
|
|
|
43011
43079
|
actorId?: string | undefined;
|
|
43012
43080
|
}>;
|
|
43013
43081
|
|
|
43082
|
+
export declare const issueMoveOrder: (props: GameRunnerProps, debugLogger?: LogToDebug) => (state: GameData, destination: XY, actorId: string, appendToExisting?: boolean, ignoreObstacles?: boolean) => Partial<GameData>;
|
|
43083
|
+
|
|
43014
43084
|
export declare type ItemData = z.infer<typeof ItemDataSchema>;
|
|
43015
43085
|
|
|
43016
43086
|
export declare const ItemDataSchema: z.ZodIntersection<z.ZodObject<{
|
|
@@ -43046,6 +43116,12 @@ export declare const ItemDataSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
43046
43116
|
row?: number | undefined;
|
|
43047
43117
|
}>>;
|
|
43048
43118
|
|
|
43119
|
+
export declare type LogToDebug = (message: string, subject?: string) => void;
|
|
43120
|
+
|
|
43121
|
+
export declare const makeCommandHandler: (props: GameRunnerProps, eventReporter: InGameEventReporter, debugLogger?: LogToDebug) => (state: GameData, command: Command) => GameData;
|
|
43122
|
+
|
|
43123
|
+
export declare function matchInteraction(command: Command, room: RoomData | undefined, interactions: Interaction[], gameState: GameData): Interaction | undefined;
|
|
43124
|
+
|
|
43049
43125
|
export declare type MoveOrder = z.infer<typeof MoveOrderSchema>;
|
|
43050
43126
|
|
|
43051
43127
|
export declare const MoveOrderSchema: z.ZodObject<{
|
|
@@ -43796,6 +43872,10 @@ declare const PagePictureSchema: z.ZodObject<{
|
|
|
43796
43872
|
|
|
43797
43873
|
export declare const parseAndUpgrade: (maybeGameDesign: unknown) => DesignParseResult;
|
|
43798
43874
|
|
|
43875
|
+
export declare interface PlaySound {
|
|
43876
|
+
(soundId: string, volume?: number): boolean;
|
|
43877
|
+
}
|
|
43878
|
+
|
|
43799
43879
|
export declare type Polygon = z.infer<typeof PolygonSchema>;
|
|
43800
43880
|
|
|
43801
43881
|
declare const PolygonSchema: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">;
|
|
@@ -63876,6 +63956,12 @@ export declare type VersionChange = {
|
|
|
63876
63956
|
}[];
|
|
63877
63957
|
};
|
|
63878
63958
|
|
|
63959
|
+
export declare const wildCard: {
|
|
63960
|
+
readonly ITEM: "$ITEM";
|
|
63961
|
+
readonly TARGET: "$TARGET";
|
|
63962
|
+
readonly VERB: "$VERB";
|
|
63963
|
+
};
|
|
63964
|
+
|
|
63879
63965
|
export declare const xPlacement: z.ZodEnum<["center", "left", "right"]>;
|
|
63880
63966
|
|
|
63881
63967
|
export declare const yPlacement: z.ZodEnum<["center", "top", "bottom"]>;
|