Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 14 additions & 28 deletions src/badge_logic/sum_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,64 @@ module.exports = function (data) {
pois: {
name: 'On Point',
id: 3,
tiers: {1: 10, 2: 50, 3: 100, 4: 250, 5: 500, 6: 1000, 7: 1500, 8: 2000, 9: 2500, 10: 4000}
tiers: {1: 500, 2: 2500, 3: 5000}
},
buildings: {
name: 'The Wright Stuff',
id: 4,
tiers: {1: 100, 2: 500, 3: 1000, 4: 2500, 5: 5000, 6: 10000, 7: 25000, 8: 50000, 9: 75000, 10: 100000}
tiers: {1: 100, 2: 500, 3: 1000}
},
gpsTraces: {
name: 'Field Mapper',
id: 5,
tiers: {1: 10, 2: 50, 3: 100, 4: 250, 5: 500, 6: 750, 7: 1000, 8: 1500, 9: 2000, 10: 5000}
tiers: {1: 10, 2: 50, 3: 100}
},
roadKms: {
name: 'On The Road Again',
id: 6,
tiers: {1: 50, 2: 100, 3: 500, 4: 1000, 5: 1500, 6: 2000, 7: 2500, 8: 5000, 9: 7500, 10: 10000}
tiers: {1: 50, 2: 100, 3: 500}
},
roadKmMods: {
name: 'Long and Winding Road',
id: 7,
tiers: {1: 50, 2: 100, 3: 500, 4: 1000, 5: 1500, 6: 2000, 7: 2500, 8: 5000, 9: 7500, 10: 10000}
tiers: {1: 50, 2: 100, 3: 500}
},
waterways: {
name: 'White Water Rafting',
id: 8,
tiers: {1: 50, 2: 100, 3: 500, 4: 1000, 5: 1500, 6: 2000, 7: 2500, 8: 5000, 9: 7500, 10: 10000}
tiers: {1: 50, 2: 100, 3: 500}
},
countries: {
name: 'World Renown',
id: 9,
tiers: {1: 5, 2: 10, 3: 20, 4: 25, 5: 30, 6: 35, 7: 40, 8: 50, 9: 75, 10: 100}
tiers: {1: 5, 2: 10, 3: 25}
},
tasks: {
name: 'Task Champion',
id: 10,
tiers: {1: 10, 2: 25, 3: 100, 4: 200, 5: 400, 6: 800, 7: 1250, 8: 2500, 9: 5000, 10: 10000}
tiers: {1: 10, 2: 25, 3: 100}
},
taskValidations: {
name: 'Scrutinizer',
id: 11,
tiers: {1: 10, 2: 25, 3: 50, 4: 100, 5: 250, 6: 500, 7: 750, 8: 1000, 9: 2000, 10: 5000}
tiers: {1: 25, 2: 100, 3: 250}
},
josm: {
name: 'Awesome JOSM',
id: 12,
tiers: {1: 1, 2: 10, 3: 100, 4: 250, 5: 500, 6: 750, 7: 1000, 8: 1500, 9: 2500, 10: 5000}
tiers: {1: 1, 2: 10, 3: 100}
},
hashtags: {
name: 'Mapathoner',
id: 13,
tiers: {1: 1, 2: 10, 3: 25, 4: 25, 5: 50, 6: 75, 7: 100, 8: 150, 9: 250, 10: 500}
tiers: {1: 5, 2: 20, 3: 50}
},

// ID #14 and 16 used by date check logic
taskInvalidations: {
name: 'High Standards',
id: 16,
tiers: {1: 5, 2: 15, 3: 25, 4: 50, 5: 100, 6: 200, 7: 300, 8: 500, 9: 750, 10: 1000}
tiers: {1: 25, 2: 100, 3: 250}
}
};

Expand All @@ -71,22 +71,8 @@ module.exports = function (data) {
return 1;
} else if (userTotal >= badge.tiers[2] && userTotal < badge.tiers[3]) {
return 2;
} else if (userTotal >= badge.tiers[3] && userTotal < badge.tiers[4]) {
} else if (userTotal >= badge.tiers[3]) {
return 3;
} else if (userTotal >= badge.tiers[4] && userTotal < badge.tiers[5]) {
return 4;
} else if (userTotal >= badge.tiers[5] && userTotal < badge.tiers[6]) {
return 5;
} else if (userTotal >= badge.tiers[6] && userTotal < badge.tiers[7]) {
return 6;
} else if (userTotal >= badge.tiers[7] && userTotal < badge.tiers[8]) {
return 7;
} else if (userTotal >= badge.tiers[8] && userTotal < badge.tiers[9]) {
return 8;
} else if (userTotal >= badge.tiers[9] && userTotal < badge.tiers[10]) {
return 9;
} else if (userTotal >= badge.tiers[10]) {
return 10;
} else {
return 0;
}
Expand All @@ -99,7 +85,7 @@ module.exports = function (data) {

var badgeLevel = checkBadgeLevel(userTotal, badge);

if (badgeLevel < 10) {
if (badgeLevel < 3) {
var nextBadgeLevel = badgeLevel + 1;
var currentPoints = Number(userTotal);
var lastPoints = 0;
Expand Down