Added ALL_OBJECTIVES_COMPLETE script command.

This commit is contained in:
Steve 2016-02-25 10:52:01 +00:00
parent 239845a279
commit e79d331599
12 changed files with 20 additions and 13 deletions

View File

@ -106,7 +106,7 @@
]
},
{
"function" : "OBJECTIVES_COMPLETE 3",
"function" : "ALL_OBJECTIVES_COMPLETE",
"lines" : [
"WAIT 1",
"MSG_BOX Carlyle;This is Carlyle. Enemy corvette has been destroyed. All other fighters scratched.",

View File

@ -135,7 +135,7 @@
]
},
{
"function" : "OBJECTIVES_COMPLETE 4",
"function" : "ALL_OBJECTIVES_COMPLETE",
"lines" : [
"WAIT 1",
"MSG_BOX Carlyle;This is Carlyle. Enemy targets have been eliminated. Cleopatra still in one piece.",

View File

@ -139,7 +139,7 @@
]
},
{
"function" : "OBJECTIVES_COMPLETE 1",
"function" : "ALL_OBJECTIVES_COMPLETE",
"lines" : [
"WAIT 1",
"MSG_BOX de Winter;Griffin, this is de Winter. All targets destroyed.",

View File

@ -162,7 +162,7 @@
]
},
{
"function" : "OBJECTIVES_COMPLETE 4",
"function" : "ALL_OBJECTIVES_COMPLETE",
"lines" : [
"WAIT 2",
"MSG_BOX Carr;Alexandria, packaged delivered.",

View File

@ -144,7 +144,7 @@
]
},
{
"function" : "OBJECTIVES_COMPLETE 5",
"function" : "ALL_OBJECTIVES_COMPLETE",
"lines" : [
"WAIT 2",
"MSG_BOX Carr;This is Carr, reporting operation successful. Bagged us two squadron commanders.",

View File

@ -123,7 +123,7 @@
]
},
{
"function" : "OBJECTIVES_COMPLETE 3",
"function" : "ALL_OBJECTIVES_COMPLETE",
"lines" : [
"WAIT 2",
"MSG_BOX Carr;This is Carr. Reporting threat eliminated, operation successful.",

View File

@ -259,7 +259,7 @@
]
},
{
"function" : "OBJECTIVES_COMPLETE 4",
"function" : "ALL_OBJECTIVES_COMPLETE",
"lines" : [
"WAIT 2",
"MSG_BOX Williams;Control, this is Williams. Enemy capital ships have been destroyed, along with all other forces.",

View File

@ -117,7 +117,7 @@
]
},
{
"function" : "OBJECTIVES_COMPLETE 1",
"function" : "ALL_OBJECTIVES_COMPLETE",
"lines" : [
"WAIT 2",
"MSG_BOX Strickland; Looks like that was the last of 'em.",

View File

@ -223,7 +223,7 @@
]
},
{
"function" : "OBJECTIVES_COMPLETE 4",
"function" : "ALL_OBJECTIVES_COMPLETE",
"lines" : [
"WAIT 1",
"MSG_BOX de Winter;Control, this is de Winter. All enemy forces have been destroyed.",

View File

@ -205,7 +205,7 @@
]
},
{
"function" : "OBJECTIVES_COMPLETE 5",
"function" : "ALL_OBJECTIVES_COMPLETE",
"lines" : [
"WAIT 2",
"MSG_BOX Taylor;Leviathan, this is Taylor. All targets have been eliminated.",

View File

@ -134,6 +134,8 @@ static void doBattle(void)
battle.planet.x -= ssx * 0.05;
battle.planet.y -= ssy * 0.05;
doObjectives();
doHud();
@ -149,8 +151,6 @@ static void doBattle(void)
doPlayer();
doObjectives();
if (player != NULL)
{
doLocations();

View File

@ -101,13 +101,20 @@ void updateObjective(char *name, int type)
if (o->currentValue == o->targetValue)
{
completed++;
o->status = OS_COMPLETE;
addHudMessage(colors.green, "%s - Objective Complete!", o->description);
runScriptFunction(o->description);
runScriptFunction("OBJECTIVES_COMPLETE %d", ++completed);
runScriptFunction("OBJECTIVES_COMPLETE %d", completed);
if (completed == battle.numObjectivesTotal)
{
runScriptFunction("ALL_OBJECTIVES_COMPLETE");
}
}
}