Compare commits

...

17 commits
1.0.0 ... main

Author SHA1 Message Date
15a9be25cc
Merge pull request #9 from ethanrusz/actions
Update workflows
2024-02-26 16:54:56 -05:00
c1121238d8
Correct typo 2024-02-26 16:53:48 -05:00
33a5988ef6
Update workflows 2024-02-26 16:46:22 -05:00
9987bd956b
Update app.py docstring 2024-02-19 00:42:43 -05:00
2ec2ec8d3a
Correct typo in app.py 2024-02-17 20:46:19 -05:00
11b003bca4
Update app.py 2024-02-16 17:20:05 -05:00
8c992591a8
Merge pull request #8 from ethanrusz/use-none
Return None instead of empty list
2024-02-16 16:11:47 -06:00
1a95687e59
Return None instead of empty list 2024-02-16 17:07:28 -05:00
9da4481750
Merge pull request #7 from ethanrusz/creatures
Add creature list
2024-02-15 18:27:27 -06:00
c80635913f
Add creature list 2024-02-15 19:26:40 -05:00
69027f0aeb
Update build-and-push.yml
Correct missing tagging.
2024-02-15 16:57:35 -05:00
9864f55e3c
Merge pull request #6 from ethanrusz/actions
Update build and push workflow
2024-02-15 15:46:08 -06:00
7b106be2b1
Update build and push workflow 2024-02-15 16:45:42 -05:00
3f225d6df8
Update build-and-push.yml 2024-02-15 16:22:58 -05:00
7777340160
Update build-and-push.yml 2024-02-15 16:21:58 -05:00
87658fcdf6
Merge pull request #5 from ethanrusz/actions
Add build workflow
2024-02-15 15:21:16 -06:00
cd9ede7bd8
Add build workflow 2024-02-15 16:20:17 -05:00
3 changed files with 80 additions and 11 deletions

29
.github/workflows/build-latest.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: Build and Push to git.beans.team
on:
push:
branches:
- main
jobs:
update-registry:
name: Update Registry Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to git.beans.team
uses: docker/login-action@v3
with:
registry: git.beans.team
username: em
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and Push Image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: git.beans.team/em/scouter:latest

28
.github/workflows/build-release.yml vendored Normal file
View file

@ -0,0 +1,28 @@
name: Build and Push Releases
on:
release:
types: [ published ]
jobs:
update-registry:
name: Update Registry Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to git.beans.team
uses: docker/login-action@v3
with:
registry: git.beans.team
username: em
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and Push Image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: git.beans.team/em/scouter:${{ github.event.release.tag_name }}

32
app.py
View file

@ -25,13 +25,23 @@ class Run:
self.outside_power = moon.outside_max_power
def find_spawnlist(run: Run, 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.
Given a run, return all possible spawns for location.
:param run: The current run object.
:return: A list of all creatures that could still spawn.
:param remaining_power: The remaining power in the current location.
:return: A list of all creatures that may still spawn or None.
"""
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():
@ -97,7 +107,6 @@ def main():
with left_column:
st.markdown("### Outside")
st.info(f"Maximum power: {run.moon.outside_max_power}")
with st.form("outside"):
for creature in outside_creatures:
@ -126,16 +135,17 @@ def main():
outside_submit = st.form_submit_button("Calculate")
if outside_submit:
st.info(f"Maximum power: {run.moon.outside_max_power}")
if run.outside_power >= 0:
st.toast(f"🌳 Outside power remaining: {run.outside_power}")
st.warning(f"🌳 Outside power remaining: {run.outside_power}")
st.write(find_spawnlist(run.outside_power, outside_creatures))
else:
st.error(
f"Power level exceedes maximum possible for {run.moon.name}."
f"Power level exceeds maximum possible for {run.moon.name}."
)
with right_column:
st.markdown("### Inside")
st.info(f"Maximum power: {run.moon.inside_max_power}")
with st.form("inside"):
for creature in inside_creatures:
@ -164,11 +174,13 @@ def main():
inside_submit = st.form_submit_button("Calculate")
if inside_submit:
st.info(f"Maximum power: {run.moon.inside_max_power}")
if run.inside_power >= 0:
st.toast(f"🏭 Inside power remaining: {run.inside_power}")
st.warning(f"🏭 Inside power remaining: {run.inside_power}")
st.write(find_spawnlist(run.inside_power, inside_creatures))
else:
st.error(
f"Power level exceedes maximum possible for {run.moon.name}."
f"Power level exceeds maximum possible for {run.moon.name}."
)