Class TItemWeapon
Unit
CastleItems
Declaration
type TItemWeapon = class(TInventoryItem)
Description
No description available, ancestor TInventoryItem description follows
An item that can be used, kept in the inventory, or (using PutOnWorld that wraps it in TItemOnWorld) dropped on 3D world. Thanks to the Quantity property, this may actually represent many "stacked" items, all having the same properties.
Hierarchy
Overview
Nested Types
Methods
Properties
 |
property AmmoLoaded: Cardinal read FAmmoLoaded write FAmmoLoaded; |
Description
Nested Types
 |
TWeaponState = (...); |
Values
-
wsReady
-
wsAttack
-
wsReload
|
Methods
 |
procedure Attack(const Level: TAbstractLevel); virtual; |
|
Make real attack, immediate (short-range/shoot) or firing missile. Called during weapon TItemWeaponResource.AttackAnimation, at the time TItemWeaponResource.AttackTime. The default implementation in TItemWeapon does a short-range/shoot attack (if AttackDamageConst or AttackDamageRandom or AttackKnockbackDistance non-zero) and fires a missile (if FireMissileName not empty).
|
 |
procedure Use; override; |
|
|
 |
procedure ReloadNow; virtual; |
|
Make actual reload that refills AmmoLoaded.
|
 |
procedure Equip; virtual; |
|
Owner equips this weapon.
|
 |
procedure EquippedAttack(const Level: TAbstractLevel); virtual; |
|
Owner starts attack with this equipped weapon.
|
 |
procedure EquippedUpdate(const Level: TAbstractLevel; const SecondsPassed: Single; const ResourceFrame: TResourceFrame); virtual; |
|
Time passses for equipped weapon.
|
 |
procedure EquippedReload(const IgnorePreviousState: Boolean); |
|
Initiate reload of the equipped weapon (run "reload" animation, refill AmmoLoaded). If IgnorePreviousState then it works unconditionally, otherwise it works only when the current state is not in the middle of shooting/reloading.
|
Properties
 |
property AmmoLoaded: Cardinal read FAmmoLoaded write FAmmoLoaded; |
|
Currently loaded capacity in the magazine.
|
Generated by PasDoc 0.16.0.