@lands.io/mod-sdk / BreakthroughActionHooks
Interface: BreakthroughActionHooks¶
Hooks for customizing BreakthroughAction behavior.
Table of contents¶
Properties¶
Properties¶
canActivate¶
• Optional canActivate: (ctx: ActionContext, allowed: boolean) => boolean
Hook for canActivate - receives context and base allowed result
Type declaration¶
▸ (ctx, allowed): boolean
Parameters¶
| Name | Type |
|---|---|
ctx |
ActionContext |
allowed |
boolean |
Returns¶
boolean
createExecution¶
• Optional createExecution: (ctx: ActionContext, target: BreakthroughTarget, execution: Execution) => Execution
Hook for createExecution - receives context, target, and base execution
Type declaration¶
▸ (ctx, target, execution): Execution
Parameters¶
| Name | Type |
|---|---|
ctx |
ActionContext |
target |
BreakthroughTarget |
execution |
Execution |
Returns¶
getTroops¶
• Optional getTroops: (ctx: ActionContext, troops: number) => number
Hook for getTroops - receives context and base troop count
Type declaration¶
▸ (ctx, troops): number
Parameters¶
| Name | Type |
|---|---|
ctx |
ActionContext |
troops |
number |
Returns¶
number
isValidTarget¶
• Optional isValidTarget: (ctx: ActionContext, target: Player, valid: boolean) => boolean
Hook for isValidTarget - receives context, target player, and base validity
Type declaration¶
▸ (ctx, target, valid): boolean
Parameters¶
| Name | Type |
|---|---|
ctx |
ActionContext |
target |
Player |
valid |
boolean |
Returns¶
boolean
Source Code¶
View full implementation
/**
* Hooks for customizing BreakthroughAction behavior.
*/
export interface BreakthroughActionHooks {
/** Hook for canActivate - receives context and base allowed result */
canActivate?: (ctx: ActionContext, allowed: boolean) => boolean;
/** Hook for createExecution - receives context, target, and base execution */
createExecution?: (
ctx: ActionContext,
target: BreakthroughTarget,
execution: Execution
) => Execution;
/** Hook for isValidTarget - receives context, target player, and base validity */
isValidTarget?: (
ctx: ActionContext,
target: Player,
valid: boolean
) => boolean;
/** Hook for getTroops - receives context and base troop count */
getTroops?: (ctx: ActionContext, troops: number) => number;
}