{{ $t('you') }}:{{ message.text }}
@@ -50,8 +50,6 @@ export default defineComponent({
MkButton
},
- inject: ['navHook'],
-
data() {
return {
INFO: {
@@ -245,7 +243,7 @@ export default defineComponent({
margin: 0 8px;
}
- > .mk-time {
+ > .time {
margin: 0 0 0 auto;
}
}
diff --git a/src/client/pages/reversi/game.board.vue b/src/client/pages/reversi/game.board.vue
new file mode 100644
index 0000000000..c9d2528d37
--- /dev/null
+++ b/src/client/pages/reversi/game.board.vue
@@ -0,0 +1,472 @@
+
+
+
({{ $t('_reversi.black') }}) vs ({{ $t('_reversi.white') }})
+
+
+
+
+
+
+
+
+
+
{{ $t('_reversi.opponentTurn') }}
+
{{ $t('_reversi.myTurn') }}
+
+
+
+ ({{ $t('_reversi.surrendered') }})
+
+ {{ $t('_reversi.drawn') }}
+
+
+
+
+
+ {{ String.fromCharCode(64 + i) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ String.fromCharCode(64 + i) }}
+
+
+
+
{{ $t('_reversi.turnCount', { count: logPos }) }} {{ $t('_reversi.black') }}:{{ o.blackCount }} {{ $t('_reversi.white') }}:{{ o.whiteCount }} {{ $t('_reversi.total') }}:{{ o.blackCount + o.whiteCount }}
+
+
+ {{ $t('_reversi.surrender') }}
+
+
+
+ {{ logPos }} / {{ logs.length }}
+
+
+
+
+
+
+
+
+
+
{{ $t('_reversi.isLlotheo') }}
+
{{ $t('_reversi.loopedMap') }}
+
{{ $t('_reversi.canPutEverywhere') }}
+
+
+
+
+
+
+
diff --git a/src/client/pages/reversi/game.setting.vue b/src/client/pages/reversi/game.setting.vue
new file mode 100644
index 0000000000..d679d0f6d8
--- /dev/null
+++ b/src/client/pages/reversi/game.setting.vue
@@ -0,0 +1,393 @@
+
+
+
+
+
+
{{ $t('_reversi.gameSettings') }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('_reversi.blackOrWhite') }}
+
+
+
+ {{ $t('random') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('_reversi.rules') }}
+
+
+
+ {{ $t('_reversi.isLlotheo') }}
+ {{ $t('_reversi.loopedMap') }}
+ {{ $t('_reversi.canPutEverywhere') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/client/pages/reversi/game.vue b/src/client/pages/reversi/game.vue
new file mode 100644
index 0000000000..dd47ca16dd
--- /dev/null
+++ b/src/client/pages/reversi/game.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
diff --git a/src/client/pages/reversi/index.vue b/src/client/pages/reversi/index.vue
new file mode 100644
index 0000000000..1969b6be83
--- /dev/null
+++ b/src/client/pages/reversi/index.vue
@@ -0,0 +1,281 @@
+
+
+
Misskey {{ $t('_reversi.reversi') }}
+
+
+ {{ $t('invite') }}
+
+
+
+
+ {{ $t('invitations') }}
+
+
+
+
+
+
+ {{ $t('_reversi.myGames') }}
+
+
+
+ vs
+
+
+
+
+
+
+
+ {{ $t('_reversi.allGames') }}
+
+
+
+ vs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('cancel') }}
+
+
+
+
+
+
+
diff --git a/src/client/router.ts b/src/client/router.ts
index 56320d224e..5068eccfea 100644
--- a/src/client/router.ts
+++ b/src/client/router.ts
@@ -70,6 +70,8 @@ export const router = createRouter({
{ path: '/instance/abuses', component: page('instance/abuses') },
{ path: '/notes/:note', name: 'note', component: page('note'), props: route => ({ noteId: route.params.note }) },
{ path: '/tags/:tag', component: page('tag'), props: route => ({ tag: route.params.tag }) },
+ { path: '/games/reversi', component: page('reversi/index') },
+ { path: '/games/reversi/:gameId', component: page('reversi/game'), props: route => ({ gameId: route.params.gameId }) },
{ path: '/api-console', component: page('api-console') },
{ path: '/auth/:token', component: page('auth') },
{ path: '/miauth/:session', component: page('miauth') },
diff --git a/src/client/sidebar.ts b/src/client/sidebar.ts
index e57f85020d..af1f68b0dc 100644
--- a/src/client/sidebar.ts
+++ b/src/client/sidebar.ts
@@ -115,7 +115,7 @@ export const sidebarDef = {
games: {
title: 'games',
icon: faGamepad,
- to: '/games',
+ to: '/games/reversi',
},
scratchpad: {
title: 'scratchpad',
diff --git a/src/client/widgets/rss.vue b/src/client/widgets/rss.vue
index ba84ceefa3..1140a4252f 100644
--- a/src/client/widgets/rss.vue
+++ b/src/client/widgets/rss.vue
@@ -77,7 +77,7 @@ export default defineComponent({
> a {
display: block;
padding: 8px 16px;
- color: var(--text);
+ color: var(--fg);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
diff --git a/src/games/reversi/maps.ts b/src/games/reversi/maps.ts
index f74cc85659..eaaff1c918 100644
--- a/src/games/reversi/maps.ts
+++ b/src/games/reversi/maps.ts
@@ -142,51 +142,6 @@ export const eighteightH4: Map = {
]
};
-export const eighteightH12: Map = {
- name: '8x8 handicap 12',
- category: '8x8',
- data: [
- 'bb----bb',
- 'b------b',
- '--------',
- '---wb---',
- '---bw---',
- '--------',
- 'b------b',
- 'bb----bb'
- ]
-};
-
-export const eighteightH16: Map = {
- name: '8x8 handicap 16',
- category: '8x8',
- data: [
- 'bbb---bb',
- 'b------b',
- '-------b',
- '---wb---',
- '---bw---',
- 'b-------',
- 'b------b',
- 'bb---bbb'
- ]
-};
-
-export const eighteightH20: Map = {
- name: '8x8 handicap 20',
- category: '8x8',
- data: [
- 'bbb--bbb',
- 'b------b',
- 'b------b',
- '---wb---',
- '---bw---',
- 'b------b',
- 'b------b',
- 'bbb---bb'
- ]
-};
-
export const eighteightH28: Map = {
name: '8x8 handicap 28',
category: '8x8',
diff --git a/src/server/api/stream/channels/games/reversi-game.ts b/src/server/api/stream/channels/games/reversi-game.ts
index e600179480..d03501971e 100644
--- a/src/server/api/stream/channels/games/reversi-game.ts
+++ b/src/server/api/stream/channels/games/reversi-game.ts
@@ -243,20 +243,23 @@ export default class extends Channel {
if (game.isEnded) return;
if ((game.user1Id !== this.user.id) && (game.user2Id !== this.user.id)) return;
+ const myColor =
+ ((game.user1Id === this.user.id) && game.black == 1) || ((game.user2Id === this.user.id) && game.black == 2)
+ ? true
+ : false;
+
const o = new Reversi(game.map, {
isLlotheo: game.isLlotheo,
canPutEverywhere: game.canPutEverywhere,
loopedBoard: game.loopedBoard
});
+ // 盤面の状態を再生
for (const log of game.logs) {
o.put(log.color, log.pos);
}
- const myColor =
- ((game.user1Id === this.user.id) && game.black == 1) || ((game.user2Id === this.user.id) && game.black == 2)
- ? true
- : false;
+ if (o.turn !== myColor) return;
if (!o.canPut(myColor, pos)) return;
o.put(myColor, pos);