Converted the "missfire" messages. Deleted the now empty messages.cpp.

This commit is contained in:
onpon4 2016-11-19 08:51:26 -05:00
parent 7afd322a71
commit e0cac7850c
5 changed files with 21 additions and 70 deletions

View File

@ -1,7 +1,7 @@
CXXFLAGS ?= -O2 -Wall -g
CXXFLAGS += `pkg-config --cflags sdl2 SDL2_image SDL2_mixer`
LIBS = `pkg-config --libs sdl2 SDL2_image SDL2_mixer`
OBJS = alien.o audio.o bullet.o cargo.o collectable.o colors.o cutscene.o engine.o event.o explosion.o game.o gfx.o intermission.o messages.o misc.o missions.o player.o renderer.o resources.o save.o screen.o ship.o shop.o Starfighter.o title.o weapons.o window.o
OBJS = alien.o audio.o bullet.o cargo.o collectable.o colors.o cutscene.o engine.o event.o explosion.o game.o gfx.o intermission.o misc.o missions.o player.o renderer.o resources.o save.o screen.o ship.o shop.o Starfighter.o title.o weapons.o window.o
VERSION = 1.7-dev
PROG = starfighter

View File

@ -49,7 +49,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "gfx.h"
#include "intermission.h"
#include "save.h"
#include "messages.h"
#include "misc.h"
#include "missions.h"
#include "player.h"

View File

@ -49,6 +49,22 @@ static const char *ursulaPlayerHitMessage[nUrsulaPlayerHitMessage] = {
"Dammit, Chris, you made me miss!"
};
static const int nPlayerPhoebeHitMessage = 3;
static const char *playerPhoebeHitMessage[nPlayerPhoebeHitMessage] = {
"OW! I hope that was an accident!",
"Chris, please be more careful!",
"Ouch! What are you shooting at me for?"
};
static const int nPlayerUrsulaHitMessage = 5;
static const char *playerUrsulaHitMessage[nPlayerUrsulaHitMessage] = {
"I am NOT your enemy!",
"Hey! Watch it!",
"What are you doing?! Shoot THEM!",
"Open your eyes!",
"Are you blind?!"
};
void game_init()
{
@ -648,9 +664,10 @@ static void game_doBullets()
if (bullet->owner == &player)
{
game.hits++;
if ((aliens[i].classDef == CD_PHOEBE) ||
(aliens[i].classDef == CD_URSULA))
getMissFireMessage(&aliens[i]);
if (aliens[i].classDef == CD_PHOEBE)
setRadioMessage(FS_PHOEBE, playerPhoebeHitMessage[rand() % nPlayerPhoebeHitMessage], 0);
else if (aliens[i].classDef == CD_URSULA)
setRadioMessage(FS_URSULA, playerUrsulaHitMessage[rand() % nPlayerUrsulaHitMessage], 0);
}
if (!(aliens[i].flags & FL_IMMORTAL))

View File

@ -1,40 +0,0 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012 Guus Sliepen
Copyright (C) 2015, 2016 Julie Marchant <onpon4@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Starfighter.h"
static const char *missFireMessage[5] = {
"I am NOT your enemy!",
"Hey! Watch it!",
"What are you doing?! Shoot THEM!",
"OW! I hope that was an accident!",
"Open your eyes!",
};
void getMissFireMessage(object *ally)
{
int faceToUse = FS_PHOEBE;
if (ally == &aliens[ALIEN_PHOEBE])
faceToUse = FS_PHOEBE;
else
faceToUse = FS_URSULA;
setRadioMessage(faceToUse, missFireMessage[rand() % 5], 0);
}

View File

@ -1,25 +0,0 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015, 2016 Julie Marchant <onpon4@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MESSAGES_H
#define MESSAGES_H
extern void getMissFireMessage(object *ally);
#endif