mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-22 13:48:46 +00:00
feat(onboarding): more early incentives
This commit is contained in:
parent
7fd84c7d8a
commit
c210bed033
1 changed files with 5 additions and 2 deletions
|
|
@ -46,6 +46,7 @@ export default function randomDrop (user, options, req = {}, analytics) {
|
|||
|
||||
let chance = min([Math.abs(task.value - 21.27), 37.5]) / 150 + 0.02;
|
||||
chance *= task.priority // Task priority: +50% for Medium, +100% for Hard
|
||||
* (1 + Math.max(0, 80 - (5 * user.stats.lvl)) / 100) // Experimental: more at low levels
|
||||
* (1 + (task.streak / 100 || 0)) // Streak bonus: +1% per streak
|
||||
* (1 + statsComputed(user).per / 100) // PERception: +1% per point
|
||||
* (1 + (user.contributor.level / 40 || 0)) // Contrib levels: +2.5% per level
|
||||
|
|
@ -82,10 +83,12 @@ export default function randomDrop (user, options, req = {}, analytics) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (predictableRandom() < chance) {
|
||||
const firstFoodDrop = size(user.items.food) < 1;
|
||||
|
||||
if (firstFoodDrop || predictableRandom() < chance) {
|
||||
rarity = predictableRandom();
|
||||
|
||||
if (rarity > 0.6) { // food 40% chance
|
||||
if (firstFoodDrop || rarity > 0.6) { // food 40% chance
|
||||
drop = cloneDropItem(randomVal(filter(content.food, {
|
||||
canDrop: true,
|
||||
})));
|
||||
|
|
|
|||
Loading…
Reference in a new issue