src/hcode/btech/p.mech.fire.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void inferno_burn (MECH *mech, int time)
void vehicle_start_burn (MECH *objMech, MECH *objAttacker)
void checkVehicleInFire (MECH *objMech, int fromHexFire)
void vehicle_extinquish_fire_event (MUXEVENT *e)
void vehicle_extinquish_fire (dbref player, MECH *mech, char *buffer)
void water_extinguish_inferno (MECH *mech)


Function Documentation

void checkVehicleInFire ( MECH objMech,
int  fromHexFire 
)

Definition at line 167 of file mech.fire.c.

References CLASS_VTOL, DamageMech(), DoMotiveSystemHit(), GetSectInt, mech_notify(), MECHALL, MechMove, MechType, MOVE_HOVER, MOVE_VTOL, MOVE_WHEEL, NUM_SECTIONS, Number, Roll(), and vehicle_start_burn().

Referenced by heat_effect(), and NewHexEntered().

00168 {
00169         int wRoll = Roll();
00170         int wIter;
00171         int wDamage = 0;
00172 
00173         switch (MechMove(objMech)) {
00174         case MOVE_WHEEL:
00175         case MOVE_VTOL:
00176                 wRoll += 2;
00177                 break;
00178         case MOVE_HOVER:
00179                 wRoll += 4;
00180                 break;
00181         }
00182 
00183         if(wRoll < 8)                           /* don't do jack if it's < 8 */
00184                 return;
00185 
00186         if(fromHexFire)
00187                 mech_notify(objMech, MECHALL,
00188                                         "%cr%chYou drive through a wall of searing flames!%cn");
00189         else
00190                 mech_notify(objMech, MECHALL,
00191                                         "%cr%chThe fires surround your vehicle!%cn");
00192 
00193         switch (wRoll) {
00194         case 8:                                 /* roll once on the motive system chart */
00195         case 9:
00196                 if(MechType(objMech) == CLASS_VTOL) {
00197                         /*
00198                          * VTOLs _should_ make a pskill or go up one level... not right now tho
00199                          */
00200                 } else {
00201                         mech_notify(objMech, MECHALL,
00202                                                 "%cr%chThe fire damages your motive system!%cn");
00203                         DoMotiveSystemHit(objMech, 0);
00204                 }
00205                 break;
00206 
00207         case 10:
00208         case 11:
00209                 /*
00210                  * Do 1d6 damage to each loc
00211                  */
00212                 mech_notify(objMech, MECHALL,
00213                                         "%cr%chThe fire sweeps across your unit damaging it!%cn");
00214 
00215                 for(wIter = 0; wIter < NUM_SECTIONS; wIter++) {
00216                         wDamage = Number(1, 6);
00217 
00218                         if(GetSectInt(objMech, wIter))
00219                                 DamageMech(objMech, objMech, 0, -1, wIter, 0, 0, wDamage,
00220                                                    0, 0, 0, -1, 0, 1);
00221                 }
00222                 break;
00223 
00224         default:
00225                 vehicle_start_burn(objMech, objMech);
00226                 break;
00227         }
00228 }

void inferno_burn ( MECH mech,
int  time 
)

Definition at line 29 of file mech.fire.c.

References EVENT_BURN, inferno_end_event(), JELLIED, MechCritStatus, MECHEVENT, muxevent_last_type_data(), and muxevent_remove_type_data().

Referenced by heat_effect().

00030 {
00031         int l;
00032 
00033         if(!(MechCritStatus(mech) & JELLIED)) {
00034                 MechCritStatus(mech) |= JELLIED;
00035                 MECHEVENT(mech, EVENT_BURN, inferno_end_event, time, 0);
00036                 return;
00037         }
00038 
00039         l = muxevent_last_type_data(EVENT_BURN, (void *) mech) + time;
00040         muxevent_remove_type_data(EVENT_BURN, (void *) mech);
00041         MECHEVENT(mech, EVENT_BURN, inferno_end_event, l, 0);
00042 }

void vehicle_extinquish_fire ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 126 of file mech.fire.c.

References Burning, cch, DOCHECK, EVENT_VEHICLE_EXTINGUISH, Extinguishing, mech_notify(), MECH_USUALS, MECHALL, MECHEVENT, Started, VEHICLE_EXTINGUISH_TICK, and vehicle_extinquish_fire_event().

