Prototype/AmmoItem: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Removed old prototype docs)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Prototype parent|Prototype/Item}}
<div class="stub"><p>'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/prototypes/AmmoItemPrototype.html https://lua-api.factorio.com/latest/prototypes/AmmoItemPrototype.html]
Ammo used for a gun.


{{Prototype TOC|ammo}}
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
 
== Mandatory properties ==
Inherits all properties from [[Prototype/Item]].
 
{{Prototype property|ammo_type|[[Types/table|table]] of [[Types/AmmoType|AmmoType]] or [[Types/AmmoType|AmmoType]]}}
When using an array of AmmoType, the AmmoType has an extra property:
* source_type - [[Types/AmmoSourceType|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|AmmoType]], the ammo type applies to everything ("default").
 
== Optional properties ==
 
{{Prototype property|magazine_size|[[Types/float|float]]|1|optional=true}}
Number of shots before ammo item is consumed. Must be >= 1.
 
{{Prototype property|reload_time|[[Types/float|float]]|0|optional=true}}
Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine. Must be >= 0.

Latest revision as of 14:32, 25 October 2024

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/prototypes/AmmoItemPrototype.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.