mirror of
https://github.com/bartvdbraak/SlayerWeightCalculator.git
synced 2025-04-28 10:01:22 +00:00
Slayer point unlocks, removal list filter
This commit is contained in:
parent
b19346ac16
commit
367b564961
1 changed files with 22 additions and 5 deletions
|
@ -96,18 +96,35 @@ export default {
|
||||||
this.currentMaster = this.mastersData[this.$route.params.id];
|
this.currentMaster = this.mastersData[this.$route.params.id];
|
||||||
this.monstersData = this.currentMaster.assignments;
|
this.monstersData = this.currentMaster.assignments;
|
||||||
|
|
||||||
//filter the list of Monsters
|
//filter the list of Monsters and calculate task chances
|
||||||
this.filterData();
|
this.filterData();
|
||||||
this.generateTaskWeights();
|
this.generateTaskWeights();
|
||||||
},
|
},
|
||||||
filterData() {
|
filterData() {
|
||||||
this.filtered_items = this.monstersData;
|
this.filtered_items = this.monstersData;
|
||||||
//filter based on Account Stats
|
let removeIds = [];
|
||||||
|
|
||||||
|
//filter based on Stats
|
||||||
this.configData.statUnlocks.forEach(stat=>{
|
this.configData.statUnlocks.forEach(stat=>{
|
||||||
// For each stat requirement, remove those from list where the current stat value is greater or equal to the monsters requirement value.
|
//for each stat requirement, remove those from list where the current stat value is greater or equal to the monsters requirement value.
|
||||||
this.filtered_items = _.filter(this.filtered_items, function(o){ return parseInt(stat.value.current) >= parseInt(o[stat.filter]) } );
|
this.filtered_items = _.filter(this.filtered_items, function(monster){ return parseInt(stat.value.current) >= parseInt(monster[stat.filter]) } );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//filter based on Point Unlocks
|
||||||
|
this.configData.pointUnlocks.forEach(reward=>{
|
||||||
|
if ((reward.unlock === 'true' && reward.block) || reward.unlock === 'false') {
|
||||||
|
//if reward unlocked but blocks monsters OR reward not unlocked and doesnt block
|
||||||
|
//then, add to removal
|
||||||
|
removeIds = removeIds.concat(reward.monster_ids)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//filter based on Block List
|
||||||
|
|
||||||
|
//filter based on Quest unlocks
|
||||||
|
|
||||||
|
//handle removal list
|
||||||
|
this.filtered_items = _.filter(this.filtered_items, function(monster){ return !removeIds.includes(parseInt(monster.id)) } );
|
||||||
},
|
},
|
||||||
generateTaskWeights() {
|
generateTaskWeights() {
|
||||||
//calculate total weight
|
//calculate total weight
|
||||||
|
|
Loading…
Reference in a new issue