Skip to content

Commit 65a1e14

Browse files
committed
Merge branch 'develop'
2 parents b638d0a + a53606a commit 65a1e14

File tree

5 files changed

+47
-14
lines changed

5 files changed

+47
-14
lines changed

locales/en/apgames.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2840,6 +2840,12 @@
28402840
"description": "Display the board using vertexes instead of hexes."
28412841
}
28422842
},
2843+
"diffusion": {
2844+
"pips": {
2845+
"description": "Display the stones as pips instead of as numerals.",
2846+
"name": "Pips"
2847+
}
2848+
},
28432849
"entropy": {
28442850
"piece-numbers": {
28452851
"name": "Piece numbers",
@@ -2940,6 +2946,12 @@
29402946
"name": "Hide moves"
29412947
}
29422948
},
2949+
"oware": {
2950+
"pips": {
2951+
"description": "Display the stones as pips instead of as numerals.",
2952+
"name": "Pips"
2953+
}
2954+
},
29432955
"pente": {
29442956
"hide-threatened": {
29452957
"description": "Don't highlight pieces that are threatened to be captured.",
@@ -3067,6 +3079,12 @@
30673079
"name": "Flat view"
30683080
}
30693081
},
3082+
"toguz": {
3083+
"pips": {
3084+
"description": "Display the stones as pips instead of as numerals.",
3085+
"name": "Pips"
3086+
}
3087+
},
30703088
"trax": {
30713089
"show-origin": {
30723090
"description": "Mark the position of the first piece.",
@@ -4241,7 +4259,8 @@
42414259
"TOO_HOPPY": "You may not make more than {{count}} moves on your turn.",
42424260
"TOO_EARLY_FOR_REFILL": "Please submit your refill request before making your remaining moves.",
42434261
"TOO_LATE_FOR_BLOCKED": "You do not count as blocked if you've already moved on this turn.",
4244-
"TOO_LATE_FOR_REFILL": "There is no need to force a refill of the draw pool after your third move. It will refill automatically after you submit."
4262+
"TOO_LATE_FOR_REFILL": "There is no need to force a refill of the draw pool after your third move. It will refill automatically after you submit.",
4263+
"VALID_REFILL": "Please submit your move to trigger the refill. You will have {{count}} moves remaining after the refill, as well as the option to pass."
42454264
},
42464265

42474266
"furl": {

src/games/_base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export abstract class GameBase {
265265
public abstract currplayer: number|undefined;
266266

267267
public abstract move(move: string, opts?: IMoveOptions): GameBase;
268-
public abstract render(opts: IRenderOpts): APRenderRep;
268+
public abstract render(opts: IRenderOpts): APRenderRep|APRenderRep[];
269269
public abstract state(opts?: {strip?: boolean, player?: number}): IAPGameState;
270270
public abstract load(idx: number): GameBase;
271271
public abstract clone(): GameBase;

src/games/arimaa.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export class ArimaaGame extends GameBase {
5454
notes: "apgames:notes.arimaa",
5555
urls: [
5656
"https://arimaa.com/arimaa/",
57+
"https://arimaa.com/arimaa/learn/rulesIntro.html",
5758
"https://boardgamegeek.com/boardgame/4616/arimaa",
5859
],
5960
people: [
@@ -76,8 +77,8 @@ export class ArimaaGame extends GameBase {
7677
{ uid: "eee", name: "Endless Endgame", group: "setup" },
7778
{ uid: "free", name: "Arbitrary Setup", group: "setup", unrated: true },
7879
],
79-
categories: ["goal>breakthrough", "mechanic>capture", "mechanic>move", "mechanic>coopt", "board>shape>rect", "board>connect>rect", "components>special"],
80-
flags: ["experimental", "perspective", "no-moves", "custom-buttons", "random-start"]
80+
categories: ["goal>breakthrough", "goal>cripple", "goal>immobilize", "mechanic>capture", "mechanic>move", "mechanic>coopt", "mechanic>random>setup", "board>shape>rect", "board>connect>rect", "components>chess"],
81+
flags: ["experimental", "perspective", "no-moves", "custom-buttons", "random-start", "custom-colours"]
8182
};
8283
public static coords2algebraic(x: number, y: number): string {
8384
return GameBase.coords2algebraic(x, y, 8);
@@ -1126,10 +1127,10 @@ export class ArimaaGame extends GameBase {
11261127
for (const colour of [1, 2] as const) {
11271128
legend[`${pc}${colour}`] = {
11281129
name,
1129-
colour,
1130+
colour: this.getPlayerColour(colour),
11301131
colour2: {
11311132
func: "bestContrast",
1132-
bg: colour,
1133+
bg: this.getPlayerColour(colour),
11331134
fg: [
11341135
"_context_strokes",
11351136
"_context_fill"
@@ -1143,13 +1144,13 @@ export class ArimaaGame extends GameBase {
11431144
name,
11441145
colour: {
11451146
func: "flatten",
1146-
fg: colour,
1147+
fg: this.getPlayerColour(colour),
11471148
bg: "_context_background",
1148-
opacity: 0.5,
1149+
opacity: 0.375,
11491150
},
11501151
colour2: {
11511152
func: "bestContrast",
1152-
bg: colour,
1153+
bg: this.getPlayerColour(colour),
11531154
fg: [
11541155
"_context_strokes",
11551156
"_context_fill"
@@ -1360,4 +1361,12 @@ export class ArimaaGame extends GameBase {
13601361
}
13611362
}
13621363

1364+
public getPlayerColour(p: playerid): number|string {
1365+
if (p === 1) {
1366+
return "#bf9212";
1367+
} else {
1368+
return "#989898";
1369+
}
1370+
}
1371+
13631372
}

src/games/frogger.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,6 +1327,7 @@ export class FroggerGame extends GameBase {
13271327
const cloned: FroggerGame = Object.assign(new FroggerGame(this.numplayers, [...this.variants]), deepclone(this) as FroggerGame);
13281328

13291329
let allcomplete = false;
1330+
let refill = false;
13301331
const moves: string[] = m.split("/");
13311332

13321333
if (moves[moves.length - 1] === "") {
@@ -1403,7 +1404,9 @@ export class FroggerGame extends GameBase {
14031404
result.valid = false;
14041405
result.message = i18next.t("apgames:validation.frogger.NO_CARDS_FOR_REFILL");
14051406
return result;
1406-
}// else refill = true;
1407+
} else {
1408+
refill = true;
1409+
}
14071410
}
14081411

14091412
let complete = false;
@@ -1613,7 +1616,11 @@ export class FroggerGame extends GameBase {
16131616
result.valid = true;
16141617
result.canrender = true;
16151618
result.complete = (allcomplete && moves.length === this.nummoves) ? 1 : 0;
1616-
result.message = i18next.t("apgames:validation._general.VALID_MOVE");
1619+
if (refill)
1620+
result.message = i18next.t("apgames:validation.frogger.VALID_REFILL", {count: 3 - moves.length});
1621+
else
1622+
result.message = i18next.t("apgames:validation._general.VALID_MOVE");
1623+
16171624
return result;
16181625
}
16191626

@@ -1911,8 +1918,7 @@ export class FroggerGame extends GameBase {
19111918

19121919
// add flood markers for the start and end columns
19131920
const points = [];
1914-
for (let r = 0; r <= this.numplayers; r++) {
1915-
const row = this.rows - 2 - r;
1921+
for (let row = 0; row <= this.numplayers; row++) {
19161922
points.push({col: 0, row: row} as RowCol);
19171923
points.push({col: this.columns - 1, row: row} as RowCol);
19181924
}

src/games/krypte.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console */
21
import { GameBase, IAPGameState, IClickResult, IIndividualState, IRenderOpts, IValidationResult } from "./_base";
32
import { APGamesInformation } from "../schemas/gameinfo";
43
import { APMoveResult } from "../schemas/moveresults";

0 commit comments

Comments
 (0)