Skip to content

Commit

Permalink
Allow multiple crates per trip
Browse files Browse the repository at this point in the history
  • Loading branch information
gc committed Mar 13, 2024
1 parent 625e6e6 commit a6c856b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lib/util/handleTripFinish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,16 @@ const tripFinishEffects: TripFinishEffect[] = [
dropratePerMinute = Math.ceil(dropratePerMinute / 3);
}
const minutes = Math.floor(data.duration / Time.Minute);
const loot = new Bank();
for (let i = 0; i < minutes; i++) {
if (roll(dropratePerMinute)) {
const loot = new Bank().add('Easter crate (s5)');
await user.addItemsToBank({ items: loot, collectionLog: true });
messages.push(bold(`You found ${loot}!`));
break;
loot.add('Easter crate (s5)');
}
}
if (loot.length > 0) {
await user.addItemsToBank({ items: loot, collectionLog: true });
messages.push(bold(`You found ${loot}!`));
}
}
},
{
Expand Down

0 comments on commit a6c856b

Please sign in to comment.