Skip to content

Commit

Permalink
Fix: emotion calculation between 119 and 150
Browse files Browse the repository at this point in the history
  • Loading branch information
Air111 committed Apr 17, 2024
1 parent cf0008e commit 845feee
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions module/campaign/gems_farming.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@

class GemsFleetEmotion(FleetEmotion):

@property
def max(self):
return 150

@property
def limit(self):
return 4

def update(self):
current = max(self.value, 0)
if current >= 119:
self.current = current
else:
recover_count = int(int(datetime.now().timestamp()) // 360 - int(self.record.timestamp()) // 360)
recover_count = max(recover_count, 0)
self.current = min(current + self.speed * recover_count, 119)

def reset(self, emotion):
self.current = emotion
self.config.set_record(**{self.value_name: emotion})
Expand Down

0 comments on commit 845feee

Please sign in to comment.