Class TItemWeaponResource

Unit

Declaration

type TItemWeaponResource = class(TItemResource)

Description

Weapon that can make an immiediate attack (short-range/shoot) or fire a missile.

Hierarchy

Overview

Fields

Public nested const DefaultAttackTime = 0.0;
Public nested const DefaultAttackDamageConst = 0.0;
Public nested const DefaultAttackDamageRandom = 0.0;
Public nested const DefaultAttackKnockbackDistance = 0.0;
Public nested const DefaultAttackShoot = false;

Methods

Protected function ItemClass: TInventoryItemClass; override;
Public constructor Create(const AName: string); override;
Public procedure LoadFromFile(ResourceConfig: TCastleConfig); override;

Properties

Public property EquippingSound: TSoundType read FEquippingSound write FEquippingSound;
Public property AttackAnimation: T3DResourceAnimation read FAttackAnimation;
Public property ReadyAnimation: T3DResourceAnimation read FReadyAnimation;
Public property AttackTime: Single read FAttackTime write FAttackTime default DefaultAttackTime;
Public property AttackSoundStart: TSoundType read FAttackSoundStart write FAttackSoundStart;
Public property AttackAmmo: string read FAttackAmmo write FAttackAmmo;
Public property AttackDamageConst: Single read FAttackDamageConst write FAttackDamageConst default DefaultAttackDamageConst;
Public property AttackDamageRandom: Single read FAttackDamageRandom write FAttackDamageRandom default DefaultAttackDamageRandom;
Public property AttackKnockbackDistance: Single read FAttackKnockbackDistance write FAttackKnockbackDistance default DefaultAttackKnockbackDistance;
Public property AttackShoot: boolean read FAttackShoot write FAttackShoot default DefaultAttackShoot;
Public property AttackSoundHit: TSoundType read FAttackSoundHit write FAttackSoundHit;
Public property FireMissileName: string read FFireMissileName write FFireMissileName;
Public property FireMissileSound: TSoundType read FFireMissileSound write FFireMissileSound;

Description

Fields

Public nested const DefaultAttackTime = 0.0;
 
Public nested const DefaultAttackDamageConst = 0.0;
 
Public nested const DefaultAttackDamageRandom = 0.0;
 
Public nested const DefaultAttackKnockbackDistance = 0.0;
 
Public nested const DefaultAttackShoot = false;
 

Methods

Protected function ItemClass: TInventoryItemClass; override;
 
Public constructor Create(const AName: string); override;
 
Public procedure LoadFromFile(ResourceConfig: TCastleConfig); override;
 

Properties

Public property EquippingSound: TSoundType read FEquippingSound write FEquippingSound;

Sound to make on equipping. Each weapon can have it's own equipping sound.

Public property AttackAnimation: T3DResourceAnimation read FAttackAnimation;

Animation of attack with this weapon.

Public property ReadyAnimation: T3DResourceAnimation read FReadyAnimation;

Animation of keeping weapon ready.

Public property AttackTime: Single read FAttackTime write FAttackTime default DefaultAttackTime;

A time within AttackAnimationat at which TItemWeapon.Attack method will be called, which actually hits the enemy.

Public property AttackSoundStart: TSoundType read FAttackSoundStart write FAttackSoundStart;

Sound when attack starts. This is played when attack animation starts, and it means that we already checked that you have necessary ammunition (see AttackAmmo). None (stNone) by default.

Public property AttackAmmo: string read FAttackAmmo write FAttackAmmo;

Ammunition required to make an attack (applies to both immediate attack, like short-range/shoot, and firing missiles). Indicates item resource name to use as ammunition (like 'Quiver' or 'Bullets'). It may be empty, in which case the ammunition is not necessary to make an attack. If it's set, we will check whether owner of the weapon (like a player) has at least one item of this resource, and we'll decrease it when firing.

For example, if this weapon is a pistol, then you can set AttackDamageConst and AttackDamageRandom to non-zero and AttackShoot to True to perform an immediatele shooting attack. And set AttackAmmo to something like 'Bullets'.

For example, if this weapon is a bow, then you can set FireMissileName to 'Arrow', to fire arrows as missiles (they will fly and can be avoided by fast moving enemies). And set AttackAmmo to something like 'Quiver'.

Public property AttackDamageConst: Single read FAttackDamageConst write FAttackDamageConst default DefaultAttackDamageConst;

Immediate attack (short-range/shoot) damage and knockback. This type of attack (along with AttackSoundHit) is only done if one of these properties is non-zero. They must be >= 0.

Public property AttackDamageRandom: Single read FAttackDamageRandom write FAttackDamageRandom default DefaultAttackDamageRandom;
 
Public property AttackKnockbackDistance: Single read FAttackKnockbackDistance write FAttackKnockbackDistance default DefaultAttackKnockbackDistance;
 
Public property AttackShoot: boolean read FAttackShoot write FAttackShoot default DefaultAttackShoot;

Does the immediate attack is shooting.

  • Shooting means that the hit enemy is determined by casting a ray from owner (like a shooting player) and seeing what it hits. Even enemies far away may be hit, but you have to aim precisely.

  • When this is False, we make a short-range (melee) attack. In this case the hit enemy is determined by looking at the weapon bounding volume near owner. Only the enemies very close to the owner get hit.

Public property AttackSoundHit: TSoundType read FAttackSoundHit write FAttackSoundHit;

Sound on successful hit by an immediate attack (short-range/shoot).

Public property FireMissileName: string read FFireMissileName write FFireMissileName;

Creature resource name to be created (like 'Arrow') when firing a missile. Must be set to something not empty to actually fire a missile.

Public property FireMissileSound: TSoundType read FFireMissileSound write FFireMissileSound;

Sound on missile fired. None (stNone) by default.


Generated by PasDoc 0.15.0.