|
|
|
@ -34,7 +34,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
|
|
|
import { faUser, faUsers, faTractor, faWindowRestore,
|
|
|
|
|
faDollarSign, faTimes, faExchangeAlt,
|
|
|
|
|
faInfoCircle, faArrowUp, faArrowDown, faAward,
|
|
|
|
|
faBan, faArrowCircleLeft, faPlusCircle } from '@fortawesome/free-solid-svg-icons'
|
|
|
|
|
faBan, faArrowCircleLeft, faPlusCircle, faBirthdayCake } from '@fortawesome/free-solid-svg-icons'
|
|
|
|
|
|
|
|
|
|
import { GroupBox, Row, Col, Button } from '../widgets.jsx'
|
|
|
|
|
import SpaceNode from './SpaceNode.jsx'
|
|
|
|
@ -49,7 +49,7 @@ import { buy, roll, endTurn, loan, trade, submitTradeAccept,
|
|
|
|
|
submitTradeDeny, submitTradeCancel, audit,
|
|
|
|
|
buyUncleBert, skip, endAiTurn, startGame, readyToStart,
|
|
|
|
|
leaveGame, kickPlayer, toggleRevealForTrade,
|
|
|
|
|
addAIPlayer } from './interface.js'
|
|
|
|
|
addAIPlayer, birthdayBonusPlayer } from './interface.js'
|
|
|
|
|
|
|
|
|
|
let showScreenDelay = 2000;
|
|
|
|
|
|
|
|
|
@ -177,18 +177,18 @@ class PlayerResources extends React.Component {
|
|
|
|
|
<ResourceUnit img={TractorImg} h='240' s='100' label='Tractors'
|
|
|
|
|
amount={player.assets.tractor}>
|
|
|
|
|
{player.assets.tractor}
|
|
|
|
|
</ResourceUnit>{' '}
|
|
|
|
|
{player.assets.birthday ? (
|
|
|
|
|
<ResourceUnit img={CakeImg} h='240' s='100' label='Birthday'
|
|
|
|
|
amount={player.assets.birthday ? player.assets.birthday : 0}>
|
|
|
|
|
{player.assets.birthday ? player.assets.birthday : 0}
|
|
|
|
|
</ResourceUnit>
|
|
|
|
|
) : (<></>)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* {' '}
|
|
|
|
|
* <ResourceUnit img={CakeImg} h='240' s='100' label='Birthday'
|
|
|
|
|
* amount={player.assets.birthday ? player.assets.birthday : 0}>
|
|
|
|
|
* {player.assets.birthday ? player.assets.birthday : 0}
|
|
|
|
|
* </ResourceUnit> */
|
|
|
|
|
|
|
|
|
|
// http://stackoverflow.com/questions/149055
|
|
|
|
|
function formatMoney(n) {
|
|
|
|
|
return n.toFixed(1).replace(/(\d)(?=(\d{3})+\.)/g, '$1,').slice(0, -2); }
|
|
|
|
@ -1949,6 +1949,7 @@ class AlertOverlay extends React.Component {
|
|
|
|
|
<FontAwesomeIcon icon={faTimes} />
|
|
|
|
|
</div>
|
|
|
|
|
) : (<></>)}
|
|
|
|
|
<div className='alert-container'>
|
|
|
|
|
<div className='alert-overlay-contents'>
|
|
|
|
|
{this.props.children}
|
|
|
|
|
<br />
|
|
|
|
@ -1966,6 +1967,7 @@ class AlertOverlay extends React.Component {
|
|
|
|
|
{!this.props.preventHiding ? (<a onClick={this.hide}>close</a>) : (<></>)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2055,12 +2057,15 @@ class Info extends React.Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class StartGame extends React.Component {
|
|
|
|
|
render() {
|
|
|
|
|
const { auditThreshold, downPayment, loanInterest, maxDebt, startingOtbs, startingCash, startingDebt } = this.props.game.settings;
|
|
|
|
|
const playerName = this.props.player.name;
|
|
|
|
|
const { color } = this.props.player;
|
|
|
|
|
const { name, host } = this.props.game;
|
|
|
|
|
const StartGame = ({ game, player, toggleReady }) => {
|
|
|
|
|
const { auditThreshold, downPayment, loanInterest, maxDebt, startingOtbs, startingCash, startingDebt } = game.settings;
|
|
|
|
|
const playerName = player.name;
|
|
|
|
|
const { color } = player;
|
|
|
|
|
const { name, host } = game;
|
|
|
|
|
|
|
|
|
|
const birthdayClass = (player) =>
|
|
|
|
|
player.assets.birthday ? 'birthday-selected' : '';
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<h1>Lobby</h1>
|
|
|
|
@ -2069,14 +2074,26 @@ class StartGame extends React.Component {
|
|
|
|
|
</p>
|
|
|
|
|
<h3>Players</h3>
|
|
|
|
|
<ul>
|
|
|
|
|
<li><PlayerColorIcon color={color} /> {playerName}</li>
|
|
|
|
|
{this.props.game.otherPlayers.map((p, i) => (
|
|
|
|
|
<li>
|
|
|
|
|
<PlayerColorIcon color={color} /> {playerName}
|
|
|
|
|
{playerName === host ? (
|
|
|
|
|
<span title="Birthday Bonus" className={'lobby-icon ' + birthdayClass(player)} onClick={() => birthdayBonusPlayer(playerName)}>
|
|
|
|
|
<FontAwesomeIcon icon={faBirthdayCake} />
|
|
|
|
|
</span>
|
|
|
|
|
) : (<></>)}
|
|
|
|
|
</li>
|
|
|
|
|
{game.otherPlayers.map((p, i) => (
|
|
|
|
|
<li key={i}>
|
|
|
|
|
<PlayerColorIcon color={p.player.color} /> {p.player.name}
|
|
|
|
|
{playerName === host ? (
|
|
|
|
|
<span title="Kick Player" className="kick-player" onClick={() => kickPlayer(p.player.name)}>
|
|
|
|
|
<>
|
|
|
|
|
<span title="Kick Player" className="lobby-icon kick-player" onClick={() => kickPlayer(p.player.name)}>
|
|
|
|
|
<FontAwesomeIcon icon={faBan} />
|
|
|
|
|
</span>
|
|
|
|
|
<span title="Birthday Bonus" className={"lobby-icon " + birthdayClass(p.player)} onClick={() => birthdayBonusPlayer(p.player.name)}>
|
|
|
|
|
<FontAwesomeIcon icon={faBirthdayCake} />
|
|
|
|
|
</span>
|
|
|
|
|
</>
|
|
|
|
|
): (<></>)}
|
|
|
|
|
</li>
|
|
|
|
|
))}
|
|
|
|
@ -2097,13 +2114,12 @@ class StartGame extends React.Component {
|
|
|
|
|
<li><b>Starting Debt</b>: ${formatMoney(startingDebt)}</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<label>
|
|
|
|
|
<input type="checkbox" onChange={this.props.toggleReady} />
|
|
|
|
|
<input type="checkbox" onChange={toggleReady} />
|
|
|
|
|
Ready to start
|
|
|
|
|
</label>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const SCREENS = { summary: 'summary', misc: 'misc', farms: 'farms',
|
|
|
|
|
cards: 'cards', trade: 'trade', loans: 'loans',
|
|
|
|
@ -2246,7 +2262,7 @@ class BoardApp extends React.Component {
|
|
|
|
|
buttonText='Close'
|
|
|
|
|
hideHandler={() => 'nothing'}
|
|
|
|
|
handler={() => { return false; }}>
|
|
|
|
|
<Fragment>
|
|
|
|
|
<div className="game-over">
|
|
|
|
|
<h1>Game Over!</h1>
|
|
|
|
|
{alert.contents.results.map((e, i) => (
|
|
|
|
|
<p key={i}>{e}</p>
|
|
|
|
@ -2257,7 +2273,14 @@ class BoardApp extends React.Component {
|
|
|
|
|
<p>{alert.contents.stats.emergency}</p>
|
|
|
|
|
<p>{alert.contents.stats.highRoller}</p>
|
|
|
|
|
<p>{alert.contents.stats.lowRoller}</p>
|
|
|
|
|
</Fragment>
|
|
|
|
|
{alert.contents.stats.players.map(p => (
|
|
|
|
|
<div key={p.name}>
|
|
|
|
|
<p><b>{p.name} Harvests:</b></p>
|
|
|
|
|
<p>Total: ${formatMoney(p.harvestTotal)} Expenses: ${formatMoney(Math.abs(p.operatingExpenses))}</p>
|
|
|
|
|
<p>Avg ${formatMoney(p.harvestAverage)} rolling {p.harvestRoll} for {p.numHarvests} harvests</p>
|
|
|
|
|
<p>Hay: ${formatMoney(p.hay)} Grain: ${formatMoney(p.grain)} Fruit: ${formatMoney(p.fruit)} Cows: ${formatMoney(p.cows)}</p>
|
|
|
|
|
</div>))}
|
|
|
|
|
</div>
|
|
|
|
|
</AlertOverlay>
|
|
|
|
|
);
|
|
|
|
|
} else if (alert && alert.type === ALERTS.auditCalled) {
|
|
|
|
|