Switched eastereggs and logic, added last achievement

This commit is contained in:
Linus Probert 2018-09-06 20:12:37 +02:00
parent 3ef3351933
commit 9e6325905f
4 changed files with 30 additions and 25 deletions

View File

@ -7,7 +7,7 @@ project(breakhack C)
set(breakhack_GAME_TITLE "BreakHack") set(breakhack_GAME_TITLE "BreakHack")
set(breakhack_MAJOR_VERSION 1) set(breakhack_MAJOR_VERSION 1)
set(breakhack_MINOR_VERSION 0) set(breakhack_MINOR_VERSION 0)
set(breakhack_PATCH_VERSION 5) set(breakhack_PATCH_VERSION 6)
set(breakhack_RELEASE_TYPE "") set(breakhack_RELEASE_TYPE "")
include(FindLua) include(FindLua)

View File

@ -260,20 +260,18 @@ bosses[3] = concat({ texturePaths.undead0, texturePaths.undead1 }, bosses[3])
local eastereggs = { local eastereggs = {
{ stats.misc, 6*16, 1*16, "Linus, the Developer", behaviour.passive }, { 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, 3*16, "Lialynn, the Ranger", behaviour.passive },
{ stats.misc, 2*16, 4*16, "Vax, the Twin", behaviour.passive }, { stats.misc, 4*16, 3*16, "Miniel, the Paladin", behaviour.passive },
{ stats.misc, 2*16, 3*16, "Vex, the Twin", behaviour.passive }, { stats.misc, 2*16,12*16, "Feng, the Fighter", behaviour.passive },
{ stats.misc, 0*16,10*16, "Grog, the Barbarian", behaviour.passive }, { stats.misc, 0*16, 7*16, "Adnis, the Ranger", behaviour.passive },
{ stats.misc, 3*16, 4*16, "Percy, the Gunslinger", behaviour.passive }, { stats.misc, 7*16, 8*16, "Ti, the Mage", 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 for i=1,#eastereggs do
eastereggs[i] = concat({ texturePaths.player0, texturePaths.player1 }, eastereggs[i]) eastereggs[i] = concat({ texturePaths.player0, texturePaths.player1 }, eastereggs[i])
end end
local platino = { -- Add Platino
{ table.insert(eastereggs, {
texturePaths.reptile0, texturePaths.reptile0,
texturePaths.reptile1, texturePaths.reptile1,
stats.platino, stats.platino,
@ -282,8 +280,7 @@ local platino = {
"Platino", "Platino",
behaviour.sentinel, behaviour.sentinel,
true true
} })
}
local function repack(data) local function repack(data)
return { return {
@ -327,15 +324,20 @@ if(CURRENT_LEVEL > 0) then
end end
end end
if random(100) == 1 then local addSpecialInLevel = random(100) == 1
enemies[#enemies+1] = eastereggs[random(#eastereggs)]
end
if random(100) == 1 then local function add_monster_to_tile(room, roomx, roomy, rx, ry, monster)
enemies = concat(enemies, platino) local x = (roomx * 512) + rx * 32
local y = (roomy * 384) + ry * 32
room.monsters[rx][ry] = {
x,
y,
monster
}
end end
function module.add_monsters_to_room(room, roomx, roomy) function module.add_monsters_to_room(room, roomx, roomy)
local addSpecial = addSpecialInLevel and random(5) == 1
local count = random(3) local count = random(3)
if (CURRENT_LEVEL > 3) then if (CURRENT_LEVEL > 3) then
count = random(4) count = random(4)
@ -345,13 +347,13 @@ function module.add_monsters_to_room(room, roomx, roomy)
local rx = random(13) + 1 local rx = random(13) + 1
local ry = random(9) + 1 local ry = random(9) + 1
if room_builder.is_tile_avilable(room, rx, ry) then if room_builder.is_tile_avilable(room, rx, ry) then
local x = (roomx * 512) + rx * 32 if addSpecial then
local y = (roomy * 384) + ry * 32 addSpecialInLevel = false
room.monsters[rx][ry] = { addSpecial = false
x, add_monster_to_tile(room, roomx, roomy, rx, ry, eastereggs[random(#eastereggs)])
y, else
enemies[random(#enemies)] add_monster_to_tile(room, roomx, roomy, rx, ry, enemies[random(#enemies)])
} end
i = i + 1 i = i + 1
end end
end end

View File

@ -531,6 +531,8 @@ player_monster_kill_check(Player *player, Monster *monster)
steam_set_achievement(THE_DOCTOR_IS_OUT); steam_set_achievement(THE_DOCTOR_IS_OUT);
else if (strcmp("Linus, the Developer", monster->label) == 0) else if (strcmp("Linus, the Developer", monster->label) == 0)
steam_set_achievement(BUGGFIXER); steam_set_achievement(BUGGFIXER);
else if (strcmp("Ti, the Mage", monster->label) == 0)
steam_set_achievement(BUGGCREATOR);
#endif // STEAM_BUILD #endif // STEAM_BUILD
} }
} }

View File

@ -10,7 +10,8 @@ typedef enum EAchievement
LIGHTS_ON = 2, LIGHTS_ON = 2,
BACK_TO_WORK = 5, BACK_TO_WORK = 5,
DRAGON_SLAYER = 6, DRAGON_SLAYER = 6,
BUGGFIXER = 7 BUGGFIXER = 7,
BUGGCREATOR = 8
} EAchievement; } EAchievement;