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

_unit_type_ Struct Reference

#include <unittype.h>

List of all members.


Detailed Description

Base structure of unit-type.

#include "unittype.h"

typedef struct _unit_type_ UnitType;

This structure contains the informations that are shared between all units of the same type and determins if an unit is a building, a person, ...

The unit-type structure members:

UnitType::OType

Object type (future extensions).

UnitType::Ident

Unique identifier of the unit-type, used to reference it in config files and during startup. As convention they start with "unit-" fe. "unit-farm".

Note:
Don't use this member in game, use instead the pointer to this structure. See UnitTypeByIdent().
UnitType::Name

Pretty name shown by the engine. The name should be shorter than 17 characters and no word can be longer than 8 characters.

UnitType::SameSprite

Identifier of an unit-type with this are the sprites shared.

UnitType::File[TilesetMax]

Path file name of sprite files for the different tilesets.

Note:
It is planned to change this to support more and better tilesets.
UnitType::SpriteFile

Path file name of shadow sprite file for the different tilesets.

UnitType::Width UnitType::Height

Size of a sprite frame in pixels. All frames of a sprite have the same size. Also all sprites (tilesets) must have the same size.

UnitType::ShadowWidth UnitType::ShadowHeight

Size of a shadow sprite frame in pixels. All frames of a sprite have the same size. Also all sprites (tilesets) must have the same size.

UnitType::ShadowOffset

Vertical offset to draw the shadow in pixels.

UnitType::Animations

Animation scripts for the different actions. Currently the animations still, move, attack and die are supported.

See also:
Animations

_animations_

Animation

_animation_

UnitType::Icon

Icon to display for this unit-type. Contains configuration and run time variable.

Note:
This icon can be used for training, but isn't used.
UnitType::Missile

Configuration and run time variable of the missile weapon.

Note:
It is planned to support more than one weapons. And the sound of the missile should be used as fire sound.
UnitType::CorpseName

Corpse unit-type name, should only be used during setup.

UnitType::CorpseType

Corpse unit-type pointer, only this should be used during run time. Many unit-types can share the same corpse.

UnitType::CorpseScript

Index into corpse animation script. Used if unit-types share the same corpse but have different animations.

UnitType::_Speed

Non upgraded movement speed.

Note:
Until now we didn't support speed upgrades.
FIXME: continue this documentation

UnitType::Construction

What is shown in construction phase.

UnitType::SightRange

Sight range

UnitType::_HitPoints

Maximum hit points

UnitType::_MaxMana

Maximum mana points

UnitType::Magic

Unit is a mage

UnitType::_Costs[MaxCosts]

How many resources needed

UnitType::TileWidth

Tile size on map width

UnitType::TileHeight

Tile size on map height

UnitType::BoxWidth

Selected box size width

UnitType::BoxHeight

Selected box size height

UnitType::NumDirections

Number of directions the unit can face

UnitType::MinAttackRange

Minimal attack range

UnitType::_AttackRange

How far can the unit attack

UnitType::ReactRangeComputer

Reacts on enemy for computer

UnitType::ReactRangePerson

Reacts on enemy for person player

UnitType::_Armor

Amount of armor this unit has

UnitType::Priority

Priority value / AI Treatment

UnitType::_BasicDamage

Basic damage dealt

UnitType::_PiercingDamage

Piercing damage dealt

UnitType::WeaponsUpgradable

Weapons could be upgraded

UnitType::ArmorUpgradable

Armor could be upgraded

UnitType::UnitType

Land / fly / naval

FIXME: original only visual effect, we do more with this!

UnitType::DecayRate

Decay rate in 1/6 seconds

UnitType::AnnoyComputerFactor

How much this annoys the computer

FIXME: not used

UnitType::MouseAction

Right click action

UnitType::Points

How many points you get for unit

UnitType::CanTarget

Which units can it attack

UnitType::LandUnit

Land animated

UnitType::AirUnit

Air animated

