Logo Search packages:      
Sourcecode: freecraft version File versions  Download package

_missile_type_ Struct Reference

#include <missile.h>

List of all members.


Detailed Description

Base structure of missile-types.

#include "missile.h"

typedef struct _missile_type_ MissileType;

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 (CCL). See (define-missile-type).

The missile-type structure members:

MissileType::OType

Object type (future extensions).

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::File

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 ( _missile_class_, ...). Missiles like fire have no directions, missiles like arrows have a direction.

Note:
Note that only 8 directions are currently supported and only 5 are stored in the image (N NW W SW S) and 4 are mirrored.
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::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 informations (_missile_class_, MissileClassNone, ...). This isn't used if the missile is handled by Missile::Controller.

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 MisleType::Class or Missile::Controller.

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 that a projectile will deal its damage. A range of 0 will mean that the damage will be limited to only where the missile was directed towards. So if you shot a missile at a unit, it would only damage that unit. A value of 1 only effects the field on that the missile is shot. A value of 2 would mean that for a range of 1 around the impact spot, the damage for that particular missile would be dealt. All fields that aren't the center get only 50% of the damage.

Note:
Can this value be higher? 3 (3x3 area with 25%), 4 (4x4 area with 12.5%)! Yes, but is currently not written.
MissileType::ImpactName

The name 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.

Note:
Used and should only be used during configuration and startup.
MissileType::ImpactMissile

Pointer to the impact missile-type. Used during run time.

MissileType::Sprite

Missile sprite image loaded from MissileType::File

Definition at line 325 of file missile.h.


Public Attributes

unsigned CanHitOwner: 1
 impact sound for this missile-type
MissileClass Class
 missile can't hit own units
char * File
 missile name
SoundConfig FiredSound
 number of directions missile can face
unsigned FriendlyFire: 1
 missile can hit the owner
int Height
 missile width in pixels
char * Ident
 object type (future extensions)
MissileTypeImpactMissile
 impact missile-type name
char * ImpactName
 missile damage range
SoundConfig ImpactSound
 fired sound
int NumDirections
 number of sprite frames in graphic
const void * OType
int Range
 missile speed
int Sleep
 missile start delay
int Speed
 missile sleep
GraphicSprite
 missile produces an impact
int SpriteFrames
 missile height in pixels
int StartDelay
 missile class
int Width
 missile sprite file

The documentation for this struct was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index