Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

BattleGroup.cpp File Reference


Detailed Description

implements BattleGroup.h

Definition in file BattleGroup.cpp.

#include "BattleGroup.h"
#include "BattleState.h"
#include "BattleUnitStat.h"
#include "BattleUnitData.h"
#include "Sound.h"
#include "GameState.h"

Include dependency graph for BattleGroup.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void playVoiceContact (BattleState &BS, bool isActive)
void playVoiceStress (BattleState &BS, bool isActive)
void playVoicePanick (BattleState &BS, bool isActive)
FLOAT triArea (Vec2D &p0, Vec2D &p1, Vec2D &p2)


Function Documentation

void playVoiceContact BattleState   BS,
bool    isActive
 

Definition at line 31 of file BattleGroup.cpp.

References Sound::getMasterSFXVol(), BattleState::m_cvLastContact, BattleState::m_cvLastPanick, Sound::playRandomSound(), sys_localRandInt(), BattleState::teamAColor, BattleState::teamBColor, and Vec3D.

Referenced by BattleGroup::fire().

00032 {
00033         float vol = Sound::getMasterSFXVol();
00034         if( !isActive ) vol *= 0.92f;
00035         Vec3D playerCol( GameState::consolePlayer()->color() );
00036         if( BS.teamAColor!=playerCol && BS.teamBColor!=playerCol ) vol = 0.0f;
00037         
00038         if( BS.m_cvLastContact > 240 )
00039                 if( BS.m_cvLastPanick > 240 )
00040                         if( sys_localRandInt()%25==0 )
00041                         {
00042                                 BS.m_cvLastContact = 0;
00043                                 Sound::playRandomSound( Sound::CLASS_BATTLE_CONTACT, vol );
00044                         }
00045 }

void playVoicePanick BattleState   BS,
bool    isActive
 

Definition at line 63 of file BattleGroup.cpp.

References Sound::getMasterSFXVol(), BattleState::m_cvLastStress, Sound::playRandomSound(), sys_localRandInt(), BattleState::teamAColor, BattleState::teamBColor, and Vec3D.

Referenced by BattleGroup::destroyUnit().

00064 {
00065         float vol = Sound::getMasterSFXVol();
00066         if( !isActive ) vol *= 0.92f;
00067         Vec3D playerCol( GameState::consolePlayer()->color() );
00068         if( BS.teamAColor!=playerCol && BS.teamBColor!=playerCol ) vol = 0.0f;
00069 
00070         if( BS.m_cvLastStress > 180 )           
00071                 if( sys_localRandInt()%1==0 )
00072                 {
00073                         BS.m_cvLastStress = 0;
00074                         Sound::playRandomSound( Sound::CLASS_BATTLE_PANICK, vol );
00075                 }
00076 }

void playVoiceStress BattleState   BS,
bool    isActive
 

Definition at line 47 of file BattleGroup.cpp.

References Sound::getMasterSFXVol(), BattleState::m_cvLastPanick, BattleState::m_cvLastStress, Sound::playRandomSound(), sys_localRandInt(), BattleState::teamAColor, BattleState::teamBColor, and Vec3D.

Referenced by BattleGroup::destroyUnit().

00048 {
00049         float vol = Sound::getMasterSFXVol();
00050         if( !isActive ) vol *= 0.92f;
00051         Vec3D playerCol( GameState::consolePlayer()->color() );
00052         if( BS.teamAColor!=playerCol && BS.teamBColor!=playerCol ) vol = 0.0f;
00053 
00054         if( BS.m_cvLastStress > 240 )
00055                 if( BS.m_cvLastPanick > 180 )
00056                         if( sys_localRandInt()%2==0 )
00057                         {
00058                                 BS.m_cvLastStress = 0;
00059                                 Sound::playRandomSound( Sound::CLASS_BATTLE_STRESS, vol );
00060                         }
00061 }

FLOAT triArea Vec2D   p0,
Vec2D   p1,
Vec2D   p2
 

Definition at line 259 of file ATerrain.cpp.

References Vec2D.

Referenced by BattleGroup::isContain2DPoint(), and terrain_getHeight().

00260 {
00261         Vec2D side1 = p0 - p2;
00262         Vec2D side2 = p1 - p2;
00263         FLOAT area = D3DXVec2CCW( &side1, &side2) / 2.0f;               // size of the cross product/2
00264         if( area>0 ) return  area;
00265                 else     return -area;
00266 }


Generated on Wed Apr 23 05:50:52 2003 for Modern Warfare by doxygen1.3-rc2