NDDFOS5624OS3JXFPE46C2VBGU6XYA2XOOP7X5GF26HMDPYLOQXQC
KLQKDNMZA776M73IWLBYAHXLESBVKE44YJS2IAAMYJJLOC3IJMOAC
4LMTBPV7JT446YP5RLF6HT7246BY75U5V35JTEIK4PT5NEPKNNKAC
EZYBNJFUNOS3LIU6ILXN7MFKLVW4SDXW6K5T4YFKFZ2R4UWSFUXAC
OPI6W7BO4V3R5WGEVN4USOHVPUV5PVWGKYBMCRU4VQOI7F7RCF5QC
M74RMZSTQLQHMG5PGM6DMM7JJFUHHNBS7QPNGJNXCSB4WHQVBTFAC
ZXBDOUETFSXTFY6J5LIMXBCNMDW6NTUTZ7HZZ6ND7BNUKISR74FAC
NRK37A4NNGLF53STW5RJDHUEP6OKKJORJZL3HYVOKD7OW4QBO5XAC
.locslot .stockitem {
background-size: 448px;
border-radius: 5px;
box-shadow: 1px 1px 2px 1px rgba(0, 0, 0);
border: solid 0px #00000066;
}
.locslot .stockitem.fake_tile {
box-shadow:none;
background:none;
}
.locslot .highlighted {
border-width:1px !important;
box-shadow: 0 0 4px 6px rgb(255, 255, 255) !important;
cursor: pointer !important;
}
.locslot .stockitem_selected {
border-width:1px !important;
box-shadow: 0 0 4px 6px rgb(0, 0, 255) !important
}
// Get the specific location tile (also currently 'offboard') and
// put it into its fixed location slot.
//
// (28 + $loc_id) is the "material id" aka type_arg of the fake
// location tile.
// var_dump("TILE LOCATIONS");
// var_dump($this->cards->getCardsOfType('tile_location', 28 + $loc_id));
$temp = $this->cards->getCardsOfType('tile_location', 28 + $loc_id); // required, as array_shift does not want a direct reference
$location_tile = array_shift($temp);
$this->cards->moveCard($location_tile['id'], 'locslot', $loc['slots']['location']['id']);
// Create cards types:
for (var i = 1; i <= 28; i++) {
this.tiles.onItemCreate = dojo.hitch(this, function (card_div, card_type_id, card_id) {
// Delete the background from our "fake tiles" for the locations.
if (card_type_id > 28) {
dojo.addClass(card_id, "fake_tile");
dojo.setStyle(card_id, "background", "none");
}
});
for (var i = 1; i <= 42; i++) {
this.tiles.addItemType(i, 0, g_gamethemeurl + 'img/tiles-front.jpg', pos_in_img);
// for (var player_id in gamedatas.players) {
// this.playerDisplays[player_id].addItemType(i, 0, g_gamethemeurl + 'img/evidencecards.jpg', pos_in_img);
// }
this.tiles.addItemType(i, 0, g_gamethemeurl + 'img/tiles_64_2x.jpg', pos_in_img);
// this.slideToObject($('tile_' + tile.id), $('locslot_' + tile.location_arg)).play();
// dojo.place(
// this.format_block('jstpl_tile', {tile: tile, name: this.gamedatas.tileinfos[tile.type_arg].name}),
// $('board'));
// dojo.place(
// this.format_block('jstpl_tile', {tile: tile, name: this.gamedatas.tileinfos[tile.type_arg].name}),
// $('board'));
// this.slideToObject( $('tile_' + tile.id), $('locslot_' + tile.location_arg) ).play();
// var slide = this.slideToObject( $( 'stone_' + notif.args.coord_x + '_' + notif.args.coord_y ), $( 'intersection_' + notif.args.coord_x + '_' + notif.args.coord_y ), 1000 );
// var x_pix = this.getXPixelCoordinates(intersection.coord_x);
// var y_pix = this.getYPixelCoordinates(intersection.coord_y);
// if (intersection.stone_color != null) {
// // This intersection is taken, it shouldn't appear as clickable anymore
// dojo.removeClass( 'intersection_' + intersection.coord_x + '_' + intersection.coord_y, 'clickable' );
// }
// }
// // Place it on the player panel
// this.placeOnObject( $( 'stone_' + notif.args.coord_x + '_' + notif.args.coord_y ), $( 'player_board_' + notif.args.player_id ) );
// // Animate a slide from the player panel to the intersection
// dojo.style( 'stone_' + notif.args.coord_x + '_' + notif.args.coord_y, 'zIndex', 1 );
// var slide = this.slideToObject( $( 'stone_' + notif.args.coord_x + '_' + notif.args.coord_y ), $( 'intersection_' + notif.args.coord_x + '_' + notif.args.coord_y ), 1000 );
// dojo.connect( slide, 'onEnd', this, dojo.hitch( this, function() {
// // At the end of the slide, update the intersection
// dojo.removeClass( 'intersection_' + notif.args.coord_x + '_' + notif.args.coord_y, 'no_stone' );
// dojo.addClass( 'intersection_' + notif.args.coord_x + '_' + notif.args.coord_y, 'stone_' + notif.args.color );
// dojo.removeClass( 'intersection_' + notif.args.coord_x + '_' + notif.args.coord_y, 'clickable' );
// // We can now destroy the stone since it is now visible through the change in style of the intersection
// dojo.destroy( 'stone_' + notif.args.coord_x + '_' + notif.args.coord_y );
// }));
// slide.play();
/* Example:
case 'myGameState':
// Show some HTML block at this game state
dojo.style( 'my_html_block_id', 'display', 'block' );
break;
*/
case 'dummmy':
break;
}
},
// onLeavingState: this method is called each time we are leaving a game state.
// You can use this method to perform some user interface changes at this moment.
//
onLeavingState: function( stateName )
{
console.log('Leaving state: ' + stateName);
switch( stateName )
case 'client_playerPicksSolution':
// Clean up UI a bit to let user focus
dojo.fx.wipeOut({node: $('carddisplay')}).play(); // hide cards, so user doesn't accidentally click there
// Enable tile selection
this.tiles.setSelectionMode(2); // TODO: check on each selection: no more than 3, correct type etc
dojo.query('.locslot .stockitem').addClass('highlighted');
break;
}
},
// onLeavingState: this method is called each time we are leaving a game state.
// You can use this method to perform some user interface changes at this moment.
//
onLeavingState: function( stateName )
/* Example:
case 'myGameState':
// Hide the HTML block we are displaying only during this game state
dojo.style( 'my_html_block_id', 'display', 'none' );
break;
*/
case 'dummmy':
break;
console.log('Leaving state: ' + stateName);
switch( stateName )
{
case 'client_playerPicksSolution':
dojo.query('.locslot .stockitem').removeClass('highlighted');
this.tiles.setSelectionMode(0);
dojo.fx.wipeIn({node: $('carddisplay')}).play();
// "bug": if window was resized during this cards are in wrong positions; reset.
this.evidenceDisplay.resetItemsPosition();
this.evidenceDiscard.resetItemsPosition();
// TODO unhighlight tiles
break;
<div id="evidence_wrap" class="whiteblock" style="float:left; width:950px"><div id="evidence"></div></div>
<div class="whiteblock" style="display:inline-block;background:none; opacity:0.75; width:110px;">
<div id="evidence_discard"></div>
<div id="carddisplay">
<div id="evidence_wrap" class="whiteblock" style="float:left; width:950px"><div id="evidence"></div></div>
<div class="whiteblock" style="display:inline-block;background:none; opacity:0.75; width:110px;">
<div id="evidence_discard"></div>
</div>
// FAKE TILES for the fixed on-board locations. But having them being handled
// the same way as normal tiles makes it easier for us. In the UI these will
// be invisible DIVs for the most part, except when highlighted for the Case
// solving action.
29 => array('name' => clienttranslate('Lakeside'), 'nametr' => self::_('Lakeside'), 'tiletype' => 'location'),
30 => array('name' => clienttranslate('Forest Park'), 'nametr' => self::_('Forest Park'), 'tiletype' => 'location'),
31 => array('name' => clienttranslate('Little Italy'), 'nametr' => self::_('Little Italy'), 'tiletype' => 'location'),
32 => array('name' => clienttranslate('Trocadero'), 'nametr' => self::_('Trocadero'), 'tiletype' => 'location'),
33 => array('name' => clienttranslate('Ocean Drive'), 'nametr' => self::_('Ocean Drive'), 'tiletype' => 'location'),
34 => array('name' => clienttranslate('China Town'), 'nametr' => self::_('China Town'), 'tiletype' => 'location'),
35 => array('name' => clienttranslate('Central Station'), 'nametr' => self::_('Central Station'), 'tiletype' => 'location'),
36 => array('name' => clienttranslate('Main Street'), 'nametr' => self::_('Main Street'), 'tiletype' => 'location'),
37 => array('name' => clienttranslate('Road House'), 'nametr' => self::_('Road House'), 'tiletype' => 'location'),
38 => array('name' => clienttranslate('Union Square'), 'nametr' => self::_('Union Square'), 'tiletype' => 'location'),
39 => array('name' => clienttranslate('Downtown'), 'nametr' => self::_('Downtown'), 'tiletype' => 'location'),
40 => array('name' => clienttranslate('Rick’s Café'), 'nametr' => self::_('Rick’s Café'), 'tiletype' => 'location'),
41 => array('name' => clienttranslate('Waterfront'), 'nametr' => self::_('Waterfront'), 'tiletype' => 'location'),
42 => array('name' => clienttranslate('Skid Row'), 'nametr' => self::_('Skid Row'), 'tiletype' => 'location'),
$this->locations = array(
1 => array(
if (!defined('LOC_LAKESIDE')) { // guard since this included multiple times
define("LOC_LAKESIDE", 1);
define("LOC_FORESTPARK", 2);
define('LOC_LITTLEITALY', 3);
define('LOC_TROCADERO', 4);
define('LOC_OCEANDRIVE', 5);
define('LOC_CHINATOWN', 6);
define('LOC_CENTRALSTATION', 7);
define('LOC_MAINSTREET', 8);
define('LOC_ROADHOUSE', 9);
define('LOC_UNIONSQUARE', 10);
define('LOC_DOWNTOWN', 11);
define('LOC_RICKSCAFE', 12);
define('LOC_WATERFRONT', 13);
define('LOC_SKIDROW', 14);
}
$this->locations = array(
LOC_LAKESIDE => array(
'strid' => 'lakeside',
'neighbors' => array(LOC_FORESTPARK, LOC_TROCADERO, LOC_LITTLEITALY),
'coords' => array(11.2, 34.9, 0),
),
LOC_FORESTPARK => array(
'strid' => 'forestpark',
'neighbors' => array(LOC_OCEANDRIVE, LOC_TROCADERO, LOC_LAKESIDE),
'coords' => array(11.2, 59.0, 2.5),
),
LOC_LITTLEITALY => array(
'strid' => 'littleitaly',
'neighbors' => array(LOC_LAKESIDE, LOC_TROCADERO, LOC_CENTRALSTATION, LOC_CHINATOWN),
'coords' => array(31.0, 23.0, 2.0),
),
LOC_TROCADERO => array(
'strid' => 'trocadero',
'neighbors' => array(LOC_LAKESIDE, LOC_FORESTPARK, LOC_OCEANDRIVE, LOC_MAINSTREET, LOC_CENTRALSTATION, LOC_LITTLEITALY),
'coords' => array(30.0, 47.0, 0),
),
LOC_OCEANDRIVE => array(
'strid' => 'oceandrive',
'neighbors' => array(LOC_FORESTPARK, LOC_ROADHOUSE, LOC_MAINSTREET, LOC_TROCADERO),
'coords' => array(31.0, 71.0, 2.0),
),
LOC_CHINATOWN => array(
'strid' => 'chinatown',
'neighbors' => array(LOC_LITTLEITALY, LOC_CENTRALSTATION, LOC_UNIONSQUARE),
'coords' => array(50.0, 11.0, 2.0),
),
LOC_CENTRALSTATION => array(
'nametr' => self::_('Central Station'),
'neighbors_by_strid' => array('littleitaly', 'trocadero', 'chinatown', 'mainstreet', 'unionsquare', 'downtown'),
'coords' => array(50.0, 35.1, -10.5),
'neighbors' => array(LOC_LITTLEITALY, LOC_TROCADERO, LOC_MAINSTREET, LOC_DOWNTOWN, LOC_UNIONSQUARE, LOC_CHINATOWN),
'coords' => array(50.0, 35.0, 2.0),
'nametr' => self::_('Main Street'),
'neighbors_by_strid' => array('trocadero', 'oceandrive', 'roadhouse', 'rickscafe', 'downtown', 'centralstation'),
'coords' => array(49.4, 59.0, 0),
'neighbors' => array(LOC_TROCADERO, LOC_OCEANDRIVE, LOC_ROADHOUSE, LOC_RICKSCAFE, LOC_DOWNTOWN, LOC_CENTRALSTATION),
'coords' => array(50.0, 59.0, 0.0),
3 => array(
LOC_ROADHOUSE => array(
'strid' => 'roadhouse',
'neighbors' => array(LOC_OCEANDRIVE, LOC_RICKSCAFE, LOC_MAINSTREET),
'coords' => array(50.0, 83.0, 2.0),
),
LOC_UNIONSQUARE => array(
'strid' => 'unionsquare',
'neighbors' => array(LOC_CHINATOWN, LOC_CENTRALSTATION, LOC_DOWNTOWN, LOC_WATERFRONT),
'coords' => array(69.0, 23.0, 2.0),
),
LOC_DOWNTOWN => array(
'strid' => 'downtown',
'neighbors' => array(LOC_CENTRALSTATION, LOC_MAINSTREET, LOC_RICKSCAFE, LOC_SKIDROW, LOC_WATERFRONT, LOC_UNIONSQUARE),
'coords' => array(69.0, 47.0, 0),
),
LOC_RICKSCAFE => array(
'nametr' => self::_('Ricks Café'),
// TODO
'neighbors_by_strid' => array('trocadero', 'oceandrive', 'roadhouse', 'rickscafe', 'downtown', 'centralstation'),
'coords' => array(69.2, 71.0, 0),
'neighbors' => array(LOC_MAINSTREET, LOC_ROADHOUSE, LOC_SKIDROW, LOC_DOWNTOWN),
'coords' => array(69.0, 71.0, 0.0),
),
LOC_WATERFRONT => array(
'strid' => 'waterfront',
'neighbors' => array(LOC_UNIONSQUARE, LOC_DOWNTOWN, LOC_SKIDROW),
'coords' => array(88.0, 35.0, 2.0),
4 => array(
'strid' => 'forestpark',
'nametr' => self::_('Forest Park'),
// TODO
'neighbors_by_strid' => array('trocadero', 'oceandrive', 'roadhouse', 'rickscafe', 'downtown', 'centralstation'),
'coords' => array(12.0, 59.0, 2.5),
LOC_SKIDROW => array(
'strid' => 'skidrow',
'neighbors' => array(LOC_DOWNTOWN, LOC_RICKSCAFE, LOC_WATERFRONT),
'coords' => array(88.0, 59.0, 2.0),
'coords' => array(calcY($this->constants['BOARD_H'] * ($top / 100), $angle, $this->constants['BOARD_H'] * 0.07),
calcX($this->constants['BOARD_W'] * ($left / 100), $angle, $this->constants['BOARD_W'] * 0.07),
$angle)),
'coords' => array(
calcY($this->constants['BOARD_H'] * ($top / 100), $angle, $this->constants['BOARD_H'] * 0.073),
calcX($this->constants['BOARD_W'] * ($left / 100), $angle, $this->constants['BOARD_W'] * 0.073),
$angle)),
'location' => array(
'id' => $loc_id * 100 + 2,
'strid' => $loc['strid'] . '_location',
'coords' => array($this->constants['BOARD_H'] * ($top / 100), $this->constants['BOARD_W'] * ($left / 100), $angle)),
'coords' => array(calcY($this->constants['BOARD_H'] * ($top / 100), $angle, $this->constants['BOARD_H'] * -0.07),
calcX($this->constants['BOARD_W'] * ($left / 100), $angle, $this->constants['BOARD_W'] * -0.07),
'coords' => array(calcY($this->constants['BOARD_H'] * ($top / 100), $angle, $this->constants['BOARD_H'] * -0.073),
calcX($this->constants['BOARD_W'] * ($left / 100), $angle, $this->constants['BOARD_W'] * -0.073),
"description" => clienttranslate('${actplayer} must choose a card, place an investigator, or try to solve'),
"descriptionmyturn" => clienttranslate('${you} must choose a card or:'),
"description" => clienttranslate('${actplayer} must select a card, place an investigator, or try to solve'),
"descriptionmyturn" => clienttranslate('${you} must select a card or:'),