@gamepark/its-a-wonderful-world 3.0.16 → 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/ItsAWonderfulWorldOptions.d.ts +1 -2
- package/dist/ItsAWonderfulWorldOptions.d.ts.map +1 -1
- package/dist/ItsAWonderfulWorldOptions.js +1 -55
- package/dist/ItsAWonderfulWorldOptions.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.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 +3 -3
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OptionsSpecV2 } from '@gamepark/rules-api';
|
|
2
2
|
import { Empire } from './Empire';
|
|
3
3
|
import { EmpireSide } from './material/EmpireSide';
|
|
4
4
|
type PlayerOptions = {
|
|
@@ -11,7 +11,6 @@ export type ItsAWonderfulWorldOptions = {
|
|
|
11
11
|
empiresSide: EmpireSide;
|
|
12
12
|
};
|
|
13
13
|
export declare const ItsAWonderfulWorldOptionsSpecV2: OptionsSpecV2;
|
|
14
|
-
export declare const ItsAWonderfulWorldOptionsSpec: OptionsSpec<ItsAWonderfulWorldOptions>;
|
|
15
14
|
export declare function getPlayerName(empire: Empire, t: (key: string) => string): string;
|
|
16
15
|
export {};
|
|
17
16
|
//# sourceMappingURL=ItsAWonderfulWorldOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItsAWonderfulWorldOptions.d.ts","sourceRoot":"","sources":["../src/ItsAWonderfulWorldOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,
|
|
1
|
+
{"version":3,"file":"ItsAWonderfulWorldOptions.d.ts","sourceRoot":"","sources":["../src/ItsAWonderfulWorldOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,MAAM,EAAW,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAKlD,KAAK,aAAa,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAKnC,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,sBAAsB,EAAE,OAAO,CAAA;IAC/B,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,UAAU,CAAA;CACxB,CAAA;AAqBD,eAAO,MAAM,+BAA+B,EAAE,aAmB7C,CAAA;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAiBhF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getEnumValues
|
|
1
|
+
import { getEnumValues } from '@gamepark/rules-api';
|
|
2
2
|
import { Empire, empires } from './Empire';
|
|
3
3
|
import { EmpireSide } from './material/EmpireSide';
|
|
4
4
|
export const ItsAWonderfulWorldOptionsSpecV2 = {
|
|
@@ -21,60 +21,6 @@ export const ItsAWonderfulWorldOptionsSpecV2 = {
|
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
23
|
};
|
|
24
|
-
export const ItsAWonderfulWorldOptionsSpec = {
|
|
25
|
-
players: {
|
|
26
|
-
id: {
|
|
27
|
-
label: (t) => t('Empire'),
|
|
28
|
-
values: empires,
|
|
29
|
-
valueSpec: (empire) => ({ label: (t) => getPlayerName(empire, t) })
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
corruptionAndAscension: {
|
|
33
|
-
label: (t) => t('c&a'),
|
|
34
|
-
help: (t) => t('c&a.help'),
|
|
35
|
-
subscriberRequired: true
|
|
36
|
-
},
|
|
37
|
-
warAndPeace: {
|
|
38
|
-
label: (t) => t('w&p'),
|
|
39
|
-
help: (t) => t('w&p.help'),
|
|
40
|
-
subscriberRequired: true
|
|
41
|
-
},
|
|
42
|
-
empiresSide: {
|
|
43
|
-
label: (t) => t('Empire cards side'),
|
|
44
|
-
values: getEnumValues(EmpireSide),
|
|
45
|
-
valueSpec: (side) => ({
|
|
46
|
-
label: (t) => t('Side {side}', { side: String.fromCharCode(64 + (side ?? 1)) }),
|
|
47
|
-
help: (t) => getEmpireSideHelp(side, t),
|
|
48
|
-
subscriberRequired: side !== EmpireSide.A && side !== EmpireSide.B
|
|
49
|
-
})
|
|
50
|
-
},
|
|
51
|
-
validate: (options, t) => {
|
|
52
|
-
if (options.corruptionAndAscension === false) {
|
|
53
|
-
if (options.players && options.players.length > 5) {
|
|
54
|
-
throw new OptionsValidationError(t('6.players.requires.c&a'), ['corruptionAndAscension', 'players']);
|
|
55
|
-
}
|
|
56
|
-
if (options.empiresSide === EmpireSide.E || options.empiresSide === EmpireSide.F) {
|
|
57
|
-
throw new OptionsValidationError(t('face.e.f.requires.c&a'), ['corruptionAndAscension', 'empiresSide']);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
function getEmpireSideHelp(side, t) {
|
|
63
|
-
switch (side) {
|
|
64
|
-
case EmpireSide.A:
|
|
65
|
-
return t('sideA.help');
|
|
66
|
-
case EmpireSide.B:
|
|
67
|
-
return t('sideB.help');
|
|
68
|
-
case EmpireSide.C:
|
|
69
|
-
return t('sideC.help');
|
|
70
|
-
case EmpireSide.D:
|
|
71
|
-
return t('sideD.help');
|
|
72
|
-
case EmpireSide.E:
|
|
73
|
-
return t('sideE.help');
|
|
74
|
-
case EmpireSide.F:
|
|
75
|
-
return t('sideF.help');
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
24
|
export function getPlayerName(empire, t) {
|
|
79
25
|
switch (empire) {
|
|
80
26
|
case Empire.AztecEmpire:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItsAWonderfulWorldOptions.js","sourceRoot":"","sources":["../src/ItsAWonderfulWorldOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"ItsAWonderfulWorldOptions.js","sourceRoot":"","sources":["../src/ItsAWonderfulWorldOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAiB,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAoClD,MAAM,CAAC,MAAM,+BAA+B,GAAkB;IAC5D,WAAW,EAAE,CAAC;IACd,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;IAC3B,UAAU,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE;IAC/B,OAAO,EAAE;QACP,sBAAsB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE;QACtG,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAChC,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE;KACjE;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,uBAAuB;YAC7B,IAAI,EAAE;gBACJ,EAAE,MAAM,EAAE,wBAAwB,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE;gBACrD,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE;aAChE;YACD,OAAO,EAAE,uBAAuB;SACjC;KACF;CACF,CAAA;AAED,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,CAA0B;IACtE,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,MAAM,CAAC,WAAW;YACrB,OAAO,CAAC,CAAC,cAAc,CAAC,CAAA;QAC1B,KAAK,MAAM,CAAC,gBAAgB;YAC1B,OAAO,CAAC,CAAC,oBAAoB,CAAC,CAAA;QAChC,KAAK,MAAM,CAAC,WAAW;YACrB,OAAO,CAAC,CAAC,cAAc,CAAC,CAAA;QAC1B,KAAK,MAAM,CAAC,eAAe;YACzB,OAAO,CAAC,CAAC,kBAAkB,CAAC,CAAA;QAC9B,KAAK,MAAM,CAAC,gBAAgB;YAC1B,OAAO,CAAC,CAAC,oBAAoB,CAAC,CAAA;QAChC,KAAK,MAAM,CAAC,gBAAgB;YAC1B,OAAO,CAAC,CAAC,oBAAoB,CAAC,CAAA;QAChC,KAAK,MAAM,CAAC,aAAa;YACvB,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAAA;IAC9B,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { ItsAWonderfulWorldRules } from './ItsAWonderfulWorldRules';
|
|
2
|
-
export {
|
|
2
|
+
export { ItsAWonderfulWorldOptionsSpecV2 } from './ItsAWonderfulWorldOptions';
|
|
3
3
|
export { ItsAWonderfulWorldSetup } from './ItsAWonderfulWorldSetup';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAA;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { ItsAWonderfulWorldRules } from './ItsAWonderfulWorldRules';
|
|
2
|
-
export {
|
|
2
|
+
export { ItsAWonderfulWorldOptionsSpecV2 } from './ItsAWonderfulWorldOptions';
|
|
3
3
|
export { ItsAWonderfulWorldSetup } from './ItsAWonderfulWorldSetup';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAA;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -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":"","sources":["../../src/rules/ScienceProductionRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,gBAAgB,EAAgB,MAAM,qBAAqB,CAAA;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAajC,MAAM,CAAC,MAAM,wBAAwB,GACnC,CAAC,SAAoB,EAAE,EAAE,CACzB,CAAC,IAAkB,EAA8D,EAAE,CACjF,gBAAgB,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,IAAK,IAAI,CAAC,IAA+B,CAAC,SAAS,KAAK,SAAS,CAAA;AAMlI,MAAM,OAAO,qBAAsB,SAAQ,cAAc;IACvD,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;IAC3B,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAA;IAKtB,mBAAmB,CAAC,MAAc,EAAE,MAAsB;QAClE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;IAClD,CAAC;IAMD,yBAAyB,CAAC,QAAgB;QACxC,MAAM,KAAK,GAAG,KAAK,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAA;QAEvD,IAAI,IAAI,CAAC,MAAM,CAAU,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;YACxD,KAAK,MAAM,SAAS,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;gBACjE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,sBAAsB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAmC,CAAC,CAAC,CAAA;YACtI,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAA;IACd,CAAC;IAKD,UAAU,CAAC,QAAgB;QACzB,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAU,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;QACzE,IAAI,aAAa;YAAE,OAAO,KAAK,CAAA;QAC/B,OAAO,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;IACnC,CAAC;IAED,YAAY,CAAC,IAAgB;QAC3B,IAAI,gBAAgB,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YAClE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,IAA8B,CAAA;YACjE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;YACxC,OAAO;gBACL,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC;oBACpD,EAAE,EAAE,SAAS;oBACb,QAAQ,EAAE;wBACR,IAAI,EAAE,YAAY,CAAC,gBAAgB;wBACnC,MAAM;wBACN,EAAE,EAAE,SAAS;qBACd;iBACF,CAAC;aACH,CAAA;QACH,CAAC;QACD,OAAO,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;IAMD,SAAS;QACP,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;QAChC,OAAO,EAAE,CAAA;IACX,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/its-a-wonderful-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",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"test": "vitest",
|
|
19
19
|
"build": "tsc",
|
|
20
20
|
"prepack": "yarn build",
|
|
21
|
-
"publish": "yarn version ${0:-patch} && yarn npm publish && git commit -am v$(node -p \"require('./package.json').version\") && git tag v$(node -p \"require('./package.json').version\") && git push --follow-tags",
|
|
21
|
+
"publish": "yarn version ${0:-patch} && yarn npm publish ${OTP:+--otp $OTP} && git commit -am v$(node -p \"require('./package.json').version\") && git tag v$(node -p \"require('./package.json').version\") && git push --follow-tags",
|
|
22
22
|
"lint": "eslint --fix"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
@@ -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
|
}
|