Spaces:
Runtime error
Runtime error
cont draft
Browse files
app.py
CHANGED
|
@@ -282,15 +282,34 @@ elif genre == "Team Simulation":
|
|
| 282 |
|
| 283 |
df_ret = return_hero_stat(df_extra, name_choice, lb_choice=lb_choice, costume_choice=costume_choice)
|
| 284 |
return df_ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
|
| 286 |
col1, col2, col3, col4, col5 = st.columns(5)
|
| 287 |
with col1:
|
| 288 |
df_hero1 = choose_hero(key="Hero1") # 'key' in st.selectbox to differentiate widgets
|
|
|
|
| 289 |
with col2:
|
| 290 |
df_hero2 = choose_hero(key="Hero2")
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
|
| 295 |
#########################################
|
| 296 |
## Program 3 "Individual Stat"
|
|
|
|
| 282 |
|
| 283 |
df_ret = return_hero_stat(df_extra, name_choice, lb_choice=lb_choice, costume_choice=costume_choice)
|
| 284 |
return df_ret
|
| 285 |
+
|
| 286 |
+
def write_short_description(df_hero):
|
| 287 |
+
st.write(f'Power: {df_hero['power'].values[0]}')
|
| 288 |
+
st.write(f'Attack: {df_hero['attack'].values[0]}')
|
| 289 |
+
st.write(f'Defense: {df_hero['defense'].values[0]}')
|
| 290 |
+
st.write(f'Health: {df_hero['health'].values[0]}')
|
| 291 |
|
| 292 |
col1, col2, col3, col4, col5 = st.columns(5)
|
| 293 |
with col1:
|
| 294 |
df_hero1 = choose_hero(key="Hero1") # 'key' in st.selectbox to differentiate widgets
|
| 295 |
+
write_short_description(df_hero1)
|
| 296 |
with col2:
|
| 297 |
df_hero2 = choose_hero(key="Hero2")
|
| 298 |
+
write_short_description(df_hero2)
|
| 299 |
+
with col3:
|
| 300 |
+
df_hero3 = choose_hero(key="Hero3")
|
| 301 |
+
write_short_description(df_hero3)
|
| 302 |
+
with col4:
|
| 303 |
+
df_hero4 = choose_hero(key="Hero4")
|
| 304 |
+
write_short_description(df_hero4)
|
| 305 |
+
with col5:
|
| 306 |
+
df_hero5 = choose_hero(key="Hero5")
|
| 307 |
+
write_short_description(df_hero5)
|
| 308 |
+
|
| 309 |
+
df_hero_all5 = pd.concat([df_hero1, df_hero2, df_hero3, df_hero4, df_hero5])
|
| 310 |
+
total_power = df_hero1['power'].values[0]+ df_hero2['power'].values[0]+ df_hero3['power'].values[0]+ df_hero4['power'].values[0]+ df_hero5['power'].values[0]
|
| 311 |
+
st.write(f'Total power = {total_power}')
|
| 312 |
+
display_heroes_from_df(df_hero_all5, display_cols=df_hero_all5.columns[:-2], show_df=False) # display all except special-skill text
|
| 313 |
|
| 314 |
#########################################
|
| 315 |
## Program 3 "Individual Stat"
|