|
|
@ -31,7 +31,7 @@ import { connect } from 'react-redux'
|
|
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
|
|
import { faUser, faUsers, faTractor, faWindowRestore,
|
|
|
|
import { faUser, faUsers, faTractor, faWindowRestore,
|
|
|
|
faDollarSign, faTimes, faAsterisk, faExchangeAlt,
|
|
|
|
faDollarSign, faTimes, faAsterisk, faExchangeAlt,
|
|
|
|
faInfoCircle } from '@fortawesome/free-solid-svg-icons'
|
|
|
|
faInfoCircle, faArrowUp } from '@fortawesome/free-solid-svg-icons'
|
|
|
|
|
|
|
|
|
|
|
|
import { GroupBox, Row, Col, Button } from '../widgets.jsx'
|
|
|
|
import { GroupBox, Row, Col, Button } from '../widgets.jsx'
|
|
|
|
import SpaceNode from './SpaceNode.jsx'
|
|
|
|
import SpaceNode from './SpaceNode.jsx'
|
|
|
@ -180,6 +180,9 @@ class ResourceUnit extends React.Component {
|
|
|
|
borderTop: '3px solid ' + hslString + '%, 55%)'}}>
|
|
|
|
borderTop: '3px solid ' + hslString + '%, 55%)'}}>
|
|
|
|
{this.props.img ? (<img src={this.props.img} />) : (<Fragment />)}
|
|
|
|
{this.props.img ? (<img src={this.props.img} />) : (<Fragment />)}
|
|
|
|
{this.props.children}
|
|
|
|
{this.props.children}
|
|
|
|
|
|
|
|
{this.props.doubled ? (
|
|
|
|
|
|
|
|
<p>x2!</p>
|
|
|
|
|
|
|
|
) : (<></>)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -189,7 +192,7 @@ class PlayerTradeResources extends React.Component {
|
|
|
|
render () {
|
|
|
|
render () {
|
|
|
|
let player = this.props.player;
|
|
|
|
let player = this.props.player;
|
|
|
|
return (<form onSubmit={e => tradeFormSubmit(e, player)}>
|
|
|
|
return (<form onSubmit={e => tradeFormSubmit(e, player)}>
|
|
|
|
<div className='player-trade-resources'>
|
|
|
|
<div className='player-trade-resources'>
|
|
|
|
<ResourceUnit h='120' s='100' label='acres of Hay' amount={''}>
|
|
|
|
<ResourceUnit h='120' s='100' label='acres of Hay' amount={''}>
|
|
|
|
<input type='number' id='trade-hay' defaultValue='0' /></ResourceUnit> {' '}
|
|
|
|
<input type='number' id='trade-hay' defaultValue='0' /></ResourceUnit> {' '}
|
|
|
|
<ResourceUnit h='41' s='100' label='acres of Grain' amount={''}>
|
|
|
|
<ResourceUnit h='41' s='100' label='acres of Grain' amount={''}>
|
|
|
@ -228,8 +231,8 @@ class PlayerTradeResources extends React.Component {
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
<PlayerTradeProposed player={this.props.player} />
|
|
|
|
<PlayerTradeProposed player={this.props.player} />
|
|
|
|
<PlayerTradeButton player={this.props.player} />
|
|
|
|
<PlayerTradeButton player={this.props.player} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>);
|
|
|
|
</form>);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -239,11 +242,15 @@ class PlayerResources extends React.Component {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className='resource-unit-container'>
|
|
|
|
<div className='resource-unit-container'>
|
|
|
|
<ResourceUnit img={HayImg} h='120' s='100' label='acres of Hay'
|
|
|
|
<ResourceUnit img={HayImg} h='120' s='100' label='acres of Hay'
|
|
|
|
amount={player.assets.hay}>
|
|
|
|
amount={player.assets.hay}
|
|
|
|
|
|
|
|
doubled={player.hayDoubled}
|
|
|
|
|
|
|
|
>
|
|
|
|
{player.assets.hay}
|
|
|
|
{player.assets.hay}
|
|
|
|
</ResourceUnit> {' '}
|
|
|
|
</ResourceUnit> {' '}
|
|
|
|
<ResourceUnit img={WheatImg} h='41' s='100' label='acres of Grain'
|
|
|
|
<ResourceUnit img={WheatImg} h='41' s='100' label='acres of Grain'
|
|
|
|
amount={player.assets.grain}>
|
|
|
|
amount={player.assets.grain}
|
|
|
|
|
|
|
|
doubled={player.cornDoubled}
|
|
|
|
|
|
|
|
>
|
|
|
|
{player.assets.grain}
|
|
|
|
{player.assets.grain}
|
|
|
|
</ResourceUnit> {' '}
|
|
|
|
</ResourceUnit> {' '}
|
|
|
|
<ResourceUnit img={FruitImg} h='0' s='100' label='acres of Fruit'
|
|
|
|
<ResourceUnit img={FruitImg} h='0' s='100' label='acres of Fruit'
|
|
|
@ -555,6 +562,21 @@ class Loans extends React.Component {
|
|
|
|
loan(1);
|
|
|
|
loan(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
maxRepay = e => {
|
|
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
this.setState({ repay: Math.max(0, Math.floor(
|
|
|
|
|
|
|
|
Math.min(this.props.player.debt + 900, this.props.player.displayCash) / 1000)) });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
maxTakeout = e => {
|
|
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
this.setState({ takeOut: Math.max(0, Math.floor(this.state.maxLoan / 1000)) });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
quickLoan = i => {
|
|
|
|
|
|
|
|
loan(i);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
if (this.props.player.debt !== prevProps.player.debt ||
|
|
|
|
if (this.props.player.debt !== prevProps.player.debt ||
|
|
|
|
this.props.game.settings.loanInterest !== prevProps.game.settings.loanInterest ||
|
|
|
|
this.props.game.settings.loanInterest !== prevProps.game.settings.loanInterest ||
|
|
|
@ -578,7 +600,12 @@ class Loans extends React.Component {
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<form onSubmit={this.handleSubmit}>
|
|
|
|
<form onSubmit={this.handleSubmit}>
|
|
|
|
<Row collapse='true'>
|
|
|
|
<Row collapse='true'>
|
|
|
|
<Col width='8'>
|
|
|
|
<Col width="2">
|
|
|
|
|
|
|
|
{this.props.player.displayCash >= 1000 ? (
|
|
|
|
|
|
|
|
<Button className="tiny" onClick={() => this.quickLoan(-1)}>-1</Button>
|
|
|
|
|
|
|
|
) : (<span>{' '}</span>)}
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
<Col width='6'>
|
|
|
|
<div className='money'>
|
|
|
|
<div className='money'>
|
|
|
|
$:
|
|
|
|
$:
|
|
|
|
<input onChange={this.handleInput} name='repay' type='number'
|
|
|
|
<input onChange={this.handleInput} name='repay' type='number'
|
|
|
@ -587,11 +614,17 @@ class Loans extends React.Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
<Col width='4'>
|
|
|
|
<Col width='4'>
|
|
|
|
|
|
|
|
<Button className='tiny' onClick={this.maxRepay}><FontAwesomeIcon icon={faArrowUp} /></Button>{' '}
|
|
|
|
<Button className='tiny' type='submit'>Repay</Button>
|
|
|
|
<Button className='tiny' type='submit'>Repay</Button>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
<Row collapse='true'>
|
|
|
|
<Row collapse='true'>
|
|
|
|
<Col width='8'>
|
|
|
|
<Col width="2">
|
|
|
|
|
|
|
|
{this.props.player.debt < this.props.game.settings.maxDebt ? (
|
|
|
|
|
|
|
|
<Button className="tiny" onClick={() => this.quickLoan(1)}>+1</Button>
|
|
|
|
|
|
|
|
) : (<span>{' ' }</span>)}
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
<Col width='6'>
|
|
|
|
<div className='money'>
|
|
|
|
<div className='money'>
|
|
|
|
$:
|
|
|
|
$:
|
|
|
|
<input onChange={this.handleInput} name='takeOut' type='number'
|
|
|
|
<input onChange={this.handleInput} name='takeOut' type='number'
|
|
|
@ -600,6 +633,7 @@ class Loans extends React.Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
<Col width='4'>
|
|
|
|
<Col width='4'>
|
|
|
|
|
|
|
|
<Button className='tiny' onClick={this.maxTakeout}><FontAwesomeIcon icon={faArrowUp} /></Button>{' '}
|
|
|
|
<Button className='tiny' type='submit'>Take Out</Button>
|
|
|
|
<Button className='tiny' type='submit'>Take Out</Button>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
@ -875,6 +909,9 @@ class Harvest extends React.Component {
|
|
|
|
Roll for harvest!
|
|
|
|
Roll for harvest!
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
) : (<Fragment />)}
|
|
|
|
) : (<Fragment />)}
|
|
|
|
|
|
|
|
{this.props.harvestMult !== 1 ? (
|
|
|
|
|
|
|
|
<span>Multiplied by {this.props.harvestMult}!</span>
|
|
|
|
|
|
|
|
) : (<></>)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -1170,6 +1207,8 @@ class Action extends React.Component {
|
|
|
|
case 'harvest':
|
|
|
|
case 'harvest':
|
|
|
|
view = (<Harvest rolled={this.props.ui.actionValue.rolled}
|
|
|
|
view = (<Harvest rolled={this.props.ui.actionValue.rolled}
|
|
|
|
player={this.props.player}
|
|
|
|
player={this.props.player}
|
|
|
|
|
|
|
|
currentPlayer={currentPlayer}
|
|
|
|
|
|
|
|
harvestMult={this.props.ui.actionValue.harvestMult}
|
|
|
|
game={this.props.game}
|
|
|
|
game={this.props.game}
|
|
|
|
income={this.props.ui.actionValue.income}
|
|
|
|
income={this.props.ui.actionValue.income}
|
|
|
|
contents={this.props.ui.actionValue.operatingExpense}
|
|
|
|
contents={this.props.ui.actionValue.operatingExpense}
|
|
|
@ -1764,6 +1803,7 @@ class Card extends React.Component {
|
|
|
|
handleSubmit = e => {
|
|
|
|
handleSubmit = e => {
|
|
|
|
e.preventDefault();
|
|
|
|
e.preventDefault();
|
|
|
|
buy(this.props.card.id, this.state.cash);
|
|
|
|
buy(this.props.card.id, this.state.cash);
|
|
|
|
|
|
|
|
this.setState({ cash: 0 });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render () {
|
|
|
|
render () {
|
|
|
|