Skip to content

Commit

Permalink
gui update commit
Browse files Browse the repository at this point in the history
just realised that i havent uploaded the resources to the github repo
oopsies
  • Loading branch information
redstone59 authored Apr 1, 2024
1 parent 307492c commit 7b2bba8
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions bj3wc.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def do_subchallenge(self, subchallenge: Subchallenge):
over_condition = lambda: Pointer(self.game, 0xbe0, 0x323c).get_value() <= 0

score_pointer = self.get_score_pointer(subchallenge)
get_score = lambda: score_pointer.get_value()
get_score = lambda: score_pointer.get_value() - difference

current_score = get_score()

Expand All @@ -79,7 +79,7 @@ def do_subchallenge(self, subchallenge: Subchallenge):
print(f"{self.penalty} second penalty!")
self.challenge_end_time -= self.penalty

get_score = lambda: previous_score
get_score = lambda: previous_score - difference
break

elif subchallenge.time_bonus_enabled:
Expand All @@ -91,14 +91,15 @@ def do_subchallenge(self, subchallenge: Subchallenge):
print(f"{self.penalty} second penalty!")
self.challenge_end_time -= self.penalty

get_score = lambda: max(0, int(subchallenge_end_time - time.time()) * 1000)
get_score = lambda: int(subchallenge_end_time - time.time()) * 1000
break

elif self.is_challenge_time_up():
self.fail_type = "time out"
if len(self.challenge.subchallenges) != 0:
self.fail_type = "challenge end"
break

return get_score() - difference
return max(0, get_score())

def get_condition_pointer(self, subchallenge: Subchallenge):
pointer_offsets = CHALLENGE_DATA[subchallenge.objective]["pointer_offsets"]
Expand Down Expand Up @@ -137,7 +138,10 @@ def modify_quest_goals(self, subchallenge: Subchallenge):

match subchallenge.objective:
case "Avalanche":
difference = MINIQUEST_GOALS[self.game.get_quest_id()] - subchallenge.condition
if subchallenge.mode == "value":
difference = MINIQUEST_GOALS[self.game.get_quest_id()] - subchallenge.condition
else:
difference = -1000
Pointer(self.game, 0xbe0, 0xe00).set_value(difference)

case "Balance":
Expand All @@ -154,7 +158,10 @@ def modify_quest_goals(self, subchallenge: Subchallenge):
Pointer(self.game, 0xbe0, 0x395c).set_value(1000) # Change number of hands remaining to 1000

case "TimeBomb" | "MatchBomb":
difference = MINIQUEST_GOALS[self.game.get_quest_id()] - subchallenge.condition
if subchallenge.mode == "value":
difference = MINIQUEST_GOALS[self.game.get_quest_id()] - subchallenge.condition
else:
difference = -1000
Pointer(self.game, 0xbe0, 0xe00).set_value(difference)

case "Stratamax":
Expand Down Expand Up @@ -213,6 +220,8 @@ def subchallenge_loop(self):

dordle_time = time.time()
self.wait_until_open(subchallenge)
time.sleep(0.5)

if self.challenge.mode == "timed":
self.challenge_end_time += time.time() - dordle_time
self.gui_queue.put(QueueItem("new_end_time", self.challenge_end_time))
Expand Down
Binary file added resources/Flare Gothic Regular.ttf
Binary file not shown.
Binary file added resources/Myriad Pro Regular.OTF
Binary file not shown.
Binary file added resources/background_high.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/background_normal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/background_ultra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/gem.ico
Binary file not shown.

0 comments on commit 7b2bba8

Please sign in to comment.