Update script function calls.

This commit is contained in:
Steve 2015-11-29 12:55:15 +00:00
parent 46337a1f16
commit eeaccec327
26 changed files with 83 additions and 55 deletions

View File

@ -16,7 +16,7 @@
"player" : {
"type" : "Firefly",
"side" : "SIDE_ALLIES",
"pilot" : "Curtis Rice",
"pilot" : "1st Lt. Curtis Rice",
"squadron" : "Eightballers"
},
"fighters" : [

View File

@ -23,7 +23,7 @@
"player" : {
"type" : "Firefly",
"side" : "SIDE_ALLIES",
"pilot" : "Curtis Rice",
"pilot" : "1st Lt. Curtis Rice",
"squadron" : "Eightballers"
},
"fighters" : [
@ -61,8 +61,8 @@
{
"function" : "Waypoint #3",
"lines" : [
"ACTIVATE_ENTITY Pandoran",
"ACTIVATE_OBJECTIVE 1",
"ACTIVATE_ENTITIES Pandoran",
"ACTIVATE_OBJECTIVES 1",
"MSG_BOX Alba Control;Patrol A-82, you have hostiles incoming. Identified as 3 Mitikas fighters; Jackals, possibly Pandoran. Engage, but exercise extreme caution."
]
}

View File

@ -23,7 +23,7 @@
"player" : {
"type" : "ATAF",
"side" : "SIDE_ALLIES",
"pilot" : "Simon Dodds",
"pilot" : "Lt. Cdr. Simon Dodds",
"squadron" : "White Knights"
},
"fighters" : [

View File

@ -88,7 +88,7 @@
"function" : "ALLIES_KILLED 80",
"lines" : [
"MSG_BOX UNF Pilot #2;The White Knights are here! Finally!",
"ACTIVATE_ENTITY ATAFs"
"ACTIVATE_ENTITIES ATAFs"
]
},
{
@ -99,7 +99,7 @@
"MSG_BOX Lt Cdr Dodds;Estelle, we've got this. We can take them.",
"MSG_BOX Cdr de Winter;We're taking too many losses, Dodds. Fall back now, that's an order.",
"WAIT_MSG_BOX",
"ACTIVATE_ENTITY Extraction Point",
"ACTIVATE_ENTITIES Extraction Point",
"RETREAT_ALLIES"
]
}

View File

@ -14,7 +14,7 @@
}
],
"player" : {
"pilot" : "Daniel Carr",
"pilot" : "Lt. Cdr. Daniel Carr",
"squadron" : "Iron Patriots",
"type" : "TAF",
"side" : "SIDE_ALLIES"

View File

@ -26,6 +26,14 @@
"targetType" : "TT_ESCAPED",
"active" : 0
},
{
"description" : "Do not destroy Stranded Dart",
"targetName" : "Stranded Dart",
"targetValue" : 1,
"targetType" : "TT_DESTROY",
"isCondition" : 1,
"active" : 0
},
{
"description" : "Destroy Intercepting Darts",
"targetName" : "Dart",
@ -35,7 +43,7 @@
}
],
"player" : {
"pilot" : "Lt. Daniel Carr",
"pilot" : "Lt. Cdr. Daniel Carr",
"squadron" : "Iron Patriots",
"type" : "TAF",
"side" : "SIDE_ALLIES",
@ -121,8 +129,8 @@
"function" : "Waypoint #2",
"lines" : [
"MSG_BOX Alexandria Orbital;Patrol, we're again identifying a handful of crates drifting close to your current position. Please effect pick up.",
"ACTIVATE_ENTITY package",
"ACTIVATE_OBJECTIVE 1"
"ACTIVATE_ENTITIES package",
"ACTIVATE_OBJECTIVES 1"
]
},
{
@ -131,9 +139,8 @@
"MSG_BOX Alexandria Orbital;Patrol, a stranded Dart has been spotted nearby. A tug has been dispatch to bring it in. Please escort it to the target's location.",
"MSG_BOX 1st Lt Carr;Know anything about the occupant, or affiliation?",
"MSG_BOX Alexandria Orbital;Negative, Lieutenant. We'll know more once it's brought in.",
"ACTIVATE_ENTITY Stranded Dart",
"ACTIVATE_ENTITY Tug",
"ACTIVATE_OBJECTIVE 2"
"ACTIVATE_ENTITIES Stranded Dart;Tug",
"ACTIVATE_OBJECTIVES 2;3"
]
},
{
@ -142,10 +149,10 @@
"WAIT 2",
"MSG_BOX Tug;Tow cable attached. Ready to head home.",
"MSG_BOX 1st Lt Carr;We're done here. Let's bring our mystery guest in.",
"ACTIVATE_ENTITY Extraction Point",
"ACTIVATE_ENTITIES Extraction Point",
"WAIT 20",
"ACTIVATE_ENTITY Dart",
"ACTIVATE_OBJECTIVE 3",
"ACTIVATE_ENTITIES Dart",
"ACTIVATE_OBJECTIVES 4",
"MSG_BOX TAF Pilot;Dan, we've got enemy vessels inbound. More Darts.",
"MSG_BOX 1st Lt Carr;Prepare to engage. Protect the asset!"
]

