 8541c87c97
			
		
	
	8541c87c97
	
	
	
		
			
			* Paint: Implement New Game * Add docstring * Remove unnecessary self.multiworld references * Implement start_inventory_from_pool * Convert logic to use LogicMixin * Add location_exists_with_options function to deduplicate code * Simplify starting tool creation * Add Paint to supported games list * Increment version to 0.4.1 * Update docs to include color selection features * Fix world attribute definitions * Fix linting errors * De-duplicate lists of traps * Move LogicMixin to __init__.py * 0.5.0 features - adjustable canvas size increment, updated similarity metric * Fix OptionError formatting * Create OptionError when generating single-player game with error-prone settings * Increment version to 0.5.1 * Update CODEOWNERS * Update documentation for 0.5.2 client changes * Simplify region creation * Add comments describing logic * Remove unnecessary f-strings * Remove unused import * Refactor rules to location class * Remove unnecessary self.multiworld references * Update logic to correctly match client-side item caps --------- Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
		
			
				
	
	
		
			25 lines
		
	
	
		
			779 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			779 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from typing import NamedTuple, Dict
 | |
| 
 | |
| from BaseClasses import CollectionState, Location
 | |
| 
 | |
| 
 | |
| class PaintLocation(Location):
 | |
|     game = "Paint"
 | |
|     def access_rule(self, state: CollectionState):
 | |
|         from .rules import paint_percent_available
 | |
|         return paint_percent_available(state, state.multiworld.worlds[self.player], self.player) >=\
 | |
|                (self.address % 198600) / 4
 | |
| 
 | |
| 
 | |
| class PaintLocationData(NamedTuple):
 | |
|     region: str
 | |
|     address: int
 | |
| 
 | |
| 
 | |
| location_data_table: Dict[str, PaintLocationData] = {
 | |
|     # f"Similarity: {i}%": PaintLocationData("Canvas", 198500 + i) for i in range(1, 96)
 | |
|     f"Similarity: {i/4}%": PaintLocationData("Canvas", 198600 + i) for i in range(1, 381)
 | |
| }
 | |
| 
 | |
| location_table = {name: data.address for name, data in location_data_table.items()}
 |