|
|
@ -293,8 +293,23 @@ function formatMoney(n) {
|
|
|
|
|
|
|
|
|
|
|
|
class MoneySummary extends React.Component {
|
|
|
|
class MoneySummary extends React.Component {
|
|
|
|
render () {
|
|
|
|
render () {
|
|
|
|
|
|
|
|
const { max } = this.props;
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<span><b>{this.props.title}</b>: ${formatMoney(this.props.value)}</span>
|
|
|
|
<span className="small-text">
|
|
|
|
|
|
|
|
<Row>
|
|
|
|
|
|
|
|
<Col width={max ? '3' : "6"} className="align-right pad-right">
|
|
|
|
|
|
|
|
<b>{this.props.title}</b>:
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
<Col width={max ? '9' : "6"}>
|
|
|
|
|
|
|
|
${formatMoney(this.props.value)}
|
|
|
|
|
|
|
|
{max ? (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
{' '}/ ${formatMoney(max)}
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
) : (<></>)}
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -305,12 +320,23 @@ class PlayerSummary extends React.Component {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<GroupBox title={(<Fragment><div className={'player player-' + player.color}></div> {player.name}
|
|
|
|
<GroupBox title={(<Fragment><div className={'player player-' + player.color}></div> {player.name}
|
|
|
|
</Fragment>)}>
|
|
|
|
</Fragment>)}>
|
|
|
|
<MoneySummary title='Cash' value={player.displayCash} /> {' '}
|
|
|
|
<Row>
|
|
|
|
<MoneySummary title='Debt' value={player.debt} /> {' '}
|
|
|
|
<Col width="5">
|
|
|
|
<br /><br />
|
|
|
|
<MoneySummary title='Cash' value={player.displayCash} />
|
|
|
|
<MoneySummary title='Assets' value={assetsValue(player)} /> {' '}
|
|
|
|
</Col>
|
|
|
|
<MoneySummary title='Net worth' value={netWorth(player)} />
|
|
|
|
<Col width="7">
|
|
|
|
<br /><br />
|
|
|
|
<MoneySummary title='Assets' value={assetsValue(player)} />
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
<Row>
|
|
|
|
|
|
|
|
<Col width="5">
|
|
|
|
|
|
|
|
<MoneySummary title='Debt' value={player.debt} />
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
<Col width="7">
|
|
|
|
|
|
|
|
<MoneySummary title='Net worth' value={netWorth(player)} />
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
<br />
|
|
|
|
<PlayerResources player={player} />
|
|
|
|
<PlayerResources player={player} />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<PlayerTurnContainer player={player}
|
|
|
|
<PlayerTurnContainer player={player}
|
|
|
@ -961,14 +987,24 @@ class Loans extends React.Component {
|
|
|
|
render () {
|
|
|
|
render () {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<GroupBox title={'Loans'}>
|
|
|
|
<GroupBox title={'Loans'}>
|
|
|
|
<MoneySummary title='Cash' value={this.props.player.displayCash} /> {' '}
|
|
|
|
<Row>
|
|
|
|
<MoneySummary title='Debt' value={this.props.player.debt} />
|
|
|
|
<Col width="4">
|
|
|
|
/${formatMoney(this.props.game.settings.maxDebt)}
|
|
|
|
<MoneySummary title='Cash' value={this.props.player.displayCash} />
|
|
|
|
<br />
|
|
|
|
</Col>
|
|
|
|
{this.props.game.settings.loanInterest > 0 ? '(' + (this.props.game.settings.loanInterest * 100) + '% interest added to each loan)' : ''}
|
|
|
|
<Col width="8">
|
|
|
|
<br />
|
|
|
|
<MoneySummary title='Debt' value={this.props.player.debt} max={this.props.game.settings.maxDebt} />
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
{this.props.game.settings.loanInterest > 0 ? (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
{'('}{this.props.game.settings.loanInterest * 100} % interest added to each loan{')'}
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
) : ''}
|
|
|
|
{this.props.player.debt >= this.props.game.settings.maxDebt ? (
|
|
|
|
{this.props.player.debt >= this.props.game.settings.maxDebt ? (
|
|
|
|
<><Button onClick={this.handleEmergencyLoan}>Emergency Loan</Button> $1,000 at 100% interest</>
|
|
|
|
<span className="small-text">
|
|
|
|
|
|
|
|
<Button onClick={this.handleEmergencyLoan} className="tiny">Emergency Loan</Button> $1,000 at 100% interest
|
|
|
|
|
|
|
|
</span>
|
|
|
|
) : (<></>)}
|
|
|
|
) : (<></>)}
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<form onSubmit={this.handleSubmit}>
|
|
|
|
<form onSubmit={this.handleSubmit}>
|
|
|
|