00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _FAILURES_H
00014 #define _FAILURES_H
00015
00016 #include "p.failures.h"
00017
00018 #define IsAutocannon(a) (MechWeapons[a].type == TAMMO)
00019 #define IsEnergy(a) (MechWeapons[a].type==TBEAM)
00020
00021
00022
00023
00024 #define HEAT 1
00025 #define RANGE 2
00026 #define DAMAGE 3
00027 #define POWER_SPIKE 4
00028 #define WEAPON_JAMMED 5
00029 #define WEAPON_DUD 6
00030 #define CRAZY_MISSILES 7
00031
00032 #define FAIL_STATIC 1
00033
00034
00035 #define FAIL_NONE 0
00036 #define FAIL_JAMMED 1
00037 #define FAIL_SHORTED 2
00038 #define FAIL_DUD 3
00039 #define FAIL_EMPTY 4
00040 #define FAIL_DESTROYED 5
00041 #define FAIL_AMMOJAMMED 6
00042 #define FAIL_AMMOCRITJAMMED 7
00043
00044 struct brand_data {
00045 char *name;
00046 short level;
00047 int success;
00048 int modifier;
00049 };
00050
00051 struct failure_data {
00052 char *message;
00053 int data;
00054 void (*func) (MECH *, int, int, int, int, int, int *, int *);
00055 int type;
00056 int flag;
00057 };
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 #ifndef _FAILURES_C
00068
00069 extern struct brand_data brands[];
00070 extern struct failure_data failures[];
00071 #else
00072 struct brand_data brands[] = {
00073 {"Lords", 1, 80, -40},
00074 {"Hesperus", 2, 90, -20},
00075 {"Martell", 3, 95, 0},
00076 {"Magna", 4, 100, 20},
00077 {"Agra", 5, 101, 40},
00078
00079 {"Luxor", 1, 80, -40},
00080 {"SperryBrowning", 2, 90, -20},
00081 {"Oriente", 3, 95, 0},
00082 {"Deprus", 4, 100, 20},
00083 {"Armstrong", 5, 101, 40},
00084
00085 {"Coventry", 1, 80, -40},
00086 {"Shannon", 2, 90, -20},
00087 {"Bical", 3, 95, 0},
00088 {"Holly", 4, 100, 20},
00089 {"Telos", 5, 101, 40},
00090
00091 {"Pynes", 1, 80, -40},
00092 {"Hotshot", 2, 90, -20},
00093 {"Firestorm", 3, 95, 0},
00094 {"Purity", 4, 100, 20},
00095 {"Ventra", 5, 101, 40},
00096
00097 {"Dalban", 1, 80, -40},
00098 {"Hartford", 2, 90, -20},
00099 {"Garet", 3, 95, 0},
00100 {"Ares", 4, 100, 20},
00101 {"Tek", 5, 101, 40},
00102
00103 {"Duoteck", 1, 80, -40},
00104 {"CeresCom", 2, 90, -20},
00105 {"Achernar", 3, 95, 0},
00106 {"Tek", 4, 100, 20},
00107 {"Iriad", 5, 101, 40},
00108 };
00109
00110 #define REQ_HEAT 1
00111 #define REQ_TARGET 2
00112 #define REQ_TAC 3
00113 #define REQ_LRS 4
00114 #define REQ_SCANNERS 5
00115 #define REQ_COMPUTER 6
00116 #define REQ_RADIO 7
00117
00118 struct failure_data failures[] = {
00119 #define ENERGY_INDEX 0
00120
00121
00122 {"%ch%crYour weapon fails to charge properly!%cn", 15,
00123 FailureWeaponDamage, FAIL_NONE, 0},
00124 {"%ch%crYour weapon fails to charge properly!%cn", 30,
00125 FailureWeaponDamage, FAIL_NONE, 0},
00126 {"%ch%crYour weapon fails to charge properly!%cn", 45,
00127 FailureWeaponDamage, FAIL_NONE, 0},
00128 {"%ch%crFailure in the weapon's cooling system ; too much heat produced!%cn",
00129 30, FailureWeaponHeat, FAIL_NONE, REQ_HEAT},
00130 {"%ch%crOdd energy reading from the weapon ; It seems to have gone offline!%cn",
00131 0, FailureWeaponSpike, FAIL_SHORTED, 0},
00132 {"%ch%crWeapon melts down!%cn", 0, FailureWeaponSpike, FAIL_SHORTED,
00133 0},
00134
00135
00136 #define AC_INDEX 6
00137
00138 {"%ch%crRound misfires! .. and spirals off!%cn", 0,
00139 FailureWeaponDud, FAIL_NONE, 0},
00140 {"%ch%crRound not fired! Dud!%cn", 0, FailureWeaponDud, FAIL_DUD, 0},
00141 {"%ch%crWeapon JAMS... clearing!%cn", 0, FailureWeaponJammed,
00142 FAIL_JAMMED, 0},
00143 {"%ch%crFailure in the weapon's cooling system, too much heat produced!%cn",
00144 20, FailureWeaponHeat, FAIL_NONE, REQ_HEAT},
00145 {"%ch%crFailure in the weapon's cooling system, too much heat produced!%cn",
00146 40, FailureWeaponHeat, FAIL_NONE, REQ_HEAT},
00147 {"%ch%crRound not fired! STUCK in chamber!%cn", 0, FailureWeaponDud,
00148 FAIL_DUD, 0},
00149
00150
00151 #define MISSILE_INDEX 12
00152
00153 {"%ch%crRack jams, attemping to clear!%cn", 0, FailureWeaponJammed,
00154 FAIL_JAMMED, 0},
00155 {"%ch%crSome of your missiles veer off course!%cn", 20,
00156 FailureWeaponMissiles, FAIL_NONE, 0},
00157 {"%ch%crSome of your missiles veer off course!%cn", 40,
00158 FailureWeaponMissiles, FAIL_NONE, 0},
00159 {"%ch%crGuidance Failure! All missile veer off course!%cn", 100,
00160 FailureWeaponMissiles, FAIL_NONE, 0},
00161 {"%ch%crWeapon power spikes.. attempting to restart!%cn", 0,
00162 FailureWeaponSpike, FAIL_SHORTED, 0},
00163 {"%ch%crWeapon power spikes.. Electronics fused!!%cn", 0,
00164 FailureWeaponSpike, FAIL_SHORTED, 0},
00165
00166
00167 #define FLAMMER_INDEX 18
00168
00169 {"%ch%crGel line clogs, sending pressure through it now!%cn", 0,
00170 FailureWeaponJammed, FAIL_JAMMED, 0},
00171 {"%ch%crElectric ignition shorts out! Restarting!%cn", 0,
00172 FailureWeaponSpike, FAIL_SHORTED, 0},
00173 {"%ch%crFuel leaks on the chassis and ignites!%cn", 100,
00174 FailureWeaponHeat, FAIL_NONE, 0},
00175
00176 {"%ch%crFuel at critical point!! Shutting down weapon to vent heat!%cn",
00177 0, FailureWeaponSpike, FAIL_SHORTED, 0},
00178 {"%ch%crEjection nozzel gums up! Please wait while pressure is applied!%cn",
00179 0, FailureWeaponJammed, FAIL_JAMMED, 0},
00180 {"%ch%crFuel canisters explode! No fuel left to burn!%cn", 0,
00181 FailureWeaponSpike, FAIL_EMPTY, 0},
00182
00183
00184 #define COMPUTER_INDEX 24
00185
00186 {"%ch%crComputer Glitch! Target lost, please reacquire!%cn", 0,
00187 FailureComputerTarget, FAIL_NONE, REQ_TARGET},
00188 {"%ch%crTactical shorts out! Fixing .. Please stand by.%cn", 1,
00189 FailureComputerScanner, FAIL_NONE, REQ_TAC},
00190 {"%ch%crLong Range Sensors short out! .. Fixing .. Please stand by.%cn",
00191 2, FailureComputerScanner, FAIL_NONE, REQ_LRS},
00192 {"%ch%crScanners short out! Fixing .. Please stand by.%cn", 4,
00193 FailureComputerScanner, FAIL_NONE, REQ_SCANNERS},
00194 {"%ch%crA sudden *SNAP* echos in your cockpit then all your displays die!%cn",
00195 7, FailureComputerScanner, FAIL_NONE, REQ_SCANNERS},
00196 {"%ch%crYou hear a loud *SNAP* *CRACKLE* and then everything powers down!%cn",
00197 0, FailureComputerShutdown, FAIL_NONE, REQ_COMPUTER},
00198
00199
00200 #define RADIO_INDEX 30
00201 {"none", 50, FailureRadioStatic, FAIL_NONE, 0},
00202 {"none", 70, FailureRadioStatic, FAIL_NONE, 0},
00203 {"%ch%crYour readouts register a power loss in your radio!%cn", 15,
00204 FailureRadioRange, FAIL_NONE, REQ_RADIO},
00205 {"%ch%crYour readouts register a power loss in your radio!%cn", 30,
00206 FailureRadioRange, FAIL_NONE, REQ_RADIO},
00207 {"%ch%crYour radio suddenly shorts out! Please wait for backup to come online!%cn",
00208 0, FailureRadioShort, FAIL_NONE, REQ_RADIO},
00209 {"%ch%crYour entire radio system suddenly shorts out!%cn", 0,
00210 FailureRadioShort, FAIL_NONE, REQ_RADIO}
00211 };
00212
00213 #endif
00214 #endif