Skip to content

Commit b43f2a3

Browse files
committed
Seedling steam achievement
1 parent 5d3f6ff commit b43f2a3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,7 @@ run_game_render(void)
11171117
static inline void
11181118
register_scores(void)
11191119
{
1120+
debug("Registering steam scores");
11201121
uint8_t details[4] = {(uint8_t)gPlayer->stats.lvl, (uint8_t)cLevel, (uint8_t)(gPlayer->class + 1), 0};
11211122
steam_register_score((int)gPlayer->gold, (int32_t *)&details, 1);
11221123
steam_register_kills((int)gPlayer->stat_data.kills, (int32_t *)&details, 1);
@@ -1138,6 +1139,10 @@ register_scores(void)
11381139
steam_set_achievement(MAGICAL);
11391140
steam_register_mage_score((int)gPlayer->gold, (int32_t *)&details, 1);
11401141
}
1142+
1143+
if (gCustomSeed != 0 && !weeklyGame) {
1144+
steam_set_achievement(SEEDLING);
1145+
}
11411146
}
11421147
#endif
11431148

src/steam/steamworks_api_wrapper.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ static Achievement g_Achievements[] = {_ACH_ID(BAD_DOG, "Bad Dog"),
2323
_ACH_ID(BACK_TO_WORK, "Back to work"),
2424
_ACH_ID(DRAGON_SLAYER, "Platinum dragon slayer"),
2525
_ACH_ID(ROGUE_LIKE, "Rogue-like"),
26-
_ACH_ID(MAGICAL, "Magical")};
26+
_ACH_ID(MAGICAL, "Magical"),
27+
_ACH_ID(SEEDLING, "Seedling")};
2728
static Uint8 numAchievements = 7;
2829

2930
static bool m_Initiated = false;
@@ -140,6 +141,7 @@ steam_set_achievement(EAchievement eAch)
140141
Achievement *a = &g_Achievements[i];
141142
if (a->m_eAchievementID == eAch && !a->m_bAchieved) {
142143
c_SteamUserStats_SetAchievement(g_Achievements[i].m_pchAchievementID);
144+
debug("Setting \"%s\" achievement", a->m_rgchName);
143145
gui_log("You just earned the \"%s\" achievement", a->m_rgchName);
144146
}
145147
}

src/steam/steamworks_api_wrapper.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ typedef enum EAchievement {
1313
BUGGCREATOR = 8,
1414
ROGUE_LIKE = 9,
1515
MAGICAL = 10,
16-
ARCADE_HACK = 11
16+
ARCADE_HACK = 11,
17+
SEEDLING = 12,
1718
} EAchievement;
1819

1920
#define _ACH_ID(id, name) {id, #id, name, "", 0, 0}

0 commit comments

Comments
 (0)