View File

@ -22,7 +22,7 @@
"player" : {
"type" : "Firefly",
"side" : "SIDE_ALLIES",
"pilot" : "Opal Williams",
"pilot" : "1st Lt. Opal Williams",
"squadron" : "Agamemnon's 1st",
"x" : 25,
"y" : 45

View File

@ -7,7 +7,7 @@
"player" : {
"type" : "TAF",
"side" : "SIDE_ALLIES",
"pilot" : "Jim Goddard",
"pilot" : "2nd Lt. Jim Goddard",
"squadron" : "Midnight Runners"
},
"script" : [

View File

@ -15,7 +15,7 @@
"player" : {
"type" : "TAF",
"side" : "SIDE_ALLIES",
"pilot" : "Jim Goddard",
"pilot" : "2nd Lt. Jim Goddard",
"squadron" : "Midnight Runners"
},
"fighters" : [

View File

@ -15,7 +15,7 @@
"player" : {
"type" : "TAF",
"side" : "SIDE_ALLIES",
"pilot" : "Jim Goddard",
"pilot" : "2nd Lt. Jim Goddard",
"squadron" : "Midnight Runners"
},
"fighters" : [

View File

@ -15,7 +15,7 @@
"player" : {
"type" : "TAF",
"side" : "SIDE_ALLIES",
"pilot" : "Jim Goddard",
"pilot" : "2nd Lt. Jim Goddard",
"squadron" : "Midnight Runners"
},
"fighters" : [

View File

@ -15,7 +15,7 @@
"player" : {
"type" : "TAF",
"side" : "SIDE_ALLIES",
"pilot" : "Jim Goddard",
"pilot" : "2nd Lt. Jim Goddard",
"squadron" : "Midnight Runners"
},
"fighters" : [

View File

@ -15,7 +15,7 @@
"player" : {
"type" : "TAF",
"side" : "SIDE_ALLIES",
"pilot" : "Jim Goddard",
"pilot" : "2nd Lt. Jim Goddard",
"squadron" : "Midnight Runners"
},
"fighters" : [

View File

@ -15,7 +15,7 @@
"player" : {
"type" : "TAF",
"side" : "SIDE_ALLIES",
"pilot" : "Jim Goddard",
"pilot" : "2nd Lt. Jim Goddard",
"squadron" : "Midnight Runners"
},
"fighters" : [

View File

@ -15,7 +15,7 @@
"player" : {
"type" : "TAF",
"side" : "SIDE_ALLIES",
"pilot" : "Katherine Strickland",
"pilot" : "Cdr. Katherine Strickland",
"squadron" : "Steel Bulls"
},
"fighters" : [

View File

@ -16,7 +16,7 @@
"player" : {
"type" : "TAF",
"side" : "SIDE_ALLIES",
"pilot" : "Katherine Strickland",
"pilot" : "Cdr. Katherine Strickland",
"squadron" : "Steel Bulls"
},
"fighters" : [

View File

@ -36,7 +36,7 @@
"player" : {
"type" : "Ray",
"side" : "SIDE_ALLIES",
"pilot" : "Ian Barclay",
"pilot" : "Lt. Cdr. Seth McLeod",
"squadron" : "Steel Bulls"
},
"fighters" : [

View File

@ -29,7 +29,7 @@
"player" : {
"type" : "TAF",
"side" : "SIDE_ALLIES",
"pilot" : "Katherine Strickland",
"pilot" : "Cdr. Katherine Strickland",
"squadron" : "Steel Bulls",
"x" : 10,
"y" : 25

View File

@ -13,7 +13,7 @@
}
],
"player" : {
"pilot" : "Eliza Gaskin",
"pilot" : "1st Lt. Eliza Gaskin",
"squadron" : "The ABCs",
"type" : "Firefly",
"side" : "SIDE_ALLIES"

View File

@ -21,7 +21,7 @@
}
],
"player" : {
"pilot" : "Eliza Gaskin",
"pilot" : "1st Lt. Eliza Gaskin",
"squadron" : "The ABCs",
"type" : "Firefly",
"side" : "SIDE_ALLIES"
@ -109,19 +109,19 @@
{
"function" : "TIME 60",
"lines" : [
"ACTIVATE_ENTITY_GROUP Pandoran-1"
"ACTIVATE_ENTITY_GROUPS Pandoran-1"
]
},
{
"function" : "TIME 120",
"lines" : [
"ACTIVATE_ENTITY_GROUP Pandoran-2"
"ACTIVATE_ENTITY_GROUPS Pandoran-2"
]
},
{
"function" : "TIME 180",
"lines" : [
"ACTIVATE_ENTITY_GROUP Pandoran-3"
"ACTIVATE_ENTITY_GROUPS Pandoran-3"
]
}
]

View File

@ -21,7 +21,7 @@
}
],
"player" : {
"pilot" : "Preston Palmer",
"pilot" : "2nd Lt. Preston Palmer",
"squadron" : "S&R",
"type" : "Tug",
"side" : "SIDE_ALLIES"

View File

@ -293,10 +293,15 @@ void activateEntities(char *name)
}
}
void activateEntityGroup(char *groupName)
void activateEntityGroups(char *groupNames)
{
Entity *e;
char *groupName;
groupName = strtok(groupNames, ";");
while (groupName)
{
for (e = battle.entityHead.next ; e != NULL ; e = e->next)
{
if (strcmp(e->groupName, groupName) == 0)
@ -304,6 +309,9 @@ void activateEntityGroup(char *groupName)
e->active = 1;
}
}
groupName = strtok(NULL, ";");
}
}
static void activateEpicFighters(int n, int side)

View File

@ -106,6 +106,8 @@ void updateObjective(char *name, int type)
{
o->status = OS_COMPLETE;
addHudMessage(colors.green, "%s - Objective Complete!", o->description);
runScriptFunction("OBJECTIVES_COMPLETE %d", battle.numObjectivesComplete + 1);
}
}
}
@ -177,20 +179,30 @@ void failIncompleteObjectives(void)
}
}
void activateObjective(int num)
void activateObjectives(char *objectives)
{
int i = 0;
char *token;
int i, num;
Objective *o;
token = strtok(objectives, ";");
while (token)
{
i = 0;
num = atoi(token);
for (o = battle.objectiveHead.next ; o != NULL ; o = o->next)
{
if (i == num)
{
addHudMessage(colors.cyan, "New Objective : %s", o->description);
o->active = 1;
return;
}
i++;
}
token = strtok(NULL, ";");
}
}

View File

@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern void updateChallenges(void);
extern void addHudMessage(SDL_Color c, char *format, ...);
extern void runScriptFunction(char *format, ...);
extern void completeMission(void);
extern void failMission(void);

View File

@ -121,20 +121,20 @@ static void executeNextLine(ScriptRunner *runner)
sscanf(line, "%s", command);
if (strcmp(command, "ACTIVATE_ENTITY") == 0)
if (strcmp(command, "ACTIVATE_ENTITIES") == 0)
{
sscanf(line, "%*s %[^\n]", strParam[0]);
activateEntities(strParam[0]);
}
else if (strcmp(command, "ACTIVATE_ENTITY_GROUP") == 0)
else if (strcmp(command, "ACTIVATE_ENTITY_GROUPS") == 0)
{
sscanf(line, "%*s %[^\n]", strParam[0]);
activateEntityGroup(strParam[0]);
activateEntityGroups(strParam[0]);
}
else if (strcmp(command, "ACTIVATE_OBJECTIVE") == 0)
else if (strcmp(command, "ACTIVATE_OBJECTIVES") == 0)
{
sscanf(line, "%*s %d", &intParam[0]);
activateObjective(intParam[0]);
sscanf(line, "%*s %s", strParam[0]);
activateObjectives(strParam[0]);
}
else if (strcmp(command, "MSG_BOX") == 0)
{

View File

@ -31,8 +31,8 @@ extern void retreatAllies(void);
extern void addHudMessage(SDL_Color c, char *format, ...);
extern void addMessageBox(char *title, char *format, ...);
extern void activateEntities(char *name);
extern void activateEntityGroup(char *groupName);
extern void activateObjective(int num);
extern void activateEntityGroups(char *groupName);
void activateObjectives(char *objectives);
extern int showingMessageBoxes(void);
extern Battle battle;