39 :
Mission(identity, fname, pname)
137 if (isdigit(name[len-1]) && isspace(name[len-2])) {
151 result = elem->
Name();
217 SelectCombatGroups(subgroup.
value(), d, list);
226 static int combat_group_index = 0;
230 while (++combatant && !result) {
231 if (combatant->
GetIFF() == iff) {
232 ::SelectCombatGroups(combatant->
GetForce(), d, group_list);
236 if (group_list.
size() > 0)
237 result = group_list[combat_group_index++ % group_list.
size()];
287 strcpy_s(
path, pname);
290 Print(
"\nCan't Load Mission Template, script unspecified.\n");
296 int max_ships = (int) 1e6;
318 if (!file_type || file_type->
value() !=
"MISSION_TEMPLATE") {
319 Print(
"ERROR: invalid MISSION TEMPLATE file '%s'\n",
filename);
327 char target_name[256];
334 delete term; term = 0;
342 if (defname ==
"name")
345 else if (defname ==
"type") {
351 else if (defname ==
"system") {
366 else if (defname ==
"degrees")
369 else if (defname ==
"region")
372 else if (defname ==
"objective")
375 else if (defname ==
"sitrep")
378 else if (defname ==
"start")
381 else if (defname ==
"team")
384 else if (defname ==
"target")
387 else if (defname ==
"ward")
390 else if ((defname ==
"alias")) {
401 else if ((defname ==
"callsign")) {
403 Print(
"WARNING: callsign struct missing in '%s'\n",
filename);
412 else if (defname ==
"optional") {
414 Print(
"WARNING: optional group struct missing in '%s'\n",
filename);
423 else if (defname ==
"element") {
425 Print(
"WARNING: element struct missing in '%s'\n",
filename);
435 Print(
"WARNING: failed to map element %s '%s' in '%s'\n",
447 else if (defname ==
"event") {
476 Print(
"Mission Template Loaded.\n\n");
494 bool use_loc =
false;
503 if (defname ==
"name")
506 else if (defname ==
"elem")
509 else if (defname ==
"code")
512 else if (defname ==
"design")
515 else if (defname ==
"iff")
518 else if (defname ==
"loc") {
524 else if (defname ==
"rloc") {
530 else if (defname ==
"player") {
533 if (player && !code.
length())
557 if (code ==
"player") {
566 else if (campaign && code ==
"player_carrier") {
578 else if (campaign && code ==
"player_squadron") {
592 else if (campaign && code ==
"strike_target") {
621 else if (!first_match)
626 if (first_match && !elem)
631 if (rloc) elem->
SetRLoc(*rloc);
639 ::Print(
"WARNING: Could not resolve mission alias '%s'\n", (
const char*) name);
644 if (!elem || !
ok)
return;
654 if (defname ==
"objective") {
656 Print(
"WARNING: order struct missing for element '%s' in '%s'\n", (
const char*) elem->
Name(),
filename);
666 else if (defname ==
"instr") {
667 Text* obj =
new(__FILE__,__LINE__)
Text;
672 else if (defname ==
"order" || defname ==
"navpt") {
674 Print(
"WARNING: order struct missing for element '%s' in '%s'\n", (
const char*) elem->
Name(),
filename);
684 else if (defname ==
"loadout") {
686 Print(
"WARNING: loadout struct missing for element '%s' in '%s'\n", (
const char*) elem->
Name(),
filename);
712 if (defname ==
"name")
715 else if (defname ==
"iff")
720 if (name.
length() > 0 && iff >= 0)
741 if (defname ==
"min") {
746 else if (defname ==
"max") {
752 else if ((defname ==
"optional")) {
757 else if (total - n - skip <= min)
764 Print(
"WARNING: optional group struct missing in '%s'\n",
filename);
781 else if (defname ==
"element") {
786 else if (total - n - skip <= min)
793 Print(
"WARNING: element struct missing in '%s'\n",
filename);
817 return n > 0 && n >= min;