src/hcode/btech/mech.lite.c File Reference

#include "mech.h"
#include "p.mech.utils.h"

Include dependency graph for mech.lite.c:

Go to the source code of this file.

Functions

static int mech_lites_target (MECH *mech, MECH *target)
void cause_lite (MECH *mech, MECH *tempMech)
void end_lite_check (MECH *mech)


Function Documentation

void cause_lite ( MECH mech,
MECH tempMech 
)

Definition at line 42 of file mech.lite.c.

References mech_lites_target(), mech_notify(), MECHALL, MechCritStatus, MechLit, MechSLWarn, and SLITE_LIT.

Referenced by update_LOSinfo().

00043 {
00044         if(MechLit(tempMech))
00045                 return;
00046         if(mech_lites_target(mech, tempMech)) {
00047                 MechCritStatus(tempMech) |= SLITE_LIT;
00048                 if(MechSLWarn(tempMech))
00049                         mech_notify(tempMech, MECHALL, "You are being illuminated!");
00050         }
00051 }

void end_lite_check ( MECH mech  ) 

Definition at line 53 of file mech.lite.c.

References FindObjectsData(), MAP::first_free, getMap(), MECH::mapindex, MECH::mapnumber, mech_lites_target(), mech_notify(), MECHALL, MechCritStatus, MechLit, MechSLWarn, MAP::mechsOnMap, and SLITE_LIT.

Referenced by aero_update(), and mech_update().

00054 {
00055         MAP *map = getMap(mech->mapindex);
00056         MECH *t;
00057         int i;
00058 
00059         if(!MechLit(mech))
00060                 return;
00061         if(!map)
00062                 return;
00063         for(i = 0; i < map->first_free; i++) {
00064                 if(i == mech->mapnumber)
00065                         continue;
00066                 if(!(t = FindObjectsData(map->mechsOnMap[i])))
00067                         continue;
00068                 if(mech_lites_target(t, mech))
00069                         return;
00070         }
00071         MechCritStatus(mech) &= ~SLITE_LIT;
00072         if(MechSLWarn(mech))
00073                 mech_notify(mech, MECHALL, "You are no longer being illuminated.");
00074 }

static int mech_lites_target ( MECH mech,
MECH target 
) [static]

Definition at line 24 of file mech.lite.c.

References FaMechRange, FORWARDARC, getMap(), InWeaponArc(), LITE_RANGE, MECH::mapindex, MechFX, MechFY, MechLites, MECHLOSFLAG_BLOCK, MechLOSFlag_WaterCount, MechLOSFlag_WoodCount, and MechToMech_LOSFlag.

Referenced by cause_lite(), and end_lite_check().

00025 {
00026         MAP *map = getMap(mech->mapindex);
00027         int losflag = MechToMech_LOSFlag(map, mech, target);
00028 
00029         if(!MechLites(mech))
00030                 return 0;
00031         if(FaMechRange(mech, target) > LITE_RANGE)
00032                 return 0;
00033         if(!(InWeaponArc(mech, MechFX(target), MechFY(target)) & FORWARDARC))
00034                 return 0;
00035         if((losflag & MECHLOSFLAG_BLOCK) ||
00036            MechLOSFlag_WoodCount(losflag) > 2 ||
00037            MechLOSFlag_WaterCount(losflag) != 0)
00038                 return 0;
00039         return 1;
00040 }


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