Removed the shock damage messages, fixed a mistake.
This commit is contained in:
parent
5982fcc0d8
commit
59a15eb6f3
|
@ -216,6 +216,5 @@ void collectable_explode(collectables *collectable)
|
|||
addExplosion(collectable->x + rand() % 25 - rand() % 25,
|
||||
collectable->y + rand() % 25 - rand() % 25, E_BIG_EXPLOSION);
|
||||
|
||||
if (player_checkShockDamage(collectable->x, collectable->y))
|
||||
setInfoLine("Warning: Mine damage to shield!!", FONT_RED);
|
||||
player_checkShockDamage(collectable->x, collectable->y);
|
||||
}
|
||||
|
|
12
src/game.cpp
12
src/game.cpp
|
@ -430,13 +430,15 @@ static void game_doBullets()
|
|||
object *bullet = engine.bulletHead;
|
||||
object *prevBullet = engine.bulletHead;
|
||||
|
||||
collectables *collectable = engine.collectableHead;
|
||||
collectables *prevCollectable = engine.collectableHead;
|
||||
collectables *collectable;
|
||||
collectables *prevCollectable;
|
||||
|
||||
bool okayToHit = false;
|
||||
int old_shield;
|
||||
float homingMissileSpeed = 0;
|
||||
|
||||
bullet = engine.bulletHead;
|
||||
prevBullet = engine.bulletHead;
|
||||
engine.bulletTail = engine.bulletHead;
|
||||
|
||||
while (bullet->next != NULL)
|
||||
|
@ -660,6 +662,8 @@ static void game_doBullets()
|
|||
}
|
||||
|
||||
// check to see if a bullet (on any side) hits a mine
|
||||
collectable = engine.collectableHead;
|
||||
prevCollectable = engine.collectableHead;
|
||||
engine.collectableTail = engine.collectableHead;
|
||||
while (collectable->next != NULL)
|
||||
{
|
||||
|
@ -715,9 +719,7 @@ static void game_doBullets()
|
|||
addExplosion(bullet->x + RANDRANGE(-35, 35),
|
||||
bullet->y + RANDRANGE(-35, 35), E_BIG_EXPLOSION);
|
||||
|
||||
if (player_checkShockDamage (bullet->x, bullet->y))
|
||||
setInfoLine("Warning: Missile Shockwave Damage!!",
|
||||
FONT_RED);
|
||||
player_checkShockDamage(bullet->x, bullet->y);
|
||||
}
|
||||
bullet->active = false;
|
||||
}
|
||||
|
|
|
@ -68,15 +68,15 @@ void player_setTarget(int index)
|
|||
engine.targetShield /= aliens[index].shield;
|
||||
}
|
||||
|
||||
char player_checkShockDamage(float x, float y)
|
||||
void player_checkShockDamage(float x, float y)
|
||||
{
|
||||
float distX = fabsf(x - player.x);
|
||||
float distY = fabsf(y - player.y);
|
||||
|
||||
// Don't let the player be hurt by an explosion after they have completed
|
||||
// all the mission objectives. That would be *really* annoying!
|
||||
if ((engine.cheatShield) || (engine.missionCompleteTimer != 0))
|
||||
return 0;
|
||||
|
||||
float distX = fabsf(x - player.x);
|
||||
float distY = fabsf(y - player.y);
|
||||
return;
|
||||
|
||||
if ((distX <= 50) && (distY <= 50))
|
||||
{
|
||||
|
@ -90,11 +90,7 @@ char player_checkShockDamage(float x, float y)
|
|||
player.shield -= (int)(10 - distY);
|
||||
LIMIT(player.shield, 0, player.maxShield);
|
||||
player.hit = 10;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void exitPlayer()
|
||||
|
|
|
@ -25,7 +25,7 @@ extern bool player_chargerFired;
|
|||
|
||||
extern void initPlayer();
|
||||
void player_setTarget(int index);
|
||||
char player_checkShockDamage(float x, float y);
|
||||
void player_checkShockDamage(float x, float y);
|
||||
extern void exitPlayer();
|
||||
extern void flushInput();
|
||||
extern void getPlayerInput();
|
||||
|
|
Loading…
Reference in New Issue