Skip to content

Commit 331ae3a

Browse files
authored
Merge pull request #264 from th555/sunspot
Adding Sunspot
2 parents f831aa1 + fc4f0d7 commit 331ae3a

File tree

5 files changed

+1068
-2
lines changed

5 files changed

+1068
-2
lines changed

locales/en/apgames.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@
182182
"streetcar": "It's against the law to build housing or transit in this wealthy neighborhood. Remove single-family housing limits to let citizens build, making the neighborhood more affordable and diverse. Then connect new buildings with streetcar lines of your own color to score points.",
183183
"strings": "Players simultaneously choose a string to pull, moving, splitting, and joining stacks of coins. The winner is the first one able to get five coins on their home spaces. Are you pulling strings? Or is your opponent pulling yours?",
184184
"subdivision": "You are a real estate developer competing with others to develop a new subdivision. Where you build is somewhat restricted, and what gets built next to you affects your value. Bring down your competitors' values while maximizing your own.",
185+
"sunspot": "Form a loop through placing stones and flipping subgroups.",
185186
"surmount": "An exnihilation game in which larger groups destroy smaller ones.",
186187
"susan": "In Susan, the goal is to surround any opponent's piece with other pieces. On your turn, you may place a piece or slide a piece to an adjacent empty space. If both players have a stone surrounded simultaneously, the player that just took their turn loses. The game ends in a tie if both players performed three slides each consecutively.",
187188
"symple": "A territory game where you get a point for every stone placed, and a penalty for each individual group of connected pieces. Find the right balance to maximize your score.",
@@ -2247,6 +2248,23 @@
22472248
"description": "Controlling all the open spaces around a park grants bonus points"
22482249
}
22492250
},
2251+
"sunspot": {
2252+
"size-4": {
2253+
"name": "Size 4 board"
2254+
},
2255+
"size-5": {
2256+
"name": "Size 5 board"
2257+
},
2258+
"size-6": {
2259+
"name": "Size 6 board"
2260+
},
2261+
"#board": {
2262+
"name": "Size 7 board"
2263+
},
2264+
"size-8": {
2265+
"name": "Size 8 board"
2266+
}
2267+
},
22502268
"surmount": {
22512269
"#board": {
22522270
"name": "Hexhex 5 (61 spaces)"
@@ -2880,6 +2898,12 @@
28802898
"name": "Always show numbers"
28812899
}
28822900
},
2901+
"sunspot": {
2902+
"hide-interior": {
2903+
"description": "Don't highlight interior stones.",
2904+
"name": "Hide interior stones"
2905+
}
2906+
},
28832907
"terrace": {
28842908
"flat": {
28852909
"description": "A flat view that uses shading to indicate height.",

playground/playground.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
19201920
var statusbox = document.getElementById("clickstatus");
19211921
statusbox.innerHTML = resultStr;
19221922
} else {
1923+
console.log(err);
19231924
alert("An error occurred: " + err.message);
19241925
}
19251926
console.log("Game state: "+state);
@@ -1978,6 +1979,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
19781979
var statusbox = document.getElementById("clickstatus");
19791980
statusbox.innerHTML = resultStr;
19801981
} else {
1982+
console.log(err);
19811983
alert("An error occurred: " + err.message);
19821984
}
19831985
console.log("Game state: "+state);

src/games/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ import { StairsGame, IStairsState } from "./stairs";
213213
import { EmuGame, IEmuState } from "./emu";
214214
import { DeckfishGame, IDeckfishState } from "./deckfish";
215215
import { BluestoneGame, IBluestoneState } from "./bluestone";
216+
import { SunspotGame, ISunspotState } from "./sunspot";
216217

217218
export {
218219
APGamesInformation, GameBase, GameBaseSimultaneous, IAPGameState,
@@ -428,6 +429,7 @@ export {
428429
EmuGame, IEmuState,
429430
DeckfishGame, IDeckfishState,
430431
BluestoneGame, IBluestoneState,
432+
SunspotGame, ISunspotState,
431433
};
432434

433435
const games = new Map<string, typeof AmazonsGame | typeof BlamGame | typeof CannonGame |
@@ -500,7 +502,8 @@ const games = new Map<string, typeof AmazonsGame | typeof BlamGame | typeof Cann
500502
typeof BloqueoGame | typeof StormCGame | typeof PilastriGame |
501503
typeof TessellaGame | typeof GorogoGame | typeof StibroGame |
502504
typeof BiscuitGame | typeof QuincunxGame | typeof SiegeOfJGame |
503-
typeof StairsGame | typeof EmuGame | typeof DeckfishGame | typeof BluestoneGame
505+
typeof StairsGame | typeof EmuGame | typeof DeckfishGame | typeof BluestoneGame |
506+
typeof SunspotGame
504507
>();
505508
// Manually add each game to the following array
506509
[
@@ -533,7 +536,7 @@ const games = new Map<string, typeof AmazonsGame | typeof BlamGame | typeof Cann
533536
GyveGame, PahTumGame, NakattaGame, OmnyGame, PacruGame, AzacruGame, CifraGame, GygesGame,
534537
PonteDDGame, SurmountGame, GlissGame, MorphosGame, AssemblyGame, PaintbucketGame, C1Game,
535538
BloqueoGame, StormCGame, PilastriGame, TessellaGame, GorogoGame, BiscuitGame, QuincunxGame,
536-
SiegeOfJGame, StairsGame, EmuGame, DeckfishGame, BluestoneGame,
539+
SiegeOfJGame, StairsGame, EmuGame, DeckfishGame, BluestoneGame, SunspotGame
537540
].forEach((g) => {
538541
if (games.has(g.gameinfo.uid)) {
539542
throw new Error("Another game with the UID '" + g.gameinfo.uid + "' has already been used. Duplicates are not allowed.");
@@ -969,6 +972,8 @@ export const GameFactory = (game: string, ...args: any[]): GameBase|GameBaseSimu
969972
return new DeckfishGame(...args);
970973
case "bluestone":
971974
return new BluestoneGame(...args);
975+
case "sunspot":
976+
return new SunspotGame(...args);
972977
}
973978
return;
974979
}

0 commit comments

Comments
 (0)