Spaces:
Running
Running
Merge pull request #67 from alecrem/feature/issue-66/search-by-mana-value
Browse files
Middle_School_Card_Search.py
CHANGED
@@ -79,8 +79,19 @@ if colorcol5.checkbox(_["basic"]["color_g"][l]):
|
|
79 |
if colorcol6.checkbox(_["basic"]["color_c"][l]):
|
80 |
results_df = results_df[results_df["c"] == True]
|
81 |
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
# Filter by type (select)
|
|
|
84 |
type_list = streamlit_common.locale.get_type_options()
|
85 |
select_types = col1.multiselect(
|
86 |
f'**{_["search"]["select_type"][l]}**',
|
|
|
79 |
if colorcol6.checkbox(_["basic"]["color_c"][l]):
|
80 |
results_df = results_df[results_df["c"] == True]
|
81 |
|
82 |
+
# Filter by mana value
|
83 |
+
min_mv = mslist_df["mv"].min()
|
84 |
+
max_mv = mslist_df["mv"].max()
|
85 |
+
mv_options = [mv for mv in range(min_mv, max_mv + 1)]
|
86 |
+
start_mv, end_mv = st.select_slider(
|
87 |
+
f'**{_["search"]["search_by_mv"][l]}**', options=mv_options, value=(min_mv, max_mv)
|
88 |
+
)
|
89 |
+
cond1 = results_df["mv"] >= start_mv
|
90 |
+
cond2 = results_df["mv"] <= end_mv
|
91 |
+
results_df = results_df[cond1 & cond2]
|
92 |
+
|
93 |
# Filter by type (select)
|
94 |
+
col1, col2 = st.columns(2)
|
95 |
type_list = streamlit_common.locale.get_type_options()
|
96 |
select_types = col1.multiselect(
|
97 |
f'**{_["search"]["select_type"][l]}**',
|
list_scripts/8_add_other_fields.py
CHANGED
@@ -6,7 +6,7 @@ def add_other_fields(row: pd.DataFrame) -> pd.DataFrame:
|
|
6 |
print(f"{row['name']} | {row['oracle_id']}")
|
7 |
for index, card in enumerate(cards):
|
8 |
if card["identifiers"]["scryfallOracleId"] == row["oracle_id"]:
|
9 |
-
row["
|
10 |
row["rarity"] = card["rarity"]
|
11 |
row["text"] = card["text"] if "text" in card else None
|
12 |
row["type"] = card["type"]
|
|
|
6 |
print(f"{row['name']} | {row['oracle_id']}")
|
7 |
for index, card in enumerate(cards):
|
8 |
if card["identifiers"]["scryfallOracleId"] == row["oracle_id"]:
|
9 |
+
row["mv"] = card["manaValue"]
|
10 |
row["rarity"] = card["rarity"]
|
11 |
row["text"] = card["text"] if "text" in card else None
|
12 |
row["type"] = card["type"]
|
output/middleschool_extra_fields.csv
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
,Unnamed: 0,oracle_id,name,name_ja,
|
2 |
0,0,8adbba6e-03ef-4278-aec5-8a4496b377a8,Abandon Hope,断念,2,uncommon,"As an additional cost to cast this spell, discard X cards.
|
3 |
Look at target opponent's hand and choose X cards from it. That player discards those cards.",Sorcery,,,False,False,True,False,False,False
|
4 |
1,1,5a70ccfa-d12d-4e62-a1a4-f05cda2fd442,Abandoned Outpost,見捨てられた前哨地,0,common,"Abandoned Outpost enters the battlefield tapped.
|
|
|
1 |
+
,Unnamed: 0,oracle_id,name,name_ja,mv,rarity,text,type,power,toughness,w,u,b,r,g,c
|
2 |
0,0,8adbba6e-03ef-4278-aec5-8a4496b377a8,Abandon Hope,断念,2,uncommon,"As an additional cost to cast this spell, discard X cards.
|
3 |
Look at target opponent's hand and choose X cards from it. That player discards those cards.",Sorcery,,,False,False,True,False,False,False
|
4 |
1,1,5a70ccfa-d12d-4e62-a1a4-f05cda2fd442,Abandoned Outpost,見捨てられた前哨地,0,common,"Abandoned Outpost enters the battlefield tapped.
|
output/middleschool_extra_fields.json
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
streamlit_common/locale.py
CHANGED
@@ -50,6 +50,10 @@ def get_locale():
|
|
50 |
"en": "Color:",
|
51 |
"ja": "色:",
|
52 |
},
|
|
|
|
|
|
|
|
|
53 |
"cards_found": {
|
54 |
"en": " cards were found.",
|
55 |
"ja": "枚 のカードが見つかりました。",
|
|
|
50 |
"en": "Color:",
|
51 |
"ja": "色:",
|
52 |
},
|
53 |
+
"search_by_mv": {
|
54 |
+
"en": "Mana value:",
|
55 |
+
"ja": "マナ総量:",
|
56 |
+
},
|
57 |
"cards_found": {
|
58 |
"en": " cards were found.",
|
59 |
"ja": "枚 のカードが見つかりました。",
|