build points/base damage

This commit is contained in:
Daniel
2017-11-24 22:23:53 -05:00
parent 5541d0a47a
commit 00d08847c9
2 changed files with 33 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@@ -30,6 +30,8 @@ export default class SearchForm extends React.Component {
this.gender = {};
this.mc = {};
this.energy = {};
this.bp = {};
this.base = {};
};
render() {
@@ -97,6 +99,16 @@ export default class SearchForm extends React.Component {
<label>Max Energy: <input type="text" style={{width: '30px'}} ref={(input) => this.energy.max = input} /></label>
</div>
<br />
<div>
<label>Min Build Points: <input type="text" style={{width: '20px'}} ref={(input) => this.bp.min = input} /></label>&nbsp;
<label>Max Build Points: <input type="text" style={{width: '20px'}} ref={(input) => this.bp.max = input} /></label>
</div>
<br />
<div>
<label>Min Base Damage: <input type="text" style={{width: '20px'}} ref={(input) => this.base.min = input} /></label>&nbsp;
<label>Max Base Damage: <input type="text" style={{width: '20px'}} ref={(input) => this.base.max = input} /></label>
</div>
<br />
<div>
<label>Min <img height="16" className="icon" src={"/src/img/icons/disciplines/courage.png"} />: <input type="text" style={{width: '30px'}} ref={(input) => this.stones.courage = input} /></label>&nbsp;
<label>Min <img height="16" className="icon" src={"/src/img/icons/disciplines/power.png"} />: <input type="text" style={{width: '30px'}} ref={(input) => this.stones.power = input} /></label>&nbsp;
@@ -291,6 +303,20 @@ export default class SearchForm extends React.Component {
creatureResults = creatureResults.find({'gsx$energy': {'$lte': this.energy.max.value}});
}
if (this.bp.min.value >= 0) {
attackResults = attackResults.find({'gsx$bp': {'$gte': this.bp.min.value}});
}
if (this.bp.max.value >= 0 && this.bp.max.value >= this.bp.min.value) {
attackResults = attackResults.find({'gsx$bp': {'$lte': this.bp.max.value}});
}
if (this.base.min.value >= 0) {
attackResults = attackResults.find({'gsx$base': {'$gte': this.base.min.value}});
}
if (this.base.max.value >= 0 && this.base.max.value >= this.base.min.value) {
attackResults = attackResults.find({'gsx$base': {'$lte': this.base.max.value}});
}
if (this.stones.courage.value > 0) {
creatureResults = creatureResults.find({'gsx$courage': {'$gte': this.stones.courage.value}});
}