UnitType::SeaUnit

Sea animated

UnitType::ExplodeWhenKilled

Death explosion animated

UnitType::Critter

Unit is controlled by nobody

UnitType::Building

Building

UnitType::Submarine

Is only visible by CanSeeSubmarine

UnitType::CanSeeSubmarine

Only this units can see Submarine

UnitType::CowerWorker

Is a worker, runs away if attcked

UnitType::Tanker

FIXME: used? Can transport oil

UnitType::Transporter

Can transport units

UnitType::GivesOil

We get here oil

UnitType::StoresGold

We can store oil/gold/wood here

UnitType::Vanishes

Corpes & destroyed places

UnitType::GroundAttack

Can do command ground attack

UnitType::IsUndead

Unit is already dead

UnitType::ShoreBuilding

Building must be build on coast

UnitType::CanCastSpell

Unit is able to use spells

UnitType::StoresWood

We can store wood here

UnitType::CanAttack

FIXME: docu

UnitType::Tower

FIXME: docu

UnitType::OilPatch

FIXME: docu

UnitType::GoldMine

FIXME: docu

UnitType::Hero

FIXME: docu

UnitType::StoresOil

We can store oil here

UnitType::Volatile

Invisiblity/unholy armor kills unit

UnitType::CowerMage

FIXME: docu

UnitType::Organic

Organic can be healed

UnitType::SelectableByRectangle

Selectable with mouse rectangle

UnitType::Teleporter

Can teleport other units.

UnitType::Sound

Sounds for events

UnitType::Weapon

Currently sound for weapon

FIXME: temporary solution

UnitType::Supply

Food supply

UnitType::Demand

Food demand

UnitType::ImproveIncomes[MaxCosts]

Gives the player an improved income.

UnitType::FieldFlags

Flags that are set, if an unit enters a map field or cleared, if an unit leaves a map field.

UnitType::MovementMask

Movement mask, this value is and'ed to the map field flags, to see if an unit can enter or placed on the map field.

UnitType::Stats[PlayerMax]

Unit status for each player FIXME: This stats should? be moved into the player struct

UnitType::Type

Type as number FIXME: Should us a general name f.e. Slot here?

UnitType::Property

CCL property storage

UnitType::Sprite

Sprite images

UnitType::ShadowSprite

Shadow sprite images

UnitType::PlayerColorSprite

Sprite images of the player colors. This image is drawn over UnitType::Sprite. Used with OpenGL only.

Definition at line 486 of file unittype.h.


Public Types

enum  { UnitTypeLand, UnitTypeFly, UnitTypeNaval }
 Armor could be upgraded. More...

Public Attributes

int _Armor
 Reacts on enemy for person player.
int _AttackRange
 Minimal attack range.
int _BasicDamage
 Priority value / AI Treatment.
int _Costs [MaxCosts]
 Unit can cast spells.
int _HitPoints
 Sight range.
unsigned _MaxMana: 8
 Maximum hit points.
int _PiercingDamage
 Basic damage dealt.
int _SightRange
 What is shown in construction phase.
int _Speed
 Corpse script start.
unsigned AirUnit: 1
 Land animated.
AnimationsAnimations
 Shadow vertical offset.
int AnnoyComputerFactor
 Decay rate in 1/6 seconds.
int Armor
int ArmorUpgradable
 Weapons could be upgraded.
int AttackRange
int BasicDamage
int BoxHeight
 Selected box size width.
int BoxWidth
 Tile size on map height.
unsigned Building: 1
 Unit is controlled by nobody.
int BuildTime
unsigned CanAttack: 1
 We can store wood here.
unsigned CanCastSpell: 1
 Building must be build on coast.
unsigned CanSeeSubmarine: 1
 Is only visible by CanSeeSubmarine.
int CanTarget
 How many points you get for unit.
ConstructionConstruction
 Movement speed.
int Constuction
 movement speed
char * CorpseName
 Missile weapon.
