import type { Score } from "sandstone"; import type { OBJECTIVE_CRITERION } from "sandstone/arguments/generated"; import type { AdvancementTriggers } from "sandstone/arguments/resources/AdvancementTriggers"; import type { BUILTIN_VARIABLE_NAMES, POSSIBLE_SCENARIO_EVENTS } from "./constants"; export { Actions } from "./actions"; export type _SpecificObjectiveVariable = { type: "individual"; objective_type: OBJECTIVE_CRITERION; /** The default value for the variable. 0 if undefined. */ default?: number; /** The updater function is used to dynamically compute the value of the variable. */ updater?: (value: Score, variables: Record) => void; }; export type _DummyGlobalVariable = { type: "global"; /** Whether the value should be displayed in-game. */ hidden?: boolean; /** The default value for the variable. 0 if undefined. */ default?: number; /** The updater function is used to dynamically compute the value of the variable. */ updater?: (value: Score, variables: Record) => void; }; export type _DummyIndividualVariable = { type: "individual"; /** The default value for the variable. 0 if undefined. */ default?: number; /** The updater function is used to dynamically compute the value of the variable. */ updater?: (value: Score, variables: Record) => void; }; /** * A custom variable defined for the whole challenge. */ export type _InputVariableType = _SpecificObjectiveVariable | _DummyGlobalVariable | _DummyIndividualVariable; export declare function isSpecificObjectiveVariable(variable: _InputVariableType): variable is _SpecificObjectiveVariable; /** * The base configuration necessary to define events, end conditions, and win conditions for a challenge. */ export type _BaseConfig = { /** * Name of the datapack that will be created for this challenge. */ name: string; /** * The path where the datapack will be created. It is expected to be `kradle-studio/challenges`. */ kradle_challenge_path: string; /** * Game duration in ticks. * * Can be set to `INFINITY` (the default) to run without a time limit. * * @default INFINITY */ GAME_DURATION?: number; roles: ROLE_NAMES[]; custom_variables: Record>; }; export type _ScenarioEvents = Partial void>>; export type Roles = { [role in ROLES_NAMES]: role; }; export type FullVariable = { type: "individual" | "global"; score: Score; default: number | undefined; updater: ((value: Score, variables: Record) => void) | undefined; }; /** * "Full" variables are the variables the challenges passes to the user in events/other variable updaters. */ export type FullVariables = Record>; export type Variables = Record; type _InputEventCommonProperties = { /** The target score to reach to trigger the event */ target?: number | undefined; /** The mode of the event, either fire once or fire every time the score reaches the target */ mode: "fire_once" | "repeatable"; /** Actions to execute when the event is triggered */ actions: () => void; }; export type _InputScoreCustomEventType = { /** The target score to reach to trigger the event */ score: Score; } & _InputEventCommonProperties; export type _InputAdvancementCustomEventType = { /** A list of criteria that must be met to trigger the event */ criteria: AdvancementTriggers[]; } & _InputEventCommonProperties; export type _InputCustomEventType = _InputScoreCustomEventType | _InputAdvancementCustomEventType; export type CustomScoreEvent = { /** The input event that defines the conditions for the custom event */ inputEvent: _InputScoreCustomEventType; /** The score that counts how many times the event has been triggered */ counter: Score; /** The type of the event */ type: "global" | "individual"; /** A name used for debugging purposes */ debugName: string; }; //# sourceMappingURL=types.d.ts.map