diff --git a/src/alien.cpp b/src/alien.cpp index 2d2f8a7..a920c90 100644 --- a/src/alien.cpp +++ b/src/alien.cpp @@ -662,7 +662,7 @@ void alien_defs_init() alien_defs[CD_URANUSBOSSWING1].collectChance = 100; alien_defs[CD_URANUSBOSSWING1].collectType = P_ANYTHING; alien_defs[CD_URANUSBOSSWING1].collectValue = 250; - alien_defs[CD_URANUSBOSSWING1].flags = FL_WEAPCO | FL_IMMORTAL; + alien_defs[CD_URANUSBOSSWING1].flags = FL_WEAPCO | FL_IMMORTAL | FL_DAMAGEOWNER; // Uranus Boss Wing 2 alien_defs[CD_URANUSBOSSWING2].classDef = CD_URANUSBOSSWING2; @@ -679,7 +679,7 @@ void alien_defs_init() alien_defs[CD_URANUSBOSSWING2].collectChance = 100; alien_defs[CD_URANUSBOSSWING2].collectType = P_ANYTHING; alien_defs[CD_URANUSBOSSWING2].collectValue = 250; - alien_defs[CD_URANUSBOSSWING2].flags = FL_WEAPCO | FL_IMMORTAL; + alien_defs[CD_URANUSBOSSWING2].flags = FL_WEAPCO | FL_IMMORTAL | FL_DAMAGEOWNER; } void aliens_init() @@ -1202,8 +1202,8 @@ void alien_setAI(object *alien) if (i <= chase) { // Chase the target - alien->dx = ((alien->x - tx) / ((300 / alien->speed) + rand() % 100)); - alien->dy = ((alien->y - ty) / ((300 / alien->speed) + rand() % 100)); + alien->dx = ((alien->x - tx) / ((300 / alien->speed) + rand() % 100)); + alien->dy = ((alien->y - ty) / ((300 / alien->speed) + rand() % 100)); return; } else if ((i >= point) && (i <= stop)) @@ -1211,8 +1211,8 @@ void alien_setAI(object *alien) // Fly to a random point around the target tx += (rand() % area - (rand() % area * 2)); ty += (rand() % area - (rand() % area * 2)); - alien->dx = ((alien->x - tx) / ((300 / alien->speed) + rand() % 100)); - alien->dy = ((alien->y - ty) / ((300 / alien->speed) + rand() % 100)); + alien->dx = ((alien->x - tx) / ((300 / alien->speed) + rand() % 100)); + alien->dy = ((alien->y - ty) / ((300 / alien->speed) + rand() % 100)); return; } else @@ -1635,7 +1635,7 @@ void alien_hurt(object *alien, object *attacker, int damage, bool ion) alien->shield -= damage; // Chain reaction damage if needed - if (alien->flags & FL_DAMAGEOWNER) + if ((alien->owner != alien) && (alien->flags & FL_DAMAGEOWNER)) { alien_hurt(alien->owner, attacker, damage, ion); } diff --git a/src/game.cpp b/src/game.cpp index ea5c9e8..839ec84 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -554,6 +554,13 @@ static void game_doBullets() aliens[i].hit = 5; } + else if (aliens[i].flags & FL_DAMAGEOWNER) + { + alien_hurt(aliens[i].owner, bullet->owner, + bullet->damage, (bullet->flags & WF_DISABLE)); + + aliens[i].owner->hit = 5; + } if (bullet->id == WT_CHARGER) { diff --git a/src/intermission.cpp b/src/intermission.cpp index 58dd0ad..cba6975 100644 --- a/src/intermission.cpp +++ b/src/intermission.cpp @@ -944,7 +944,8 @@ int intermission() } } - engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0; + engine.keyState[KEY_FIRE] = 0; + engine.keyState[KEY_ALTFIRE] = 0; intermission_doCursor(); delayFrame();