@mythxengine/types 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/LICENSE +21 -0
- package/dist/__tests__/rules.test.d.ts +5 -0
- package/dist/__tests__/rules.test.d.ts.map +1 -0
- package/dist/__tests__/rules.test.js +278 -0
- package/dist/__tests__/rules.test.js.map +1 -0
- package/dist/__tests__/time.test.d.ts +2 -0
- package/dist/__tests__/time.test.d.ts.map +1 -0
- package/dist/__tests__/time.test.js +125 -0
- package/dist/__tests__/time.test.js.map +1 -0
- package/dist/game/abilities.d.ts +77 -0
- package/dist/game/abilities.d.ts.map +1 -0
- package/dist/game/abilities.js +38 -0
- package/dist/game/abilities.js.map +1 -0
- package/dist/game/actions.d.ts +84 -0
- package/dist/game/actions.d.ts.map +1 -0
- package/dist/game/actions.js +10 -0
- package/dist/game/actions.js.map +1 -0
- package/dist/game/character.d.ts +128 -0
- package/dist/game/character.d.ts.map +1 -0
- package/dist/game/character.js +16 -0
- package/dist/game/character.js.map +1 -0
- package/dist/game/combat.d.ts +56 -0
- package/dist/game/combat.d.ts.map +1 -0
- package/dist/game/combat.js +5 -0
- package/dist/game/combat.js.map +1 -0
- package/dist/game/conditions.d.ts +216 -0
- package/dist/game/conditions.d.ts.map +1 -0
- package/dist/game/conditions.js +99 -0
- package/dist/game/conditions.js.map +1 -0
- package/dist/game/dice.d.ts +87 -0
- package/dist/game/dice.d.ts.map +1 -0
- package/dist/game/dice.js +13 -0
- package/dist/game/dice.js.map +1 -0
- package/dist/game/events.d.ts +85 -0
- package/dist/game/events.d.ts.map +1 -0
- package/dist/game/events.js +10 -0
- package/dist/game/events.js.map +1 -0
- package/dist/game/index.d.ts +13 -0
- package/dist/game/index.d.ts.map +1 -0
- package/dist/game/index.js +13 -0
- package/dist/game/index.js.map +1 -0
- package/dist/game/player.d.ts +110 -0
- package/dist/game/player.d.ts.map +1 -0
- package/dist/game/player.js +45 -0
- package/dist/game/player.js.map +1 -0
- package/dist/game/state.d.ts +99 -0
- package/dist/game/state.d.ts.map +1 -0
- package/dist/game/state.js +60 -0
- package/dist/game/state.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/rules/abilities.d.ts +82 -0
- package/dist/rules/abilities.d.ts.map +1 -0
- package/dist/rules/abilities.js +94 -0
- package/dist/rules/abilities.js.map +1 -0
- package/dist/rules/custom-tests.d.ts +163 -0
- package/dist/rules/custom-tests.d.ts.map +1 -0
- package/dist/rules/custom-tests.js +43 -0
- package/dist/rules/custom-tests.js.map +1 -0
- package/dist/rules/difficulties.d.ts +51 -0
- package/dist/rules/difficulties.d.ts.map +1 -0
- package/dist/rules/difficulties.js +77 -0
- package/dist/rules/difficulties.js.map +1 -0
- package/dist/rules/index.d.ts +123 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +170 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/mechanics.d.ts +130 -0
- package/dist/rules/mechanics.d.ts.map +1 -0
- package/dist/rules/mechanics.js +64 -0
- package/dist/rules/mechanics.js.map +1 -0
- package/dist/session/index.d.ts +228 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +60 -0
- package/dist/session/index.js.map +1 -0
- package/dist/tools/contract.d.ts +63 -0
- package/dist/tools/contract.d.ts.map +1 -0
- package/dist/tools/contract.js +36 -0
- package/dist/tools/contract.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Game actions - dispatched to engine
|
|
3
|
+
*/
|
|
4
|
+
import type { Effect } from "./conditions.js";
|
|
5
|
+
/**
|
|
6
|
+
* All actions that can be dispatched to the engine
|
|
7
|
+
* Discriminated union for type-safe handling
|
|
8
|
+
*/
|
|
9
|
+
export type GameAction = MoveAction | InteractAction | SkillTestAction | AttackAction | DefendAction | UseAbilityAction | UseItemAction | RestAction | FleeAction | DialogueAction | GMOverrideAction;
|
|
10
|
+
/** Move to a new location */
|
|
11
|
+
export interface MoveAction {
|
|
12
|
+
type: "MOVE";
|
|
13
|
+
locationId: string;
|
|
14
|
+
}
|
|
15
|
+
/** Interact with an object or NPC */
|
|
16
|
+
export interface InteractAction {
|
|
17
|
+
type: "INTERACT";
|
|
18
|
+
targetId: string;
|
|
19
|
+
approach: string;
|
|
20
|
+
}
|
|
21
|
+
/** Perform a skill test */
|
|
22
|
+
export interface SkillTestAction {
|
|
23
|
+
type: "SKILL_TEST";
|
|
24
|
+
characterId: string;
|
|
25
|
+
skill: string;
|
|
26
|
+
difficulty: number;
|
|
27
|
+
context: string;
|
|
28
|
+
}
|
|
29
|
+
/** Attack a target */
|
|
30
|
+
export interface AttackAction {
|
|
31
|
+
type: "ATTACK";
|
|
32
|
+
characterId: string;
|
|
33
|
+
targetId: string;
|
|
34
|
+
weaponIndex: number;
|
|
35
|
+
}
|
|
36
|
+
/** Take defensive stance */
|
|
37
|
+
export interface DefendAction {
|
|
38
|
+
type: "DEFEND";
|
|
39
|
+
characterId: string;
|
|
40
|
+
}
|
|
41
|
+
/** Use a special ability */
|
|
42
|
+
export interface UseAbilityAction {
|
|
43
|
+
type: "USE_ABILITY";
|
|
44
|
+
characterId: string;
|
|
45
|
+
abilityId: string;
|
|
46
|
+
targetId?: string;
|
|
47
|
+
}
|
|
48
|
+
/** Use an item */
|
|
49
|
+
export interface UseItemAction {
|
|
50
|
+
type: "USE_ITEM";
|
|
51
|
+
characterId: string;
|
|
52
|
+
itemName: string;
|
|
53
|
+
targetId?: string;
|
|
54
|
+
}
|
|
55
|
+
/** Rest to recover */
|
|
56
|
+
export interface RestAction {
|
|
57
|
+
type: "REST";
|
|
58
|
+
restType: "short" | "long";
|
|
59
|
+
}
|
|
60
|
+
/** Flee from combat */
|
|
61
|
+
export interface FleeAction {
|
|
62
|
+
type: "FLEE";
|
|
63
|
+
characterId: string;
|
|
64
|
+
}
|
|
65
|
+
/** Engage in dialogue */
|
|
66
|
+
export interface DialogueAction {
|
|
67
|
+
type: "DIALOGUE";
|
|
68
|
+
npcId: string;
|
|
69
|
+
message: string;
|
|
70
|
+
}
|
|
71
|
+
/** GM override for narrative effects */
|
|
72
|
+
export interface GMOverrideAction {
|
|
73
|
+
type: "GM_OVERRIDE";
|
|
74
|
+
effect: Effect;
|
|
75
|
+
narrative: string;
|
|
76
|
+
}
|
|
77
|
+
export type ActionType = GameAction["type"];
|
|
78
|
+
/**
|
|
79
|
+
* Type guard to check action type
|
|
80
|
+
*/
|
|
81
|
+
export declare function isActionType<T extends ActionType>(action: GameAction, type: T): action is Extract<GameAction, {
|
|
82
|
+
type: T;
|
|
83
|
+
}>;
|
|
84
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/game/actions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,UAAU,GAClB,UAAU,GACV,cAAc,GACd,eAAe,GACf,YAAY,GACZ,YAAY,GACZ,gBAAgB,GAChB,aAAa,GACb,UAAU,GACV,UAAU,GACV,cAAc,GACd,gBAAgB,CAAC;AAErB,6BAA6B;AAC7B,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qCAAqC;AACrC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,2BAA2B;AAC3B,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC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,YAAY,CAAC,CAAC,SAAS,UAAU,EAC/C,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,CAAC,GACN,MAAM,IAAI,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAE5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/game/actions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAqGH;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAkB,EAClB,IAAO;IAEP,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Character types
|
|
3
|
+
*/
|
|
4
|
+
import type { Abilities, AbilityName } from "./abilities.js";
|
|
5
|
+
import type { Condition, Effect } from "./conditions.js";
|
|
6
|
+
/**
|
|
7
|
+
* Character psychology for story weaving
|
|
8
|
+
* These elements allow the GM to personalize the narrative
|
|
9
|
+
*/
|
|
10
|
+
export interface CharacterPsychology {
|
|
11
|
+
/** What terrifies or deeply unsettles the character */
|
|
12
|
+
fears: string[];
|
|
13
|
+
/** Current objectives the character is pursuing */
|
|
14
|
+
goals: string[];
|
|
15
|
+
/** Long-term dreams and desires */
|
|
16
|
+
ambitions: string[];
|
|
17
|
+
/** People, places, or ideals the character cares about */
|
|
18
|
+
bonds: string[];
|
|
19
|
+
/** Weaknesses that can be exploited or cause trouble */
|
|
20
|
+
flaws: string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create an empty psychology (for characters without defined psychology)
|
|
24
|
+
*/
|
|
25
|
+
export declare function createEmptyPsychology(): CharacterPsychology;
|
|
26
|
+
/**
|
|
27
|
+
* A skill provides a bonus to related tests
|
|
28
|
+
*/
|
|
29
|
+
export interface Skill {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
ability: AbilityName;
|
|
33
|
+
bonus: number;
|
|
34
|
+
description: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Special ability granted by archetype or advancement
|
|
38
|
+
*/
|
|
39
|
+
export interface SpecialAbility {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
description: string;
|
|
43
|
+
usage: "passive" | "per_scene" | "per_session" | "per_day";
|
|
44
|
+
usesRemaining?: number;
|
|
45
|
+
effect: Effect;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Character equipment (narrative, not itemized)
|
|
49
|
+
*/
|
|
50
|
+
export interface CharacterEquipment {
|
|
51
|
+
/** e.g., ["Katana (d8)", "Pistol (d6)"] */
|
|
52
|
+
weapons: string[];
|
|
53
|
+
/** e.g., "Light armor (+1 defense)" */
|
|
54
|
+
armor: string | null;
|
|
55
|
+
/** e.g., ["Medkit", "Grappling hook"] */
|
|
56
|
+
gear: string[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A playable character (PC or NPC)
|
|
60
|
+
*/
|
|
61
|
+
export interface Character {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
archetypeId: string;
|
|
65
|
+
abilities: Abilities;
|
|
66
|
+
hp: {
|
|
67
|
+
current: number;
|
|
68
|
+
max: number;
|
|
69
|
+
};
|
|
70
|
+
skills: Skill[];
|
|
71
|
+
specialAbilities: SpecialAbility[];
|
|
72
|
+
equipment: CharacterEquipment;
|
|
73
|
+
conditions: Condition[];
|
|
74
|
+
flags: string[];
|
|
75
|
+
personality: string[];
|
|
76
|
+
background: string;
|
|
77
|
+
psychology: CharacterPsychology;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A weapon for combat
|
|
81
|
+
*/
|
|
82
|
+
export interface Weapon {
|
|
83
|
+
name: string;
|
|
84
|
+
damage: string;
|
|
85
|
+
ability: AbilityName;
|
|
86
|
+
skill?: string;
|
|
87
|
+
properties?: string[];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Narrative role an NPC plays in the story
|
|
91
|
+
*/
|
|
92
|
+
export type NarrativeRole = "quest_giver" | "ally" | "obstacle" | "information" | "antagonist" | "merchant" | "background";
|
|
93
|
+
/**
|
|
94
|
+
* An NPC (non-player character)
|
|
95
|
+
*/
|
|
96
|
+
export interface NPC {
|
|
97
|
+
id: string;
|
|
98
|
+
name: string;
|
|
99
|
+
description: string;
|
|
100
|
+
personality: string;
|
|
101
|
+
motivation: string;
|
|
102
|
+
attitude: "friendly" | "neutral" | "hostile" | "unknown";
|
|
103
|
+
dialogueHints: string[];
|
|
104
|
+
/** Role this NPC plays in the narrative */
|
|
105
|
+
narrativeRole: NarrativeRole;
|
|
106
|
+
/** Scene IDs where this NPC appears */
|
|
107
|
+
sceneAppearances?: string[];
|
|
108
|
+
/** Character IDs this NPC has relationships with */
|
|
109
|
+
relationships?: Record<string, string>;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* An enemy combatant
|
|
113
|
+
*/
|
|
114
|
+
export interface Enemy {
|
|
115
|
+
id: string;
|
|
116
|
+
name: string;
|
|
117
|
+
description: string;
|
|
118
|
+
abilities: Abilities;
|
|
119
|
+
hp: {
|
|
120
|
+
current: number;
|
|
121
|
+
max: number;
|
|
122
|
+
};
|
|
123
|
+
armor: number;
|
|
124
|
+
attacks: Weapon[];
|
|
125
|
+
conditions: Condition[];
|
|
126
|
+
threat: "minion" | "standard" | "elite" | "boss";
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=character.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"character.d.ts","sourceRoot":"","sources":["../../src/game/character.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzD;;;GAGG;AACH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AAS,EAAE,SAAS,CAAC;IACrB,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;CAClD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Character types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Create an empty psychology (for characters without defined psychology)
|
|
6
|
+
*/
|
|
7
|
+
export function createEmptyPsychology() {
|
|
8
|
+
return {
|
|
9
|
+
fears: [],
|
|
10
|
+
goals: [],
|
|
11
|
+
ambitions: [],
|
|
12
|
+
bonds: [],
|
|
13
|
+
flaws: [],
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=character.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"character.js","sourceRoot":"","sources":["../../src/game/character.ts"],"names":[],"mappings":"AAAA;;GAEG;AAsBH;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,EAAE;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combat types
|
|
3
|
+
*/
|
|
4
|
+
import type { DiceResult, RollAdvantageState } from "./dice.js";
|
|
5
|
+
/**
|
|
6
|
+
* Combat state when combat is active
|
|
7
|
+
*/
|
|
8
|
+
export interface CombatState {
|
|
9
|
+
active: boolean;
|
|
10
|
+
round: number;
|
|
11
|
+
/** Character/enemy IDs in initiative order */
|
|
12
|
+
turnOrder: string[];
|
|
13
|
+
/** ID of current actor */
|
|
14
|
+
currentTurnId: string;
|
|
15
|
+
/** Index in turn order */
|
|
16
|
+
turnIndex: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Result of an initiative roll
|
|
20
|
+
*/
|
|
21
|
+
export interface InitiativeResult {
|
|
22
|
+
characterId: string;
|
|
23
|
+
roll: DiceResult;
|
|
24
|
+
total: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Damage modification due to resistance/vulnerability
|
|
28
|
+
*/
|
|
29
|
+
export interface DamageModification {
|
|
30
|
+
originalDamage: number;
|
|
31
|
+
finalDamage: number;
|
|
32
|
+
reason: "resistance" | "vulnerability";
|
|
33
|
+
damageType: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Result of an attack
|
|
37
|
+
*/
|
|
38
|
+
export interface AttackResult {
|
|
39
|
+
hit: boolean;
|
|
40
|
+
roll: DiceResult;
|
|
41
|
+
damage?: number;
|
|
42
|
+
critical?: "hit" | "miss";
|
|
43
|
+
defenderHpRemaining?: number;
|
|
44
|
+
/** The advantage state used for this attack */
|
|
45
|
+
advantageState: RollAdvantageState;
|
|
46
|
+
/** Damage modification info if resistance/vulnerability applied */
|
|
47
|
+
damageModification?: DamageModification;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Result of a defense action
|
|
51
|
+
*/
|
|
52
|
+
export interface DefenseResult {
|
|
53
|
+
bonus: number;
|
|
54
|
+
duration: number;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=combat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combat.d.ts","sourceRoot":"","sources":["../../src/game/combat.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,0BAA0B;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,GAAG,eAAe,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,+CAA+C;IAC/C,cAAc,EAAE,kBAAkB,CAAC;IACnC,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combat.js","sourceRoot":"","sources":["../../src/game/combat.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conditions and effects
|
|
3
|
+
*/
|
|
4
|
+
import type { AbilityName } from "./abilities.js";
|
|
5
|
+
import type { GameTime } from "./state.js";
|
|
6
|
+
/**
|
|
7
|
+
* A status condition on a character
|
|
8
|
+
*/
|
|
9
|
+
export interface Condition {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
duration: number | "permanent" | "until_rest";
|
|
14
|
+
effects: Effect[];
|
|
15
|
+
stackable: boolean;
|
|
16
|
+
/** Optional: game time when this condition expires (for time-based conditions) */
|
|
17
|
+
expiresAtGameTime?: GameTime;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Scope for advantage/disadvantage effects
|
|
21
|
+
*/
|
|
22
|
+
export type AdvantageScope = "attacks" | "defense" | "skill_tests" | "all";
|
|
23
|
+
/**
|
|
24
|
+
* An effect that modifies game state
|
|
25
|
+
*/
|
|
26
|
+
export type Effect = {
|
|
27
|
+
type: "MODIFY_ABILITY";
|
|
28
|
+
ability: AbilityName;
|
|
29
|
+
amount: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: "MODIFY_SKILL";
|
|
32
|
+
skillId: string;
|
|
33
|
+
amount: number;
|
|
34
|
+
} | {
|
|
35
|
+
type: "MODIFY_HP";
|
|
36
|
+
amount: number;
|
|
37
|
+
} | {
|
|
38
|
+
type: "MODIFY_DEFENSE";
|
|
39
|
+
amount: number;
|
|
40
|
+
} | {
|
|
41
|
+
type: "ADD_CONDITION";
|
|
42
|
+
conditionId: string;
|
|
43
|
+
} | {
|
|
44
|
+
type: "REMOVE_CONDITION";
|
|
45
|
+
conditionId: string;
|
|
46
|
+
} | {
|
|
47
|
+
type: "SET_FLAG";
|
|
48
|
+
flag: string;
|
|
49
|
+
value: boolean;
|
|
50
|
+
} | {
|
|
51
|
+
type: "DEAL_DAMAGE";
|
|
52
|
+
targetId: string;
|
|
53
|
+
amount: number | string;
|
|
54
|
+
damageType: string;
|
|
55
|
+
} | {
|
|
56
|
+
type: "HEAL";
|
|
57
|
+
targetId: string;
|
|
58
|
+
amount: number | string;
|
|
59
|
+
} | {
|
|
60
|
+
type: "NARRATIVE";
|
|
61
|
+
text: string;
|
|
62
|
+
} | {
|
|
63
|
+
type: "GRANT_ADVANTAGE";
|
|
64
|
+
scope: AdvantageScope;
|
|
65
|
+
skills?: string[];
|
|
66
|
+
} | {
|
|
67
|
+
type: "GRANT_DISADVANTAGE";
|
|
68
|
+
scope: AdvantageScope;
|
|
69
|
+
skills?: string[];
|
|
70
|
+
} | {
|
|
71
|
+
type: "RESISTANCE";
|
|
72
|
+
damageType: string;
|
|
73
|
+
multiplier?: number;
|
|
74
|
+
} | {
|
|
75
|
+
type: "VULNERABILITY";
|
|
76
|
+
damageType: string;
|
|
77
|
+
multiplier?: number;
|
|
78
|
+
};
|
|
79
|
+
export type EffectType = Effect["type"];
|
|
80
|
+
/**
|
|
81
|
+
* Common conditions
|
|
82
|
+
*/
|
|
83
|
+
export declare const COMMON_CONDITIONS: {
|
|
84
|
+
readonly WOUNDED: {
|
|
85
|
+
readonly id: "wounded";
|
|
86
|
+
readonly name: "Wounded";
|
|
87
|
+
readonly description: "-1 to all tests";
|
|
88
|
+
readonly duration: "until_rest";
|
|
89
|
+
readonly effects: readonly [{
|
|
90
|
+
readonly type: "MODIFY_ABILITY";
|
|
91
|
+
readonly ability: "STR";
|
|
92
|
+
readonly amount: -1;
|
|
93
|
+
}, {
|
|
94
|
+
readonly type: "MODIFY_ABILITY";
|
|
95
|
+
readonly ability: "AGI";
|
|
96
|
+
readonly amount: -1;
|
|
97
|
+
}, {
|
|
98
|
+
readonly type: "MODIFY_ABILITY";
|
|
99
|
+
readonly ability: "WIT";
|
|
100
|
+
readonly amount: -1;
|
|
101
|
+
}, {
|
|
102
|
+
readonly type: "MODIFY_ABILITY";
|
|
103
|
+
readonly ability: "CON";
|
|
104
|
+
readonly amount: -1;
|
|
105
|
+
}];
|
|
106
|
+
readonly stackable: false;
|
|
107
|
+
};
|
|
108
|
+
readonly STUNNED: {
|
|
109
|
+
readonly id: "stunned";
|
|
110
|
+
readonly name: "Stunned";
|
|
111
|
+
readonly description: "Skip next turn";
|
|
112
|
+
readonly duration: 1;
|
|
113
|
+
readonly effects: readonly [];
|
|
114
|
+
readonly stackable: false;
|
|
115
|
+
};
|
|
116
|
+
readonly FRIGHTENED: {
|
|
117
|
+
readonly id: "frightened";
|
|
118
|
+
readonly name: "Frightened";
|
|
119
|
+
readonly description: "-2 to attacks, can't approach source";
|
|
120
|
+
readonly duration: 3;
|
|
121
|
+
readonly effects: readonly [{
|
|
122
|
+
readonly type: "MODIFY_SKILL";
|
|
123
|
+
readonly skillId: "combat";
|
|
124
|
+
readonly amount: -2;
|
|
125
|
+
}];
|
|
126
|
+
readonly stackable: false;
|
|
127
|
+
};
|
|
128
|
+
readonly INSPIRED: {
|
|
129
|
+
readonly id: "inspired";
|
|
130
|
+
readonly name: "Inspired";
|
|
131
|
+
readonly description: "+2 to all tests until end of scene";
|
|
132
|
+
readonly duration: "until_rest";
|
|
133
|
+
readonly effects: readonly [{
|
|
134
|
+
readonly type: "MODIFY_ABILITY";
|
|
135
|
+
readonly ability: "STR";
|
|
136
|
+
readonly amount: 2;
|
|
137
|
+
}, {
|
|
138
|
+
readonly type: "MODIFY_ABILITY";
|
|
139
|
+
readonly ability: "AGI";
|
|
140
|
+
readonly amount: 2;
|
|
141
|
+
}, {
|
|
142
|
+
readonly type: "MODIFY_ABILITY";
|
|
143
|
+
readonly ability: "WIT";
|
|
144
|
+
readonly amount: 2;
|
|
145
|
+
}, {
|
|
146
|
+
readonly type: "MODIFY_ABILITY";
|
|
147
|
+
readonly ability: "CON";
|
|
148
|
+
readonly amount: 2;
|
|
149
|
+
}];
|
|
150
|
+
readonly stackable: false;
|
|
151
|
+
};
|
|
152
|
+
readonly BLESSED: {
|
|
153
|
+
readonly id: "blessed";
|
|
154
|
+
readonly name: "Blessed";
|
|
155
|
+
readonly description: "Advantage on all rolls";
|
|
156
|
+
readonly duration: 3;
|
|
157
|
+
readonly effects: readonly [{
|
|
158
|
+
readonly type: "GRANT_ADVANTAGE";
|
|
159
|
+
readonly scope: "all";
|
|
160
|
+
}];
|
|
161
|
+
readonly stackable: false;
|
|
162
|
+
};
|
|
163
|
+
readonly CURSED: {
|
|
164
|
+
readonly id: "cursed";
|
|
165
|
+
readonly name: "Cursed";
|
|
166
|
+
readonly description: "Disadvantage on all rolls";
|
|
167
|
+
readonly duration: 3;
|
|
168
|
+
readonly effects: readonly [{
|
|
169
|
+
readonly type: "GRANT_DISADVANTAGE";
|
|
170
|
+
readonly scope: "all";
|
|
171
|
+
}];
|
|
172
|
+
readonly stackable: false;
|
|
173
|
+
};
|
|
174
|
+
readonly HIDDEN: {
|
|
175
|
+
readonly id: "hidden";
|
|
176
|
+
readonly name: "Hidden";
|
|
177
|
+
readonly description: "Advantage on attacks until revealed";
|
|
178
|
+
readonly duration: "until_rest";
|
|
179
|
+
readonly effects: readonly [{
|
|
180
|
+
readonly type: "GRANT_ADVANTAGE";
|
|
181
|
+
readonly scope: "attacks";
|
|
182
|
+
}];
|
|
183
|
+
readonly stackable: false;
|
|
184
|
+
};
|
|
185
|
+
readonly FIRE_RESISTANT: {
|
|
186
|
+
readonly id: "fire_resistant";
|
|
187
|
+
readonly name: "Fire Resistant";
|
|
188
|
+
readonly description: "Takes half damage from fire";
|
|
189
|
+
readonly duration: "permanent";
|
|
190
|
+
readonly effects: readonly [{
|
|
191
|
+
readonly type: "RESISTANCE";
|
|
192
|
+
readonly damageType: "fire";
|
|
193
|
+
}];
|
|
194
|
+
readonly stackable: false;
|
|
195
|
+
};
|
|
196
|
+
readonly FIRE_VULNERABLE: {
|
|
197
|
+
readonly id: "fire_vulnerable";
|
|
198
|
+
readonly name: "Fire Vulnerable";
|
|
199
|
+
readonly description: "Takes double damage from fire";
|
|
200
|
+
readonly duration: "permanent";
|
|
201
|
+
readonly effects: readonly [{
|
|
202
|
+
readonly type: "VULNERABILITY";
|
|
203
|
+
readonly damageType: "fire";
|
|
204
|
+
}];
|
|
205
|
+
readonly stackable: false;
|
|
206
|
+
};
|
|
207
|
+
readonly PRONE: {
|
|
208
|
+
readonly id: "prone";
|
|
209
|
+
readonly name: "Prone";
|
|
210
|
+
readonly description: "Attackers have advantage (melee) or disadvantage (ranged)";
|
|
211
|
+
readonly duration: "permanent";
|
|
212
|
+
readonly effects: readonly [];
|
|
213
|
+
readonly stackable: false;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
//# sourceMappingURL=conditions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../src/game/conditions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,YAAY,CAAC;IAC9C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,kFAAkF;IAClF,iBAAiB,CAAC,EAAE,QAAQ,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,KAAK,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,MAAM,GACd;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAChE;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC1C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2FpB,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conditions and effects
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Common conditions
|
|
6
|
+
*/
|
|
7
|
+
export const COMMON_CONDITIONS = {
|
|
8
|
+
WOUNDED: {
|
|
9
|
+
id: "wounded",
|
|
10
|
+
name: "Wounded",
|
|
11
|
+
description: "-1 to all tests",
|
|
12
|
+
duration: "until_rest",
|
|
13
|
+
effects: [
|
|
14
|
+
{ type: "MODIFY_ABILITY", ability: "STR", amount: -1 },
|
|
15
|
+
{ type: "MODIFY_ABILITY", ability: "AGI", amount: -1 },
|
|
16
|
+
{ type: "MODIFY_ABILITY", ability: "WIT", amount: -1 },
|
|
17
|
+
{ type: "MODIFY_ABILITY", ability: "CON", amount: -1 },
|
|
18
|
+
],
|
|
19
|
+
stackable: false,
|
|
20
|
+
},
|
|
21
|
+
STUNNED: {
|
|
22
|
+
id: "stunned",
|
|
23
|
+
name: "Stunned",
|
|
24
|
+
description: "Skip next turn",
|
|
25
|
+
duration: 1,
|
|
26
|
+
effects: [],
|
|
27
|
+
stackable: false,
|
|
28
|
+
},
|
|
29
|
+
FRIGHTENED: {
|
|
30
|
+
id: "frightened",
|
|
31
|
+
name: "Frightened",
|
|
32
|
+
description: "-2 to attacks, can't approach source",
|
|
33
|
+
duration: 3,
|
|
34
|
+
effects: [{ type: "MODIFY_SKILL", skillId: "combat", amount: -2 }],
|
|
35
|
+
stackable: false,
|
|
36
|
+
},
|
|
37
|
+
INSPIRED: {
|
|
38
|
+
id: "inspired",
|
|
39
|
+
name: "Inspired",
|
|
40
|
+
description: "+2 to all tests until end of scene",
|
|
41
|
+
duration: "until_rest",
|
|
42
|
+
effects: [
|
|
43
|
+
{ type: "MODIFY_ABILITY", ability: "STR", amount: 2 },
|
|
44
|
+
{ type: "MODIFY_ABILITY", ability: "AGI", amount: 2 },
|
|
45
|
+
{ type: "MODIFY_ABILITY", ability: "WIT", amount: 2 },
|
|
46
|
+
{ type: "MODIFY_ABILITY", ability: "CON", amount: 2 },
|
|
47
|
+
],
|
|
48
|
+
stackable: false,
|
|
49
|
+
},
|
|
50
|
+
BLESSED: {
|
|
51
|
+
id: "blessed",
|
|
52
|
+
name: "Blessed",
|
|
53
|
+
description: "Advantage on all rolls",
|
|
54
|
+
duration: 3,
|
|
55
|
+
effects: [{ type: "GRANT_ADVANTAGE", scope: "all" }],
|
|
56
|
+
stackable: false,
|
|
57
|
+
},
|
|
58
|
+
CURSED: {
|
|
59
|
+
id: "cursed",
|
|
60
|
+
name: "Cursed",
|
|
61
|
+
description: "Disadvantage on all rolls",
|
|
62
|
+
duration: 3,
|
|
63
|
+
effects: [{ type: "GRANT_DISADVANTAGE", scope: "all" }],
|
|
64
|
+
stackable: false,
|
|
65
|
+
},
|
|
66
|
+
HIDDEN: {
|
|
67
|
+
id: "hidden",
|
|
68
|
+
name: "Hidden",
|
|
69
|
+
description: "Advantage on attacks until revealed",
|
|
70
|
+
duration: "until_rest",
|
|
71
|
+
effects: [{ type: "GRANT_ADVANTAGE", scope: "attacks" }],
|
|
72
|
+
stackable: false,
|
|
73
|
+
},
|
|
74
|
+
FIRE_RESISTANT: {
|
|
75
|
+
id: "fire_resistant",
|
|
76
|
+
name: "Fire Resistant",
|
|
77
|
+
description: "Takes half damage from fire",
|
|
78
|
+
duration: "permanent",
|
|
79
|
+
effects: [{ type: "RESISTANCE", damageType: "fire" }],
|
|
80
|
+
stackable: false,
|
|
81
|
+
},
|
|
82
|
+
FIRE_VULNERABLE: {
|
|
83
|
+
id: "fire_vulnerable",
|
|
84
|
+
name: "Fire Vulnerable",
|
|
85
|
+
description: "Takes double damage from fire",
|
|
86
|
+
duration: "permanent",
|
|
87
|
+
effects: [{ type: "VULNERABILITY", damageType: "fire" }],
|
|
88
|
+
stackable: false,
|
|
89
|
+
},
|
|
90
|
+
PRONE: {
|
|
91
|
+
id: "prone",
|
|
92
|
+
name: "Prone",
|
|
93
|
+
description: "Attackers have advantage (melee) or disadvantage (ranged)",
|
|
94
|
+
duration: "permanent",
|
|
95
|
+
effects: [], // Handled situationally by GM
|
|
96
|
+
stackable: false,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=conditions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../src/game/conditions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkDH;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,iBAAiB;QAC9B,QAAQ,EAAE,YAAqB;QAC/B,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,gBAAyB,EAAE,OAAO,EAAE,KAAc,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE;YACxE,EAAE,IAAI,EAAE,gBAAyB,EAAE,OAAO,EAAE,KAAc,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE;YACxE,EAAE,IAAI,EAAE,gBAAyB,EAAE,OAAO,EAAE,KAAc,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE;YACxE,EAAE,IAAI,EAAE,gBAAyB,EAAE,OAAO,EAAE,KAAc,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE;SACzE;QACD,SAAS,EAAE,KAAK;KACjB;IACD,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gBAAgB;QAC7B,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,EAAE;QACX,SAAS,EAAE,KAAK;KACjB;IACD,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,sCAAsC;QACnD,QAAQ,EAAE,CAAC;QAC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