Adds arcade game leaderboard

- Also fixes an ASSASSIN hidden state issue where the monster would
dissappear even if it's stunned.
This commit is contained in:
Linus Probert 2018-10-27 13:28:48 +02:00
parent f53703dd88
commit c2eae7a9fe
4 changed files with 22 additions and 7 deletions

View File

@ -1009,6 +1009,9 @@ register_scores(void)
if (quickGame) {
steam_register_qp_score((int) gPlayer->gold, (int32_t*) &details, 1);
}
if (arcadeGame) {
steam_register_arcade_score((int)gPlayer->gold, (int32_t)&details, 1);
}
if (gPlayer->class == ROGUE) {
steam_set_achievement(ROGUE_LIKE);
steam_register_rogue_score((int) gPlayer->gold, (int32_t*) &details, 1);

View File

@ -157,6 +157,8 @@ assassin_cloak_effect(Monster *m, bool cloak)
else
gui_log("%s reappears, filled with rage", m->label);
particle_engine_fire_explosion(m->sprite->pos, DIM(TILE_DIMENSION, TILE_DIMENSION));
m->sprite->hidden = cloak;
m->stateIndicator.sprite->hidden = cloak;
}
@ -727,9 +729,6 @@ monster_render(Monster *m, Camera *cam)
if (m->stats.hp <= 0)
return;
if (m->behaviour == ASSASSIN && m->state.current != AGRESSIVE)
return;
sprite_render(m->sprite, cam);
}
@ -739,9 +738,6 @@ monster_render_top_layer(Monster *m, RoomMatrix *rm, Camera *cam)
if (m->stats.hp <= 0)
return;
if (m->behaviour == ASSASSIN && m->state.current != AGRESSIVE)
return;
Position mPos = position_to_matrix_coords(&m->sprite->pos);
mPos.y -= 1;
if (rm->spaces[mPos.x][mPos.y].player) {

View File

@ -9,6 +9,7 @@
static const char *LB_HIGHSCORE = "Highscore";
static const char *LB_QUICKPLAY_HIGHSCORE = "Quickplay Highscore";
static const char *LB_ARCADE_HIGHSCORE = "Arcade Highscore";
static const char *LB_ROGUE_HIGHSCORE = "Rogue Highscore";
static const char *LB_WARRIOR_HIGHSCORE = "Warrior Highscore";
static const char *LB_KILLS = "Most Kills";
@ -28,6 +29,7 @@ static bool m_bStatsReceived = false;
static Sint64 m_AppID = 0;
static Sint64 m_hHighscoreLeaderboard = 0;
static Sint64 m_hQpHighscoreLeaderboard = 0;
static Sint64 m_hArcadeHighscoreLeaderboard = 0;
static Sint64 m_hKillsLeaderboard = 0;
static Sint64 m_hRogueHighscore = 0;
static Sint64 m_hWarriorHighscore = 0;
@ -69,6 +71,8 @@ leaderboard_received(Sint64 hLeaderboard, const char *name)
m_hWarriorHighscore = hLeaderboard;
else if (strcmp(LB_QUICKPLAY_HIGHSCORE, name) == 0)
m_hQpHighscoreLeaderboard = hLeaderboard;
else if (strcmp(LB_ARCADE_HIGHSCORE, name) == 0)
m_hArcadeHighscoreLeaderboard = hLeaderboard;
}
bool
@ -106,6 +110,8 @@ request_data_queue_run(void)
c_SteamUserStats_FindLeaderboard(LB_HIGHSCORE);
else if (!m_hQpHighscoreLeaderboard)
c_SteamUserStats_FindLeaderboard(LB_QUICKPLAY_HIGHSCORE);
else if (!m_hArcadeHighscoreLeaderboard)
c_SteamUserStats_FindLeaderboard(LB_ARCADE_HIGHSCORE);
else if (!m_hKillsLeaderboard)
c_SteamUserStats_FindLeaderboard(LB_KILLS);
else if (!m_hRogueHighscore)
@ -150,6 +156,13 @@ void steam_register_qp_score(Sint32 nScore, const int32_t *details, int32_t nDet
c_SteamUserStats_UploadLeaderboardScore(m_hQpHighscoreLeaderboard, nScore, details, nDetails);
}
void steam_register_arcade_score(Sint32 nScore, const int32_t * details, int32_t nDetails)
{
if (!m_hArcadeHighscoreLeaderboard)
return;
c_SteamUserStats_UploadLeaderboardScore(m_hArcadeHighscoreLeaderboard, nScore, details, nDetails);
}
void steam_register_warrior_score(Sint32 nScore, const int32_t * details, int32_t nDetails)
{
if (!m_hWarriorHighscore)

View File

@ -12,7 +12,8 @@ typedef enum EAchievement
DRAGON_SLAYER = 6,
BUGGFIXER = 7,
BUGGCREATOR = 8,
ROGUE_LIKE = 9
ROGUE_LIKE = 9,
ARCADE_HACK = 10
} EAchievement;
@ -40,6 +41,8 @@ void steam_register_score(Sint32 nScore, const int32_t *details, int32_t nDetail
void steam_register_qp_score(Sint32 nScore, const int32_t *details, int32_t nDetails);
void steam_register_arcade_score(Sint32 nScore, const int32_t *details, int32_t nDetails);
void steam_register_warrior_score(Sint32 nScore, const int32_t *details, int32_t nDetails);
void steam_register_rogue_score(Sint32 nScore, const int32_t *details, int32_t nDetails);