Allow player to retreat from missions.
This commit is contained in:
parent
0369602905
commit
4db432f845
|
@ -46,6 +46,9 @@ static int conditionMet(Trigger *trigger)
|
|||
case TRIGGER_KILLS:
|
||||
return trigger->targetValue == battle.stats[STAT_ENEMIES_KILLED];
|
||||
|
||||
case TRIGGER_LOSSES:
|
||||
return trigger->targetValue == battle.stats[STAT_ALLIES_KILLED];
|
||||
|
||||
case TRIGGER_WAYPOINT:
|
||||
return 1;
|
||||
|
||||
|
@ -81,5 +84,11 @@ static void fireTrigger(Trigger *trigger)
|
|||
case TA_ACTIVE_OBJECTIVE:
|
||||
activateObjective(atoi(trigger->actionValue));
|
||||
break;
|
||||
|
||||
case TA_RETREAT_ALLIES:
|
||||
battle.epic = 0;
|
||||
addHudMessage(colors.red, "Mission Aborted! Retreat!");
|
||||
retreatAllies();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ extern void addHudMessage(SDL_Color c, char *format, ...);
|
|||
extern void activateEntities(char *name);
|
||||
extern void activateObjective(int num);
|
||||
extern void activateEntityGroup(char *groupName);
|
||||
extern void retreatAllies(void);
|
||||
|
||||
extern Battle battle;
|
||||
extern Colors colors;
|
||||
|
|
|
@ -73,6 +73,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define EF_COLLECTS_ITEMS (2 << 6)
|
||||
#define EF_MUST_DISABLE (2 << 7)
|
||||
#define EF_FLEEING (2 << 8)
|
||||
#define EF_NO_EPIC (2 << 9)
|
||||
|
||||
#define AIF_NONE 0
|
||||
#define AIF_FOLLOWS_PLAYER (2 << 0)
|
||||
|
@ -190,6 +191,7 @@ enum
|
|||
TT_DISABLE,
|
||||
TT_WAYPOINT,
|
||||
TT_ESCAPED,
|
||||
TT_PLAYER_ESCAPED,
|
||||
TT_ITEM
|
||||
};
|
||||
|
||||
|
@ -197,6 +199,7 @@ enum
|
|||
{
|
||||
TRIGGER_TIME,
|
||||
TRIGGER_KILLS,
|
||||
TRIGGER_LOSSES,
|
||||
TRIGGER_WAYPOINT,
|
||||
TRIGGER_ESCAPES,
|
||||
TRIGGER_ITEM
|
||||
|
@ -208,7 +211,8 @@ enum
|
|||
TA_FAIL_MISSION,
|
||||
TA_ACTIVE_ENTITY,
|
||||
TA_ACTIVE_ENTITY_GROUP,
|
||||
TA_ACTIVE_OBJECTIVE
|
||||
TA_ACTIVE_OBJECTIVE,
|
||||
TA_RETREAT_ALLIES
|
||||
};
|
||||
|
||||
enum
|
||||
|
|
|
@ -41,6 +41,7 @@ void initLookups(void)
|
|||
addLookup("EF_FLEEING", EF_FLEEING);
|
||||
addLookup("EF_HAS_ROPE", EF_HAS_ROPE);
|
||||
addLookup("EF_COLLECTS_ITEMS", EF_COLLECTS_ITEMS);
|
||||
addLookup("EF_NO_EPIC", EF_NO_EPIC);
|
||||
|
||||
addLookup("AIF_NONE", AIF_NONE);
|
||||
addLookup("AIF_FOLLOWS_PLAYER", AIF_FOLLOWS_PLAYER);
|
||||
|
@ -55,6 +56,7 @@ void initLookups(void)
|
|||
addLookup("TT_DISABLE", TT_DISABLE);
|
||||
addLookup("TT_WAYPOINT", TT_WAYPOINT);
|
||||
addLookup("TT_ESCAPED", TT_ESCAPED);
|
||||
addLookup("TT_PLAYER_ESCAPED", TT_PLAYER_ESCAPED);
|
||||
addLookup("TT_ITEM", TT_ITEM);
|
||||
|
||||
addLookup("WT_BUTTON", WT_BUTTON);
|
||||
|
@ -127,6 +129,7 @@ void initLookups(void)
|
|||
|
||||
addLookup("TRIGGER_TIME", TRIGGER_TIME);
|
||||
addLookup("TRIGGER_KILLS", TRIGGER_KILLS);
|
||||
addLookup("TRIGGER_LOSSES", TRIGGER_LOSSES);
|
||||
addLookup("TRIGGER_WAYPOINT", TRIGGER_WAYPOINT);
|
||||
|
||||
addLookup("TA_COMPLETE_MISSION", TA_COMPLETE_MISSION);
|
||||
|
@ -134,6 +137,7 @@ void initLookups(void)
|
|||
addLookup("TA_ACTIVE_ENTITY", TA_ACTIVE_ENTITY);
|
||||
addLookup("TA_ACTIVE_OBJECTIVE", TA_ACTIVE_OBJECTIVE);
|
||||
addLookup("TA_ACTIVE_ENTITY_GROUP", TA_ACTIVE_ENTITY_GROUP);
|
||||
addLookup("TA_RETREAT_ALLIES", TA_RETREAT_ALLIES);
|
||||
}
|
||||
|
||||
static void addLookup(char *name, long value)
|
||||
|
|
Loading…
Reference in New Issue