Skip to content

Commit

Permalink
random boosterfactor milestone message
Browse files Browse the repository at this point in the history
  • Loading branch information
saertna committed Mar 20, 2024
1 parent 4d02dc1 commit 9208384
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ import {getLevelForPoints, statusPointsForLevel} from './levels'
import {
getRandomMessagePoints,
getRandomMessageTwoNoteChallenge,
getRandomMessageWeeklyChallenge
getRandomMessageWeeklyChallenge,
getRandomMessageBoosterFactor
} from './randomNotificationText'
import {ModalInformationbox} from 'ModalInformationbox';
import {ModalBooster} from 'ModalBooster';
Expand Down Expand Up @@ -228,7 +229,9 @@ export default class gamification extends Plugin implements GamificationMediator
// PLUGIN_VERSION
// ).open();

await this.decreaseStreakbooster(50);
//await this.decreaseStreakbooster(50);
await this.increaseStreakbooster(0.8);

//this.setBadgeSave(getBadgeDetails('Brainiac Trailblazer'),'23-09-07', 'level 20');
//this.setBadgeSave(getBadgeDetails('Savvy Scholar'), '23-08-15', 'level 15');
});
Expand Down Expand Up @@ -1024,8 +1027,10 @@ export default class gamification extends Plugin implements GamificationMediator
// Send message if newBoosterFactor crosses a multiple of 5
const oldIntegerPart = Math.floor(oldBoosterFactor);
const newIntegerPart = Math.floor(newBoosterFactor);
if (newBoosterFactor > oldBoosterFactor && newIntegerPart !== oldIntegerPart) {
new Notice(`Boom! You just hit another milestone! High five, champ!`,this.getSettingNumber('timeShowNotice') * 1000 * 1.2)
if (oldBoosterFactor <= 80 && newBoosterFactor <= 80 && newBoosterFactor > oldBoosterFactor &&
newIntegerPart !== oldIntegerPart && newIntegerPart % 5 === 0) {
new Notice(getRandomMessageBoosterFactor(),this.getSettingNumber('timeShowNotice') * 1000 * 1.2)
console.log(`${getRandomMessageBoosterFactor()} : ${newBoosterFactor}`)
}

if (debugLogs) console.debug(`newBoosterFakfor: ${newBoosterFactor}`);
Expand Down
57 changes: 57 additions & 0 deletions src/randomNotificationText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,58 @@ const randomPointNotices: string[] = [
"Well deserved! [X] points earned!"
];

const boosterFactorMessage : string[] = [
"Boom! You just hit a new Boosterfactor milestone! High five, booster pro!",
"Boosting it up! High five for reaching that Boosterfactor benchmark!",
"Way to amplify your game! High five for hitting that Boosterfactor goal!",
"You're turbocharging your progress! High five for achieving that Boosterfactor milestone!",
"Bam! Another Boosterfactor milestone smashed! High five, booster champion!",
"You're on turbo mode! High five for maximizing your Boosterfactor!",
"High five alert! You just boosted your way to a new milestone!",
"You're officially a booster master! High five for your unstoppable Boosterfactor streak!",
"Nailed it! High five for reaching another Boosterfactor milestone!",
"Woo hoo! High five for leveling up your Boosterfactor game!",
"On a boost spree! High five for maximizing your Boosterfactor!",
"High fives all around for reaching that Boosterfactor milestone!",
"Look at you go! High five for turbocharging your Boosterfactor!",
"You're making waves with your Boosterfactor! High five for the milestone!",
"High five incoming! You're a Boosterfactor maestro!",
"Keep 'em coming! High five for reaching another Boosterfactor milestone!",
"Bravo! High five for your stellar Boosterfactor progress!",
"High fives galore for hitting that Boosterfactor milestone!",
"You're unstoppable! High five for your Boosterfactor mayhem!",
"Kaboom! High five for blowing past that Boosterfactor milestone!",
"Way to hustle with your Boosterfactor! High five, booster hustler!",
"High five vibes for boosting your way to that milestone!",
"Bringing the heat with your Boosterfactor! High five for the milestone heatwave!",
"You're a Boosterfactor machine! High five, keep it up!",
"High fives incoming! You're a Boosterfactor mastermind!",
"Boosting like a boss! High five, booster superstar!",
"Look out, world! High five for your Boosterfactor domination!",
"High fives on repeat! You're a Boosterfactor magician!",
"Impressive stuff! High five for your Boosterfactor magic!",
"You're unstoppable! High five for your Boosterfactor momentum!",
"Keep the boost alive! High five for your Boosterfactor mojo!",
"High fives are in order! You're a Boosterfactor ninja!",
"Mission accomplished! High five for reaching that Boosterfactor milestone!",
"You're on a boost roll! High five for your Boosterfactor rampage!",
"High five alert! You're a Boosterfactor rockstar!",
"Two thumbs up! High five for your Boosterfactor success!",
"You're boosting it! High five for your Boosterfactor spree!",
"High fives incoming! You're a Boosterfactor sensation!",
"You're a Boosterfactor superhero! High five, booster caped crusader!",
"High five vibes! You're a Boosterfactor sensation!",
"You're a Boosterfactor legend! High five, oh mighty booster!",
"High fives all around! You're a Boosterfactor superstar!",
"You're a Boosterfactor champion! High five, boost conqueror!",
"High five incoming! You're a Boosterfactor warrior!",
"You're on fire with your Boosterfactor! High five for the victory!",
"You're a Boosterfactor guru! High five, wise booster!",
"High five vibes! You're a Boosterfactor wizard!",
"You're a Boosterfactor icon! High five, illustrious booster!",
"High five alert! You're a Boosterfactor prodigy!",
"You're unstoppable! High five for your Boosterfactor triumph!"
]

export function getRandomMessageWeeklyChallenge(points: number): string {
const randomIndex = Math.floor(Math.random() * messagesWeeklyChallenge.length);
Expand All @@ -183,6 +235,11 @@ export function getRandomMessagePoints(points: number): string {
return message.replace("[X]", points.toString());
}

export function getRandomMessageBoosterFactor(): string {
const randomIndex = Math.floor(Math.random() * boosterFactorMessage.length);
return boosterFactorMessage[randomIndex];
}

// Example usage
// const randomPoints = 100; // Replace with your actual points value
// const randomMessage = getRandomMessageWeeklyChallenge(randomPoints);
Expand Down

0 comments on commit 9208384

Please sign in to comment.