File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 34713471 "LABEL_STASH" : " Player {{playerNum}}'s hand" ,
34723472 "NO_CARD" : " The card \" {{card}}\" does not appear to be in your hand." ,
34733473 "NO_INFLUENCE" : " You don't have any influence left." ,
3474+ "NOT_ADJ" : " New cards must be placed adjacent to at least one existing card." ,
34743475 "PARTIAL_PLACEMENT" : " Click an empty space on the board to place your card."
34753476 },
34763477 "konane" : {
Original file line number Diff line number Diff line change @@ -419,6 +419,19 @@ export class JacynthGame extends GameBase {
419419 result . message = i18next . t ( "apgames:validation._general.OCCUPIED" , { cell : to } ) ;
420420 return result ;
421421 }
422+ // adjacent to existing card
423+ let hasadj = false ;
424+ for ( const n of g . neighbours ( to ) ) {
425+ if ( this . board . has ( n ) ) {
426+ hasadj = true ;
427+ break ;
428+ }
429+ }
430+ if ( ! hasadj ) {
431+ result . valid = false ;
432+ result . message = i18next . t ( "apgames:validation.jacynth.NOT_ADJ" ) ;
433+ return result ;
434+ }
422435
423436 // if influence is missing, may or not be complete
424437 if ( influence === undefined || influence . length === 0 ) {
You can’t perform that action at this time.
0 commit comments