Skip to content

Commit

Permalink
Switched eastereggs and logic, added last achievement
Browse files Browse the repository at this point in the history
  • Loading branch information
LiquidityC committed Sep 6, 2018
1 parent 3ef3351 commit 9e63259
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(breakhack C)
set(breakhack_GAME_TITLE "BreakHack")
set(breakhack_MAJOR_VERSION 1)
set(breakhack_MINOR_VERSION 0)
set(breakhack_PATCH_VERSION 5)
set(breakhack_PATCH_VERSION 6)
set(breakhack_RELEASE_TYPE "")

include(FindLua)
Expand Down
48 changes: 25 additions & 23 deletions data/monstergen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,18 @@ 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 },
{ stats.misc, 2*16, 3*16, "Lialynn, the Ranger", behaviour.passive },
{ stats.misc, 4*16, 3*16, "Miniel, the Paladin", behaviour.passive },
{ stats.misc, 2*16,12*16, "Feng, the Fighter", behaviour.passive },
{ stats.misc, 0*16, 7*16, "Adnis, the Ranger", behaviour.passive },
{ stats.misc, 7*16, 8*16, "Ti, the Mage", behaviour.passive },
}
for i=1,#eastereggs do
eastereggs[i] = concat({ texturePaths.player0, texturePaths.player1 }, eastereggs[i])
end

local platino = {
{
-- Add Platino
table.insert(eastereggs, {
texturePaths.reptile0,
texturePaths.reptile1,
stats.platino,
Expand All @@ -282,8 +280,7 @@ local platino = {
"Platino",
behaviour.sentinel,
true
}
}
})

local function repack(data)
return {
Expand Down Expand Up @@ -327,15 +324,20 @@ if(CURRENT_LEVEL > 0) then
end
end

if random(100) == 1 then
enemies[#enemies+1] = eastereggs[random(#eastereggs)]
end
local addSpecialInLevel = random(100) == 1

if random(100) == 1 then
enemies = concat(enemies, platino)
local function add_monster_to_tile(room, roomx, roomy, rx, ry, monster)
local x = (roomx * 512) + rx * 32
local y = (roomy * 384) + ry * 32
room.monsters[rx][ry] = {
x,
y,
monster
}
end

function module.add_monsters_to_room(room, roomx, roomy)
local addSpecial = addSpecialInLevel and random(5) == 1
local count = random(3)
if (CURRENT_LEVEL > 3) then
count = random(4)
Expand All @@ -345,13 +347,13 @@ function module.add_monsters_to_room(room, roomx, roomy)
local rx = random(13) + 1
local ry = random(9) + 1
if room_builder.is_tile_avilable(room, rx, ry) then
local x = (roomx * 512) + rx * 32
local y = (roomy * 384) + ry * 32
room.monsters[rx][ry] = {
x,
y,
enemies[random(#enemies)]
}
if addSpecial then
addSpecialInLevel = false
addSpecial = false
add_monster_to_tile(room, roomx, roomy, rx, ry, eastereggs[random(#eastereggs)])
else
add_monster_to_tile(room, roomx, roomy, rx, ry, enemies[random(#enemies)])
end
i = i + 1
end
end
Expand Down
2 changes: 2 additions & 0 deletions src/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ player_monster_kill_check(Player *player, Monster *monster)
steam_set_achievement(THE_DOCTOR_IS_OUT);
else if (strcmp("Linus, the Developer", monster->label) == 0)
steam_set_achievement(BUGGFIXER);
else if (strcmp("Ti, the Mage", monster->label) == 0)
steam_set_achievement(BUGGCREATOR);
#endif // STEAM_BUILD
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/steam/steamworks_api_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ typedef enum EAchievement
LIGHTS_ON = 2,
BACK_TO_WORK = 5,
DRAGON_SLAYER = 6,
BUGGFIXER = 7
BUGGFIXER = 7,
BUGGCREATOR = 8
} EAchievement;


Expand Down

0 comments on commit 9e63259

Please sign in to comment.