mirror of
https://github.com/ethanrusz/scouter.git
synced 2025-04-12 04:26:33 -04:00
Compare commits
3 commits
9da4481750
...
11b003bca4
Author | SHA1 | Date | |
---|---|---|---|
11b003bca4 | |||
8c992591a8 | |||
1a95687e59 |
1 changed files with 9 additions and 2 deletions
11
app.py
11
app.py
|
@ -25,16 +25,23 @@ class Run:
|
|||
self.outside_power = moon.outside_max_power
|
||||
|
||||
|
||||
def find_spawnlist(remaining_power: int, creatures: list[Creature]) -> list[str]:
|
||||
def find_spawnlist(remaining_power: int, creatures: list[Creature]) -> list[str] | None:
|
||||
"""
|
||||
Given a run, return all possible spwns for location.
|
||||
|
||||
:param remaining_power: The remaining power in the current location.
|
||||
:return: A list of all creatures that may still spawn.
|
||||
"""
|
||||
return sorted(
|
||||
if remaining_power == 0:
|
||||
return None
|
||||
|
||||
spawnable = sorted(
|
||||
[creature.name for creature in creatures if creature.power <= remaining_power]
|
||||
)
|
||||
if spawnable != []:
|
||||
return spawnable
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def main():
|
||||
|
|
Loading…
Add table
Reference in a new issue