Repository navigation
fix(game): recalculate trade ship spawn rate on each level roll in PortExecution - #5015
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan includes up to 8 reviews per rolling hour; 5 remain after this review. Walkthrough
ChangesTrade ship spawning
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR recalculates the pity-based trade-ship spawn rate for each port-level roll and adds focused tests; no actionable merge-blocking risk remains beyond normal checks. Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add approved & assigned issue number here:
Resolves #5013
Description:
In
PortExecution.ts,shouldSpawnTradeShip()rolls for trade ship spawns for each level of the port (for (let i = 0; i < this.port!.level(); i++)). When a roll fails,this.tradeShipSpawnRejectionsis incremented to track consecutive rejections.Previously,
spawnRatewas computed once before the loop:Because
Config.tradeShipSpawnRate()implements a pity modifier (1 / (tradeShipSpawnRejections + 1)) that increases spawn chances as rejections accumulate, computingspawnRateonce before the loop prevented higher-level ports (levels 2–5) from benefiting from the updated pity rate across consecutive failed rolls within the same tick.This PR moves the
tradeShipSpawnRatecalculation inside the loop so that each roll evaluates against the up-to-date rejection count.Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
berkelmali