File: mission.h

package info (click to toggle)
openssn 1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 7,340 kB
  • sloc: cpp: 10,973; makefile: 80
file content (35 lines) | stat: -rw-r--r-- 1,172 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef MISSION_HEADER_FILE__
#define MISSION_HEADER_FILE__

#include "submarine.h"

#define MISSION_STARTED 1
#define MISSION_SUCCESS 2
#define MISSION_FAILED 3

// Go through all ships and see if they still have a mission
// flag. 
// If all mission flags have been set and the mission has not
// already failed, then mark the mission a success.
// This function returns the new mission status.
int Mission_Status(Submarine *all_subs, int old_status);


// This function checks to see if a ship has its mission status
// set to MISSION_FIND. If it does, then we check to see if the
// player can detect the ship. If the player can, we clear the
// ship's mission flag. This function returns TRUE normally or
// FALSE if an error occurs.
int Check_Find(Submarine *all_subs);

// This function checks to see if any vessels need to
// remain alive to complete the mission. The function
// checks the alive timer and reduces it. If the mission
// timer reaches zero (0), then we change the status 
// of the vessel to MISSION_NONE from MISSION_ALIVE.
// Returns TRUE if everything goes normally or FALSE
// if an error occurs.
int Check_Alive(Submarine *all_subs);

#endif