@gamepark/its-a-wonderful-world 3.0.17 → 3.0.18
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/dist/ItsAWonderfulWorldMemory.d.ts +1 -2
- package/dist/ItsAWonderfulWorldMemory.d.ts.map +1 -1
- package/dist/ItsAWonderfulWorldMemory.js +0 -1
- package/dist/ItsAWonderfulWorldMemory.js.map +1 -1
- package/dist/material/CustomMoveType.d.ts +2 -1
- package/dist/material/CustomMoveType.d.ts.map +1 -1
- package/dist/material/CustomMoveType.js +1 -0
- package/dist/material/CustomMoveType.js.map +1 -1
- package/dist/rules/ScienceProductionRule.d.ts +10 -2
- package/dist/rules/ScienceProductionRule.d.ts.map +1 -1
- package/dist/rules/ScienceProductionRule.js +26 -41
- package/dist/rules/ScienceProductionRule.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItsAWonderfulWorldMemory.d.ts","sourceRoot":"","sources":["../src/ItsAWonderfulWorldMemory.ts"],"names":[],"mappings":"AAGA,oBAAY,MAAM;IAIhB,KAAK,IAAI;IAST,YAAY,IAAA;IAMZ,UAAU,IAAA;IAMV,YAAY,IAAA;
|
|
1
|
+
{"version":3,"file":"ItsAWonderfulWorldMemory.d.ts","sourceRoot":"","sources":["../src/ItsAWonderfulWorldMemory.ts"],"names":[],"mappings":"AAGA,oBAAY,MAAM;IAIhB,KAAK,IAAI;IAST,YAAY,IAAA;IAMZ,UAAU,IAAA;IAMV,YAAY,IAAA;CACb"}
|
|
@@ -4,6 +4,5 @@ export var Memory;
|
|
|
4
4
|
Memory[Memory["DraftedCards"] = 2] = "DraftedCards";
|
|
5
5
|
Memory[Memory["EmpireSide"] = 3] = "EmpireSide";
|
|
6
6
|
Memory[Memory["ScienceBonus"] = 4] = "ScienceBonus";
|
|
7
|
-
Memory[Memory["PendingConstructionBonusTokens"] = 5] = "PendingConstructionBonusTokens";
|
|
8
7
|
})(Memory || (Memory = {}));
|
|
9
8
|
//# sourceMappingURL=ItsAWonderfulWorldMemory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItsAWonderfulWorldMemory.js","sourceRoot":"","sources":["../src/ItsAWonderfulWorldMemory.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"ItsAWonderfulWorldMemory.js","sourceRoot":"","sources":["../src/ItsAWonderfulWorldMemory.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,MA0BX;AA1BD,WAAY,MAAM;IAIhB,qCAAS,CAAA;IAST,mDAAY,CAAA;IAMZ,+CAAU,CAAA;IAMV,mDAAY,CAAA;AACd,CAAC,EA1BW,MAAM,KAAN,MAAM,QA0BjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomMoveType.d.ts","sourceRoot":"","sources":["../../src/material/CustomMoveType.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,uBAAuB,IAAI;IAC3B,UAAU,IAAI;IACd,cAAc,IAAI;IAClB,gBAAgB,IAAI;
|
|
1
|
+
{"version":3,"file":"CustomMoveType.d.ts","sourceRoot":"","sources":["../../src/material/CustomMoveType.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,uBAAuB,IAAI;IAC3B,UAAU,IAAI;IACd,cAAc,IAAI;IAClB,gBAAgB,IAAI;IACpB,sBAAsB,IAAI;CAC3B"}
|
|
@@ -4,5 +4,6 @@ export var CustomMoveType;
|
|
|
4
4
|
CustomMoveType[CustomMoveType["RecycleAll"] = 2] = "RecycleAll";
|
|
5
5
|
CustomMoveType[CustomMoveType["PlaceResources"] = 3] = "PlaceResources";
|
|
6
6
|
CustomMoveType[CustomMoveType["PlaceAllOnEmpire"] = 4] = "PlaceAllOnEmpire";
|
|
7
|
+
CustomMoveType[CustomMoveType["ChooseScienceCharacter"] = 5] = "ChooseScienceCharacter";
|
|
7
8
|
})(CustomMoveType || (CustomMoveType = {}));
|
|
8
9
|
//# sourceMappingURL=CustomMoveType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomMoveType.js","sourceRoot":"","sources":["../../src/material/CustomMoveType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"CustomMoveType.js","sourceRoot":"","sources":["../../src/material/CustomMoveType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,yFAA2B,CAAA;IAC3B,+DAAc,CAAA;IACd,uEAAkB,CAAA;IAClB,2EAAoB,CAAA;IACpB,uFAA0B,CAAA;AAC5B,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB"}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CustomMove, MaterialMove } from '@gamepark/rules-api';
|
|
2
2
|
import { Empire } from '../Empire';
|
|
3
|
+
import { Character } from '../material/Character';
|
|
4
|
+
import { CustomMoveType } from '../material/CustomMoveType';
|
|
3
5
|
import { Resource } from '../material/Resource';
|
|
4
6
|
import { ProductionRule } from './ProductionRule';
|
|
5
7
|
import { RuleId } from './RuleId';
|
|
8
|
+
export type ScienceCharacterChoice = {
|
|
9
|
+
player: Empire;
|
|
10
|
+
character: Character;
|
|
11
|
+
};
|
|
12
|
+
export declare const isScienceCharacterChoice: (character: Character) => (move: MaterialMove) => move is CustomMove<CustomMoveType, ScienceCharacterChoice>;
|
|
6
13
|
export declare class ScienceProductionRule extends ProductionRule {
|
|
7
14
|
resource: Resource;
|
|
8
15
|
nextRule: RuleId;
|
|
9
16
|
protected awardSupremacyBonus(empire: Empire, _moves: MaterialMove[]): void;
|
|
10
17
|
getActivePlayerLegalMoves(playerId: Empire): MaterialMove[];
|
|
11
18
|
canEndTurn(playerId: Empire): boolean;
|
|
12
|
-
|
|
19
|
+
onCustomMove(move: CustomMove): MaterialMove[];
|
|
20
|
+
onRuleEnd(): never[];
|
|
13
21
|
}
|
|
14
22
|
//# sourceMappingURL=ScienceProductionRule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScienceProductionRule.d.ts","sourceRoot":"","sources":["../../src/rules/ScienceProductionRule.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ScienceProductionRule.d.ts","sourceRoot":"","sources":["../../src/rules/ScienceProductionRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAoB,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAG3D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAKjC,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AAKD,eAAO,MAAM,wBAAwB,cACvB,SAAS,YACd,YAAY,KAAG,IAAI,IAAI,UAAU,CAAC,cAAc,EAAE,sBAAsB,CACiD,CAAA;AAMlI,qBAAa,qBAAsB,SAAQ,cAAc;IACvD,QAAQ,WAAmB;IAC3B,QAAQ,SAAwB;IAKhC,SAAS,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAE1E;IAMD,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,EAAE,CAU1D;IAKD,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAIpC;IAED,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,EAAE,CAgB7C;IAMD,SAAS,YAGR;CACF"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isCustomMoveType } from '@gamepark/rules-api';
|
|
2
2
|
import { Memory } from '../ItsAWonderfulWorldMemory';
|
|
3
3
|
import { Character } from '../material/Character';
|
|
4
|
+
import { CustomMoveType } from '../material/CustomMoveType';
|
|
4
5
|
import { LocationType } from '../material/LocationType';
|
|
5
6
|
import { MaterialType } from '../material/MaterialType';
|
|
6
7
|
import { Resource } from '../material/Resource';
|
|
7
8
|
import { ProductionRule } from './ProductionRule';
|
|
8
9
|
import { RuleId } from './RuleId';
|
|
10
|
+
export const isScienceCharacterChoice = (character) => (move) => isCustomMoveType(CustomMoveType.ChooseScienceCharacter)(move) && move.data.character === character;
|
|
9
11
|
export class ScienceProductionRule extends ProductionRule {
|
|
10
12
|
resource = Resource.Science;
|
|
11
13
|
nextRule = RuleId.GoldProduction;
|
|
@@ -14,23 +16,10 @@ export class ScienceProductionRule extends ProductionRule {
|
|
|
14
16
|
}
|
|
15
17
|
getActivePlayerLegalMoves(playerId) {
|
|
16
18
|
const moves = super.getActivePlayerLegalMoves(playerId);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
location: {
|
|
22
|
-
type: LocationType.PlayerCharacters,
|
|
23
|
-
player: playerId,
|
|
24
|
-
id: Character.Financier
|
|
25
|
-
}
|
|
26
|
-
}), this.material(MaterialType.CharacterToken).createItem({
|
|
27
|
-
id: Character.General,
|
|
28
|
-
location: {
|
|
29
|
-
type: LocationType.PlayerCharacters,
|
|
30
|
-
player: playerId,
|
|
31
|
-
id: Character.General
|
|
32
|
-
}
|
|
33
|
-
}));
|
|
19
|
+
if (this.remind(Memory.ScienceBonus, playerId)) {
|
|
20
|
+
for (const character of [Character.Financier, Character.General]) {
|
|
21
|
+
moves.push(this.customMove(CustomMoveType.ChooseScienceCharacter, { player: playerId, character }));
|
|
22
|
+
}
|
|
34
23
|
}
|
|
35
24
|
return moves;
|
|
36
25
|
}
|
|
@@ -40,30 +29,26 @@ export class ScienceProductionRule extends ProductionRule {
|
|
|
40
29
|
return false;
|
|
41
30
|
return super.canEndTurn(playerId);
|
|
42
31
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
32
|
+
onCustomMove(move) {
|
|
33
|
+
if (isCustomMoveType(CustomMoveType.ChooseScienceCharacter)(move)) {
|
|
34
|
+
const { player, character } = move.data;
|
|
35
|
+
this.forget(Memory.ScienceBonus, player);
|
|
36
|
+
return [
|
|
37
|
+
this.material(MaterialType.CharacterToken).createItem({
|
|
38
|
+
id: character,
|
|
39
|
+
location: {
|
|
40
|
+
type: LocationType.PlayerCharacters,
|
|
41
|
+
player,
|
|
42
|
+
id: character
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
];
|
|
53
46
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this.memorize(Memory.PendingConstructionBonusTokens, pending - 1, player);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
this.forget(Memory.ScienceBonus, player);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return consequences;
|
|
47
|
+
return super.onCustomMove(move);
|
|
48
|
+
}
|
|
49
|
+
onRuleEnd() {
|
|
50
|
+
this.forget(Memory.ScienceBonus);
|
|
51
|
+
return [];
|
|
67
52
|
}
|
|
68
53
|
}
|
|
69
54
|
//# sourceMappingURL=ScienceProductionRule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScienceProductionRule.js","sourceRoot":"","sources":["../../src/rules/ScienceProductionRule.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ScienceProductionRule.js","sourceRoot":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derful-world",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.18",
|
|
4
4
|
"description": "The rules of It's a Wonderful World adapted for Game Park",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"es-toolkit": "^1.45.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gamepark/rules-api": "~7.
|
|
29
|
+
"@gamepark/rules-api": "~7.8.0",
|
|
30
30
|
"es-toolkit": "^1.50.0",
|
|
31
31
|
"vitest": "^4.1.10"
|
|
32
32
|
}
|