Jung commited on
Commit
794debf
·
verified ·
1 Parent(s): 44ec947

add master talents

Browse files
Files changed (1) hide show
  1. app.py +38 -17
app.py CHANGED
@@ -183,6 +183,34 @@ def return_hero_stat(df0, hero_name, lb_choice="None", costume_choice="None"):
183
  f'{prefix} Health':'health'})
184
  return df_ret
185
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  #########################################
187
  ## Load the main file (TODO: caching)=
188
  st.set_page_config(layout="wide")
@@ -327,8 +355,15 @@ elif genre == "Team Simulation":
327
  costume_choice = st.selectbox(label='Costume:', options=costume_list, index=0, key=key+"_costume")
328
  lb_list = ['None', 'LB1', 'LB2']
329
  lb_choice = st.selectbox(label='Limit Break:', options=lb_list, index=0, key=key+"_lb")
330
-
 
 
331
  df_ret = return_hero_stat(df_extra, name_choice, lb_choice=lb_choice, costume_choice=costume_choice)
 
 
 
 
 
332
  return df_ret
333
 
334
  def write_short_description(df_hero):
@@ -393,24 +428,10 @@ else:
393
 
394
  lb_list = ['None', 'LB1', 'LB2']
395
  lb_choice = st.selectbox(label='Limit Break:', options=lb_list, index=0)
396
-
397
- talent_list = ['None', 'Sword', 'Shield', 'Health']
398
- # talent_choice = st.radio(
399
- # "Approx. Talent",
400
- # talent_list,
401
- # captions = ["Default", "Talents stat are all cruded approximated. Visit heroplan.io for exact calculation."]
402
- # )
403
- talent_choice = st.selectbox(label='Approx. Talent (stat are all cruded approximated. Visit heroplan.io for exact calculation.) :', options=talent_list, index=0)
404
- talent_tp, talent_attack, talent_defense, talent_health = 0, 0, 0, 0
405
- if talent_choice == 'Sword':
406
- talent_tp, talent_attack, talent_defense, talent_health = 100, 150, 50, 100
407
- elif talent_choice == 'Shield':
408
- talent_tp, talent_attack, talent_defense, talent_health = 100, 50, 150, 100
409
- elif talent_choice == 'Health':
410
- talent_tp, talent_attack, talent_defense, talent_health = 100, 75, 75, 200
411
 
412
-
413
  df_ret = return_hero_stat(df_extra, name_choice, lb_choice=lb_choice, costume_choice=costume_choice)
 
414
  df_ret.power.values[0] += talent_tp
415
  df_ret.attack.values[0] += talent_attack
416
  df_ret.defense.values[0] += talent_defense
 
183
  f'{prefix} Health':'health'})
184
  return df_ret
185
 
186
+
187
+ def return_talent_choice(key="default_key"):
188
+ talent_list = ['None', 'Sword+20', 'Shield+20', 'Health+20', 'Sword+25', 'Shield+25', 'Health+20 Shield+5','Sword+20 Shield+5','Shield+20 Sword+5']
189
+
190
+ talent_choice = st.selectbox(label='Approx. Talent (stat are all cruded approximated. Visit heroplan.io for exact calculation.) :',
191
+ options=talent_list,
192
+ index=0,
193
+ key=key)
194
+
195
+ talent_tp, talent_attack, talent_defense, talent_health = 0, 0, 0, 0
196
+ if talent_choice == 'Sword+20':
197
+ talent_tp, talent_attack, talent_defense, talent_health = 100, 150, 50, 100
198
+ elif talent_choice == 'Shield+20':
199
+ talent_tp, talent_attack, talent_defense, talent_health = 100, 50, 150, 100
200
+ elif talent_choice == 'Health+20':
201
+ talent_tp, talent_attack, talent_defense, talent_health = 100, 75, 75, 200
202
+ if talent_choice == 'Sword+25':
203
+ talent_tp, talent_attack, talent_defense, talent_health = 125, 300, 50, 200
204
+ elif talent_choice == 'Shield+25':
205
+ talent_tp, talent_attack, talent_defense, talent_health = 125, 50, 330, 200
206
+ elif talent_choice == 'Health+20 Shield+5': # choose shield-path on 5 master nodes
207
+ talent_tp, talent_attack, talent_defense, talent_health = 125, 75, 255, 300
208
+ elif talent_choice == 'Sword+20 Shield+5':
209
+ talent_tp, talent_attack, talent_defense, talent_health = 125, 150, 230, 200
210
+ elif talent_choice == 'Shield+20 Sword+5':
211
+ talent_tp, talent_attack, talent_defense, talent_health = 125, 200, 150, 200
212
+ return talent_tp, talent_attack, talent_defense, talent_health
213
+
214
  #########################################
215
  ## Load the main file (TODO: caching)=
216
  st.set_page_config(layout="wide")
 
355
  costume_choice = st.selectbox(label='Costume:', options=costume_list, index=0, key=key+"_costume")
356
  lb_list = ['None', 'LB1', 'LB2']
357
  lb_choice = st.selectbox(label='Limit Break:', options=lb_list, index=0, key=key+"_lb")
358
+
359
+ talent_tp, talent_attack, talent_defense, talent_health = return_talent_choice(key=key+"_talent")
360
+
361
  df_ret = return_hero_stat(df_extra, name_choice, lb_choice=lb_choice, costume_choice=costume_choice)
362
+ df_ret.power.values[0] += talent_tp
363
+ df_ret.attack.values[0] += talent_attack
364
+ df_ret.defense.values[0] += talent_defense
365
+ df_ret.health.values[0] += talent_health
366
+
367
  return df_ret
368
 
369
  def write_short_description(df_hero):
 
428
 
429
  lb_list = ['None', 'LB1', 'LB2']
430
  lb_choice = st.selectbox(label='Limit Break:', options=lb_list, index=0)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
 
432
+ talent_tp, talent_attack, talent_defense, talent_health = return_talent_choice()
433
  df_ret = return_hero_stat(df_extra, name_choice, lb_choice=lb_choice, costume_choice=costume_choice)
434
+
435
  df_ret.power.values[0] += talent_tp
436
  df_ret.attack.values[0] += talent_attack
437
  df_ret.defense.values[0] += talent_defense