int CorpseScript
 Corpse unit-type.
UnitTypeCorpseType
 Corpse type name.
unsigned CowerMage: 1
 Invisiblity/unholy armor kills unit.
unsigned CowerPeon: 1
unsigned CowerWorker: 1
 Only this units can see Submarine.
unsigned Critter: 1
 Death explosion animated.
int DecayRate
 Land / fly / naval.
int Demand
 Food supply.
unsigned ExplodeWhenKilled: 1
 Sea animated.
unsigned ExtraArmor: 8
 Extra damage through upgrade.
unsigned ExtraDamage: 8
unsigned FieldFlags
 Gives player an improved income.
char * File [TilesetMax]
 Unit-type shared sprites.
unsigned GivesOil: 1
 Can transport units.
int GoldCost
unsigned GoldMine: 1
 Platform can be build here.
unsigned GroundAttack: 1
 Corpes & destroyed places.
int Height
 Sprite width.
unsigned Hero: 1
 Gold can be collected here.
unsigned HitPoints
unsigned Icon
 " height
IconConfig Icon
 Animation scripts.
char * Ident
 Object type (future extensions).
int ImproveIncomes [MaxCosts]
 Food demand.
unsigned IsUndead: 1
 Can do command ground attack.
unsigned LandUnit: 1
int Magic
 Maximum mana points.
int MinAttackRange
 Number of directions unit can face.
MissileConfig Missile
 Icon to display for this unit.
int MissileWeapon
int MouseAction
 How much this annoys the computer.
unsigned MovementMask
 Unit map field flags.
char * Name
 Identifier.
int NumDirections
 Selected box size height.
int OilCost
unsigned OilPatch: 1
 Unit can attack, but not move.
unsigned Organic: 1
 FIXME: docu.
const void * OType
int PiercingDamage
int Points
int Priority
 Amount of armor this unit has.
void * Property
 Type as number.
int ReactRangeComputer
 How far can the unit attack.
int ReactRangePerson
 Reacts on enemy for computer.
RleSpriteRleSprite
 Type as number.
int SameSprite
 unit name
char * SameSprite
 Pretty name shown from the engine.
unsigned SeaUnit: 1
 Air animated.
unsigned SelectableByRectangle: 1
 Organic can be healed.
char * ShadowFile
 Sprite files.
int ShadowHeight
 Shadow sprite width.
int ShadowOffset
 Shadow sprite height.
GraphicShadowSprite
 Sprite images.
int ShadowWidth
 Sprite height.
unsigned ShoreBuilding: 1
 Unit is already dead.
int SightRange
UnitSound Sound
 Can teleport other units.
int Speed
 icon to display for this unit
GraphicSprite
 CCL property storage.
UnitStats Stats [PlayerMax]
 Unit check this map flags for move.
unsigned StoresGold: 1
 We get here oil.
unsigned StoresOil: 1
 Is hero only used for triggers.
unsigned StoresWood: 1
 Unit is able to use spells.
unsigned Submarine: 1
 Building.
int Supply
 Currently sound for weapon.
unsigned Tanker: 1
 Is a worker, runs away if attcked.
unsigned Teleporter: 1
 Selectable with mouse rectangle.
int TileHeight
 Tile size on map width.
int TileWidth
 How many resources needed.
unsigned Tower: 1
 Unit can attack.
unsigned Transporter: 1
 FIXME: used? Can transport oil.
unsigned Type
 Extra armor through upgrade.
int Type
 Unit status for each player.
int UnitType
enum _unit_type_:: { ... }  UnitType
 Armor could be upgraded.
unsigned Vanishes: 1
 We can store oil/gold/wood here.
unsigned Volatile: 1
 We can store oil here.
WeaponSound Weapon
 Sounds for events.
int WeaponsUpgradable
 Piercing damage dealt.
int Width
 Shadow file.
int WoodCost

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

Generated by  Doxygen 1.6.0   Back to index