Begins #8 First boss

- Introduces FIRE_DEMON behaviour
- Just need to pick a sprite and adapt the lua code
This commit is contained in:
Linus Probert 2018-08-14 13:25:18 +02:00
parent 1a09328793
commit 6cc96a954d
3 changed files with 12 additions and 3 deletions

View File

@ -498,8 +498,11 @@ check_next_level(void)
} }
if (tile->levelExit) { if (tile->levelExit) {
mixer_play_effect(NEXT_LEVEL); mixer_play_effect(NEXT_LEVEL);
mixer_play_music(GAME_MUSIC0 + get_random(2));
++cLevel; ++cLevel;
if (cLevel % 5 == 0)
mixer_play_music(BOSS_MUSIC0);
else
mixer_play_music(GAME_MUSIC0 + get_random(2));
resetGame(); resetGame();
} }
} }

View File

@ -106,6 +106,7 @@ monster_behaviour_check_post_hit(Monster *m)
monster_state_change(m, SCARED); monster_state_change(m, SCARED);
break; break;
case GUERILLA: case GUERILLA:
case FIRE_DEMON:
break; break;
default: default:
monster_state_change(m, AGRESSIVE); monster_state_change(m, AGRESSIVE);
@ -118,6 +119,7 @@ monster_behaviour_check_post_attack(Monster *m)
{ {
switch (m->behaviour) { switch (m->behaviour) {
case GUERILLA: case GUERILLA:
case FIRE_DEMON:
monster_state_change(m, SCARED); monster_state_change(m, SCARED);
break; break;
default: default:
@ -152,6 +154,7 @@ monster_behaviour_check(Monster *m, RoomMatrix *rm)
{ {
switch (m->behaviour) { switch (m->behaviour) {
case GUERILLA: case GUERILLA:
case FIRE_DEMON:
if (m->state.stepsSinceChange > 8 if (m->state.stepsSinceChange > 8
&& m->state.current == SCARED) { && m->state.current == SCARED) {
monster_state_change(m, AGRESSIVE); monster_state_change(m, AGRESSIVE);
@ -438,7 +441,8 @@ monster_move(Monster *m, RoomMatrix *rm, Map *map)
} }
if (!position_equals(&origPos, &m->sprite->pos) && rm->modifier->type == RMOD_TYPE_FIRE) { if (!position_equals(&origPos, &m->sprite->pos)
&& (rm->modifier->type == RMOD_TYPE_FIRE || m->behaviour == FIRE_DEMON)) {
Object *o = object_create_fire(); Object *o = object_create_fire();
o->sprite->pos = origPos; o->sprite->pos = origPos;
o->damage *= m->stats.lvl; o->damage *= m->stats.lvl;
@ -600,6 +604,7 @@ monster_set_behaviour(Monster *m, MonsterBehaviour behaviour)
case HOSTILE: case HOSTILE:
case GUERILLA: case GUERILLA:
case COWARD: case COWARD:
case FIRE_DEMON:
m->state.current = AGRESSIVE; m->state.current = AGRESSIVE;
break; break;
case SENTINEL: case SENTINEL:

View File

@ -34,7 +34,8 @@ typedef enum {
HOSTILE, HOSTILE,
GUERILLA, GUERILLA,
COWARD, COWARD,
SENTINEL SENTINEL,
FIRE_DEMON
} MonsterBehaviour; } MonsterBehaviour;
typedef enum { typedef enum {