Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
LiquidityC committed Aug 23, 2018
2 parents 9244da3 + cc1ae5d commit c23927c
Show file tree
Hide file tree
Showing 44 changed files with 1,397 additions and 328 deletions.
11 changes: 7 additions & 4 deletions 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 0)
set(breakhack_MINOR_VERSION 2)
set(breakhack_PATCH_VERSION 1)
set(breakhack_PATCH_VERSION 0)
set(breakhack_RELEASE_TYPE "(beta)")

include(FindLua)
Expand Down Expand Up @@ -100,6 +100,7 @@ include_directories(
${SDL2_IMAGE_INCLUDE_DIR}
${SDL2_TTF_INCLUDE_DIR}
${SDL2_MIXER_INCLUDE_DIR}
sqlite3
)

if (CMOCKA_FOUND)
Expand Down Expand Up @@ -167,7 +168,7 @@ add_executable(breakhack
src/projectile
src/vector2d
src/map_room_modifiers
src/sqlite3
sqlite3/sqlite3
src/db
src/settings
src/actiontextbuilder
Expand All @@ -177,10 +178,12 @@ add_executable(breakhack
src/screen
src/hiscore
src/object
src/gui_util
src/tooltip
)

# Sqlite has some warnings that I we don't need to see
set_source_files_properties(src/sqlite3.c COMPILE_FLAGS -w)
set_source_files_properties(sqlite3/sqlite3.c COMPILE_FLAGS -w)

target_link_libraries(breakhack
${CMAKE_DL_LIBS} # Sqlite needs DL libs
Expand Down Expand Up @@ -241,7 +244,7 @@ ENDIF ()
# LINT:
if (CPPCHECK_FOUND)
add_custom_target(lint
COMMAND ${CPPCHECK_EXECUTABLE} --force --language=c --template=gcc --error-exitcode=1 --quiet --enable=warning,style,performance,portability,information,missingInclude --suppress=*:src/sqlite3.? -isrc/sqlite3.c src/
COMMAND ${CPPCHECK_EXECUTABLE} --force --language=c --template=gcc --error-exitcode=1 --quiet --enable=warning,style,performance,portability,information,missingInclude src/
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Run cppcheck"
)
Expand Down
20 changes: 20 additions & 0 deletions build/releasenotes/beta2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
f5a88fc Introduces texture blending
52913af Completes #42 Add boss 2 & 3
449cc36 Fixes some minor buggs
f67aab0 Completes #43 Add win state
8c261fd Added the undead monsters for level > 10
6326a64 Begins #42 Add boss 2 & 3
f1b0045 Introduces the "orc levels"
ffe1736 Minor buggfixes and typos
8bf9329 Version bump and badges
8c25693 Moves sqlite3 files to separate dir
bec9eb4 Fixed a typo in skill tooltip
43f021a Created an FPS counter for debug mode
dbc36aa Fixes #41, Minimap
c390c02 Fixes #40, Prevent adjecant traps before lvl 4
9ef97c0 Fixes #38, Artifact inventory
358c0c7 Fixes #37 and #39 Adds tooltips to everything
5f754d5 Merge branch 'master' into dev
30058ea Creates gui_util and moves some code out from gui.c
854f2c0 Prevent levels > 10 from crashing the game.
549f47a Minor code fixes and a slight tweak to the blue color
116 changes: 89 additions & 27 deletions data/monstergen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ local behaviour = {
guerilla = 3,
coward = 4,
sentinel = 5,
fire_demon = 6
fire_demon = 6,
sorcerer = 7,
assassin = 8
}

local stats = {
Expand Down Expand Up @@ -84,19 +86,26 @@ local stats = {
def = 0,
speed = 1
},
orc = {
hp = 20,
dmg = 2,
atk = 0,
def = 0,
speed = 1
},
boss = {
hp = 60,
dmg = 4,
dmg = 3,
atk = 1,
def = 0,
speed = 1
},
platino = {
hp = 60,
dmg = 60,
atk = 60,
def = 60,
speed = 3
hp = 90,
dmg = 1,
atk = 0,
def = 0,
speed = 1
}
}

Expand Down Expand Up @@ -134,6 +143,16 @@ for i=1,#pests do
pests[i] = concat({ texturePaths.pest0, texturePaths.pest1 }, pests[i])
end

local avian = {
{ stats.default, 0, 11*16, "A Small Brown Bat", behaviour.pacifist },
{ stats.default, 16, 11*16, "A Big Brown Bat", behaviour.normal },
{ stats.default, 32, 11*16, "A Vampire Bat", behaviour.guerilla },
{ stats.default, 48, 11*16, "A Rabid Bat", behaviour.hostile },
}
for i=1,#avian do
avian[i] = concat({ texturePaths.avian0, texturePaths.avian1 }, avian[i])
end

local misc = {
{ stats.misc, 0, 0, "A Giant Black Rat", behaviour.sentinel },
{ stats.misc, 16, 0, "A Giant White Rat", behaviour.sentinel },
Expand All @@ -143,13 +162,33 @@ for i=1,#misc do
misc[i] = concat({ texturePaths.misc0, texturePaths.misc1 }, misc[i])
end

local undead = {
-- UNDEAD
local reanimated = {
{ stats.undead, 0, 32, "A Skeleton", behaviour.normal },
{ stats.undead, 48, 32, "A Black Skeleton", behaviour.normal },
{ stats.undead, 64, 32, "A Zombie", behaviour.normal },
{ stats.undead, 80, 32, "A Zombie", behaviour.normal }
}
for i=1,#reanimated do
reanimated[i] = concat({ texturePaths.undead0, texturePaths.undead1 }, reanimated[i])
end

local undead = {
{ stats.undead, 5*16, 16, "A Mummy", behaviour.normal },
{ stats.undead, 6*16, 16, "A Two Headed Mummy", behaviour.sentinel },
{ stats.undead, 0*16, 32, "A Skeleton", behaviour.normal },
{ stats.misc, 1*16, 32, "A Burning Skeleton", behaviour.fire_demon },
{ stats.misc, 2*16, 32, "An Eldritch Skeleton", behaviour.sorcerer },
{ stats.misc, 3*16, 32, "A Black Skeleton", behaviour.guerilla },
{ stats.misc, 4*16, 32, "A Zombie", behaviour.coward },
{ stats.misc, 5*16, 32, "A Pale Zombie", behaviour.coward },
{ stats.misc, 7*16, 32, "A Scorched Zombie", behaviour.fire_demon },
{ stats.undead, 0*16, 4*16, "A Whight", behaviour.coward },
{ stats.undead, 1*16, 4*16, "A Ghast", behaviour.sentinel },
{ stats.misc, 1*16, 4*16, "A Ghost", behaviour.guerilla },
{ stats.misc, 0*16, 5*16, "A Spectre", behaviour.sentinel },
{ stats.undead, 1*16, 5*16, "An Eldritch Spectre", behaviour.sorcerer },
{ stats.undead, 2*16, 5*16, "A Scorched Spectre", behaviour.fire_demon },
}
for i=1,#undead do
undead[i] = concat({ texturePaths.undead0, texturePaths.undead1 }, undead[i])
end
Expand Down Expand Up @@ -188,10 +227,36 @@ for i=1,#demon do
demon[i] = concat({ texturePaths.demon0, texturePaths.demon1 }, demon[i])
end

local orcs = {
{ stats.orc, 0, 4*16, "An Orc Guard", behaviour.normal },
{ stats.orc, 16, 4*16, "An Orc Seargeant", behaviour.coward },
{ stats.orc, 32, 4*16, "An Orc Militia", behaviour.hostile },
{ stats.orc, 48, 4*16, "An Orc Sentry", behaviour.sentinel },
{ stats.orc, 64, 4*16, "An Orc Brute", behaviour.guerilla },
{ stats.orc, 80, 4*16, "An Orc Captain", behaviour.hostile },
{ stats.orc, 96, 4*16, "An Orc Pyro", behaviour.fire_demon },
}
for i=1,#orcs do
orcs[i] = concat({ texturePaths.humanoid0, texturePaths.humanoid1 }, orcs[i])
end

local assassins = {
{ stats.misc, 1*16, 6*16, "A Reaper", behaviour.assassin },
{ stats.misc, 0*16, 7*16, "An Assassin", behaviour.assassin },
{ stats.misc, 1*16, 7*16, "A Royal Assassin", behaviour.assassin },
}
for i=1,#assassins do
assassins[i] = concat({ texturePaths.undead0, texturePaths.undead1 }, assassins[i])
end

local bosses = {
{ stats.boss, 16, 5*16, "The Hell Hound", behaviour.fire_demon, true }
{ stats.boss, 16, 5*16, "The Hell Hound", behaviour.fire_demon, true },
{ stats.boss, 16, 23*16, "The Cleric", behaviour.sorcerer, true },
{ stats.boss, 16, 8*16, "The Shadow", behaviour.assassin, true },
}
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 platino = {
{
Expand All @@ -201,7 +266,8 @@ local platino = {
48,
12*16,
"Platino",
behaviour.sentinel
behaviour.sentinel,
true
}
}

Expand All @@ -224,29 +290,24 @@ if(CURRENT_LEVEL > 0) then
if (CURRENT_LEVEL == 1) then
enemies = concat(enemies, pests)
enemies = concat(enemies, misc)
enemies = concat(enemies, dogs)
elseif (CURRENT_LEVEL > 5) then
elseif (CURRENT_LEVEL > 15) then
enemies = {}
enemies = concat(enemies, demon)
enemies = concat(enemies, undead)
enemies = concat(enemies, reptile)
enemies = concat(enemies, misc)
elseif (CURRENT_LEVEL > 3) then
enemies = concat(enemies, orcs)
enemies = concat(enemies, assassins)
elseif (CURRENT_LEVEL > 10) then
enemies = {}
enemies = concat(enemies, undead)
enemies = concat(enemies, reptile)
enemies = concat(enemies, misc)
enemies = concat(enemies, dogs)
elseif (CURRENT_LEVEL > 2) then
enemies = concat(enemies, avian)
elseif (CURRENT_LEVEL > 5) then
enemies = {}
enemies = concat(enemies, undead)
enemies = concat(enemies, reptile)
enemies = concat(enemies, misc)
enemies = concat(enemies, dogs)
enemies = concat(enemies, orcs)
enemies = concat(enemies, avian)
elseif (CURRENT_LEVEL > 1) then
enemies = {}
enemies = concat(enemies, undead)
enemies = concat(enemies, reanimated)
enemies = concat(enemies, reptile)
enemies = concat(enemies, avian)
enemies = concat(enemies, misc)
enemies = concat(enemies, dogs)
end
Expand Down Expand Up @@ -279,7 +340,7 @@ function module.add_monsters_to_room(room, roomx, roomy)
end

function module.add_boss_to_room(room, roomx, roomy)
local boss = bosses[1]
local boss = bosses[CURRENT_LEVEL / 5]
local success = false
while not success do
local rx = random(13) + 1
Expand Down Expand Up @@ -309,3 +370,4 @@ function module.load_monsters(map, monsters)
end

return module

22 changes: 19 additions & 3 deletions data/trapgen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,25 @@ function module.add_traps_to_room(room)
while i < count do
local rx = random(13) + 1
local ry = random(9) + 1
if room_builder.is_tile_avilable(room, rx, ry) then
room.traps[rx][ry] = traps[random(#traps)]
i = i + 1
if CURRENT_LEVEL < 4 then
if room_builder.is_tile_avilable(room, rx, ry)
and not room.traps[rx+1][ry]
and not room.traps[rx-1][ry]
and not room.traps[rx][ry+1]
and not room.traps[rx][ry-1]
and not room.traps[rx+1][ry+1]
and not room.traps[rx+1][ry-1]
and not room.traps[rx-1][ry+1]
and not room.traps[rx-1][ry-1]
then
room.traps[rx][ry] = traps[random(#traps)]
i = i + 1
end
else
if room_builder.is_tile_avilable(room, rx, ry) then
room.traps[rx][ry] = traps[random(#traps)]
i = i + 1
end
end
end
end
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c23927c

Please sign in to comment.