Skip to content

Commit

Permalink
SZN7 BOOST (#7)
Browse files Browse the repository at this point in the history
Signed-off-by: prxt <prxt@6529.io>
  • Loading branch information
prxt6529 authored Jun 26, 2024
1 parent 201cd6f commit 5296b6a
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 23 deletions.
1 change: 1 addition & 0 deletions src/entities/ITDH.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export interface DefaultBoost {
memes_szn4: BoostInfo;
memes_szn5: BoostInfo;
memes_szn6: BoostInfo;
memes_szn7: BoostInfo;
memes_genesis: BoostInfo;
memes_nakamoto: BoostInfo;
gradients: BoostInfo;
Expand Down
20 changes: 16 additions & 4 deletions src/tdhLoop/tdh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export interface MemesSeason {
export function getDefaultBoost(): DefaultBoost {
return {
memes_card_sets: {
available: 0.34,
available: 0.39,
available_info: [
'0.3 for Full Collection Set',
'0.35 for Full Collection Set',
'0.02 for each additional set up to 2'
],
acquired: 0,
Expand Down Expand Up @@ -95,6 +95,12 @@ export function getDefaultBoost(): DefaultBoost {
acquired: 0,
acquired_info: []
},
memes_szn7: {
available: 0.05,
available_info: ['0.05 for Season 7 Set'],
acquired: 0,
acquired_info: []
},
memes_genesis: {
available: 0.01,
available_info: ['0.01 for Meme Cards #1, #2, #3 (Genesis Set)'],
Expand Down Expand Up @@ -496,14 +502,14 @@ function calculateMemesBoostsCardSets(cardSets: number) {
let boost = 1;
const breakdown = getDefaultBoost();

let cardSetBreakdown = 0.3;
let cardSetBreakdown = 0.35;
const additionalCardSets = cardSets - 1;
// additional full sets up to 2
cardSetBreakdown += Math.min(additionalCardSets * 0.02, 0.04);
boost += cardSetBreakdown;
breakdown.memes_card_sets.acquired = cardSetBreakdown;

const acquiredInfo = ['0.3 for Full Collection Set'];
const acquiredInfo = ['0.35 for Full Collection Set'];
if (additionalCardSets === 1) {
acquiredInfo.push(`0.02 for 1 additional set`);
} else if (additionalCardSets > 1) {
Expand Down Expand Up @@ -534,6 +540,7 @@ function calculateMemesBoostsSeasons(
const cardSetS4 = hasSeasonSet(4, seasons, memes);
const cardSetS5 = hasSeasonSet(5, seasons, memes);
const cardSetS6 = hasSeasonSet(6, seasons, memes);
const cardSetS7 = hasSeasonSet(7, seasons, memes);

if (cardSetS1) {
boost += 0.05;
Expand Down Expand Up @@ -580,6 +587,11 @@ function calculateMemesBoostsSeasons(
breakdown.memes_szn6.acquired = 0.05;
breakdown.memes_szn6.acquired_info = ['0.05 for holding Season 6 Set'];
}
if (cardSetS7) {
boost += 0.05;
breakdown.memes_szn7.acquired = 0.05;
breakdown.memes_szn7.acquired_info = ['0.05 for holding Season 7 Set'];
}

return {
boost: boost,
Expand Down
60 changes: 41 additions & 19 deletions src/tests/calculateBoost.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,56 @@ const seasons: MemesSeason[] = [
start_index: 1,
end_index: 47,
count: 47,
name: 'SNZ1',
display: 'SNZ1'
name: 'SZN1',
display: 'SZN1'
},
{
id: 2,
start_index: 48,
end_index: 86,
count: 39,
name: 'SNZ2',
display: 'SNZ2'
name: 'SZN2',
display: 'SZN2'
},
{
id: 3,
start_index: 87,
end_index: 118,
count: 32,
name: 'SNZ3',
display: 'SNZ3'
name: 'SZN3',
display: 'SZN3'
},
{
id: 4,
start_index: 119,
end_index: 151,
count: 33,
name: 'SNZ4',
display: 'SNZ4'
name: 'SZN4',
display: 'SZN4'
},
{
id: 5,
start_index: 152,
end_index: 180,
count: 29,
name: 'SNZ5',
display: 'SNZ5'
name: 'SZN5',
display: 'SZN5'
},
{
id: 6,
start_index: 181,
end_index: 212,
count: 32,
name: 'SNZ6',
display: 'SNZ6'
name: 'SZN6',
display: 'SZN6'
},
{
id: 7,
start_index: 213,
end_index: 245,
count: 33,
name: 'SZN7',
display: 'SZN7'
}
];

Expand Down Expand Up @@ -139,6 +147,20 @@ test('calculateBoost should calculate the boost correctly', () => {
).total
).toBe(1.05);

// s7 set
expect(
calculateBoost(
seasons,
0,
{
genesis: 0,
nakamoto: 0
},
getSeasonSet(7),
[]
).total
).toBe(1.05);

// s1 set + genesis
expect(
calculateBoost(
Expand Down Expand Up @@ -305,7 +327,7 @@ test('calculateBoost should calculate the boost correctly', () => {
getSeasonSet(3),
[]
).total
).toBe(1.3);
).toBe(1.35);

// 2set
expect(
Expand All @@ -319,7 +341,7 @@ test('calculateBoost should calculate the boost correctly', () => {
getSeasonSet(3),
[]
).total
).toBe(1.32);
).toBe(1.37);

// 3set
expect(
Expand All @@ -333,7 +355,7 @@ test('calculateBoost should calculate the boost correctly', () => {
getSeasonSet(3),
[]
).total
).toBe(1.34);
).toBe(1.39);

// 4set
expect(
Expand All @@ -347,7 +369,7 @@ test('calculateBoost should calculate the boost correctly', () => {
getSeasonSet(3),
[]
).total
).toBe(1.34);
).toBe(1.39);

// 1set + 4gradient
expect(
Expand All @@ -361,7 +383,7 @@ test('calculateBoost should calculate the boost correctly', () => {
getSeasonSet(3),
[{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }]
).total
).toBe(1.36);
).toBe(1.41);

// 3set + 3gradient
expect(
Expand All @@ -375,7 +397,7 @@ test('calculateBoost should calculate the boost correctly', () => {
getSeasonSet(3),
[{ id: 1 }, { id: 2 }, { id: 3 }]
).total
).toBe(1.4);
).toBe(1.45);

// 3set + naka + genesis + 3gradient
expect(
Expand All @@ -389,7 +411,7 @@ test('calculateBoost should calculate the boost correctly', () => {
getSeasonSet(3),
[{ id: 1 }, { id: 2 }, { id: 3 }]
).total
).toBe(1.4);
).toBe(1.45);

// s3 + s4 set
expect(
Expand Down

0 comments on commit 5296b6a

Please sign in to comment.