Skip to content

Commit c67acd4

Browse files
committed
Added first batch of achievements among updating notification system
1 parent cc6093e commit c67acd4

5 files changed

Lines changed: 404 additions & 67 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#include "Achievements.h"
2+
3+
#include <unordered_map>
4+
5+
#define R(id, name, description, icon, ...) { #id, name, icon, description, { __VA_ARGS__ } }
6+
#define P(id, name, description, icon, maxProgress, ...) { #id, name, icon, description, { __VA_ARGS__ }, maxProgress }
7+
8+
std::vector<Achievement> gAchievementList = {
9+
// Star Achievements
10+
P("Get1Star", "Your Journey Begins", "Get a Star", "stars.1", 1),
11+
P("Get8Stars", "You feel a strong power", "Get 8 Stars", "stars.8", 8, "Get1Star"),
12+
P("Get30Stars", "Earning a Quarter", "Get 30 Stars", "stars.30", 30, "Get8Stars"),
13+
P("Get31Stars", "Extra Cent", "Get 31 Stars", "stars.31", 31, "Get30Stars"),
14+
P("Get50Stars", "Lucky Eight", "Get 50 Stars", "stars.50", 50, "Get31Stars"),
15+
P("Get70Stars", "Halfway There", "Get 70 Stars", "stars.70", 70, "Get50Stars"),
16+
P("Get120Stars", "The Completionist", "Get 120 Stars", "stars.120", 120, "Get70Stars"),
17+
18+
// Cap Achievements
19+
R("UnlockWingCap", "Super Man-rio", "Unlock the Wing Cap", "cap.wing"),
20+
R("UnlockMetalCap", "Heavy-Headed", "Unlock the Metal Cap", "cap.metal"),
21+
R("UnlockVanishCap", "Wait, Where Is He?", "Unlock the Vanish Cap", "cap.vanish"),
22+
23+
// Level Achievements
24+
R("Get6MainStars", "F Rank", "Get all 6 Main Stars in One Level", "ranks.f"),
25+
R("Get100CoinStar", "E Rank", "Get a 100-Coin Star", "ranks.e", "Get6MainStars"),
26+
R("GetAll100CoinStars", "D Rank", "Get all Coins in One Level", "ranks.d", "Get100CoinStar"),
27+
R("GetAllStarsInBasement", "C Rank", "Get all Main Stars in the Basement", "ranks.c", "GetAll100CoinStars"),
28+
R("GetAllStarsInFloor1", "B Rank", "Get all Main Stars on Floor 1", "ranks.b", "GetAllStarsInBasement"),
29+
R("GetAllStarsInFloor2", "A Rank", "Get all Main Stars on Floor 2", "ranks.a", "GetAllStarsInFloor1"),
30+
R("GetAllStarsInGame", "S Rank", "Get all Main Stars on Floor 3", "ranks.s", "GetAllStarsInFloor2"),
31+
R("GetAllCastleStars", "S+ Rank", "Get all Castle Main Stars", "ranks.splus", "GetAllStarsInGame"),
32+
33+
// Boss Achievements
34+
R("DefeatKingBobomb", "Explosive Test", "Defeat King Bob-omb", "bosses.king-bob"),
35+
R("DefeatMrI", "I vs Eye", "Defeat Mr. I", "bosses.mr-i"),
36+
R("DefeatWiggler", "Insecticide", "Defeat Wiggler", "bosses.wiggler"),
37+
R("DefeatAllBooses", "Boo Who?", "Defeat All Boos in the Haunted House", "bosses.big-boo"),
38+
R("DefeatAllBigBullies", "The Real Bully", "Defeat All Big Bullies From LLL", "bosses.big-bully"),
39+
R("DefeatEyerok", "Welcome To The Jam", "Defeat Eyerok", "bosses.eyerok"),
40+
R("DefeatKingWhomp", "Come On And Slam", "Defeat King Whomp", "bosses.king-whomp"),
41+
R("DefeatBowser1", "Bowser Trapped In The Dark", "Defeat Bowser in the Dark World", "bosses.bowser1"),
42+
R("DefeatBowser2", "Bowser Burned By The Lava", "Defeat Bowser in the Fire Sea", "bosses.bowser2"),
43+
R("DefeatBowser3", "Final Showdown", "Defeat Bowser in the Sky", "bosses.bowser3"),
44+
R("DefearBowser3WithAllStars", "True Ending", "Defeat Bowser in the Sky with 120 Stars",
45+
"bosses.bowser3-with-120-stars", "The Completionist"),
46+
47+
// Death Achievements
48+
R("DeathByBoss", "Git Gud", "Get Defeated by a Boss", "deaths.boss"),
49+
R("DeathByFalling", "Gravity Is A Myth", "Die by Falling", "deaths.falling"),
50+
R("DeathByQuickSand", "Sink Or Swim", "Die in Quick Sand", "deaths.quicksand"),
51+
R("DeathByCrushing", "Space Jam", "Die by Being Crushed", "deaths.crushing"),
52+
R("DeathByBowser", "Bad Ending", "Get Defeated by Bowser", "deaths.bowser"),
53+
R("DeathByEnemy", "Watch Your Step", "Die by an Enemy", "deaths.enemy"),
54+
R("DeathByDrowning", "Under The Sea", "Die by Drowning", "deaths.drowning"),
55+
R("DeathByFire", "Roasted Mario", "Die by Fire or Lava", "extras.carpet-burn"),
56+
57+
// Extra Achievements
58+
R("TalkWithYoshi", "It Is You?", "Talk with Yoshi on the Roof", "extras.yoshi"),
59+
P("Slide20Times", "Burned Ass", "Go Down The Slide 20 Times", "extras.carpet-burn", 20),
60+
R("BeatEveryRace", "Olympic Runner", "Beat Every Racing Challenge", "extras.runner"),
61+
P("Talk25Times", "Olympic Talker", "Talk to NPCs 25 Times", "extras.talker", 25),
62+
R("GrabSwimmingStars", "Olympic Swimmer", "Grab every star that needs Metal Cap without it", "extras.swimmer"),
63+
R("WatchEnding", "The Cake Is A Lie?!", "Watch the game ending", "extras.cake"),
64+
R("ReleaseChainChomp", "Chomp-Chomp!", "Release the Chain Chomp", "extras.chain-chomp"),
65+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#pragma once
2+
3+
#include "types.h"
4+
5+
struct Achievement {
6+
std::string id;
7+
std::string name;
8+
const char* icon;
9+
std::string description;
10+
std::vector<std::string> dependencies;
11+
int32_t maxProgress = 0;
12+
};
13+
14+
extern std::vector<Achievement> gAchievementList;

src/port/ui/GhostshipMenuSettings.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,10 @@ void GhostshipMenu::AddMenuSettings() {
375375
});
376376
})
377377
.Options(ButtonOptions().Tooltip("Displays a test notification."));
378+
AddWidget(path, "Test Achievement Notification", WIDGET_BUTTON)
379+
.RaceDisable(false)
380+
.Callback([](WidgetInfo& info) { Notification::EmitAchievement(nullptr, "Harbour Mastery", 0); })
381+
.Options(ButtonOptions().Tooltip("Displays a test notification."));
378382
}
379383

380384
} // namespace GhostshipGui

0 commit comments

Comments
 (0)