|
|
@ -51,6 +51,8 @@ import { buy, roll, endTurn, loan, trade, submitTradeAccept,
|
|
|
|
leaveGame, kickPlayer, toggleRevealForTrade,
|
|
|
|
leaveGame, kickPlayer, toggleRevealForTrade,
|
|
|
|
addAIPlayer } from './interface.js'
|
|
|
|
addAIPlayer } from './interface.js'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const showScreenDelay = 2000;
|
|
|
|
|
|
|
|
|
|
|
|
function netWorth(player) {
|
|
|
|
function netWorth(player) {
|
|
|
|
return ((player.assets.hay + player.assets.grain) * 2000) +
|
|
|
|
return ((player.assets.hay + player.assets.grain) * 2000) +
|
|
|
|
(player.assets.fruit * 5000) +
|
|
|
|
(player.assets.fruit * 5000) +
|
|
|
@ -212,7 +214,7 @@ class PlayerTurnContainer extends React.Component {
|
|
|
|
} else if (player.state === GAME_STATES.preTurn) {
|
|
|
|
} else if (player.state === GAME_STATES.preTurn) {
|
|
|
|
view = (
|
|
|
|
view = (
|
|
|
|
<Fragment>
|
|
|
|
<Fragment>
|
|
|
|
<Button onClick={this.clickRoll}>Roll</Button>{' '}{auditButton}
|
|
|
|
<Button className="action-item" onClick={this.clickRoll}>Roll</Button>{' '}{auditButton}
|
|
|
|
</Fragment>
|
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else if (player.state === GAME_STATES.midTurn) {
|
|
|
|
} else if (player.state === GAME_STATES.midTurn) {
|
|
|
@ -235,7 +237,7 @@ class PlayerTurnContainer extends React.Component {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
view = (
|
|
|
|
view = (
|
|
|
|
<Fragment>
|
|
|
|
<Fragment>
|
|
|
|
<Button onClick={endTurn}>
|
|
|
|
<Button className="action-item" onClick={endTurn}>
|
|
|
|
End Turn
|
|
|
|
End Turn
|
|
|
|
</Button>{' '}{auditButton}
|
|
|
|
</Button>{' '}{auditButton}
|
|
|
|
</Fragment>);
|
|
|
|
</Fragment>);
|
|
|
@ -1249,7 +1251,7 @@ class Die extends React.Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{this.props.skip && !this.state.finalFace ?
|
|
|
|
{this.props.skip && !this.state.finalFace ?
|
|
|
|
(<div className='center'>
|
|
|
|
(<div className='center'>
|
|
|
|
<Button onClick={() => this.skip()}>Skip</Button>
|
|
|
|
<Button className="action-item" onClick={() => this.skip()}>Skip</Button>
|
|
|
|
</div>) :
|
|
|
|
</div>) :
|
|
|
|
(<Fragment />)}
|
|
|
|
(<Fragment />)}
|
|
|
|
</Fragment>
|
|
|
|
</Fragment>
|
|
|
@ -1342,7 +1344,7 @@ class Harvest extends React.Component {
|
|
|
|
{this.props.crop === 'cows' ? ' head of cow' : ' acres'}</b>!
|
|
|
|
{this.props.crop === 'cows' ? ' head of cow' : ' acres'}</b>!
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{isCurrentPlayer || this.props.currentPlayer.ai ? (
|
|
|
|
{isCurrentPlayer || this.props.currentPlayer.ai ? (
|
|
|
|
<Button onClick={() => this.nextView('roll')}>
|
|
|
|
<Button className="action-item" onClick={() => this.nextView('roll')}>
|
|
|
|
Roll for harvest!
|
|
|
|
Roll for harvest!
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
) : (<Fragment />)}
|
|
|
|
) : (<Fragment />)}
|
|
|
@ -1359,7 +1361,7 @@ class Harvest extends React.Component {
|
|
|
|
showScreen={() => this.nextView('income')}
|
|
|
|
showScreen={() => this.nextView('income')}
|
|
|
|
skip={this.props.player.name === this.props.game.currentPlayer || this.props.currentPlayer.ai}
|
|
|
|
skip={this.props.player.name === this.props.game.currentPlayer || this.props.currentPlayer.ai}
|
|
|
|
autoSkip={this.props.autoSkip === 'die'}
|
|
|
|
autoSkip={this.props.autoSkip === 'die'}
|
|
|
|
showScreenDelay={2000} />);
|
|
|
|
showScreenDelay={showScreenDelay} />);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'income':
|
|
|
|
case 'income':
|
|
|
|
view = (
|
|
|
|
view = (
|
|
|
@ -1392,7 +1394,7 @@ class Harvest extends React.Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{isCurrentPlayer || this.props.currentPlayer.ai ? (
|
|
|
|
{isCurrentPlayer || this.props.currentPlayer.ai ? (
|
|
|
|
<div className='center spacer'>
|
|
|
|
<div className='center spacer'>
|
|
|
|
<Button onClick={() => this.nextView('expense-value')}>Continue</Button>
|
|
|
|
<Button className="action-item" onClick={() => this.nextView('expense-value')}>Continue</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
) : (<Fragment />)}
|
|
|
|
) : (<Fragment />)}
|
|
|
|
</Fragment>
|
|
|
|
</Fragment>
|
|
|
@ -1428,7 +1430,7 @@ class Harvest extends React.Component {
|
|
|
|
{isCurrentPlayer || this.props.currentPlayer.ai ?
|
|
|
|
{isCurrentPlayer || this.props.currentPlayer.ai ?
|
|
|
|
(
|
|
|
|
(
|
|
|
|
<div className='center spacer'>
|
|
|
|
<div className='center spacer'>
|
|
|
|
<Button onClick={this.props.nextAction}>Continue</Button>
|
|
|
|
<Button className="action-item" onClick={this.props.nextAction}>Continue</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
) : (<Fragment />)}
|
|
|
|
) : (<Fragment />)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -1454,9 +1456,9 @@ class Moving extends React.Component {
|
|
|
|
buttons = (<Fragment />);
|
|
|
|
buttons = (<Fragment />);
|
|
|
|
} else if (this.props.ui.playerSpaces[(this.props.currentPlayer.ai && this.props.currentPlayer.color) || this.props.player.color]
|
|
|
|
} else if (this.props.ui.playerSpaces[(this.props.currentPlayer.ai && this.props.currentPlayer.color) || this.props.player.color]
|
|
|
|
=== this.props.ui.actionValue.to) {
|
|
|
|
=== this.props.ui.actionValue.to) {
|
|
|
|
buttons = (<Button onClick={() => this.props.showNextAction()}>Continue</Button>);
|
|
|
|
buttons = (<Button className="action-item" onClick={() => this.props.showNextAction()}>Continue</Button>);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
buttons = (<Button onClick={() => this.skip()}>Skip</Button>);
|
|
|
|
buttons = (<Button className="action-item" onClick={() => this.skip()}>Skip</Button>);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const { currentPlayer } = this.props;
|
|
|
|
const { currentPlayer } = this.props;
|
|
|
|
return (
|
|
|
|
return (
|
|
|
@ -1518,7 +1520,7 @@ class Action extends React.Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buttons = (<Button onClick={() => this.props.showNextAction()}>Continue</Button>);
|
|
|
|
buttons = (<Button className="action-item" onClick={() => this.props.showNextAction()}>Continue</Button>);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'farmers-fate':
|
|
|
|
case 'farmers-fate':
|
|
|
|
view = (
|
|
|
|
view = (
|
|
|
@ -1529,7 +1531,7 @@ class Action extends React.Component {
|
|
|
|
</GroupBox>
|
|
|
|
</GroupBox>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
buttons = (<Button onClick={() => this.props.showNextAction()}>Continue</Button>);
|
|
|
|
buttons = (<Button className="action-item" onClick={() => this.props.showNextAction()}>Continue</Button>);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'ff-uncle-bert':
|
|
|
|
case 'ff-uncle-bert':
|
|
|
|
const { cash } = this.props.player;
|
|
|
|
const { cash } = this.props.player;
|
|
|
@ -1593,7 +1595,7 @@ class Action extends React.Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>);
|
|
|
|
</div>);
|
|
|
|
buttons = (<Button onClick={() => this.props.showNextAction()}>Continue</Button>);
|
|
|
|
buttons = (<Button className="action-item" onClick={() => this.props.showNextAction()}>Continue</Button>);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'info':
|
|
|
|
case 'info':
|
|
|
|
view = (
|
|
|
|
view = (
|
|
|
@ -1601,7 +1603,7 @@ class Action extends React.Component {
|
|
|
|
<p>{this.props.ui.actionValue}</p>
|
|
|
|
<p>{this.props.ui.actionValue}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
buttons = (<Button onClick={() => this.props.showNextAction()}>Continue</Button>);
|
|
|
|
buttons = (<Button className="action-item" onClick={() => this.props.showNextAction()}>Continue</Button>);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'harvest':
|
|
|
|
case 'harvest':
|
|
|
|
view = (<Harvest rolled={this.props.ui.actionValue.rolled}
|
|
|
|
view = (<Harvest rolled={this.props.ui.actionValue.rolled}
|
|
|
@ -1681,7 +1683,7 @@ class Action extends React.Component {
|
|
|
|
autoSkip={this.props.ui.autoSkip}
|
|
|
|
autoSkip={this.props.ui.autoSkip}
|
|
|
|
skip={(this.props.player.name === this.props.game.currentPlayer ||
|
|
|
|
skip={(this.props.player.name === this.props.game.currentPlayer ||
|
|
|
|
currentPlayer.ai)}
|
|
|
|
currentPlayer.ai)}
|
|
|
|
showScreenDelay={2000} />);
|
|
|
|
showScreenDelay={showScreenDelay} />);
|
|
|
|
buttons = (<Fragment />);
|
|
|
|
buttons = (<Fragment />);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@ -1693,7 +1695,7 @@ class Action extends React.Component {
|
|
|
|
game={this.props.game} />);
|
|
|
|
game={this.props.game} />);
|
|
|
|
} else if (currentPlayer.ai) {
|
|
|
|
} else if (currentPlayer.ai) {
|
|
|
|
view = (
|
|
|
|
view = (
|
|
|
|
<Button onClick={endAiTurn}>
|
|
|
|
<Button className="action-item" onClick={endAiTurn}>
|
|
|
|
Next Player's Turn
|
|
|
|
Next Player's Turn
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
);
|
|
|
|
);
|
|
|
|