From 07d7d6e58bb2079a3fe6d57a08e1192f9b23ece5 Mon Sep 17 00:00:00 2001 From: Linus Probert Date: Mon, 3 Sep 2018 16:49:45 +0200 Subject: [PATCH] Added easteregg monsters and a funny achievement --- data/monstergen.lua | 18 ++++++++++++++++++ src/main.c | 2 +- src/player.c | 3 +++ src/steam/steamworks_api_wrapper.h | 3 ++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/data/monstergen.lua b/data/monstergen.lua index 719d705..9099b98 100644 --- a/data/monstergen.lua +++ b/data/monstergen.lua @@ -258,6 +258,20 @@ bosses[1] = concat({ texturePaths.dog0, texturePaths.dog1 }, bosses[1]) bosses[2] = concat({ texturePaths.humanoid0, texturePaths.humanoid1 }, bosses[2]) bosses[3] = concat({ texturePaths.undead0, texturePaths.undead1 }, bosses[3]) +local eastereggs = { + { stats.misc, 6*16, 1*16, "Linus, the Developer", behaviour.passive }, + { stats.misc, 4*16, 1*16, "Scanlan, the Bard", behaviour.passive }, + { stats.misc, 2*16, 4*16, "Vax, the Twin", behaviour.passive }, + { stats.misc, 2*16, 3*16, "Vex, the Twin", behaviour.passive }, + { stats.misc, 0*16,10*16, "Grog, the Barbarian", behaviour.passive }, + { stats.misc, 3*16, 4*16, "Percy, the Gunslinger", behaviour.passive }, + { stats.misc, 4*16, 0*16, "Pike, the Cleric", behaviour.passive }, + { stats.misc, 6*16, 7*16, "Keyleth, the Druid", behaviour.passive }, +} +for i=1,#eastereggs do + eastereggs[i] = concat({ texturePaths.player0, texturePaths.player1 }, eastereggs[i]) +end + local platino = { { texturePaths.reptile0, @@ -313,6 +327,10 @@ if(CURRENT_LEVEL > 0) then end end +if random(100) == 1 then + enemies[#enemies+1] = eastereggs[random(#eastereggs)] +end + if random(100) == 1 then enemies = concat(enemies, platino) end diff --git a/src/main.c b/src/main.c index 0fbadca..1f69e60 100644 --- a/src/main.c +++ b/src/main.c @@ -895,7 +895,7 @@ run_game(void) hiscore_register(gPlayer, cLevel); #ifdef STEAM_BUILD uint8_t details[4] = { (uint8_t) gPlayer->stats.lvl, (uint8_t) cLevel, 0, 0 }; - steam_register_score((int) gPlayer->gold, &details, 1); + steam_register_score((int) gPlayer->gold, (int32_t*) &details, 1); steam_register_kills((int) gPlayer->stat_data.kills, (int32_t*) &details, 1); #endif // STEAM_BUILD diff --git a/src/player.c b/src/player.c index fb9427d..afd60f8 100644 --- a/src/player.c +++ b/src/player.c @@ -521,6 +521,9 @@ player_monster_kill_check(Player *player, Monster *monster) steam_set_achievement(DRAGON_SLAYER); else if (strcmp("The Cleric", monster->label) == 0) steam_set_achievement(THE_DOCTOR_IS_OUT); + else if (strcmp("Linus, the Developer", monster->label) == 0) + steam_set_achievement(BUGGFIXER); + #endif // STEAM_BUILD if (monster->stats.hp <= 0) { diff --git a/src/steam/steamworks_api_wrapper.h b/src/steam/steamworks_api_wrapper.h index 9a3be52..98dcb9d 100644 --- a/src/steam/steamworks_api_wrapper.h +++ b/src/steam/steamworks_api_wrapper.h @@ -9,7 +9,8 @@ typedef enum EAchievement THE_DOCTOR_IS_OUT = 1, LIGHTS_ON = 2, BACK_TO_WORK = 5, - DRAGON_SLAYER = 6 + DRAGON_SLAYER = 6, + BUGGFIXER = 7 } EAchievement;