@phalanx-engine/abilities 0.1.0
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/README.md +564 -0
- package/dist/api/AbilitySystemFacade.d.ts +34 -0
- package/dist/api/AbilitySystemFacade.d.ts.map +1 -0
- package/dist/api/AbilitySystemFacade.js +213 -0
- package/dist/api/createAbilitySystem.d.ts +49 -0
- package/dist/api/createAbilitySystem.d.ts.map +1 -0
- package/dist/api/createAbilitySystem.js +205 -0
- package/dist/api/defineAbility.d.ts +3 -0
- package/dist/api/defineAbility.d.ts.map +1 -0
- package/dist/api/defineAbility.js +9 -0
- package/dist/api/defineAbilitySystem.d.ts +8 -0
- package/dist/api/defineAbilitySystem.d.ts.map +1 -0
- package/dist/api/defineAbilitySystem.js +7 -0
- package/dist/api/defineAttribute.d.ts +3 -0
- package/dist/api/defineAttribute.d.ts.map +1 -0
- package/dist/api/defineAttribute.js +3 -0
- package/dist/api/defineEffect.d.ts +6 -0
- package/dist/api/defineEffect.d.ts.map +1 -0
- package/dist/api/defineEffect.js +23 -0
- package/dist/api/index.d.ts +11 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +6 -0
- package/dist/components/AbilitiesComponentType.d.ts +7 -0
- package/dist/components/AbilitiesComponentType.d.ts.map +1 -0
- package/dist/components/AbilitiesComponentType.js +7 -0
- package/dist/components/AbilitySystemComponent.d.ts +17 -0
- package/dist/components/AbilitySystemComponent.d.ts.map +1 -0
- package/dist/components/AbilitySystemComponent.js +31 -0
- package/dist/components/ActiveEffectsComponent.d.ts +12 -0
- package/dist/components/ActiveEffectsComponent.d.ts.map +1 -0
- package/dist/components/ActiveEffectsComponent.js +6 -0
- package/dist/components/AttributesComponent.d.ts +9 -0
- package/dist/components/AttributesComponent.d.ts.map +1 -0
- package/dist/components/AttributesComponent.js +15 -0
- package/dist/components/GameplayTagsComponent.d.ts +8 -0
- package/dist/components/GameplayTagsComponent.d.ts.map +1 -0
- package/dist/components/GameplayTagsComponent.js +7 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +5 -0
- package/dist/cues/Cue.d.ts +15 -0
- package/dist/cues/Cue.d.ts.map +1 -0
- package/dist/cues/Cue.js +7 -0
- package/dist/cues/index.d.ts +3 -0
- package/dist/cues/index.d.ts.map +1 -0
- package/dist/cues/index.js +1 -0
- package/dist/events/AbilityEvents.d.ts +10 -0
- package/dist/events/AbilityEvents.d.ts.map +1 -0
- package/dist/events/AbilityEvents.js +1 -0
- package/dist/events/CueEvents.d.ts +5 -0
- package/dist/events/CueEvents.d.ts.map +1 -0
- package/dist/events/CueEvents.js +4 -0
- package/dist/events/index.d.ts +5 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +2 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/registry/AbilityHooksRegistry.d.ts +10 -0
- package/dist/registry/AbilityHooksRegistry.d.ts.map +1 -0
- package/dist/registry/AbilityHooksRegistry.js +25 -0
- package/dist/registry/AbilityRegistry.d.ts +6 -0
- package/dist/registry/AbilityRegistry.d.ts.map +1 -0
- package/dist/registry/AbilityRegistry.js +4 -0
- package/dist/registry/AbilitySystemRegistries.d.ts +12 -0
- package/dist/registry/AbilitySystemRegistries.d.ts.map +1 -0
- package/dist/registry/AbilitySystemRegistries.js +12 -0
- package/dist/registry/AttributeRegistry.d.ts +7 -0
- package/dist/registry/AttributeRegistry.d.ts.map +1 -0
- package/dist/registry/AttributeRegistry.js +11 -0
- package/dist/registry/DefinitionRegistry.d.ts +16 -0
- package/dist/registry/DefinitionRegistry.d.ts.map +1 -0
- package/dist/registry/DefinitionRegistry.js +37 -0
- package/dist/registry/EffectRegistry.d.ts +6 -0
- package/dist/registry/EffectRegistry.d.ts.map +1 -0
- package/dist/registry/EffectRegistry.js +4 -0
- package/dist/registry/index.d.ts +7 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +5 -0
- package/dist/runtime/AbilitySystemRuntime.d.ts +26 -0
- package/dist/runtime/AbilitySystemRuntime.d.ts.map +1 -0
- package/dist/runtime/AbilitySystemRuntime.js +11 -0
- package/dist/runtime/GameplayCueBuffer.d.ts +10 -0
- package/dist/runtime/GameplayCueBuffer.d.ts.map +1 -0
- package/dist/runtime/GameplayCueBuffer.js +16 -0
- package/dist/runtime/InstanceIdCounter.d.ts +6 -0
- package/dist/runtime/InstanceIdCounter.d.ts.map +1 -0
- package/dist/runtime/InstanceIdCounter.js +10 -0
- package/dist/runtime/index.d.ts +6 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +3 -0
- package/dist/systems/AbilityActivationSystem.d.ts +23 -0
- package/dist/systems/AbilityActivationSystem.d.ts.map +1 -0
- package/dist/systems/AbilityActivationSystem.js +277 -0
- package/dist/systems/AbilityHookExecutorSystem.d.ts +10 -0
- package/dist/systems/AbilityHookExecutorSystem.d.ts.map +1 -0
- package/dist/systems/AbilityHookExecutorSystem.js +35 -0
- package/dist/systems/AttributeAggregationSystem.d.ts +12 -0
- package/dist/systems/AttributeAggregationSystem.d.ts.map +1 -0
- package/dist/systems/AttributeAggregationSystem.js +117 -0
- package/dist/systems/CueBufferCleanupSystem.d.ts +8 -0
- package/dist/systems/CueBufferCleanupSystem.d.ts.map +1 -0
- package/dist/systems/CueBufferCleanupSystem.js +11 -0
- package/dist/systems/CueDispatchSystem.d.ts +8 -0
- package/dist/systems/CueDispatchSystem.d.ts.map +1 -0
- package/dist/systems/CueDispatchSystem.js +17 -0
- package/dist/systems/CuePresentationSystem.d.ts +14 -0
- package/dist/systems/CuePresentationSystem.d.ts.map +1 -0
- package/dist/systems/CuePresentationSystem.js +50 -0
- package/dist/systems/EffectApplicationSystem.d.ts +20 -0
- package/dist/systems/EffectApplicationSystem.d.ts.map +1 -0
- package/dist/systems/EffectApplicationSystem.js +174 -0
- package/dist/systems/EffectTickSystem.d.ts +16 -0
- package/dist/systems/EffectTickSystem.d.ts.map +1 -0
- package/dist/systems/EffectTickSystem.js +152 -0
- package/dist/systems/index.d.ts +9 -0
- package/dist/systems/index.d.ts.map +1 -0
- package/dist/systems/index.js +8 -0
- package/dist/targeting/TargetResolver.d.ts +19 -0
- package/dist/targeting/TargetResolver.d.ts.map +1 -0
- package/dist/targeting/TargetResolver.js +45 -0
- package/dist/targeting/index.d.ts +3 -0
- package/dist/targeting/index.d.ts.map +1 -0
- package/dist/targeting/index.js +1 -0
- package/dist/types/AbilityDef.d.ts +13 -0
- package/dist/types/AbilityDef.d.ts.map +1 -0
- package/dist/types/AbilityDef.js +1 -0
- package/dist/types/AbilityHook.d.ts +10 -0
- package/dist/types/AbilityHook.d.ts.map +1 -0
- package/dist/types/AbilityHook.js +1 -0
- package/dist/types/ActiveEffectInstance.d.ts +9 -0
- package/dist/types/ActiveEffectInstance.d.ts.map +1 -0
- package/dist/types/ActiveEffectInstance.js +1 -0
- package/dist/types/AttributeDef.d.ts +10 -0
- package/dist/types/AttributeDef.d.ts.map +1 -0
- package/dist/types/AttributeDef.js +1 -0
- package/dist/types/CueEvent.d.ts +9 -0
- package/dist/types/CueEvent.d.ts.map +1 -0
- package/dist/types/CueEvent.js +1 -0
- package/dist/types/EffectDef.d.ts +23 -0
- package/dist/types/EffectDef.d.ts.map +1 -0
- package/dist/types/EffectDef.js +17 -0
- package/dist/types/ModifierOp.d.ts +8 -0
- package/dist/types/ModifierOp.d.ts.map +1 -0
- package/dist/types/ModifierOp.js +1 -0
- package/dist/types/TargetSpec.d.ts +32 -0
- package/dist/types/TargetSpec.d.ts.map +1 -0
- package/dist/types/TargetSpec.js +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IComponent } from '@phalanx-engine/ecs';
|
|
2
|
+
import type { ActiveEffectInstance } from '../types';
|
|
3
|
+
export interface PendingEffectAdd {
|
|
4
|
+
defId: string;
|
|
5
|
+
sourceEntityId: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class ActiveEffectsComponent implements IComponent {
|
|
8
|
+
readonly type: symbol;
|
|
9
|
+
readonly queue: ActiveEffectInstance[];
|
|
10
|
+
readonly pendingAdd: PendingEffectAdd[];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ActiveEffectsComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActiveEffectsComponent.d.ts","sourceRoot":"","sources":["../../src/components/ActiveEffectsComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGrD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,sBAAuB,YAAW,UAAU;IACvD,SAAgB,IAAI,SAAwC;IAC5D,SAAgB,KAAK,EAAE,oBAAoB,EAAE,CAAM;IACnD,SAAgB,UAAU,EAAE,gBAAgB,EAAE,CAAM;CACrD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IComponent } from '@phalanx-engine/ecs';
|
|
2
|
+
export declare class AttributesComponent implements IComponent {
|
|
3
|
+
readonly type: symbol;
|
|
4
|
+
readonly base: BigInt64Array;
|
|
5
|
+
readonly current: BigInt64Array;
|
|
6
|
+
readonly dirty: Uint8Array;
|
|
7
|
+
constructor(attributeCount: number);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=AttributesComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttributesComponent.d.ts","sourceRoot":"","sources":["../../src/components/AttributesComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,qBAAa,mBAAoB,YAAW,UAAU;IACpD,SAAgB,IAAI,SAAqC;IACzD,SAAgB,IAAI,EAAE,aAAa,CAAC;IACpC,SAAgB,OAAO,EAAE,aAAa,CAAC;IACvC,SAAgB,KAAK,EAAE,UAAU,CAAC;gBAEf,cAAc,EAAE,MAAM;CAS1C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AbilitiesComponentType } from './AbilitiesComponentType';
|
|
2
|
+
export class AttributesComponent {
|
|
3
|
+
type = AbilitiesComponentType.Attributes;
|
|
4
|
+
base;
|
|
5
|
+
current;
|
|
6
|
+
dirty;
|
|
7
|
+
constructor(attributeCount) {
|
|
8
|
+
if (!Number.isInteger(attributeCount) || attributeCount < 0) {
|
|
9
|
+
throw new Error(`attributeCount must be a non-negative integer, got ${attributeCount}`);
|
|
10
|
+
}
|
|
11
|
+
this.base = new BigInt64Array(attributeCount);
|
|
12
|
+
this.current = new BigInt64Array(attributeCount);
|
|
13
|
+
this.dirty = new Uint8Array(attributeCount);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IComponent } from '@phalanx-engine/ecs';
|
|
2
|
+
export declare class GameplayTagsComponent implements IComponent {
|
|
3
|
+
readonly type: symbol;
|
|
4
|
+
readonly tags: Set<string>;
|
|
5
|
+
readonly adHocTags: Set<string>;
|
|
6
|
+
readonly effectGrantCounts: Map<string, number>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=GameplayTagsComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameplayTagsComponent.d.ts","sourceRoot":"","sources":["../../src/components/GameplayTagsComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA4BtD,qBAAa,qBAAsB,YAAW,UAAU;IACtD,SAAgB,IAAI,SAAuC;IAO3D,SAAgB,IAAI,cAAqB;IAEzC,SAAgB,SAAS,cAAqB;IAQ9C,SAAgB,iBAAiB,sBAA6B;CAC/D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { AbilitiesComponentType } from './AbilitiesComponentType';
|
|
2
|
+
export { AbilitySystemComponent, getAbilitySystemComponent, getActiveEffectsComponent, getAttributesComponent, getGameplayTagsComponent, } from './AbilitySystemComponent';
|
|
3
|
+
export { ActiveEffectsComponent } from './ActiveEffectsComponent';
|
|
4
|
+
export type { PendingEffectAdd } from './ActiveEffectsComponent';
|
|
5
|
+
export { AttributesComponent } from './AttributesComponent';
|
|
6
|
+
export { GameplayTagsComponent } from './GameplayTagsComponent';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { AbilitiesComponentType } from './AbilitiesComponentType';
|
|
2
|
+
export { AbilitySystemComponent, getAbilitySystemComponent, getActiveEffectsComponent, getAttributesComponent, getGameplayTagsComponent, } from './AbilitySystemComponent';
|
|
3
|
+
export { ActiveEffectsComponent } from './ActiveEffectsComponent';
|
|
4
|
+
export { AttributesComponent } from './AttributesComponent';
|
|
5
|
+
export { GameplayTagsComponent } from './GameplayTagsComponent';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EntityManager, EventBus } from '@phalanx-engine/ecs';
|
|
2
|
+
import type { GameplayCueDispatchedEvent } from '../events';
|
|
3
|
+
export interface CueContext {
|
|
4
|
+
readonly entityManager: EntityManager;
|
|
5
|
+
readonly eventBus: EventBus;
|
|
6
|
+
}
|
|
7
|
+
export declare abstract class Cue {
|
|
8
|
+
abstract onSpawn(event: GameplayCueDispatchedEvent, context: CueContext): void;
|
|
9
|
+
update(_deltaTimeSeconds: number): void;
|
|
10
|
+
isFinished(): boolean;
|
|
11
|
+
dispose(): void;
|
|
12
|
+
}
|
|
13
|
+
export type CueFactory = () => Cue;
|
|
14
|
+
export type CueConfig = Readonly<Record<string, CueFactory>>;
|
|
15
|
+
//# sourceMappingURL=Cue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cue.d.ts","sourceRoot":"","sources":["../../src/cues/Cue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAW5D,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAaD,8BAAsB,GAAG;aAEP,OAAO,CAAC,KAAK,EAAE,0BAA0B,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI;IAG9E,MAAM,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI;IAGvC,UAAU,IAAI,OAAO;IAKrB,OAAO,IAAI,IAAI;CACvB;AAGD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC;AAGnC,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC"}
|
package/dist/cues/Cue.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cues/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Cue } from './Cue';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ProvidedTarget } from '../types';
|
|
2
|
+
export interface AbilityActivatedEvent {
|
|
3
|
+
abilityId: string;
|
|
4
|
+
casterEntityId: number;
|
|
5
|
+
resolvedTargets: readonly number[];
|
|
6
|
+
providedTarget?: ProvidedTarget;
|
|
7
|
+
tick: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const ABILITY_ACTIVATED_EVENT = "phalanx-abilities:AbilityActivated";
|
|
10
|
+
//# sourceMappingURL=AbilityEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbilityEvents.d.ts","sourceRoot":"","sources":["../../src/events/AbilityEvents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAuB/C,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAMD,eAAO,MAAM,uBAAuB,uCAAuC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ABILITY_ACTIVATED_EVENT = 'phalanx-abilities:AbilityActivated';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CueEvent } from '../types';
|
|
2
|
+
export type GameplayCueDispatchedEvent = CueEvent;
|
|
3
|
+
export declare const GAMEPLAY_CUE_EVENT = "phalanx-abilities:GameplayCue";
|
|
4
|
+
export declare function gameplayCueKey(cueId: string): string;
|
|
5
|
+
//# sourceMappingURL=CueEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CueEvents.d.ts","sourceRoot":"","sources":["../../src/events/CueEvents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;AAMlD,eAAO,MAAM,kBAAkB,kCAAkC,CAAC;AAElE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ABILITY_ACTIVATED_EVENT } from './AbilityEvents';
|
|
2
|
+
export type { AbilityActivatedEvent } from './AbilityEvents';
|
|
3
|
+
export { GAMEPLAY_CUE_EVENT, gameplayCueKey } from './CueEvents';
|
|
4
|
+
export type { GameplayCueDispatchedEvent } from './CueEvents';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACjE,YAAY,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './api';
|
|
2
|
+
export * from './components';
|
|
3
|
+
export * from './cues';
|
|
4
|
+
export * from './events';
|
|
5
|
+
export * from './registry';
|
|
6
|
+
export * from './runtime';
|
|
7
|
+
export * from './systems';
|
|
8
|
+
export * from './targeting';
|
|
9
|
+
export * from './types';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AbilityHook } from '../types';
|
|
2
|
+
export declare class AbilityHooksRegistry {
|
|
3
|
+
private readonly hooks;
|
|
4
|
+
register(hookId: string, hook: AbilityHook): void;
|
|
5
|
+
get(hookId: string): AbilityHook;
|
|
6
|
+
tryGet(hookId: string): AbilityHook | undefined;
|
|
7
|
+
has(hookId: string): boolean;
|
|
8
|
+
get size(): number;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=AbilityHooksRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbilityHooksRegistry.d.ts","sourceRoot":"","sources":["../../src/registry/AbilityHooksRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkC;IAEjD,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI;IAQjD,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAShC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAI/C,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAInC,IAAW,IAAI,IAAI,MAAM,CAExB;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class AbilityHooksRegistry {
|
|
2
|
+
hooks = new Map();
|
|
3
|
+
register(hookId, hook) {
|
|
4
|
+
if (this.hooks.has(hookId)) {
|
|
5
|
+
throw new Error(`AbilityHooksRegistry already contains '${hookId}'`);
|
|
6
|
+
}
|
|
7
|
+
this.hooks.set(hookId, hook);
|
|
8
|
+
}
|
|
9
|
+
get(hookId) {
|
|
10
|
+
const hook = this.hooks.get(hookId);
|
|
11
|
+
if (!hook) {
|
|
12
|
+
throw new Error(`AbilityHooksRegistry does not contain '${hookId}'`);
|
|
13
|
+
}
|
|
14
|
+
return hook;
|
|
15
|
+
}
|
|
16
|
+
tryGet(hookId) {
|
|
17
|
+
return this.hooks.get(hookId);
|
|
18
|
+
}
|
|
19
|
+
has(hookId) {
|
|
20
|
+
return this.hooks.has(hookId);
|
|
21
|
+
}
|
|
22
|
+
get size() {
|
|
23
|
+
return this.hooks.size;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AbilityDef } from '../types';
|
|
2
|
+
import { DefinitionRegistry } from './DefinitionRegistry';
|
|
3
|
+
export declare class AbilityRegistry extends DefinitionRegistry<AbilityDef> {
|
|
4
|
+
protected readonly registryName = "AbilityRegistry";
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=AbilityRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbilityRegistry.d.ts","sourceRoot":"","sources":["../../src/registry/AbilityRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,eAAgB,SAAQ,kBAAkB,CAAC,UAAU,CAAC;IACjE,SAAS,CAAC,QAAQ,CAAC,YAAY,qBAAqB;CACrD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AbilityHooksRegistry } from './AbilityHooksRegistry';
|
|
2
|
+
import { AbilityRegistry } from './AbilityRegistry';
|
|
3
|
+
import { AttributeRegistry } from './AttributeRegistry';
|
|
4
|
+
import { EffectRegistry } from './EffectRegistry';
|
|
5
|
+
export interface AbilitySystemRegistries {
|
|
6
|
+
attributes: AttributeRegistry;
|
|
7
|
+
effects: EffectRegistry;
|
|
8
|
+
abilities: AbilityRegistry;
|
|
9
|
+
hooks: AbilityHooksRegistry;
|
|
10
|
+
}
|
|
11
|
+
export declare function createAbilitySystemRegistries(): AbilitySystemRegistries;
|
|
12
|
+
//# sourceMappingURL=AbilitySystemRegistries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbilitySystemRegistries.d.ts","sourceRoot":"","sources":["../../src/registry/AbilitySystemRegistries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQlD,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,OAAO,EAAE,cAAc,CAAC;IACxB,SAAS,EAAE,eAAe,CAAC;IAC3B,KAAK,EAAE,oBAAoB,CAAC;CAC7B;AAED,wBAAgB,6BAA6B,IAAI,uBAAuB,CAOvE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AbilityHooksRegistry } from './AbilityHooksRegistry';
|
|
2
|
+
import { AbilityRegistry } from './AbilityRegistry';
|
|
3
|
+
import { AttributeRegistry } from './AttributeRegistry';
|
|
4
|
+
import { EffectRegistry } from './EffectRegistry';
|
|
5
|
+
export function createAbilitySystemRegistries() {
|
|
6
|
+
return {
|
|
7
|
+
attributes: new AttributeRegistry(),
|
|
8
|
+
effects: new EffectRegistry(),
|
|
9
|
+
abilities: new AbilityRegistry(),
|
|
10
|
+
hooks: new AbilityHooksRegistry(),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AttributeDef } from '../types';
|
|
2
|
+
import { DefinitionRegistry } from './DefinitionRegistry';
|
|
3
|
+
export declare class AttributeRegistry extends DefinitionRegistry<AttributeDef> {
|
|
4
|
+
protected readonly registryName = "AttributeRegistry";
|
|
5
|
+
indexOf(id: string): number;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=AttributeRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttributeRegistry.d.ts","sourceRoot":"","sources":["../../src/registry/AttributeRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,iBAAkB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;IACrE,SAAS,CAAC,QAAQ,CAAC,YAAY,uBAAuB;IAO/C,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;CAQnC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DefinitionRegistry } from './DefinitionRegistry';
|
|
2
|
+
export class AttributeRegistry extends DefinitionRegistry {
|
|
3
|
+
registryName = 'AttributeRegistry';
|
|
4
|
+
indexOf(id) {
|
|
5
|
+
const index = this.indexOfOrMinusOne(id);
|
|
6
|
+
if (index === -1) {
|
|
7
|
+
throw new Error(`${this.registryName} does not contain '${id}'`);
|
|
8
|
+
}
|
|
9
|
+
return index;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare abstract class DefinitionRegistry<TDef extends {
|
|
2
|
+
id: string;
|
|
3
|
+
}> {
|
|
4
|
+
private readonly defs;
|
|
5
|
+
private readonly defsArray;
|
|
6
|
+
private readonly indexById;
|
|
7
|
+
register(def: TDef): TDef;
|
|
8
|
+
get(id: string): TDef;
|
|
9
|
+
tryGet(id: string): TDef | undefined;
|
|
10
|
+
has(id: string): boolean;
|
|
11
|
+
values(): readonly TDef[];
|
|
12
|
+
indexOfOrMinusOne(id: string): number;
|
|
13
|
+
get size(): number;
|
|
14
|
+
protected abstract readonly registryName: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=DefinitionRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefinitionRegistry.d.ts","sourceRoot":"","sources":["../../src/registry/DefinitionRegistry.ts"],"names":[],"mappings":"AAAA,8BAAsB,kBAAkB,CAAC,IAAI,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE;IAClE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA2B;IAEhD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IAExC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;IAEhD,QAAQ,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI;IAWzB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IASrB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAIpC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAYxB,MAAM,IAAI,SAAS,IAAI,EAAE;IASzB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAK5C,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAClD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export class DefinitionRegistry {
|
|
2
|
+
defs = new Map();
|
|
3
|
+
defsArray = [];
|
|
4
|
+
indexById = new Map();
|
|
5
|
+
register(def) {
|
|
6
|
+
if (this.defs.has(def.id)) {
|
|
7
|
+
throw new Error(`${this.registryName} already contains '${def.id}'`);
|
|
8
|
+
}
|
|
9
|
+
this.indexById.set(def.id, this.defsArray.length);
|
|
10
|
+
this.defsArray.push(def);
|
|
11
|
+
this.defs.set(def.id, def);
|
|
12
|
+
return def;
|
|
13
|
+
}
|
|
14
|
+
get(id) {
|
|
15
|
+
const def = this.defs.get(id);
|
|
16
|
+
if (!def) {
|
|
17
|
+
throw new Error(`${this.registryName} does not contain '${id}'`);
|
|
18
|
+
}
|
|
19
|
+
return def;
|
|
20
|
+
}
|
|
21
|
+
tryGet(id) {
|
|
22
|
+
return this.defs.get(id);
|
|
23
|
+
}
|
|
24
|
+
has(id) {
|
|
25
|
+
return this.defs.has(id);
|
|
26
|
+
}
|
|
27
|
+
values() {
|
|
28
|
+
return this.defsArray;
|
|
29
|
+
}
|
|
30
|
+
indexOfOrMinusOne(id) {
|
|
31
|
+
const index = this.indexById.get(id);
|
|
32
|
+
return index === undefined ? -1 : index;
|
|
33
|
+
}
|
|
34
|
+
get size() {
|
|
35
|
+
return this.defsArray.length;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EffectDef } from '../types';
|
|
2
|
+
import { DefinitionRegistry } from './DefinitionRegistry';
|
|
3
|
+
export declare class EffectRegistry extends DefinitionRegistry<EffectDef> {
|
|
4
|
+
protected readonly registryName = "EffectRegistry";
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=EffectRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EffectRegistry.d.ts","sourceRoot":"","sources":["../../src/registry/EffectRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,cAAe,SAAQ,kBAAkB,CAAC,SAAS,CAAC;IAC/D,SAAS,CAAC,QAAQ,CAAC,YAAY,oBAAoB;CACpD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { AbilityHooksRegistry } from './AbilityHooksRegistry';
|
|
2
|
+
export { AbilityRegistry } from './AbilityRegistry';
|
|
3
|
+
export { AttributeRegistry } from './AttributeRegistry';
|
|
4
|
+
export { EffectRegistry } from './EffectRegistry';
|
|
5
|
+
export { createAbilitySystemRegistries } from './AbilitySystemRegistries';
|
|
6
|
+
export type { AbilitySystemRegistries } from './AbilitySystemRegistries';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC1E,YAAY,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { AbilityHooksRegistry } from './AbilityHooksRegistry';
|
|
2
|
+
export { AbilityRegistry } from './AbilityRegistry';
|
|
3
|
+
export { AttributeRegistry } from './AttributeRegistry';
|
|
4
|
+
export { EffectRegistry } from './EffectRegistry';
|
|
5
|
+
export { createAbilitySystemRegistries } from './AbilitySystemRegistries';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ProvidedTarget } from '../types';
|
|
2
|
+
import type { GameplayCueBuffer } from './GameplayCueBuffer';
|
|
3
|
+
import { InstanceIdCounter } from './InstanceIdCounter';
|
|
4
|
+
export interface ResolvedAbilityActivationRecord {
|
|
5
|
+
abilityId: string;
|
|
6
|
+
casterEntityId: number;
|
|
7
|
+
resolvedTargets: number[];
|
|
8
|
+
providedTarget?: ProvidedTarget;
|
|
9
|
+
hookId?: string;
|
|
10
|
+
tick: number;
|
|
11
|
+
}
|
|
12
|
+
export interface AbilityActivationRequest {
|
|
13
|
+
casterEntityId: number;
|
|
14
|
+
abilityId: string;
|
|
15
|
+
providedTarget?: ProvidedTarget;
|
|
16
|
+
enqueueTick: number;
|
|
17
|
+
}
|
|
18
|
+
export interface AbilitySystemRuntime {
|
|
19
|
+
instanceIdCounter: InstanceIdCounter;
|
|
20
|
+
activationRequests: AbilityActivationRequest[];
|
|
21
|
+
currentTick: number;
|
|
22
|
+
resolvedActivationsThisTick: ResolvedAbilityActivationRecord[];
|
|
23
|
+
gameplayCueBuffer: GameplayCueBuffer;
|
|
24
|
+
}
|
|
25
|
+
export declare function createAbilitySystemRuntime(): AbilitySystemRuntime;
|
|
26
|
+
//# sourceMappingURL=AbilitySystemRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbilitySystemRuntime.d.ts","sourceRoot":"","sources":["../../src/runtime/AbilitySystemRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAaxD,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAwBD,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;CACrB;AAYD,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,EAAE,iBAAiB,CAAC;IAQrC,kBAAkB,EAAE,wBAAwB,EAAE,CAAC;IAO/C,WAAW,EAAE,MAAM,CAAC;IAQpB,2BAA2B,EAAE,+BAA+B,EAAE,CAAC;IAM/D,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;AAED,wBAAgB,0BAA0B,IAAI,oBAAoB,CAQjE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createGameplayCueBuffer } from './GameplayCueBuffer';
|
|
2
|
+
import { InstanceIdCounter } from './InstanceIdCounter';
|
|
3
|
+
export function createAbilitySystemRuntime() {
|
|
4
|
+
return {
|
|
5
|
+
instanceIdCounter: new InstanceIdCounter(),
|
|
6
|
+
activationRequests: [],
|
|
7
|
+
currentTick: -1,
|
|
8
|
+
resolvedActivationsThisTick: [],
|
|
9
|
+
gameplayCueBuffer: createGameplayCueBuffer(),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CueEvent, CuePhase, EffectCueSpec } from '../types';
|
|
2
|
+
export interface GameplayCueBuffer {
|
|
3
|
+
readonly events: CueEvent[];
|
|
4
|
+
}
|
|
5
|
+
export interface GameplayCueBufferView {
|
|
6
|
+
readonly events: readonly CueEvent[];
|
|
7
|
+
}
|
|
8
|
+
export declare function createGameplayCueBuffer(): GameplayCueBuffer;
|
|
9
|
+
export declare function appendGameplayCueEvents(buffer: GameplayCueBuffer, cues: EffectCueSpec | undefined, phase: CuePhase, tick: number, sourceEntityId: number, targetEntityId: number): void;
|
|
10
|
+
//# sourceMappingURL=GameplayCueBuffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameplayCueBuffer.d.ts","sourceRoot":"","sources":["../../src/runtime/GameplayCueBuffer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,CAAC;CACtC;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAE3D;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,GACrB,IAAI,CAWN"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getCueIdsForPhase } from '../types';
|
|
2
|
+
export function createGameplayCueBuffer() {
|
|
3
|
+
return { events: [] };
|
|
4
|
+
}
|
|
5
|
+
export function appendGameplayCueEvents(buffer, cues, phase, tick, sourceEntityId, targetEntityId) {
|
|
6
|
+
const cueIds = getCueIdsForPhase(cues, phase);
|
|
7
|
+
for (const cueId of cueIds) {
|
|
8
|
+
buffer.events.push({
|
|
9
|
+
tick,
|
|
10
|
+
cueId,
|
|
11
|
+
sourceEntityId,
|
|
12
|
+
targetEntityId,
|
|
13
|
+
phase,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstanceIdCounter.d.ts","sourceRoot":"","sources":["../../src/runtime/InstanceIdCounter.ts"],"names":[],"mappings":"AAWA,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,KAAK,CAAK;IAEX,IAAI,IAAI,MAAM;IAMrB,IAAW,OAAO,IAAI,MAAM,CAE3B;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { InstanceIdCounter } from './InstanceIdCounter';
|
|
2
|
+
export { createAbilitySystemRuntime } from './AbilitySystemRuntime';
|
|
3
|
+
export { appendGameplayCueEvents, createGameplayCueBuffer, } from './GameplayCueBuffer';
|
|
4
|
+
export type { AbilityActivationRequest, AbilitySystemRuntime, ResolvedAbilityActivationRecord, } from './AbilitySystemRuntime';
|
|
5
|
+
export type { GameplayCueBuffer, GameplayCueBufferView, } from './GameplayCueBuffer';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,wBAAwB,EACxB,oBAAoB,EACpB,+BAA+B,GAChC,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GameSystem } from '@phalanx-engine/ecs';
|
|
2
|
+
import type { AbilitySystemRegistries } from '../registry';
|
|
3
|
+
import type { AbilitySystemRuntime } from '../runtime';
|
|
4
|
+
export declare class AbilityActivationSystem extends GameSystem {
|
|
5
|
+
private readonly registries;
|
|
6
|
+
private readonly runtime;
|
|
7
|
+
private readonly inFlightTagsByCaster;
|
|
8
|
+
private readonly inFlightCostsByCaster;
|
|
9
|
+
private targetResolver;
|
|
10
|
+
constructor(registries: AbilitySystemRegistries, runtime: AbilitySystemRuntime);
|
|
11
|
+
processTick(tick: number): void;
|
|
12
|
+
private processOne;
|
|
13
|
+
private canActivate;
|
|
14
|
+
private canAffordCost;
|
|
15
|
+
private isOffCooldown;
|
|
16
|
+
private enqueueCasterEffects;
|
|
17
|
+
private enqueueEffect;
|
|
18
|
+
private getOrCreateActiveEffects;
|
|
19
|
+
private recordCooldownInFlight;
|
|
20
|
+
private recordCostInFlight;
|
|
21
|
+
private resolveTargets;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=AbilityActivationSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbilityActivationSystem.d.ts","sourceRoot":"","sources":["../../src/systems/AbilityActivationSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAYjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAEV,oBAAoB,EAErB,MAAM,YAAY,CAAC;AA4DpB,qBAAa,uBAAwB,SAAQ,UAAU;IAkBnD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAjB1B,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAkC;IAKvE,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAA0C;IAQhF,OAAO,CAAC,cAAc,CAA6B;gBAGhC,UAAU,EAAE,uBAAuB,EACnC,OAAO,EAAE,oBAAoB;IAKhC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAiE/C,OAAO,CAAC,UAAU;IAoFlB,OAAO,CAAC,WAAW;IA0DnB,OAAO,CAAC,aAAa;IAmErB,OAAO,CAAC,aAAa;IA6BrB,OAAO,CAAC,oBAAoB;IAqB5B,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,wBAAwB;IAWhC,OAAO,CAAC,sBAAsB;IAkB9B,OAAO,CAAC,kBAAkB;IAwC1B,OAAO,CAAC,cAAc;CAcvB"}
|