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

Public Member Functions | Public Attributes | List of all members
MissileType Class Reference

Base structure of missile-types. More...

#include <missile.h>

Public Member Functions

int Width () const
 
int Height () const
 
missile.cpp - The missiles.
 MissileType (const std::string &ident)
 
 ~MissileType ()
 
void LoadMissileSprite ()
 load the graphics for a missile type More...
 
void Init ()
 
void DrawMissileType (int frame, const PixelPos &pos) const
 
script_missile.cpp - The missile-type ccl functions.
void Load (lua_State *l)
 

Public Attributes

std::string Ident
 
int Transparency
 missile name More...
 
PixelSize size
 missile transparency More...
 
int DrawLevel
 missile size in pixels More...
 
int SpriteFrames
 Level to draw missile at. More...
 
int NumDirections
 number of sprite frames in graphic More...
 
int ChangeVariable
 number of directions missile can face More...
 
int ChangeAmount
 variable to change More...
 
bool ChangeMax
 how many to change More...
 
SoundConfig FiredSound
 modify the max, if value will exceed it More...
 
SoundConfig ImpactSound
 fired sound More...
 
bool CorrectSphashDamage
 impact sound for this missile-type More...
 
bool Flip
 restricts the radius damage depending on land, air, naval More...
 
bool CanHitOwner
 flip image when facing left More...
 
bool FriendlyFire
 missile can hit the owner More...
 
bool AlwaysFire
 missile can't hit own units More...
 
bool Pierce
 missile will always fire (even if target is dead) More...
 
bool PierceOnce
 missile will hit every unit on his way More...
 
bool IgnoreWalls
 pierce every target only once More...
 
bool KillFirstUnit
 missile ignores Wall units on it's way More...
 
int Class
 missile kills first unit blocking it's way More...
 
int NumBounces
 missile class More...
 
int ParabolCoefficient
 number of bounces More...
 
int StartDelay
 parabol coefficient in parabolic missile More...
 
int Sleep
 missile start delay More...
 
int Speed
 missile sleep More...
 
int BlizzardSpeed
 missile speed More...
 
int TTL
 speed for blizzard shards More...
 
int ReduceFactor
 missile time-to-live More...
 
int SmokePrecision
 Multiplier for reduce or increase damage dealt to the next unit. More...
 
int MissileStopFlags
 How frequently the smoke missile will generate itself. More...
 
NumberDescDamage
 On which terrain types missile won't fly. More...
 
int Range
 missile damage (used for non-direct missiles, e.g. impacts) More...
 
int SplashFactor
 missile damage range More...
 
std::vector< MissileConfig * > Impact
 missile splash divisor More...
 
MissileConfig Smoke
 missile produces an impact More...
 
LuaCallbackImpactParticle
 trailing missile More...
 
LuaCallbackSmokeParticle
 impact particle More...
 
LuaCallbackOnImpact
 smoke particle More...
 
CGraphicG
 called when More...
 

Detailed Description

Base structure of missile-types.

#include "missile.h"

This structure defines the base type information of all missiles. It contains all information that all missiles of the same type shares. The fields are filled from the configuration files.

The missile-type structure members:

MissileType::Ident

Unique identifier of the missile-type, used to reference it in config files and during startup.

Note
Don't use this member in game, use instead the pointer to this structure. See MissileTypeByIdent().

MissileType::DrawLevel

The Level/Order to draw the missile in, usually 0-255

MissileType::Width MissileType::Height

Size (width and height) of a frame in the image. All sprite frames of the missile-type must have the same size.

MissileType::SpriteFrames

Total number of sprite frames in the graphic image.

Note
If the image is smaller than the number of directions, width/height and/or framecount suggest the engine crashes.
There is currently a limit of 127 sprite frames, which can be lifted if needed.

MissileType::NumDirections

Number of directions missile can face.

MissileType::Transparency

Set a missile transparency.

MissileType::FiredSound

Sound of the missile, if fired.

Note
currently not used.

MissileType::ImpactSound

Impact sound for this missile.

MissileType::CanHitOwner

Can hit the unit that have fired the missile.

Note
Currently no missile can hurt its owner.

MissileType::FriendlyFire

Can't hit the units of the same player, that has the missile fired.

MissileType::Class

Class of the missile-type, defines the basic effects of the missile. Look at the different class identifiers for more information (MissileClassNone, ...).

MissileType::NumBounces

This is the number of bounces, and it is only valid with MissileClassBounce. The missile will hit this many times in a row.

MissileType::StartDelay

Delay in game cycles after the missile generation, until the missile animation and effects starts. Delay denotes the number of display cycles to skip before drawing the first sprite frame and only happens once at start.

MissileType::Sleep

This are the number of game cycles to wait for the next animation or the sleeping between the animation steps. All animations steps use the same delay. 0 is the fastest and 255 the slowest animation.

Note
Perhaps we should later allow animation scripts for more complex animations.

MissileType::Speed

The speed how fast the missile moves. 0 the missile didn't move, 1 is the slowest speed and 32 s the fastest supported speed. This is how many pixels the missiles moves with each animation step. The real use of this member depends on the MissileType::Class

Note
This is currently only used by the point-to-point missiles (MissileClassPointToPoint, ...). Perhaps we should later allow animation scripts for more complex animations.

MissileType::Range

