$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

src/include/missile.h File Reference

#include "unitsound.h"
#include "vec2i.h"

Go to the source code of this file.


Classes

class  MissileType
 Base structure of missile-types. More...
class  Missile
 Missile on the map. More...
struct  MissileDrawProxy
class  MissileNone
class  MissilePointToPoint
class  MissilePointToPointWithHit
class  MissilePointToPointCycleOnce
class  MissilePointToPointBounce
class  MissileStay
class  MissileCycleOnce
class  MissileFire
class  MissileHit
class  MissileParabolic
class  MissileLandMine
class  MissileWhirlwind
class  MissileFlameShield
class  MissileDeathCoil
class  BurningBuildingFrame

missile.h - The missile headerfile.

#define MAX_MISSILES   2048
#define MAX_LOCAL_MISSILES   4096
enum  _missile_class_ {
  MissileClassNone, MissileClassPointToPoint, MissileClassPointToPointWithHit, MissileClassPointToPointCycleOnce,
  MissileClassPointToPointBounce, MissileClassStay, MissileClassCycleOnce, MissileClassFire,
  MissileClassHit, MissileClassParabolic, MissileClassLandMine, MissileClassWhirlwind,
  MissileClassFlameShield, MissileClassDeathCoil
}
typedef int MissileClass
std::vector
< BurningBuildingFrame * > 
BurningBuildingFrames
void MissileCclRegister ()
 Burning building frames.
void LoadMissileSprites ()
 load all missile sprites
MissileTypeNewMissileTypeSlot (const std::string &ident)
 allocate an empty missile-type slot
MissileTypeMissileTypeByIdent (const std::string &ident)
 Get missile-type by ident.
MissileMakeMissile (MissileType *mtype, const PixelPos &startPos, const PixelPos &destPos)
 create a missile
MissileMakeMissile (MissileType *mtype, int sx, int sy, int dx, int dy)
MissileMakeLocalMissile (MissileType *mtype, const PixelPos &startPos, const PixelPos &destPos)
 create a local missile
MissileMakeLocalMissile (MissileType *mtype, int sx, int sy, int dx, int dy)
void FireMissile (CUnit &unit)
 fire a missile
int FindAndSortMissiles (const CViewport *vp, Missile *table[], const int tablesize)
int FindAndSortMissiles (const CViewport *vp, MissileDrawProxy table[], const int tablesize)
void MissileActions ()
 handle all missiles
int ViewPointDistanceToMissile (const Missile *missile)
 distance from view point to missile
MissileTypeMissileBurningBuilding (int percent)
 Get the burning building missile based on hp percent.
void SaveMissiles (CFile *file)
 Save missiles.
void InitMissileTypes ()
 Initialize missile-types.
void CleanMissileTypes ()
 Clean missile-types.
void InitMissiles ()
 Initialize missiles.
void CleanMissiles ()
 Clean missiles.

Define Documentation

#define MAX_LOCAL_MISSILES   4096

#define MAX_MISSILES   2048


Typedef Documentation

typedef int MissileClass

Missile-type-class typedef


Enumeration Type Documentation

Missile-class this defines how a missile-type reacts.

Enumerator:
MissileClassNone  Missile does nothing.
MissileClassPointToPoint  Missile flies from x,y to x1,y1.
MissileClassPointToPointWithHit  Missile flies from x,y to x1,y1 than shows hit animation.
MissileClassPointToPointCycleOnce  Missile flies from x,y to x1,y1 and animates ONCE from start to finish and back.
MissileClassPointToPointBounce  Missile flies from x,y to x1,y1 than bounces three times.
MissileClassStay  Missile appears at x,y, does it's anim and vanishes.
MissileClassCycleOnce  Missile appears at x,y, then cycle through the frames once.
MissileClassFire  Missile doesn't move, than checks the source unit for HP.
MissileClassHit  Missile shows the hit points.
MissileClassParabolic  Missile flies from x,y to x1,y1 using a parabolic path.
MissileClassLandMine  Missile wait on x,y until a non-air unit comes by, the explodes.
MissileClassWhirlwind  Missile appears at x,y, is whirlwind.
MissileClassFlameShield  Missile surround x,y.
MissileClassDeathCoil  Missile is death coil.


Function Documentation

void CleanMissiles (  ) 

Clean missiles.

Clean up missiles.

void CleanMissileTypes (  ) 

Clean missile-types.

Clean up missile-types.

int FindAndSortMissiles ( const CViewport vp,
MissileDrawProxy  table[],
const int  tablesize 
)

int FindAndSortMissiles ( const CViewport vp,
Missile table[],
const int  tablesize 
)

Sort visible missiles on map for display.

Parameters:
vp Viewport pointer.
table OUT : array of missile to display sorted by DrawLevel.
tablesize Size of table array
Returns:
number of missiles returned in table

void FireMissile ( CUnit unit  ) 

fire a missile

Fire missile.

Parameters:
unit Unit that fires the missile.

void InitMissiles (  ) 

Initialize missiles.

Initialize missiles.

void InitMissileTypes (  ) 

Initialize missile-types.

Initialize missile-types.

void LoadMissileSprites (  ) 

load all missile sprites

Load the graphics for all missiles types

Missile* MakeLocalMissile ( MissileType mtype,
int  sx,
int  sy,
int  dx,
int  dy 
) [inline]

Missile* MakeLocalMissile ( MissileType mtype,
const PixelPos startPos,
const PixelPos destPos 
)

create a local missile

Missile* MakeMissile ( MissileType mtype,
int  sx,
int  sy,
int  dx,
int  dy 
) [inline]

Missile* MakeMissile ( MissileType mtype,
const PixelPos startPos,
const PixelPos destPos 
)

create a missile

void MissileActions (  ) 

handle all missiles

Handle all missile actions.

MissileType* MissileBurningBuilding ( int  percent  ) 

Get the burning building missile based on hp percent.

Get the burning building missile based on hp percent.

Parameters:
percent HP percent
Returns:
the missile used for burning.

void MissileCclRegister (  ) 

Burning building frames.

register ccl features

Register CCL features for missile-type.

MissileType* MissileTypeByIdent ( const std::string &  ident  ) 

Get missile-type by ident.

Get Missile type by identifier.

Parameters:
ident Identifier.
Returns:
Missile type pointer.

MissileType* NewMissileTypeSlot ( const std::string &  ident  ) 

allocate an empty missile-type slot

Allocate an empty missile-type slot.

Parameters:
ident Identifier to identify the slot.
Returns:
New allocated (zeroed) missile-type pointer.

void SaveMissiles ( CFile file  ) 

Save missiles.

Save the state missiles to file.

Parameters:
file Output file.

int ViewPointDistanceToMissile ( const Missile missile  ) 

distance from view point to missile

Calculate distance from view-point to missle.

Parameters:
missile Missile pointer for distance.
Returns:
the computed value.


Variable Documentation

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.