diff --git a/data/fighters/hammerhead.json b/data/fighters/hammerhead.json index fb28e10..45b74f9 100644 --- a/data/fighters/hammerhead.json +++ b/data/fighters/hammerhead.json @@ -22,6 +22,5 @@ "type" : "MISSILE_MISSILE", "ammo" : 60 }, - "flags" : "EF_AVOIDS_COMBAT", - "aiFlags" : "AIF_MISSILE_BOAT" + "aiFlags" : "AIF_MISSILE_BOAT+AIF_DEFENSIVE" } diff --git a/data/fighters/khepri.json b/data/fighters/khepri.json index 6875989..ba55a9e 100644 --- a/data/fighters/khepri.json +++ b/data/fighters/khepri.json @@ -27,6 +27,5 @@ "type" : "MISSILE_MISSILE", "ammo" : 80 }, - "flags" : "EF_AVOIDS_COMBAT", - "aiFlags" : "AIF_MISSILE_BOAT" + "aiFlags" : "AIF_MISSILE_BOAT+AIF_DEFENSIVE" } diff --git a/data/fighters/list.json b/data/fighters/list.json index a76964b..a9ad538 100644 --- a/data/fighters/list.json +++ b/data/fighters/list.json @@ -19,5 +19,8 @@ "data/fighters/kingfisher.json", "data/fighters/mantis.json", "data/fighters/rook.json", - "data/fighters/thunderhead.json" + "data/fighters/thunderhead.json", + "data/fighters/scarab.json", + "data/fighters/hammerhead.json", + "data/fighters/khepri.json" ] diff --git a/data/fighters/scarab.json b/data/fighters/scarab.json index 19ad298..95033e4 100644 --- a/data/fighters/scarab.json +++ b/data/fighters/scarab.json @@ -16,12 +16,16 @@ "type" : "BT_PLASMA", "x" : 12, "y" : 0 + }, + { + "type" : "BT_ROCKET", + "x" : 0, + "y" : 0 } ], "missiles" : { "type" : "MISSILE_MISSILE", - "ammo" : 60 + "ammo" : 8 }, - "flags" : "EF_AVOIDS_COMBAT", - "aiFlags" : "AIF_MISSILE_BOAT" + "aiFlags" : "AIF_MISSILE_BOAT+AIF_DEFENSIVE" } diff --git a/src/battle/ai.c b/src/battle/ai.c index eeb9c86..af5ccd7 100644 --- a/src/battle/ai.c +++ b/src/battle/ai.c @@ -55,6 +55,11 @@ void doAI(void) return; } + if ((self->aiFlags & AIF_DEFENSIVE) && rand() % 50 && nearEnemies()) + { + return; + } + if ((self->aiFlags & AIF_GOAL_EXTRACTION) && nearExtractionPoint()) { return; diff --git a/src/defs.h b/src/defs.h index 87c3135..5ae396a 100644 --- a/src/defs.h +++ b/src/defs.h @@ -83,6 +83,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define AIF_RETREATS (2 << 4) #define AIF_GOAL_EXTRACTION (2 << 5) #define AIF_AVOIDS_COMBAT (2 << 6) +#define AIF_DEFENSIVE (2 << 7) +#define AIF_MISSILE_BOAT (2 << 8) /* player abilities */ #define BOOST_RECHARGE_TIME (FPS * 7) diff --git a/src/system/lookup.c b/src/system/lookup.c index 45c77d3..5108163 100644 --- a/src/system/lookup.c +++ b/src/system/lookup.c @@ -51,6 +51,8 @@ void initLookups(void) addLookup("AIF_RETREATS", AIF_RETREATS); addLookup("AIF_GOAL_EXTRACTION", AIF_GOAL_EXTRACTION); addLookup("AIF_AVOIDS_COMBAT", AIF_AVOIDS_COMBAT); + addLookup("AIF_DEFENSIVE", AIF_DEFENSIVE); + addLookup("AIF_MISSILE_BOAT", AIF_MISSILE_BOAT); addLookup("TT_DESTROY", TT_DESTROY); addLookup("TT_DISABLE", TT_DISABLE);