Introduces the "orc levels"

Also fixes some minor buggs.
This commit is contained in:
Linus Probert 2018-08-22 11:05:12 +02:00
parent ffe1736792
commit f1b0045829
3 changed files with 49 additions and 21 deletions

View File

@ -84,6 +84,13 @@ local stats = {
def = 0, def = 0,
speed = 1 speed = 1
}, },
orc = {
hp = 20,
dmg = 2,
atk = 0,
def = 0,
speed = 1
},
boss = { boss = {
hp = 60, hp = 60,
dmg = 4, dmg = 4,
@ -134,6 +141,16 @@ for i=1,#pests do
pests[i] = concat({ texturePaths.pest0, texturePaths.pest1 }, pests[i]) pests[i] = concat({ texturePaths.pest0, texturePaths.pest1 }, pests[i])
end 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 = { local misc = {
{ stats.misc, 0, 0, "A Giant Black Rat", behaviour.sentinel }, { stats.misc, 0, 0, "A Giant Black Rat", behaviour.sentinel },
{ stats.misc, 16, 0, "A Giant White Rat", behaviour.sentinel }, { stats.misc, 16, 0, "A Giant White Rat", behaviour.sentinel },
@ -188,10 +205,25 @@ for i=1,#demon do
demon[i] = concat({ texturePaths.demon0, texturePaths.demon1 }, demon[i]) demon[i] = concat({ texturePaths.demon0, texturePaths.demon1 }, demon[i])
end 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, 80, 4*16, "An Orc Pyro", behaviour.fire_demon },
}
for i=1,#orcs do
orcs[i] = concat({ texturePaths.humanoid0, texturePaths.humanoid1 }, orcs[i])
end
local bosses = { 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, 32, 23*16, "The Cleric", behaviour.sentinel, true },
} }
bosses[1] = concat({ texturePaths.dog0, texturePaths.dog1 }, bosses[1]) bosses[1] = concat({ texturePaths.dog0, texturePaths.dog1 }, bosses[1])
bosses[2] = concat({ texturePaths.humanoid0, texturePaths.humanoid1 }, bosses[2])
local platino = { local platino = {
{ {
@ -224,29 +256,21 @@ if(CURRENT_LEVEL > 0) then
if (CURRENT_LEVEL == 1) then if (CURRENT_LEVEL == 1) then
enemies = concat(enemies, pests) enemies = concat(enemies, pests)
enemies = concat(enemies, misc) enemies = concat(enemies, misc)
enemies = concat(enemies, dogs) elseif (CURRENT_LEVEL > 15) then
elseif (CURRENT_LEVEL > 5) then
enemies = {} enemies = {}
enemies = concat(enemies, demon) enemies = concat(enemies, demon)
enemies = concat(enemies, undead) elseif (CURRENT_LEVEL > 10) then
enemies = concat(enemies, reptile)
enemies = concat(enemies, misc)
elseif (CURRENT_LEVEL > 3) then
enemies = {} enemies = {}
enemies = concat(enemies, undead) enemies = concat(enemies, demon)
enemies = concat(enemies, reptile) elseif (CURRENT_LEVEL > 5) then
enemies = concat(enemies, misc)
enemies = concat(enemies, dogs)
elseif (CURRENT_LEVEL > 2) then
enemies = {} enemies = {}
enemies = concat(enemies, undead) enemies = concat(enemies, orcs)
enemies = concat(enemies, reptile) enemies = concat(enemies, avian)
enemies = concat(enemies, misc)
enemies = concat(enemies, dogs)
elseif (CURRENT_LEVEL > 1) then elseif (CURRENT_LEVEL > 1) then
enemies = {} enemies = {}
enemies = concat(enemies, undead) enemies = concat(enemies, undead)
enemies = concat(enemies, reptile) enemies = concat(enemies, reptile)
enemies = concat(enemies, avian)
enemies = concat(enemies, misc) enemies = concat(enemies, misc)
enemies = concat(enemies, dogs) enemies = concat(enemies, dogs)
end end

View File

@ -663,10 +663,12 @@ run_game_update(void)
skillActivated = skillbar_check_skill_activation(gSkillBar, skillActivated = skillbar_check_skill_activation(gSkillBar,
gPlayer); gPlayer);
} }
if (skillActivated && settings_get()->tooltips_enabled && playerLevel < 5) {
Settings *settings = settings_get();
if (skillActivated && settings->tooltips_enabled && playerLevel < 5) {
gGui->activeTooltip = new_skill_tooltip; gGui->activeTooltip = new_skill_tooltip;
} }
if (!artifactTooltipShown && gPlayer->equipment.hasArtifacts) { if (!artifactTooltipShown && gPlayer->equipment.hasArtifacts && settings->tooltips_enabled) {
artifactTooltipShown = true; artifactTooltipShown = true;
gGui->activeTooltip = new_artifact_tooltip; gGui->activeTooltip = new_artifact_tooltip;
} }

View File

@ -374,21 +374,23 @@ skillbar_update(SkillBar *bar, UpdateData *data)
if (data->player->equipment.artifacts[i].level == bar->artifacts[i].lvl) if (data->player->equipment.artifacts[i].level == bar->artifacts[i].lvl)
continue; continue;
Uint32 origLevel = bar->artifacts[i].lvl;
bar->artifacts[i].lvl = data->player->equipment.artifacts[i].level;
char lvl[4]; char lvl[4];
m_sprintf(lvl, 4, "%u", bar->artifacts[i].lvl); m_sprintf(lvl, 4, "%u", bar->artifacts[i].lvl);
texture_load_from_text(bar->artifacts[i].lvlSprite->textures[0], texture_load_from_text(bar->artifacts[i].lvlSprite->textures[0],
lvl, C_BLUE, C_WHITE, data->cam->renderer); lvl, C_PURPLE, C_WHITE, data->cam->renderer);
// Only update position if this is the first pickup // Only update position if this is the first pickup
if (bar->artifacts[i].lvl == 0) { if (origLevel == 0) {
bar->artifacts[i].lvlSprite->pos.x = bar->artifactDisplayOffset + 12; bar->artifacts[i].lvlSprite->pos.x = bar->artifactDisplayOffset + 12;
bar->artifacts[i].lvlSprite->pos.y = 16; bar->artifacts[i].lvlSprite->pos.y = 16;
bar->artifacts[i].aSprite->pos.x = bar->artifactDisplayOffset; bar->artifacts[i].aSprite->pos.x = bar->artifactDisplayOffset;
bar->artifacts[i].aSprite->pos.y = 8; bar->artifacts[i].aSprite->pos.y = 8;
bar->artifactDisplayOffset += 32; bar->artifactDisplayOffset += 32;
} }
bar->artifacts[i].lvl = data->player->equipment.artifacts[i].level;
} }
} }