Determines the range in which a projectile will deal its damage. A range of 0 will mean that the damage will be limited to the targeted unit only. So if you shot a missile at a unit, it would only damage that unit. A value of 1 only affects the field where the missile hits. A value of 2 would mean that the damage for that particular missile would be dealt for a range of 1 around the impact spot. All fields that aren't the center get only 1/SpashFactor of the damage. Fields 2 away get 1/(SplashFactor*2), and following...

MissileType::SplashFactor

Determines The Splash damage divisor, see Range

MissileType::Impact

The config of the next (other) missile to generate, when this missile reached its end point or its life time is over. So it can be used to generate a chain of missiles.

MissileType::Smoke

The config of the next (other) missile to generate a trailing smoke. So it can be used to generate a chain of missiles.

MissileType::Sprite

Missile sprite image loaded from MissileType::File

MissileType::G

File containing the image (sprite) graphics of the missile. The file can contain multiple sprite frames. The sprite frames for the different directions are placed in the row. The different animations steps are placed in the column. But the correct order depends on MissileType::Class. Missiles like fire have no directions, missiles like arrows have a direction.

Constructor & Destructor Documentation

◆ MissileType()

MissileType::MissileType ( const std::string &  ident)
explicit

Constructor.

◆ ~MissileType()

MissileType::~MissileType ( )

Destructor.

Member Function Documentation

◆ DrawMissileType()

void MissileType::DrawMissileType ( int  frame,
const PixelPos pos 
) const

Draw missile.

Parameters
frameAnimation frame
posScreen pixel position

◆ Height()

int MissileType::Height ( ) const
inline

◆ Init()

void MissileType::Init ( )

Initialize missile type.

◆ Load()

void MissileType::Load ( lua_State *  l)

◆ LoadMissileSprite()

void MissileType::LoadMissileSprite ( )

load the graphics for a missile type

Damage calculation for missile.

Load the graphics for a missile type

◆ Width()

int MissileType::Width ( ) const
inline

Member Data Documentation

◆ AlwaysFire

bool MissileType::AlwaysFire

missile can't hit own units

◆ BlizzardSpeed

int MissileType::BlizzardSpeed

missile speed

◆ CanHitOwner

bool MissileType::CanHitOwner

flip image when facing left

◆ ChangeAmount

int MissileType::ChangeAmount

variable to change

◆ ChangeMax

bool MissileType::ChangeMax

how many to change

◆ ChangeVariable

int MissileType::ChangeVariable

number of directions missile can face

◆ Class

int MissileType::Class

missile kills first unit blocking it's way

◆ CorrectSphashDamage

bool MissileType::CorrectSphashDamage

impact sound for this missile-type

◆ Damage

NumberDesc* MissileType::Damage

On which terrain types missile won't fly.

◆ DrawLevel

int MissileType::DrawLevel

missile size in pixels

◆ FiredSound

SoundConfig MissileType::FiredSound

modify the max, if value will exceed it

◆ Flip

bool MissileType::Flip

restricts the radius damage depending on land, air, naval

◆ FriendlyFire

bool MissileType::FriendlyFire

missile can hit the owner

◆ G

CGraphic* MissileType::G

called when

◆ Ident

std::string MissileType::Ident

◆ IgnoreWalls

bool MissileType::IgnoreWalls

pierce every target only once

◆ Impact

std::vector<MissileConfig *> MissileType::Impact

missile splash divisor

◆ ImpactParticle

LuaCallback* MissileType::ImpactParticle

trailing missile

◆ ImpactSound

SoundConfig MissileType::ImpactSound

fired sound

◆ KillFirstUnit

bool MissileType::KillFirstUnit

missile ignores Wall units on it's way

◆ MissileStopFlags

int MissileType::MissileStopFlags

How frequently the smoke missile will generate itself.

◆ NumBounces

int MissileType::NumBounces

missile class

◆ NumDirections

int MissileType::NumDirections

number of sprite frames in graphic

◆ OnImpact

LuaCallback* MissileType::OnImpact

smoke particle

◆ ParabolCoefficient

int MissileType::ParabolCoefficient

number of bounces

◆ Pierce

bool MissileType::Pierce

missile will always fire (even if target is dead)

◆ PierceOnce

bool MissileType::PierceOnce

missile will hit every unit on his way

◆ Range

int MissileType::Range

missile damage (used for non-direct missiles, e.g. impacts)

◆ ReduceFactor

int MissileType::ReduceFactor

missile time-to-live

◆ size

PixelSize MissileType::size

missile transparency

◆ Sleep

int MissileType::Sleep

missile start delay

◆ Smoke

MissileConfig MissileType::Smoke

missile produces an impact

◆ SmokeParticle

LuaCallback* MissileType::SmokeParticle

impact particle

◆ SmokePrecision

int MissileType::SmokePrecision

Multiplier for reduce or increase damage dealt to the next unit.

◆ Speed

int MissileType::Speed

missile sleep

◆ SplashFactor

int MissileType::SplashFactor

missile damage range

◆ SpriteFrames

int MissileType::SpriteFrames

Level to draw missile at.

◆ StartDelay

int MissileType::StartDelay

parabol coefficient in parabolic missile

◆ Transparency

int MissileType::Transparency

missile name

◆ TTL

int MissileType::TTL

speed for blizzard shards


The documentation for this class was generated from the following files:
(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.