Prototype/AmmoItem: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Copied over from reload_time LuaItemPrototype description)
(Fixed ammo_type doc)
Line 8: Line 8:


=== ammo_type ===
=== ammo_type ===
'''Type''': [[Types/AmmoType]]
'''Type''': [[Types/table]] of [[Types/AmmoType]] or [[Types/AmmoType]]
 
When using a vector of AmmoType, the AmmoType has an extra property:
* source_type - [[Types/AmmoSourceType]] - Mandatory. - Defines for which kind of entity this ammo type applies. Each entity kind can only be used once per array.
 
When using a plain [[Types/AmmoType]], the ammo type applies to everything ("default").


== Optional properties ==
== Optional properties ==
=== magazine_size ===
=== magazine_size ===
'''Type''': [[Types/uint32]]
'''Type''': [[Types/float]]


'''Default''': 1
'''Default''': 1


Number of shots before ammo item is consumed.
Number of shots before ammo item is consumed. Must be >= 1.


=== reload_time ===
=== reload_time ===
Line 23: Line 28:
'''Default''': 0
'''Default''': 0


Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine.
Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine. Must be >= 0.

Revision as of 15:54, 6 July 2019

Basics

Prototype type: ammo

Ammo used for a gun.

Mandatory properties

Inherits all properties from Prototype/Item.

ammo_type

Type: Types/table of Types/AmmoType or Types/AmmoType

When using a vector of AmmoType, the AmmoType has an extra property:

  • source_type - Types/AmmoSourceType - Mandatory. - Defines for which kind of entity this ammo type applies. Each entity kind can only be used once per array.

When using a plain Types/AmmoType, the ammo type applies to everything ("default").

Optional properties

magazine_size

Type: Types/float

Default: 1

Number of shots before ammo item is consumed. Must be >= 1.

reload_time

Type: Types/float

Default: 0

Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine. Must be >= 0.