Added the undead monsters for level > 10

- Fixed a double damage bug
- Prevent player from getting killed when in DEBUG mode
   - This can cause really weird behaviour if you fall into a pit.
This commit is contained in:
Linus Probert 2018-08-22 14:02:55 +02:00
parent 6326a64111
commit 8c261fd59f
3 changed files with 36 additions and 10 deletions

View File

@ -161,13 +161,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
@ -260,17 +280,21 @@ if(CURRENT_LEVEL > 0) then
enemies = concat(enemies, misc)
elseif (CURRENT_LEVEL > 15) then
enemies = {}
enemies = concat(enemies, demon)
enemies = concat(enemies, undead)
enemies = concat(enemies, orcs)
enemies = concat(enemies, reptile)
enemies = concat(enemies, avian)
elseif (CURRENT_LEVEL > 10) then
enemies = {}
enemies = concat(enemies, demon)
enemies = concat(enemies, undead)
enemies = concat(enemies, avian)
elseif (CURRENT_LEVEL > 5) then
enemies = {}
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)
@ -335,3 +359,4 @@ function module.load_monsters(map, monsters)
end
return module

View File

@ -304,7 +304,7 @@ static void
startGame(void *unused)
{
UNUSED(unused);
cLevel = 5;
cLevel = 1;
gGameState = PLAYING;
if (gPlayer)
player_destroy(gPlayer);
@ -606,6 +606,9 @@ handle_events(void)
static bool
is_player_dead(void)
{
#ifdef DEBUG
gPlayer->stats.hp = gPlayer->stats.hp > 0 ? gPlayer->stats.hp : 1;
#endif // DEBUG
if (gPlayer->stats.hp <= 0) {
return true;
}

View File

@ -158,7 +158,7 @@ monster_behaviour_check(Monster *m, RoomMatrix *rm)
case GUERILLA:
case SORCERER:
case FIRE_DEMON:
if (m->state.stepsSinceChange > 8
if (m->state.stepsSinceChange > 5
&& m->state.current == SCARED) {
monster_state_change(m, AGRESSIVE);
}
@ -397,12 +397,10 @@ sorcerer_blast(Monster *m, RoomMatrix *rm)
if (r->monster) {
int dmg = stats_fight(&m->stats, &r->monster->stats);
monster_hit(r->monster, dmg);
r->monster->stats.hp -= dmg;
gui_log("%s takes %d damage from the explosion", r->monster->label, dmg);
}else if (r->player) {
} else if (r->player) {
int dmg = stats_fight(&m->stats, &r->player->stats);
player_hit(r->player, dmg);
r->player->stats.hp -= dmg;
gui_log("You take %d damage from the explosion", dmg);
}
}