Class TMissileCreatureResource

Unit

Declaration

type TMissileCreatureResource = class(TCreatureResource)

Description

Creature that blindly moves in a given direction. It just moves into the given direction (with some possible twists, e.g. it can be a "homing" missile and/or be dragged down by gravity). On collision, it hits, potentially hurting the alive 3D object that was colliding (player or other creatures).

Missiles ignore TCreatureResource.Flying, they use their own way to handle gravity with DirectionFallSpeed.

Hierarchy

Overview

Fields

Public nested const DefaultMoveSpeed = 10.0;
Public nested const DefaultCloseDirectionToTargetSpeed = 0.0;
Public nested const DefaultPauseBetweenSoundIdle = 2.0;
Public nested const DefaultHitsPlayer = true;
Public nested const DefaultHitsCreatures = false;
Public nested const DefaultDirectionFallSpeed = 0.0;
Public nested const DefaultRemoveDead = true;

Methods

Protected function RadiusCalculate(const GravityUp: TVector3): Single; override;
Public constructor Create(const AName: string); override;
Public function CreatureClass: TCreatureClass; override;
Public procedure LoadFromFile(ResourceConfig: TCastleConfig); override;
Public function CreateCreature(World: TSceneManagerWorld; const APosition, ADirection: TVector3; const MaxLife: Single): TCreature; override;

Properties

Public property FlyAnimation: T3DResourceAnimation read FFlyAnimation;
Public property DieAnimation: T3DResourceAnimation read FDieAnimation;
Public property MoveSpeed: Single read FMoveSpeed write FMoveSpeed default DefaultMoveSpeed;
Public property SoundHit: TSoundType read FSoundHit write FSoundHit;
Public property CloseDirectionToTargetSpeed: Single read FCloseDirectionToTargetSpeed write FCloseDirectionToTargetSpeed default DefaultCloseDirectionToTargetSpeed;
Public property SoundIdle: TSoundType read FSoundIdle write FSoundIdle;
Public property PauseBetweenSoundIdle: Single read FPauseBetweenSoundIdle write FPauseBetweenSoundIdle default DefaultPauseBetweenSoundIdle;
Public property HitsPlayer: boolean read FHitsPlayer write FHitsPlayer default DefaultHitsPlayer;
Public property HitsCreatures: boolean read FHitsCreatures write FHitsCreatures default DefaultHitsCreatures;
Public property DirectionFallSpeed: Single read FDirectionFallSpeed write FDirectionFallSpeed default DefaultDirectionFallSpeed;
Public property RemoveDead: boolean read FRemoveDead write FRemoveDead default DefaultRemoveDead;

Description

Fields

Public nested const DefaultMoveSpeed = 10.0;
 
Public nested const DefaultCloseDirectionToTargetSpeed = 0.0;
 
Public nested const DefaultPauseBetweenSoundIdle = 2.0;
 
Public nested const DefaultHitsPlayer = true;
 
Public nested const DefaultHitsCreatures = false;
 
Public nested const DefaultDirectionFallSpeed = 0.0;
 
Public nested const DefaultRemoveDead = true;
 

Methods

Protected function RadiusCalculate(const GravityUp: TVector3): Single; override;
 
Public constructor Create(const AName: string); override;
 
Public function CreatureClass: TCreatureClass; override;
 
Public procedure LoadFromFile(ResourceConfig: TCastleConfig); override;
 
Public function CreateCreature(World: TSceneManagerWorld; const APosition, ADirection: TVector3; const MaxLife: Single): TCreature; override;
 

Properties

Public property FlyAnimation: T3DResourceAnimation read FFlyAnimation;
 
Public property DieAnimation: T3DResourceAnimation read FDieAnimation;

Die (destroying) animation of a missile. Optional. It can depict missile explosion. After showing this animation (or immediately when missile hits something, if this animation is not specified) the missile is removed from the level (unless RemoveDead = False).

Public property MoveSpeed: Single read FMoveSpeed write FMoveSpeed default DefaultMoveSpeed;

The moving speed: how much Direction vector will be scaled when moving.

Public property SoundHit: TSoundType read FSoundHit write FSoundHit;

Sound when missile hits anything. None (stNone) by default.

Public property CloseDirectionToTargetSpeed: Single read FCloseDirectionToTargetSpeed write FCloseDirectionToTargetSpeed default DefaultCloseDirectionToTargetSpeed;

For "homing" missiles, how fast direction to the target is corrected. Zero (default) means that the missile is not "homing".

Public property SoundIdle: TSoundType read FSoundIdle write FSoundIdle;

Sound played continously when the missile is going. None (stNone) by default.

See also
PauseBetweenSoundIdle
This should be synchonized with length of SoundIdle sound.
Public property PauseBetweenSoundIdle: Single read FPauseBetweenSoundIdle write FPauseBetweenSoundIdle default DefaultPauseBetweenSoundIdle;

This should be synchonized with length of SoundIdle sound.

Public property HitsPlayer: boolean read FHitsPlayer write FHitsPlayer default DefaultHitsPlayer;
 
Public property HitsCreatures: boolean read FHitsCreatures write FHitsCreatures default DefaultHitsCreatures;
 
Public property DirectionFallSpeed: Single read FDirectionFallSpeed write FDirectionFallSpeed default DefaultDirectionFallSpeed;

How fast is the missile pulled down by gravity. Non-zero value causes missile direction to gradually point downward, this way missile flies downward eventually.

This is quite different (in different units and with slightly different effect) than T3D.FallSpeed, hence a different name and property. TMissileCreatureResource doesn't use T3D.Gravity and so ignores T3DResource.FallSpeed, T3DResource.GrowSpeed and other properties.

0 means to not fall down (missile is not affected by gravity).

Public property RemoveDead: boolean read FRemoveDead write FRemoveDead default DefaultRemoveDead;

Should the dead (destroyed) missiles be removed from level. Useful if you want to see arrows stuck into walls where they hit.

This is like TWalkAttackCreatureResource.RemoveDead and TStillCreatureResource.RemoveDead, except for missiles the default is True. Also, even if you switch this to False, it's ignored (works like True) if the missile hit a dynamic object (like another creature or player). It only works when a missile hit something else than a creature/player, which means that it probably hit a static level wall.


Generated by PasDoc 0.15.0.