00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef MECH_SENSOR_H
00018 #define MECH_SENSOR_H
00019
00020
00021
00022
00023
00024
00025
00026 typedef struct {
00027 char *sensorname;
00028 char *matchletter;
00029
00030
00031 int fullvision;
00032
00033
00034 int maxvis;
00035
00036
00037 int maxvvar;
00038
00039
00040
00041
00042
00043 int (*seechance_func) (MECH *, MAP *, int, float, int, int);
00044
00045
00046
00047 int (*cansee_func) (MECH *, MECH *, MAP *, float, int);
00048
00049
00050 int (*tohitbonus_func) (MECH * mech, MECH * target, MAP *, int, int);
00051
00052
00053 int min_light;
00054 int max_light;
00055
00056 int required_special;
00057 int specials_set;
00058
00059 int attributeCheck;
00060
00061 char *range_desc;
00062 char *block_desc;
00063 char *special_desc;
00064 } SensorStruct;
00065
00066 #define ESEEFUNC(a) extern int a (MECH *, MAP *, int, float, int, int);
00067 #define SEEFUNC(a,b) \
00068 int a (MECH *t, MAP *map, int num, float r, int c, int l) { return (int) (b); }
00069 ESEEFUNC(vislight_see);
00070 ESEEFUNC(liteamp_see);
00071 ESEEFUNC(infrared_see);
00072 ESEEFUNC(electrom_see);
00073 ESEEFUNC(seismic_see);
00074 ESEEFUNC(radar_see);
00075 ESEEFUNC(bap_see);
00076 ESEEFUNC(blood_see);
00077
00078 #define ECSEEFUNC(a) extern int a (MECH *, MECH *, MAP *, float, int);
00079 #define CSEEFUNC(a,b) \
00080 int a (MECH *m, MECH *t, MAP *map, float r, int f) { return (int) (b); }
00081 ECSEEFUNC(vislight_csee);
00082 ECSEEFUNC(liteamp_csee);
00083 ECSEEFUNC(infrared_csee);
00084 ECSEEFUNC(electrom_csee);
00085 ECSEEFUNC(seismic_csee);
00086 ECSEEFUNC(radar_csee);
00087 ECSEEFUNC(bap_csee);
00088 ECSEEFUNC(blood_csee);
00089
00090 #define ETOHITFUNC(a) extern int a (MECH *, MECH *, MAP *, int, int);
00091 #define TOHITFUNC(a,b) \
00092 int a (MECH *m, MECH *t, MAP *map, int f, int l) { return (int) (b); }
00093
00094 ETOHITFUNC(vislight_tohit);
00095 ETOHITFUNC(liteamp_tohit);
00096 ETOHITFUNC(infrared_tohit);
00097 ETOHITFUNC(electrom_tohit);
00098 ETOHITFUNC(seismic_tohit);
00099 ETOHITFUNC(radar_tohit);
00100 ETOHITFUNC(bap_tohit);
00101 ETOHITFUNC(blood_tohit);
00102
00103 #define SENSOR_VIS 0
00104 #define SENSOR_LA 1
00105 #define SENSOR_IR 2
00106 #define SENSOR_EM 3
00107 #define SENSOR_SE 4
00108 #define SENSOR_RA 5
00109 #define SENSOR_BAP 6
00110 #define SENSOR_BHAP 7
00111
00112 #define SENSOR_ATTR_NONE 0
00113 #define SENSOR_ATTR_SEISMIC 1
00114
00115 #ifdef _MECH_SENSOR_C
00116 SensorStruct sensors[] = {
00117 {"Vislight", "V", 0, 60, 0, vislight_see, vislight_csee,
00118 vislight_tohit,
00119 -1, -1, 0, 1, SENSOR_ATTR_NONE,
00120 "Visual",
00121 "Fire/Smoke/Obstacles, 3 pt woods, 5 underwater hexes",
00122 "Bad in night-fighting (BTH)"},
00123 {"Light-amplification", "L", 0, 60, 0, liteamp_see, liteamp_csee,
00124 liteamp_tohit,
00125 0, 1, 0 - NS_TECH, 1, SENSOR_ATTR_NONE,
00126 "Visual (Dawn/Dusk), 2x Visual (Night)",
00127 "Fire/Smoke/Obstacles, 2 pt woods, any water",
00128 "Somewhat harder enemy detection (than vislight), bad in forests (BTH/range)"},
00129 {"Infrared", "I", 1, 15, 0, infrared_see, infrared_csee,
00130 infrared_tohit,
00131 -1, -1, 0 - NS_TECH, 1, SENSOR_ATTR_NONE,
00132 "15",
00133 "Fire/Obstacles, 6 pt woods",
00134 "Easy to hit 'hot' targets, not very efficient in forests (BTH)"},
00135 {"Electromagnetic", "E", 1, 24, 8, electrom_see, electrom_csee,
00136 electrom_tohit,
00137 -1, -1, 0 - NS_TECH, 1, SENSOR_ATTR_NONE,
00138 "16-24",
00139 "Mountains/Obstacles, 8 pt woods",
00140 "Easy to hit heavies, good in forests (BTH), overall unreliable (chances of detection/BTH)"},
00141 {"Seismic", "S", 1, 8, 4, seismic_see, seismic_csee, seismic_tohit, -1,
00142 -1,
00143 0 - NS_TECH, 1, SENSOR_ATTR_SEISMIC,
00144 "4-8",
00145 "Nothing",
00146 "Easier heavy and/or moving object detection (although overall hard to detect with), somewhat unreliable(BTH)"},
00147 {"Radar", "R", 1, 180, 0, radar_see, radar_csee, radar_tohit, -1, -1,
00148 AA_TECH, 1, SENSOR_ATTR_NONE,
00149 "<=180",
00150 "Obstacles, enemy elevation (Enemy Z >= 10, range: 180, Enemy Z < 10, range: varies)",
00151 "Premier anti-aircraft sensor, partially negates partial cover(BTH), doesn't see targets that are too low for detection"},
00152
00153 {"Beagle ActiveProbe", "B", 1, 6, 0, bap_see, bap_csee, bap_tohit, -1,
00154 -1, BEAGLE_PROBE_TECH, 1, SENSOR_ATTR_NONE, "<=6",
00155 "Nothing (except range)",
00156 "Ultimate sensor in close-range detection (slightly varying BTH, but ignores partial/woods/water)"},
00157
00158
00159 {"Bloodhound ActiveProbe", "H", 1, 8, 0, blood_see, blood_csee,
00160 blood_tohit, -1,
00161 -1, BLOODHOUND_PROBE_TECH, 2, SENSOR_ATTR_NONE, "<=8",
00162 "Nothing (except range)",
00163 "Superior version of the Beagle Active Probe (slightly varying BTH, but ignores partial/woods/water)"}
00164 };
00165
00166 #define NUM_SENSORS (sizeof (sensors) / sizeof(sensors[0]))
00167 #else
00168 extern SensorStruct sensors[];
00169 #endif
00170 #endif