// Don't enter areas you're not supposed to
if (enemy->tx != (int)enemy->x)
{
- if (!(enemy->flags & ENT_FLIES))
+ if (!(enemy->flags & (ENT_FLIES|ENT_SWIMS)))
{
- //if ((map.data[x][y] == MAP_AIR) || (map.data[x][y] >= MAP_DECORATION))
if (!map.isSolid(x, y))
{
enemy->tx = (int)enemy->x;
lookForPlayer(enemy);
}
+void checkCombo()
+{
+ int old = game.currentComboHits;
+
+ game.doCombo();
+
+ if (old == 24 && game.currentComboHits == 25)
+ {
+ presentPlayerMedal("25_Hit_Combo");
+ }
+}
+
void enemyBulletCollisions(Entity *bullet)
{
if (bullet->health < 1)
if ((bullet->owner == &player) || (bullet->owner == &engine.world) || (bullet->flags & ENT_BOSS))
{
- sprintf(comboString, "Combo-%s", bullet->name);
+ snprintf(comboString, sizeof comboString, "Combo-%s", bullet->name);
if (Collision::collision(enemy, bullet))
{
{
if (bullet->owner == &player)
{
- game.score += enemy->value;
+ addPlayerScore(enemy->value);
game.currentMissionEnemiesDefeated++;
if (player.currentWeapon != &weapon[WP_LASER])
{
- game.doCombo();
+ checkCombo();
}
checkObjectives(comboString, false);
{
if (player.currentWeapon != &weapon[WP_LASER])
{
- game.doCombo();
+ checkCombo();
checkObjectives(comboString, false);
}
}
if (game.currentComboHits >= 3)
{
char message[50];
- sprintf(message, _("%d Hit Combo!"), game.currentComboHits);
+ snprintf(message, sizeof message, _("%d Hit Combo!"), game.currentComboHits);
engine.setInfoMessage(message, 0, INFO_NORMAL);
}
{
for (int i = 0 ; i < MAX_ENEMIES ; i++)
{
- strcpy(defEnemy[i].name, "");
+ defEnemy[i].name[0] = 0;
}
int enemy = 0;