00127 {
00128         cch(MECH_USUALS);
00129 
00130         DOCHECK(Started(mech),
00131                         "Your tank is started! You can not extinguish the flames while your tank is started!");
00132         DOCHECK(!Burning(mech), "This unit is not on fire!");
00133         DOCHECK(Extinguishing(mech),
00134                         "You're already trying to put out the fire!");
00135 
00136         mech_notify(mech, MECHALL, "You begin to exitinguish the fires!");
00137 
00138         MECHEVENT(mech, EVENT_VEHICLE_EXTINGUISH,
00139                           vehicle_extinquish_fire_event, VEHICLE_EXTINGUISH_TICK, 0);
00140 }

void vehicle_extinquish_fire_event ( MUXEVENT e  ) 

Definition at line 110 of file mech.fire.c.

References Burning, my_event_type::data, mech_notify(), MECHALL, MechLOSBroadcast(), and StopBurning.

Referenced by vehicle_extinquish_fire().

00111 {
00112         MECH *objMech = (MECH *) e->data;
00113 
00114         if(!objMech)
00115                 return;
00116 
00117         if(!Burning(objMech))
00118                 return;
00119 
00120         StopBurning(objMech);
00121 
00122         mech_notify(objMech, MECHALL, "You manage to dowse the fire.");
00123         MechLOSBroadcast(objMech, "is no longer engulfed in flames.");
00124 }

void vehicle_start_burn ( MECH objMech,
MECH objAttacker 
)

Definition at line 82 of file mech.fire.c.

References ArmorStringFromIndex(), BurningSide, DamageMech(), EVENT_VEHICLEBURN, GetSectInt, mech_notify(), mech_printf(), MECHALL, MECHEVENT, MechLOSBroadcast(), MechMove, MechType, NUM_SECTIONS, Number, vehicle_burn_event(), and VEHICLEBURN_TICK.

Referenced by checkVehicleInFire(), and heat_effect().

00083 {
00084         int wIter;
00085         int wDamage = 0;
00086         char strLocName[30];
00087 
00088         if(!objAttacker)
00089                 objAttacker = objMech;
00090 
00091         mech_notify(objMech, MECHALL, "You catch on fire!");
00092         MechLOSBroadcast(objMech, "catches on fire!");
00093 
00094         for(wIter = 0; wIter < NUM_SECTIONS; wIter++) {
00095                 if(GetSectInt(objMech, wIter) && !BurningSide(objMech, wIter)) {
00096                         wDamage = Number(1, 6);
00097                         ArmorStringFromIndex(wIter, strLocName, MechType(objMech),
00098                                                                  MechMove(objMech));
00099                         mech_printf(objMech, MECHALL,
00100                                                 "Your %s catches on fire!", strLocName);
00101 
00102                         DamageMech(objMech, objAttacker, 0, -1, wIter, 0, 0, wDamage,
00103                                            0, 0, 0, -1, 0, 1);
00104                         MECHEVENT(objMech, EVENT_VEHICLEBURN, vehicle_burn_event,
00105                                           VEHICLEBURN_TICK, wIter);
00106                 }
00107         }
00108 }

void water_extinguish_inferno ( MECH mech  ) 

Definition at line 146 of file mech.fire.c.

References add_decoration(), CLASS_MECH, EVENT_BURN, Fallen, getMap(), InWater, JELLIED, Jellied, MECH::mapindex, mech_notify(), MECHALL, MechCritStatus, MechElevation, MechLOSBroadcast(), MechType, MechX, MechY, muxevent_remove_type_data(), SMOKE, and TYPE_SMOKE.

Referenced by Inferno_Hit(), LandMech(), mech_drop(), MechFalls(), and move_mech().

00147 {
00148         int elev = MechElevation(mech);
00149         MAP *map = getMap(mech->mapindex);
00150 
00151         if(!InWater(mech) || MechType(mech) != CLASS_MECH ||
00152            !Jellied(mech) || (elev == -1 && !Fallen(mech)))
00153                 return;
00154 
00155         muxevent_remove_type_data(EVENT_BURN, (void *) mech);
00156         MechCritStatus(mech) &= ~JELLIED;
00157 
00158         mech_notify(mech, MECHALL, "The flames extinguish in a roar of steam!");
00159         MechLOSBroadcast(mech,
00160                                          "is surrounded by a plume of steam as the flames extinguish.");
00161 
00162         /* According to FASA, the inferno jelly should keep on burning on the
00163          * water hex. We'll just add some steam (smoke) instead. */
00164         add_decoration(map, MechX(mech), MechY(mech), TYPE_SMOKE, SMOKE, 120);
00165 }


Generated on Mon May 28 04:25:41 2007 for BattletechMUX by  doxygen 1.4.7