diff --git a/src/samples/slay-the-spire-like/data/desert/card.csv.d.ts b/src/samples/slay-the-spire-like/data/desert/card.csv.d.ts index d8fc3cb..73e3189 100644 --- a/src/samples/slay-the-spire-like/data/desert/card.csv.d.ts +++ b/src/samples/slay-the-spire-like/data/desert/card.csv.d.ts @@ -1,8 +1,8 @@ import type { CardEffect } from './cardEffect.csv'; -export type CardType = "item" | "status"; -export type CardCostType = "energy" | "uses" | "none"; -export type CardTargetType = "player" | "enemy" | "enemies"; +export type CardType = 'item' | 'status'; +export type CardCostType = 'energy' | 'uses' | 'none'; +export type CardTargetType = 'player' | 'enemy' | 'enemies'; type CardTable = readonly { readonly id: string; diff --git a/src/samples/slay-the-spire-like/data/desert/cardEffect.csv.d.ts b/src/samples/slay-the-spire-like/data/desert/cardEffect.csv.d.ts index 52dca3f..72f7e92 100644 --- a/src/samples/slay-the-spire-like/data/desert/cardEffect.csv.d.ts +++ b/src/samples/slay-the-spire-like/data/desert/cardEffect.csv.d.ts @@ -1,8 +1,8 @@ import type { Card } from './card.csv'; import type { Effect } from './effect.csv'; -export type CardEffectTrigger = "onPlay" | "onDraw" | "onDiscard"; -export type CardEffectTarget = "user" | "eachTarget" | "eachEnemy" | "randomEnemy" | "player"; +export type CardEffectTrigger = 'onPlay' | 'onDraw' | 'onDiscard'; +export type CardEffectTarget = 'user' | 'eachTarget' | 'eachEnemy' | 'randomEnemy' | 'player'; export type CardEffectList = [effect: Effect, stacks: number][]; type CardEffectTable = readonly { diff --git a/src/samples/slay-the-spire-like/data/desert/effect.csv.d.ts b/src/samples/slay-the-spire-like/data/desert/effect.csv.d.ts index 989f2d5..1efb29e 100644 --- a/src/samples/slay-the-spire-like/data/desert/effect.csv.d.ts +++ b/src/samples/slay-the-spire-like/data/desert/effect.csv.d.ts @@ -1,4 +1,4 @@ -export type EffectLifecycle = "instant" | "temporary" | "lingering" | "permanent" | "posture" | "item" | "itemTemporary" | "itemUntilPlay" | "itemUntilDiscard" | "itemPermanent"; +export type EffectLifecycle = 'instant' | 'temporary' | 'lingering' | 'permanent' | 'posture' | 'item' | 'itemTemporary' | 'itemUntilPlay' | 'itemUntilDiscard' | 'itemPermanent'; type EffectTable = readonly { readonly id: string; diff --git a/src/samples/slay-the-spire-like/data/desert/encounter.csv.d.ts b/src/samples/slay-the-spire-like/data/desert/encounter.csv.d.ts index 9c00853..c3f5ca2 100644 --- a/src/samples/slay-the-spire-like/data/desert/encounter.csv.d.ts +++ b/src/samples/slay-the-spire-like/data/desert/encounter.csv.d.ts @@ -1,8 +1,8 @@ import type { Enemy } from './enemy.csv'; import type { Effect } from './effect.csv'; -export type EncounterType = "minion" | "elite" | "event" | "shop" | "camp" | "curio"; -export type EnemyList = [data: Enemy, hp: number, effects: [effect: Effect, stacks: number][]][]; +export type EncounterType = 'minion' | 'elite' | 'event' | 'shop' | 'camp' | 'curio'; +export type EnemyList = [data: Enemy, hp: int, effects: [effect: Effect, stacks: int][]][]; type EncounterTable = readonly { readonly id: string; diff --git a/src/samples/slay-the-spire-like/data/desert/intent.csv.d.ts b/src/samples/slay-the-spire-like/data/desert/intent.csv.d.ts index fec85d7..52143e0 100644 --- a/src/samples/slay-the-spire-like/data/desert/intent.csv.d.ts +++ b/src/samples/slay-the-spire-like/data/desert/intent.csv.d.ts @@ -1,9 +1,9 @@ import type { Enemy } from './enemy.csv'; import type { Effect } from './effect.csv'; -export type IntentEffectTarget = "user" | "eachEnemy" | "randomEnemy" | "player"; -export type IntentEffect = ["user" | "eachEnemy" | "randomEnemy" | "player", Effect, number]; -export type IntentEffectList = ["user" | "eachEnemy" | "randomEnemy" | "player", Effect, number][]; +export type IntentEffectTarget = 'user' | 'eachEnemy' | 'randomEnemy' | 'player'; +export type IntentEffect = [IntentEffectTarget, Effect, number]; +export type IntentEffectList = IntentEffect[]; type IntentTable = readonly { readonly id: string; diff --git a/src/samples/slay-the-spire-like/system/types.ts b/src/samples/slay-the-spire-like/system/types.ts index 6dd49cc..3e87a0a 100644 --- a/src/samples/slay-the-spire-like/system/types.ts +++ b/src/samples/slay-the-spire-like/system/types.ts @@ -1,89 +1,23 @@ -export type EffectData = { - readonly id: string; - readonly name: string; - readonly description: string; - readonly lifecycle: EffectLifecycle; -}; -export type EffectLifecycle = - | "instant" - | "temporary" - | "lingering" - | "permanent" - | "posture" - | "item" - | "itemTemporary" - | "itemUntilPlay" - | "itemUntilDiscard" - | "itemPermanent"; +import { + Card, + Effect, + Encounter, + EncounterType, + Enemy, + Intent, + Item, +} from "../data/desert"; -export type EnemyData = { - readonly id: string; - readonly name: string; - readonly intents: readonly IntentData[]; - readonly description: string; -}; +export type CardData = Card; +export type ItemData = Item; +export type EffectData = Effect; +export type IntentData = Intent; +export type EnemyData = Enemy; +export type EncounterData = + Encounter & { type: T }; -export type CardType = "item" | "status"; -export type CardCostType = "energy" | "uses" | "none"; -export type CardTargetType = "single" | "none"; -export type EffectTarget = "self" | "player" | "team"; - -export type CardEffectTrigger = "onPlay" | "onDraw" | "onDiscard"; -export type CardEffectTarget = "self" | "target" | "all" | "random"; - -export type CardEffect = { - readonly id: string; - readonly trigger: CardEffectTrigger; - readonly target: CardEffectTarget; - readonly effects: readonly [EffectData, number][]; -}; - -export type CardData = { - readonly id: string; - readonly name: string; - readonly desc: string; - readonly type: CardType; - readonly costType: CardCostType; - readonly costCount: number; - readonly targetType: CardTargetType; - readonly effects: readonly CardEffect[]; -}; - -export type EncounterType = - | "minion" - | "elite" - | "event" - | "shop" - | "camp" - | "curio"; -export type EncounterData = { - readonly id: string; - readonly type: T; - readonly name: string; - readonly description: string; - readonly enemies: readonly [ - data: EnemyData, - hp: number, - effects: [EffectData, stacks: number][], - ][]; - readonly dialogue: string; -}; - -export type IntentData = { - readonly id: string; - readonly enemy: EnemyData; - readonly initialIntent: boolean; - readonly nextIntents: readonly IntentData[]; - readonly brokenIntent: readonly IntentData[]; - readonly effects: readonly [EffectTarget, EffectData, number][]; -}; - -export type ItemData = { - readonly id: string; - readonly type: string; - readonly name: string; - readonly shape: string; - readonly card: CardData; - readonly price: number; - readonly description: string; -}; +export { + CardTargetType, + CardEffectTarget, + IntentEffectTarget, +} from "../data/desert";