Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a pull Request to Update the file #38

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cards.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static function import($age, $csv) {
if (getenv('DEBUG')) {
$card->numPlayers = 1; // use all cards in development
}

$cards[] = $card;
}

Expand Down Expand Up @@ -274,10 +274,10 @@ public function points(Player $player) {
$total += $mult * $pl->wonderStage;
break;
// $mult points for each brown/grey/blue card
case 'brown,grey,blue':
case 'brown,grey,purple':
foreach (explode(',', $color) as $subcolor) {
foreach ($pl->cardsPlayed as $c) {
if ($c->getColor() == $color)
if ($c->getColor() == $subcolor)
$total += $mult;
}
}
Expand All @@ -295,7 +295,7 @@ public function points(Player $player) {

case Card::BLUE:
return intval($this->command);
}
}

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion cards/age3.csv
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Temple,CCOGPL,blue,Pantheon,7,,,1,1,1,2,2Statue,TCC,blue,Gardens,5,,,1,2,2,2,2,GOSS,blue,Town Hall,6,,,1,1,2,3,3,GPLCTOS,blue,Palace,8,,,1,1,1,1,2Library,OSTT,blue,Senate,6,,,1,1,2,2,2Forum,LOT,yellow,Haven,(1){1} brown,,,1,2,2,2,2Caravansery,GS,yellow,Lighthouse,(1){1} grey,,,1,1,1,2,2,CCP,yellow,Chamber of Commerce,(2){2} grey,,,0,1,1,2,2Dispensary,OSS,yellow,Arena,(3){1} wonder,,,1,1,2,2,3Walls,SOOO,red,Fortifications,3,,,1,1,1,1,2Training Ground,SSSO,red,Circus,3,,,0,1,2,3,3,OTTL,red,Arsenal,3,,,1,2,2,2,3Laboratory,TCCC,red,Siege Workshop,3,,,1,1,2,2,2Dispensary,CCLP,green,Lodge,1,,,1,1,1,2,2Laboratory,OOGL,green,Observatory,2,,,1,1,1,1,2Library,TTPG,green,University,3,,,1,2,2,2,2School,SSSG,green,Academy,1,,,1,1,1,1,2School,TPL,green,Study,2,,,1,1,2,2,2,OOCST,purple,Workers Guild,<> brown 1,,,,,,,,OOSS,purple,Craftsmens Guild,<> grey 2,,,,,,,,LPG,purple,Traders Guild,<> yellow 1,,,,,,,,CCCLP,purple,Philosophers Guild,<> green 1,,,,,,,,CCCG,purple,Spies Guild,<> red 1,,,,,,,,OOSL,purple,Strategists Guild,<> -1 1,,,,,,,,TTTPG,purple,Shipowners Guild,"V brown,grey,blue 1",,,,,,,,TTOOP,purple,Scientists Guild,&/@/#,,,,,,,,TTTSL,purple,Magistrates Guild,<> blue 1,,,,,,,,SSCCG,purple,Builders Guild,<V> wonder 1,,,,,,,
Temple,CCOGPL,blue,Pantheon,7,,,1,1,1,2,2Statue,TCC,blue,Gardens,5,,,1,2,2,2,2,GOSS,blue,Town Hall,6,,,1,1,2,3,3,GPLCTOS,blue,Palace,8,,,1,1,1,1,2Library,OSTT,blue,Senate,6,,,1,1,2,2,2Forum,LOT,yellow,Haven,(1){1} brown,,,1,2,2,2,2Caravansery,GS,yellow,Lighthouse,(1){1} yellow,,,1,1,1,2,2,CCP,yellow,Chamber of Commerce,(2){2} grey,,,0,1,1,2,2Dispensary,OSS,yellow,Arena,(3){1} wonder,,,1,1,2,2,3Walls,SOOO,red,Fortifications,3,,,1,1,1,1,2Training Ground,SSSO,red,Circus,3,,,0,1,2,3,3,OTTL,red,Arsenal,3,,,1,2,2,2,3Laboratory,TCCC,red,Siege Workshop,3,,,1,1,2,2,2Dispensary,CCLP,green,Lodge,1,,,1,1,1,2,2Laboratory,OOGL,green,Observatory,2,,,1,1,1,1,2Library,TTPG,green,University,3,,,1,2,2,2,2School,SSSG,green,Academy,1,,,1,1,1,1,2School,TPL,green,Study,2,,,1,1,2,2,2,OOCST,purple,Workers Guild,<> brown 1,,,,,,,,OOSS,purple,Craftsmens Guild,<> grey 2,,,,,,,,LPG,purple,Traders Guild,<> yellow 1,,,,,,,,CCCLP,purple,Philosophers Guild,<> green 1,,,,,,,,CCCG,purple,Spies Guild,<> red 1,,,,,,,,OOSL,purple,Strategists Guild,<> -1 1,,,,,,,,TTTPG,purple,Shipowners Guild,"V brown,grey,purple 1",,,,,,,,TTOOP,purple,Scientists Guild,&/@/#,,,,,,,,TTTSL,purple,Magistrates Guild,<> blue 1,,,,,,,,SSCCG,purple,Builders Guild,<V> wonder 1,,,,,,,
Expand Down
3 changes: 2 additions & 1 deletion includes/websocket.functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public static function parseHeaders( $header )
$fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $header));
foreach( $fields as $field ) {
if( preg_match('/([^:]+): (.+)/m', $field, $match) ) {
$match[1] = preg_replace('/(?<=^|[\x09\x20\x2D])./e', 'strtoupper("\0")', strtolower(trim($match[1])));
//$match[1] = preg_replace('/(?<=^|[\x09\x20\x2D])./e', 'strtoupper("\0")', strtolower(trim($match[1])));
$match[1] = preg_replace_callback('/(?<=^|[\x09\x20\x2D])./', function ($matches) { return strtoupper($matches[0]);}, strtolower(trim($match[1])));
if( isset($retVal[$match[1]]) ) {
$retVal[$match[1]] = array($retVal[$match[1]], $match[2]);
} else {
Expand Down
2 changes: 1 addition & 1 deletion includes/websocket.server.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public function addUriHandler($script, IWebSocketUriHandler $handler){
* @param IWebSocketMessage $msg
*/
protected function dispatchMessage(IWebSocketConnection $user,IWebSocketMessage $msg){
$this->debug("dispatchMessage");
//$this->debug("dispatchMessage");

if(array_key_exists($this->_connections[$user],$this->uriHandlers)){
$this->uriHandlers[$this->_connections[$user]]->onMessage($user, $msg);
Expand Down
6 changes: 1 addition & 5 deletions player.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,7 @@ public function playWonderStage() {
$this->canStealGuild = true;
break;
case 'discard': // halikarnassus's play from the discard pile
if(count($this->_game->discard) > 0){
$tojson = function($a){ return $a->json(); };
$this->state = Player::USINGDISCARD;
$this->send('discard', array('cards' => array_map($tojson, $this->_game->discard)));
}
$this->state = Player::USINGDISCARD;
break;
case 'play2': // babylon's play both cards at the end of a hand
$this->canPlayTwoBuilt = true;
Expand Down
13 changes: 10 additions & 3 deletions scripts/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,15 @@ SevenWonders.prototype = {
if(this.trashCardsDisplayed[i].data('cardInfo').color == cardColor) numInColor++;

carddiv.find('.options, h1').css('display', 'none');
var left = isDiscard ? 10 : 168 + index * 136;
var bottom = (isDiscard || cardColor == 'blue') ? 10 : 95 + numInColor * 40;
if ( isDiscard ) {
var left = 10 + index * 136;
var bottom = 10 + numInColor * 40;
} else {
var left = 168 + index * 136;
var bottom = (cardColor == 'blue') ? 10 : 95 + numInColor * 40;
}
//var left = isDiscard ? 10 : 168 + index * 136;
//var bottom = (isDiscard || cardColor == 'blue') ? 10 : 95 + numInColor * 40;
carddiv.css({
'z-index': 2000 - numInColor,
'left': left,
Expand Down Expand Up @@ -280,7 +287,7 @@ SevenWonders.prototype = {
left: offset.left
});
$('#game').append(newCard);
self.moveToBoard(newCard, true);
self.wonder.moveToBoard(newCard, true);
self.hideCardSelect();
return false;
});
Expand Down
Loading