mirror of
				https://github.com/bartvdbraak/SlayerWeightCalculator.git
				synced 2025-10-31 04:09:11 +00:00 
			
		
		
		
	Implements all current filters (point unlocks, block list, quest unlocks)
This commit is contained in:
		
							parent
							
								
									367b564961
								
							
						
					
					
						commit
						44934f784b
					
				
					 3 changed files with 39 additions and 39 deletions
				
			
		|  | @ -23,8 +23,6 @@ | ||||||
|                                 accept=".json"> |                                 accept=".json"> | ||||||
|                         </b-form-file> |                         </b-form-file> | ||||||
|                     </b-button-toolbar> |                     </b-button-toolbar> | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|                 </b-col> |                 </b-col> | ||||||
|             </b-row> |             </b-row> | ||||||
|             <b-row class="shadow py-3 mb-5"> |             <b-row class="shadow py-3 mb-5"> | ||||||
|  |  | ||||||
|  | @ -11,19 +11,19 @@ export default { | ||||||
| 		return { | 		return { | ||||||
| 			mainConfig: { | 			mainConfig: { | ||||||
| 				statUnlocks: [ | 				statUnlocks: [ | ||||||
| 					{id: 0, name: 'Slayer level', filter: 'slayer_req', value: {min: 1, current: 99, max: 99}, image: 'slayer_icon.png', unlock: false}, | 					{id: 0, name: 'Slayer level', filter: 'slayer_req', value: {min: 1, current: 99, max: 99}, image: 'slayer_icon.png', unlock: 'false'}, | ||||||
| 					{id: 1, name: 'Combat level', filter: 'combat_req', value: {min: 3, current: 126, max: 126}, image: 'combat_icon.png', unlock: false}, | 					{id: 1, name: 'Combat level', filter: 'combat_req', value: {min: 3, current: 126, max: 126}, image: 'combat_icon.png', unlock: 'false'}, | ||||||
| 					{id: 2, name: 'Defence level', filter: 'defence_req', value: {min: 1, current: 99, max: 99}, image: 'defence_icon.png', unlock: false}, | 					{id: 2, name: 'Defence level', filter: 'defence_req', value: {min: 1, current: 99, max: 99}, image: 'defence_icon.png', unlock: 'false'}, | ||||||
| 				], | 				], | ||||||
| 				pointUnlocks: [ | 				pointUnlocks: [ | ||||||
| 					{id: 0, name: 'Seeing red', monster_ids: [83, 3], unlock: false, masters: [5,6,7]}, | 					{id: 0, name: 'Seeing red', monster_ids: [83, 3], unlock: 'false', masters: [5,6,7]}, | ||||||
| 					{id: 1, name: 'I hope you mith me', monster_ids: [72], unlock: false, masters: [5,6,7]}, | 					{id: 1, name: 'I hope you mith me', monster_ids: [72], unlock: 'false', masters: [5,6,7]}, | ||||||
| 					{id: 2, name: 'Watch the birdie', monster_ids: [4], unlock: false, masters: [4,5,6,7]}, | 					{id: 2, name: 'Watch the birdie', monster_ids: [4], unlock: 'false', masters: [4,5,6,7]}, | ||||||
| 					{id: 3, name: 'Hot stuff', monster_ids: [102], unlock: false, masters: [4,6,7]}, | 					{id: 3, name: 'Hot stuff', monster_ids: [102], unlock: 'false', masters: [4,6,7]}, | ||||||
| 					{id: 4, name: 'Reptile got ripped', monster_ids: [66], unlock: false, masters: [4,5,6,7]}, | 					{id: 4, name: 'Reptile got ripped', monster_ids: [66], unlock: 'false', masters: [4,5,6,7]}, | ||||||
| 					{id: 5, name: 'Like a boss', monster_ids: [15], unlock: false, masters: [5,6,7]}, | 					{id: 5, name: 'Like a boss', monster_ids: [15], unlock: 'false', masters: [5,6,7]}, | ||||||
| 					{id: 6, name: 'Stop the Wyvern', monster_ids: [42], unlock: false, block: true}, | 					{id: 6, name: 'Stop the Wyvern', monster_ids: [42], unlock: 'false', block: 'true'}, | ||||||
| 					{id: 7, name: 'Basilocked', monster_ids: [7], unlock: false, masters: [5,6,7]}, | 					{id: 7, name: 'Basilocked', monster_ids: [7], unlock: 'false', masters: [5,6,7]}, | ||||||
| 				], | 				], | ||||||
| 				blockList: [ | 				blockList: [ | ||||||
| 					{id: 0, name: 'Block task (50 quest points)', monster_ids: null, block: true}, | 					{id: 0, name: 'Block task (50 quest points)', monster_ids: null, block: true}, | ||||||
|  | @ -34,29 +34,29 @@ export default { | ||||||
| 					{id: 5, name: 'Block task (300 quest points)', monster_ids: null, block: true}, | 					{id: 5, name: 'Block task (300 quest points)', monster_ids: null, block: true}, | ||||||
| 				], | 				], | ||||||
| 				questUnlocks: [ | 				questUnlocks: [ | ||||||
| 					{id: 0, name: 'Bone Voyage', monster_ids: [42], unlock: false}, | 					{id: 0, name: 'Bone Voyage', monster_ids: [42], unlock: 'false'}, | ||||||
| 					{id: 1, name: 'Cabin Fever', monster_ids: [60, 21], unlock: false}, | 					{id: 1, name: 'Cabin Fever', monster_ids: [60, 21], unlock: 'false'}, | ||||||
| 					{id: 2, name: 'Contact!', monster_ids: [70], unlock: false}, | 					{id: 2, name: 'Contact!', monster_ids: [70], unlock: 'false'}, | ||||||
| 					{id: 3, name: 'Death Plateau', monster_ids: [96], unlock: false}, | 					{id: 3, name: 'Death Plateau', monster_ids: [96], unlock: 'false'}, | ||||||
| 					{id: 4, name: 'Death to the Dorgeshuun', monster_ids: [74], unlock: false}, | 					{id: 4, name: 'Death to the Dorgeshuun', monster_ids: [74], unlock: 'false'}, | ||||||
| 					{id: 5, name: 'Desert Treasure (started)', monster_ids: [34, 94], unlock: false}, | 					{id: 5, name: 'Desert Treasure (started)', monster_ids: [34, 94], unlock: 'false'}, | ||||||
| 					{id: 6, name: 'Dragon Slayer', monster_ids: [48, 14, 83, 12, 17, 58, 97, 72], alternative_text: "Dragons", unlock: false}, | 					{id: 6, name: 'Dragon Slayer', monster_ids: [48, 14, 83, 12, 17, 58, 97, 72], alternative_text: "Dragons", unlock: 'false'}, | ||||||
| 					{id: 7, name: 'Dragon Slayer II', monster_ids: [2, 87], unlock: false}, | 					{id: 7, name: 'Dragon Slayer II', monster_ids: [2, 87], unlock: 'false'}, | ||||||
| 					{id: 8, name: 'Elemental Workshop I', monster_ids: [92], unlock: false}, | 					{id: 8, name: 'Elemental Workshop I', monster_ids: [92], unlock: 'false'}, | ||||||
| 					{id: 9, name: 'Ernest the Chicken', monster_ids: [62], unlock: false}, | 					{id: 9, name: 'Ernest the Chicken', monster_ids: [62], unlock: 'false'}, | ||||||
| 					{id: 10, name: 'Fairytale II (without Priest in Peril)', monster_ids: [1], unlock: false}, | 					{id: 10, name: 'Fairytale II (without Priest in Peril)', monster_ids: [1], unlock: 'false'}, | ||||||
| 					{id: 11, name: 'Horror from the Deep', monster_ids: [29], unlock: false}, | 					{id: 11, name: 'Horror from the Deep', monster_ids: [29], unlock: 'false'}, | ||||||
| 					{id: 12, name: 'Legends\' Quest', monster_ids: [91], unlock: false}, | 					{id: 12, name: 'Legends\' Quest', monster_ids: [91], unlock: 'false'}, | ||||||
| 					{id: 13, name: 'Lost City', monster_ids: [77, 80], unlock: false}, | 					{id: 13, name: 'Lost City', monster_ids: [77, 80], unlock: 'false'}, | ||||||
| 					{id: 14, name: 'Lunar Diplomacy (partial)', monster_ids: [98], unlock: false}, | 					{id: 14, name: 'Lunar Diplomacy (partial)', monster_ids: [98], unlock: 'false'}, | ||||||
| 					{id: 15, name: 'Mourning\'s End Part II (started)', monster_ids: [30], unlock: false}, | 					{id: 15, name: 'Mourning\'s End Part II (started)', monster_ids: [30], unlock: 'false'}, | ||||||
| 					{id: 16, name: 'Olaf\'s Quest (partial)', monster_ids: [16], unlock: false}, | 					{id: 16, name: 'Olaf\'s Quest (partial)', monster_ids: [16], unlock: 'false'}, | ||||||
| 					{id: 17, name: 'Priest in Peril', monster_ids: [6, 27, 103, 45, 90, 106, 13, 0, 57, 78, 43, 1], alternative_text: "Morytania monsters", unlock: false}, | 					{id: 17, name: 'Priest in Peril', monster_ids: [6, 27, 103, 45, 90, 106, 13, 0, 57, 78, 43, 1], alternative_text: "Morytania monsters", unlock: 'false'}, | ||||||
| 					{id: 18, name: 'Regicide (started)', monster_ids: [37], unlock: false}, | 					{id: 18, name: 'Regicide (started)', monster_ids: [37], unlock: 'false'}, | ||||||
| 					{id: 19, name: 'Royal Trouble', monster_ids: [89], unlock: false}, | 					{id: 19, name: 'Royal Trouble', monster_ids: [89], unlock: 'false'}, | ||||||
| 					{id: 20, name: 'Rum Deal (started)', monster_ids: [39], unlock: false}, | 					{id: 20, name: 'Rum Deal (started)', monster_ids: [39], unlock: 'false'}, | ||||||
| 					{id: 21, name: 'Skippy and the Mogres (miniquest)', monster_ids: [73], unlock: false}, | 					{id: 21, name: 'Skippy and the Mogres (miniquest)', monster_ids: [73], unlock: 'false'}, | ||||||
| 					{id: 22, name: 'Waterfall Quest', monster_ids: [40], unlock: false}, | 					{id: 22, name: 'Waterfall Quest', monster_ids: [40], unlock: 'false'}, | ||||||
| 				], | 				], | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | @ -61,13 +61,13 @@ export default { | ||||||
| 					key: 'combat_req', | 					key: 'combat_req', | ||||||
| 					label: 'Combat Requirement', | 					label: 'Combat Requirement', | ||||||
| 					sortable: true, | 					sortable: true, | ||||||
| 					// class: 'd-none', | 					class: 'd-none', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					key: 'slayer_req', | 					key: 'slayer_req', | ||||||
| 					label: 'Slayer Requirement', | 					label: 'Slayer Requirement', | ||||||
| 					sortable: true, | 					sortable: true, | ||||||
| 					class: '', | 					class: 'd-none', | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					key: 'defence_req', | 					key: 'defence_req', | ||||||
|  | @ -112,7 +112,7 @@ export default { | ||||||
| 
 | 
 | ||||||
| 			//filter based on Point Unlocks | 			//filter based on Point Unlocks | ||||||
| 			this.configData.pointUnlocks.forEach(reward=>{ | 			this.configData.pointUnlocks.forEach(reward=>{ | ||||||
| 	            if ((reward.unlock === 'true' && reward.block) || reward.unlock === 'false') { | 	            if ((reward.unlock === 'true' && reward.block) || (reward.unlock === 'false' && !reward.block)) { | ||||||
| 					//if reward unlocked but blocks monsters OR reward not unlocked and doesnt block | 					//if reward unlocked but blocks monsters OR reward not unlocked and doesnt block | ||||||
| 					//then, add to removal | 					//then, add to removal | ||||||
| 					removeIds = removeIds.concat(reward.monster_ids) | 					removeIds = removeIds.concat(reward.monster_ids) | ||||||
|  | @ -120,8 +120,10 @@ export default { | ||||||
| 			}); | 			}); | ||||||
| 
 | 
 | ||||||
| 			//filter based on Block List | 			//filter based on Block List | ||||||
|  | 			removeIds = removeIds.concat(this.configData.blockList.map(item => item.monster_ids)); | ||||||
| 
 | 
 | ||||||
| 			//filter based on Quest unlocks | 			//filter based on Quest unlocks | ||||||
|  | 			removeIds = removeIds.concat(this.configData.questUnlocks.filter(quest => quest.unlock === 'false').flatMap(item => item.monster_ids)); | ||||||
| 
 | 
 | ||||||
| 			//handle removal list | 			//handle removal list | ||||||
| 			this.filtered_items = _.filter(this.filtered_items, function(monster){ return !removeIds.includes(parseInt(monster.id)) } ); | 			this.filtered_items = _.filter(this.filtered_items, function(monster){ return !removeIds.includes(parseInt(monster.id)) } ); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue