Well you can ignore the SEXP changes and anything that stems from them as I'm handling those anyway.
EDIT :
Here's a patch to add in the Was-destroyed-by-delay SEXP. The allow-dynamic-goals, and set-scannable SEXPs are basically useless as this functionality can already be called from the alter-ship-flag SEXP without all the bollocks that resulted in me writing the alter-ship-flag SEXP in the first place. The hide-ship-name SEXP's functionality can and has been added to alter-ship-flag SEXP in the patch.
Index: code/parse/sexp.cpp
===================================================================
--- code/parse/sexp.cpp (revision 10205)
+++ code/parse/sexp.cpp (working copy)
@@ -180,6 +180,7 @@
//Objectives Category
{ "is-destroyed", OP_IS_DESTROYED, 1, INT_MAX, SEXP_BOOLEAN_OPERATOR, },
{ "is-destroyed-delay", OP_IS_DESTROYED_DELAY, 2, INT_MAX, SEXP_BOOLEAN_OPERATOR, },
+ { "was-destroyed-by-delay", OP_WAS_DESTROYED_BY_DELAY, 3, INT_MAX, SEXP_BOOLEAN_OPERATOR, },
{ "is-subsystem-destroyed", OP_IS_SUBSYSTEM_DESTROYED, 2, 2, SEXP_BOOLEAN_OPERATOR, },
{ "is-subsystem-destroyed-delay", OP_IS_SUBSYSTEM_DESTROYED_DELAY, 3, 3, SEXP_BOOLEAN_OPERATOR, },
{ "is-disabled", OP_IS_DISABLED, 1, INT_MAX, SEXP_BOOLEAN_OPERATOR, },
@@ -5117,6 +5118,77 @@
return SEXP_FALSE;
}
+
+// First ship is the destroyer, rest of the arguments are the destroyed ships.
+int sexp_was_destroyed_by(int n, fix* latest_time)
+{
+ char* destroyer_ship_name;
+ char* destroyed_ship_name;
+ int count = 0, num_destroyed;
+ fix time;
+
+ Assert(n != -1);
+
+ destroyer_ship_name = CTEXT(n);
+
+ num_destroyed = 0;
+
+ for (n = CDR(n); n != -1; n = CDR(n))
+ {
+ count++;
+ destroyed_ship_name = CTEXT(n);
+
+ if (sexp_query_has_yet_to_arrive(destroyed_ship_name))
+ return SEXP_CANT_EVAL;
+
+ // check to see if this ship/wing has departed. If so, then function is known false
+ if (mission_log_get_time(LOG_SHIP_DEPARTED, destroyed_ship_name, NULL, NULL))
+ return SEXP_KNOWN_FALSE;
+
+ // check the mission log. If ship/wing not destroyed, immediately return SEXP_FALSE.
+ if (mission_log_get_time(LOG_SHIP_DESTROYED, destroyed_ship_name, destroyer_ship_name, &time))
+ {
+ num_destroyed++;
+ if (latest_time && (time > *latest_time))
+ *latest_time = time;
+ }
+ }
+
+ if (count == num_destroyed)
+ return SEXP_KNOWN_TRUE;
+ else
+ return SEXP_FALSE;
+}
+
+int sexp_was_destroyed_by_delay(int n)
+{
+ fix delay, time;
+ int val;
+
+ Assert(n >= 0);
+
+ time = 0;
+
+ delay = i2f(eval_num(n));
+
+ // check value of is_destroyed function. KNOWN_FALSE should be returned immediately
+ val = sexp_was_destroyed_by(CDR(n), &time);
+ if (val == SEXP_KNOWN_FALSE)
+ return val;
+
+ if (val == SEXP_CANT_EVAL)
+ return SEXP_CANT_EVAL;
+
+ if (val)
+ {
+
+ if ((Missiontime - time) >= delay)
+ return SEXP_KNOWN_TRUE;
+ }
+
+ return SEXP_FALSE;
+}
+
int sexp_is_subsystem_destroyed_delay(int n)
{
char *ship_name, *subsys_name;
@@ -22027,6 +22099,10 @@
sexp_val = sexp_is_destroyed( node, NULL );
break;
+ case OP_WAS_DESTROYED_BY_DELAY:
+ sexp_val = sexp_was_destroyed_by_delay(node);
+ break;
+
case OP_IS_SUBSYSTEM_DESTROYED:
sexp_val = sexp_is_subsystem_destroyed(node);
break;
@@ -24452,6 +24528,7 @@
case OP_HAS_ARRIVED:
case OP_HAS_DEPARTED:
case OP_IS_DESTROYED_DELAY:
+ case OP_WAS_DESTROYED_BY_DELAY:
case OP_IS_SUBSYSTEM_DESTROYED_DELAY:
case OP_IS_DISABLED_DELAY:
case OP_IS_DISARMED_DELAY:
@@ -25318,6 +25395,12 @@
else
return OPF_SHIP_WING;
+ case OP_WAS_DESTROYED_BY_DELAY:
+ if (argnum == 0)
+ return OPF_POSITIVE;
+ else
+ return OPF_SHIP;
+
case OP_IS_DESTROYED_DELAY:
case OP_HAS_ARRIVED_DELAY:
case OP_HAS_DEPARTED_DELAY:
@@ -29288,6 +29371,13 @@
"\t1:\tTime delay in seconds (see above).\r\n"
"\tRest:\tName of ship (or wing) to check status of." },
+ { OP_WAS_DESTROYED_BY_DELAY, "Was destroyed by delay (Boolean operator)\r\n"
+ "\tBecomes true <delay> seconds after all specified ships have been destroyed by the specified first ship.\r\n\r\n"
+ "Returns a boolean value. Takes 3 or more arguments...\r\n"
+ "\t1:\tTime delay in seconds (see above).\r\n"
+ "\t2:\tShip that should have destroyed the other ships (see below).\r\n"
+ "\tRest:\tName of ships to check status of." },
+
{ OP_IS_SUBSYSTEM_DESTROYED_DELAY, "Is subsystem destroyed delay (Boolean operator)\r\n"
"\tBecomes true <delay> seconds after the specified subsystem of the specified "
"ship is destroyed.\r\n\r\n"
Index: code/parse/sexp.h
===================================================================
--- code/parse/sexp.h (revision 10205)
+++ code/parse/sexp.h (working copy)
@@ -286,6 +286,7 @@
#define OP_PERCENT_SHIPS_DISABLED (0x000f | OP_CATEGORY_OBJECTIVE | OP_NONCAMPAIGN_FLAG) // Goober5000
#define OP_PERCENT_SHIPS_ARRIVED (0x0010 | OP_CATEGORY_OBJECTIVE | OP_NONCAMPAIGN_FLAG) // FUBAR-BDHR
#define OP_NAV_IS_VISITED (0x0011 | OP_CATEGORY_OBJECTIVE | OP_NONCAMPAIGN_FLAG) // Kazan
+#define OP_WAS_DESTROYED_BY_DELAY (0x0012 | OP_CATEGORY_OBJECTIVE | OP_NONCAMPAIGN_FLAG) // WCS
#define OP_TIME_SHIP_DESTROYED (0x0000 | OP_CATEGORY_TIME | OP_NONCAMPAIGN_FLAG)
#define OP_TIME_SHIP_ARRIVED (0x0001 | OP_CATEGORY_TIME | OP_NONCAMPAIGN_FLAG)
@@ -382,7 +383,6 @@
#define OP_IS_IN_MISSION (0x004d | OP_CATEGORY_STATUS | OP_NONCAMPAIGN_FLAG) // Goober5000
-
// conditional sexpressions
#define OP_WHEN (0x0000 | OP_CATEGORY_CONDITIONAL)
#define OP_WHEN_ARGUMENT (0x0001 | OP_CATEGORY_CONDITIONAL) // Goober5000
Index: code/ship/ship.cpp
===================================================================
--- code/ship/ship.cpp (revision 10205)
+++ code/ship/ship.cpp (working copy)
@@ -361,6 +361,7 @@
};
// Constant for flag, Name of flag, In flags or flags2
+// When adding new flags remember to bump MAX_SHIP_FLAG_NAMES in ship.h
ship_flag_name Ship_flag_names[] = {
{SF_VAPORIZE, "vaporize", 1, },
{SF_WARP_BROKEN, "break-warp", 1, },
@@ -370,6 +371,7 @@
{SF_HIDDEN_FROM_SENSORS, "hidden-from-sensors", 1, },
{SF2_STEALTH, "stealth", 2, },
{SF2_FRIENDLY_STEALTH_INVIS, "friendly-stealth-invisible", 2, },
+ {SF2_HIDE_SHIP_NAME, "hide-ship-name", 2, },
{SF2_AFTERBURNER_LOCKED, "afterburners-locked", 2, },
{SF2_PRIMARIES_LOCKED, "primaries-locked", 2, },
{SF2_SECONDARIES_LOCKED, "secondaries-locked", 2, },
Index: code/ship/ship.h
===================================================================
--- code/ship/ship.h (revision 10205)
+++ code/ship/ship.h (working copy)
@@ -421,7 +421,7 @@
int flag_list; // is this flag in the 1st or 2nd ship flags list?
} ship_flag_name;
-#define MAX_SHIP_FLAG_NAMES 15
+#define MAX_SHIP_FLAG_NAMES 16
extern ship_flag_name Ship_flag_names[];
// states for the flags variable within the ship structure
What other SEXPs were added by the WCS team? Matth might be able to answer but from using X3N0-Life-Form re-engineered WCS code I've identified these SEXPs which I suspect we already have an alternative to
trigger-arrival-track
force-battle-music
set-forward-deceleration
About the only other SEXP which might be useful is their lock-controls SEXP. I remember in Diaspora we did the same thing using scripts and the ignore-key SEXP. So it's probably worth adding.
[attachment deleted by an evil time traveler]