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

Classes
missile.h File Reference
#include "missileconfig.h"
#include "script.h"
#include "unitptr.h"
#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...
 
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  MissileTracer
 
class  MissileClipToTarget
 
class  MissileContinious
 
class  MissileStraightFly
 
class  BurningBuildingFrame
 

missile.h - The missile headerfile.

enum  {
  MissileClassNone, MissileClassPointToPoint, MissileClassPointToPointWithHit, MissileClassPointToPointCycleOnce,
  MissileClassPointToPointBounce, MissileClassStay, MissileClassCycleOnce, MissileClassFire,
  MissileClassHit, MissileClassParabolic, MissileClassLandMine, MissileClassWhirlwind,
  MissileClassFlameShield, MissileClassDeathCoil, MissileClassTracer, MissileClassClipToTarget,
  MissileClassContinious, MissileClassStraightFly
}
 
std::vector< BurningBuildingFrame * > BurningBuildingFrames
 
bool MissileInitMove (Missile &missile, bool pointToPoint=false)
 
bool PointToPointMissile (Missile &missile)
 
void MissileHandlePierce (Missile &missile, const Vec2i &pos)
 
bool MissileHandleBlocking (Missile &missile, const PixelPos &position)
 
void MissileCclRegister ()
 Burning building frames. More...
 
void LoadMissileSprites ()
 load all missile sprites More...
 
MissileTypeNewMissileTypeSlot (const std::string &ident)
 allocate an empty missile-type slot More...
 
MissileTypeMissileTypeByIdent (const std::string &ident)
 Get missile-type by ident. More...
 
MissileMakeMissile (const MissileType &mtype, const PixelPos &startPos, const PixelPos &destPos)
 create a missile More...
 
MissileMakeLocalMissile (const MissileType &mtype, const PixelPos &startPos, const PixelPos &destPos)
 create a local missile More...
 
int CalculateDamage (const CUnit &attacker, const CUnit &goal, const NumberDesc *formula)
 Calculates damage done to goal by attacker using formula. More...
 
void FireMissile (CUnit &unit, CUnit *goal, const Vec2i &goalPos)
 fire a missile More...
 
void FindAndSortMissiles (const CViewport &vp, std::vector< Missile * > &table)
 
void MissileActions ()
 handle all missiles More...
 
int ViewPointDistanceToMissile (const Missile &missile)
 distance from view point to missile More...
 
MissileTypeMissileBurningBuilding (int percent)
 Get the burning building missile based on hp percent. More...
 
void SaveMissiles (CFile &file)
 Save missiles. More...
 
void InitMissileTypes ()
 Initialize missile-types. More...
 
void CleanMissileTypes ()
 Clean missile-types. More...
 
void InitMissiles ()
 Initialize missiles. More...
 
void CleanMissiles ()
 Clean missiles. More...
 
void FreeBurningBuildingFrames ()
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

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

Enumerator
MissileClassNone 
MissileClassPointToPoint 

Missile does nothing.

MissileClassPointToPointWithHit 

Missile flies from x,y to x1,y1.

MissileClassPointToPointCycleOnce 

Missile flies from x,y to x1,y1 than shows hit animation.

MissileClassPointToPointBounce 

Missile flies from x,y to x1,y1 and animates ONCE from start to finish and back.

MissileClassStay 

Missile flies from x,y to x1,y1 than bounces three times.

MissileClassCycleOnce 

Missile appears at x,y, does it's anim and vanishes.

MissileClassFire 

Missile appears at x,y, then cycle through the frames once.

MissileClassHit 

Missile doesn't move, than checks the source unit for HP.

MissileClassParabolic 

Missile shows the hit points.

MissileClassLandMine 

Missile flies from x,y to x1,y1 using a parabolic path.

MissileClassWhirlwind 

Missile wait on x,y until a non-air unit comes by, the explodes.

MissileClassFlameShield 

Missile appears at x,y, is whirlwind.

MissileClassDeathCoil 

Missile surround x,y.

MissileClassTracer 

Missile is death coil.

MissileClassClipToTarget 

Missile seeks towards to target unit.

