If a message box speaker is "Wingmate" randomly choose from all available wingmates.
This commit is contained in:
parent
0baaeac246
commit
1ff7e4bcd6
|
@ -147,19 +147,37 @@ void drawMessageBox(void)
|
|||
|
||||
static void nextMessage(void)
|
||||
{
|
||||
Entity *e;
|
||||
Entity *e, *wingmate;
|
||||
|
||||
wingmate = NULL;
|
||||
|
||||
playSound(SND_RADIO);
|
||||
|
||||
for (e = battle.entityHead.next ; e != NULL ; e = e->next)
|
||||
{
|
||||
if (e->active && e != player)
|
||||
{
|
||||
if (strcmp(e->name, head.next->title) == 0)
|
||||
{
|
||||
battle.messageSpeaker = e;
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(head.next->title, "Wingmate") == 0 && e->type == ET_FIGHTER && e->speed > 0)
|
||||
{
|
||||
wingmate = e;
|
||||
|
||||
if (rand() % 2)
|
||||
{
|
||||
battle.messageSpeaker = e;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
battle.messageSpeaker = wingmate;
|
||||
}
|
||||
|
||||
void resetMessageBox(void)
|
||||
{
|
||||
|
|
|
@ -28,3 +28,4 @@ extern void playSound(int sound);
|
|||
extern App app;
|
||||
extern Battle battle;
|
||||
extern Colors colors;
|
||||
extern Entity *player;
|
||||
|
|
Loading…
Reference in New Issue