Skip to content

Commit

Permalink
Adding snowballs
Browse files Browse the repository at this point in the history
finally fixes #14
dont know if i want to change where it is (currently the calculations menu) but the feature Exists
  • Loading branch information
Vhou-Atroph committed Mar 9, 2024
1 parent a1c0c3f commit 6214128
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/calc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ pub fn full_calc(trap:Vec<i64>,
throw:Vec<i64>,
squirt:Vec<i64>,
drop:Vec<i64>,
no_group: i64,
lured:bool,
defense:Option<f64>,
neg_defense:Option<f64>) -> i64 {
let mut gagdmg: i64 = 0;
let mut gagdmg: i64 = no_group;
let mut lured_loc = lured;
if trap.len() == 1 && lured_loc {
gagdmg+=gag_calculator(trap,false,defense,neg_defense);
Expand Down
16 changes: 15 additions & 1 deletion src/tt_damage_calculator/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
drp_used = []
trp_used = []


no_group = IntVar()
no_group.set(0)

organic = BooleanVar()
lured = BooleanVar()
pin_val = BooleanVar()
Expand All @@ -55,7 +59,7 @@

# Total damage calculation
def calc_dmg(*args):
tot_dmg = tt_damage_calculator.full_calc(trp_used, snd_used, trw_used, sqt_used, drp_used, lured.get(), dmg_down.get(), dmg_up.get())
tot_dmg = tt_damage_calculator.full_calc(trp_used, snd_used, trw_used, sqt_used, drp_used, no_group.get(), lured.get(), dmg_down.get(), dmg_up.get())
cog_level_indicator.configure(text=tt_damage_calculator.lvl_ind_string(tt_damage_calculator.lvl_ind(tot_dmg), int(dmg_down.get() * 100), int(dmg_up.get() * 100)))
dmg_indicator.configure(text=str(tot_dmg))

Expand Down Expand Up @@ -202,6 +206,14 @@ def press(self):
banana_peel, rake, marbles, quicksand, trapdoor, tnt, railroad
]

# Add groupless damaging gag
def use_groupless(name:str, damage:int):
no_group.set(no_group.get() + damage)
hist_box.configure(state=NORMAL)
hist_box.insert('1.0', "Gag used: " + name + " (" + str(damage) + ")\n")
hist_box.configure(state=DISABLED)
calc_dmg()

# Calculation history
hist = Frame(col1)
hist_lbl = Label(hist, text="History")
Expand Down Expand Up @@ -279,6 +291,7 @@ def clear_inputs(*arg):
sqt_used = []
drp_used = []
trp_used = []
no_group.set(0)
for i in gag_btns:
i.configure(text='0')
if not status_lock.get():
Expand Down Expand Up @@ -336,6 +349,7 @@ def cog_health_calc_show():
def_menu2.add_radiobutton(label="-50%", value=0.5, variable=dmg_up, command=calc_dmg)
def_menu2.add_radiobutton(label="-60%", value=0.6, variable=dmg_up, command=calc_dmg)
calculations_menu.add_cascade(label="Cog Defense Down", menu=def_menu2)
calculations_menu.add_command(label="Snowball", command=lambda:use_groupless("Snowball", 1))
calculations_menu.add_separator()
calculations_menu.add_checkbutton(label="Lock Status", variable=status_lock, onvalue=True, offvalue=False, accelerator=settings.keybinds.lock)
toolbar.add_cascade(label="Calculations", menu=calculations_menu)
Expand Down

0 comments on commit 6214128

Please sign in to comment.