From 9be21cbd3ae3b8a793a1e93ebc82f463d5a51fd2 Mon Sep 17 00:00:00 2001 From: onpon4 Date: Tue, 2 Jun 2015 12:43:06 -0400 Subject: [PATCH] Made it possible to hit the Uranus boss via its wings. The idea is clearly supposed to be breaking the boss in two and then destroying the halves, so it makes no sense for the wings you break off to also act as shields, which they did. Pretty much all this did was cause a lot of shots to be wasted. --- src/alien.cpp | 14 +++++++------- src/game.cpp | 7 +++++++ src/intermission.cpp | 3 ++- 3 files changed, 16 insertions(+), 8 deletions(-) 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();