MissileClassContinious 

Missile remains clipped to target's current goal and plays his animation once.

MissileClassStraightFly 

Missile stays and plays it's animation several times.

Missile flies from x,y to x1,y1 then continues to fly, until incompatible terrain is detected

Function Documentation

◆ CalculateDamage()

int CalculateDamage ( const CUnit attacker,
const CUnit goal,
const NumberDesc formula 
)

Calculates damage done to goal by attacker using formula.

Calculate damage.

Parameters
attackerAttacker.
goalGoal unit.
formulaFormula used to calculate damage.
Returns
damage produces on goal.

◆ CleanMissiles()

void CleanMissiles ( )

Clean missiles.

Clean up missiles.

◆ CleanMissileTypes()

void CleanMissileTypes ( )

Clean missile-types.

Clean up missile-types.

◆ FindAndSortMissiles()

void FindAndSortMissiles ( const CViewport vp,
std::vector< Missile * > &  table 
)

Sort visible missiles on map for display.

Parameters
vpViewport pointer.
tableOUT : array of missile to display sorted by DrawLevel.

◆ FireMissile()

void FireMissile ( CUnit unit,
CUnit goal,
const Vec2i goalPos 
)

fire a missile

Fire missile.

Parameters
unitUnit that fires the missile.

◆ FreeBurningBuildingFrames()

void FreeBurningBuildingFrames ( )

◆ InitMissiles()

void InitMissiles ( )

Initialize missiles.

Initialize missiles.

◆ InitMissileTypes()

void InitMissileTypes ( )

Initialize missile-types.

Initialize missile-types.

◆ LoadMissileSprites()

void LoadMissileSprites ( )

load all missile sprites

Load the graphics for all missiles types

◆ MakeLocalMissile()

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

create a local missile

Create a new local missile at (x,y).

Parameters
mtypeType pointer of missile.
startPosMissile start point in pixel.
destPosMissile destination point in pixel.
Returns
created missile.

◆ MakeMissile()

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

create a missile

Create a new global missile at (x,y).

Parameters
mtypeType pointer of missile.
startPosMissile start point in pixel.
destPosMissile destination point in pixel.
Returns
created missile.

◆ MissileActions()

void MissileActions ( )

handle all missiles

Handle all missile actions.

◆ MissileBurningBuilding()

MissileType* MissileBurningBuilding ( int  percent)

Get the burning building missile based on hp percent.

Get the burning building missile based on hp percent.

Parameters
percentHP percent
Returns
the missile used for burning.

◆ MissileCclRegister()

void MissileCclRegister ( )

Burning building frames.

register ccl features

Register CCL features for missile-type.

◆ MissileHandleBlocking()

bool MissileHandleBlocking ( Missile missile,
const PixelPos position 
)

◆ MissileHandlePierce()

void MissileHandlePierce ( Missile missile,
const Vec2i pos 
)

◆ MissileInitMove()

bool MissileInitMove ( Missile missile,
bool  pointToPoint 
)

Init the move.

Parameters
missilemissile to initialise for movement.
Returns
true if goal is reached, false else.

◆ MissileTypeByIdent()

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

Get missile-type by ident.

Get Missile type by identifier.

Parameters
identIdentifier.
Returns
Missile type pointer.

◆ NewMissileTypeSlot()

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

allocate an empty missile-type slot

Allocate an empty missile-type slot.

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

◆ PointToPointMissile()

bool PointToPointMissile ( Missile missile)

Handle point to point missile.

Parameters
missileMissile pointer.
Returns
true if goal is reached, false else.

◆ SaveMissiles()

void SaveMissiles ( CFile file)

Save missiles.

Save the state missiles to file.

Parameters
fileOutput file.

◆ ViewPointDistanceToMissile()

int ViewPointDistanceToMissile ( const Missile missile)

distance from view point to missile

Calculate distance from view-point to missile.

Parameters
missileMissile pointer for distance.
Returns
the computed value.

Variable Documentation

◆ BurningBuildingFrames

std::vector<BurningBuildingFrame *> BurningBuildingFrames
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.