ammo_box
Vars | |
ammo_type | type that the magazine will be searching for, rejects if not a subtype of |
---|---|
base_cost | cost of the materials in the magazine/box itself |
bullet_cost | cost of all the bullets in the magazine/box |
caliber | String, used for checking if ammo of different types but still fits can fit inside it; generally used for magazines |
load_delay | Delay for loading bullets in. |
max_ammo | maximum amount of ammo in the magazine |
multiple_sprite_use_base | For sprite updating, do we use initial(icon_state) or base_icon_state? |
multiple_sprites | Controls how sprites are updated for the ammo box; see defines in combat.dm: AMMO_BOX_ONE_SPRITE; AMMO_BOX_PER_BULLET; AMMO_BOX_FULL_EMPTY |
start_empty | Whether the magazine should start with nothing in it |
stored_ammo | list containing the actual ammo within the magazine |
Procs | |
ammo_count | Count of number of bullets in the magazine |
attempt_load_round | Attempts to load a given item into this ammo box |
can_load | Whether or not the box can be loaded, used in overrides |
get_ammo_desc | Returns a string that describes the amount of ammo in the magazine. |
get_round | gets a round from the magazine, if keep is TRUE the round will stay in the gun |
give_round | puts a round into the magazine |
top_off | top_off is used to refill the magazine to max, in case you want to increase the size of a magazine with VV then refill it at once |
update_ammo_count | Updates the materials and appearance of this ammo box |
update_custom_materials | Updates the amount of material in this ammo box according to how many bullets are left in it. |
Var Details
ammo_type
type that the magazine will be searching for, rejects if not a subtype of
base_cost
cost of the materials in the magazine/box itself
bullet_cost
cost of all the bullets in the magazine/box
caliber
String, used for checking if ammo of different types but still fits can fit inside it; generally used for magazines
load_delay
Delay for loading bullets in.
max_ammo
maximum amount of ammo in the magazine
multiple_sprite_use_base
For sprite updating, do we use initial(icon_state) or base_icon_state?
multiple_sprites
Controls how sprites are updated for the ammo box; see defines in combat.dm: AMMO_BOX_ONE_SPRITE; AMMO_BOX_PER_BULLET; AMMO_BOX_FULL_EMPTY
start_empty
Whether the magazine should start with nothing in it
stored_ammo
list containing the actual ammo within the magazine
Proc Details
ammo_count
Count of number of bullets in the magazine
attempt_load_round
Attempts to load a given item into this ammo box
can_load
Whether or not the box can be loaded, used in overrides
get_ammo_desc
Returns a string that describes the amount of ammo in the magazine.
get_round
gets a round from the magazine, if keep is TRUE the round will stay in the gun
give_round
puts a round into the magazine
top_off
top_off is used to refill the magazine to max, in case you want to increase the size of a magazine with VV then refill it at once
Arguments:
- load_type - if you want to specify a specific ammo casing type to load, enter the path here, otherwise it'll use the basic /obj/item/ammo_box/var/ammo_type. Must be a compatible round
- starting - Relevant for revolver cylinders, if FALSE then we mind the nulls that represent the empty cylinders (since those nulls don't exist yet if we haven't initialized when this is TRUE)
update_ammo_count
Updates the materials and appearance of this ammo box
update_custom_materials
Updates the amount of material in this ammo box according to how many bullets are left in it.