byond - Modules - TypesVar Details - Proc Details

gun

Vars

PB_burst_bullets_firedWhen PB burst firing and handing off to /fire after a target moves out of range, this is how many bullets have been fired.
accuracy_multMultiplier. Increased and decreased through attachments. Multiplies the projectile's accuracy by this number.
accuracy_mult_unwieldedMultiplier. Increased and decreased through attachments. Multiplies the projectile's accuracy when unwielded by this number.
active_attachableThis will link to one of the attachments, or remain null.
aim_slowdownSelf explanatory. How much does aiming (wielding the gun) slow you
ammoHow the bullet will behave once it leaves the gun, also used for basic bullet damage and effects, etc. Ammo will be replaced on New() for things that do not use mags.
attachable_allowedMust be the exact path to the attachment present in the list. Empty list for a default.
attachable_offsetIs a list, see examples of from the other files. Initiated on New() because lists don't initial() properly.
attachable_overlaysList of overlays so we can switch them in an out, instead of using Cut() on overlays.
attachmentsList of all current attachments on the gun.
automaticUsed to determine if you can target multiple people.
base_gun_iconthe default gun icon_state. change to reskin the gun
burst_amountHow many shots can the weapon shoot in burst? Anything less than 2 and you cannot toggle burst.
burst_delayThe delay in between shots. Lower = less delay = faster.
burst_scatter_multMultiplier. Increases or decreases how much bonus scatter is added with each bullet during burst fire (wielded only).
caliberDetermines what kind of bullet is created when the gun is unloaded - used to match rounds to magazines. Set automatically when reloading.
cock_cooldownworld.time value, to prevent COCK COCK COCK COCK
cock_delayDelay before we can cock again, in tenths of seconds
damage_buildup_multMultiplier. Increased and decreased through attachments. Multiplies the projectile's damage bleed (buildup) by this number.
damage_falloff_multMultiplier. Increased and decreased through attachments. Multiplies the projectile's damage bleed (falloff) by this number.
damage_multMultiplier. Increased and decreased through attachments. Multiplies the projectile's damage by this number.
delay_styleDetermines what happens when you fire a gun before its wield or pull time has finished. This one is extra scatter and an acc. malus.
effective_range_maxWhat maximum range the weapon deals full damage, tapers off using damage_falloff after hitting this value. 0 for no maximum.
effective_range_minWhat minimum range the weapon deals full damage, builds up the closer you get. 0 for no minimum.
extra_delayWhen burst-firing, this number is extra time before the weapon can fire again. Depends on number of rounds fired.
fa_delayThe delay when firing full-auto
fa_firingWhether or not the gun is firing full-auto
fa_max_scatterHow bad does the scatter get on full auto?
fa_paramsClick parameters to use when firing full-auto
fa_scatter_peakHow many full-auto shots to get to max scatter?
fa_shotsHow many shots have been fired using full-auto. Used to figure out scatter
fa_targetThe atom we're shooting at while full-autoing
fire_delayFor regular shots, how long to wait before firing again.
fire_delay_groupThe group or groups of the gun where a fire delay is applied and the delays applied to each group when the gun is dropped after being fired
fire_rattleDoes our gun have a unique empty mag sound? If so use instead of pitch shifting.
fire_soundsIf fire_sound is null, it will pick a sound from the list here instead.
guaranteed_delay_timeStoring value for guaranteed delay
gun_categoryOnly guns of the same category can be fired together while dualwielding.
has_empty_iconwhether gun has icon state of (base_gun_icon)_e
has_open_iconwhether gun has icon state of (base_gun_icon)_o
in_chamberWhat is currently in the chamber. Most guns will want something in the chamber upon creation.
last_firedWhen it was last fired, related to world.time.
last_moved_mobUsed to fire faster at more than one person.
movement_onehanded_acc_penalty_multMultiplier. Increased and decreased through attachments. Multiplies the accuracy/scatter penalty of the projectile when firing onehanded while moving.
muzzle_flash_lummuzzle flash brightness
pull_timeStoring value for how long pulling a gun takes before you can use it
random_muzzle_chanceChance for random spawn to give this gun a muzzle attachment.
random_rail_chanceChance for random spawn to give this gun a rail attachment.
random_spawn_chanceChance for random attachments to spawn in general.
random_spawn_muzzleUsed when a gun will have a chance to spawn with attachments.
random_spawn_stockUsed when a gun will have a chance to spawn with attachments.
random_spawn_underUsed when a gun will have a chance to spawn with attachments.
random_stock_chanceChance for random spawn to give this gun a stock attachment.
random_under_chanceChance for random spawn to give this gun a underbarrel attachment.
recoilScreen shake when the weapon is fired.
recoil_buildupThe recoil on a dynamic recoil gun
recoil_buildup_limitThe limit at which the recoil on a gun can reach. Usually the maximum value
recoil_loss_per_secondHow much recoil_buildup is lost per second. Builds up as time passes, and is set to 0 when a single shot is fired
recoil_unwieldedMultiplier. Increased and decreased through attachments. Multiplies the gun's recoil when unwielded by this number.
scatterHow much the bullet scatters when fired.
scatter_unwieldedMultiplier. Increased and decreased through attachments. Multiplies the projectile's scatter when the gun is unwielded by this number.
starting_attachment_typesWhat attachments this gun starts with THAT CAN BE REMOVED. Important to avoid nuking the attachments on restocking! Added on New()
targetList of who yer targeting.
told_cant_shootSo that it doesn't spam them with the fact they cannot hit them.
traits_to_give
velocity_addAdded velocity to fired bullet.
wield_delayHow long between wielding and firing in tenths of seconds
wield_timeStoring value for wield delay.

Procs

add_bullet_traits@bullet_trait_entries: A list of bullet trait entries
has_ammunitionReturns TRUE if the weapon is loaded. Separate proc because there's no single way to check this for all weapons: chamber isn't always loaded, not all weapons use normal magazines etc. load_into_chamber() itself is designed to be called immediately before firing, and isn't suitable.
load_into_chamberload_into_chamber(), reload_into_chamber(), and clear_jam() do all of the heavy lifting. If you need to change up how a gun fires, just change these procs for that subtype and you're good to go.
remove_bullet_traits@bullet_traits: A list of bullet trait typepaths or ids
set_bullet_traitsPopulate traits_to_give in this proc
unload_chamberUnload a chambered round, if one exists, and empty the chamber.

Var Details

PB_burst_bullets_fired

When PB burst firing and handing off to /fire after a target moves out of range, this is how many bullets have been fired.

accuracy_mult

Multiplier. Increased and decreased through attachments. Multiplies the projectile's accuracy by this number.

accuracy_mult_unwielded

Multiplier. Increased and decreased through attachments. Multiplies the projectile's accuracy when unwielded by this number.

active_attachable

This will link to one of the attachments, or remain null.

aim_slowdown

Self explanatory. How much does aiming (wielding the gun) slow you

ammo

How the bullet will behave once it leaves the gun, also used for basic bullet damage and effects, etc. Ammo will be replaced on New() for things that do not use mags.

attachable_allowed

Must be the exact path to the attachment present in the list. Empty list for a default.

attachable_offset

Is a list, see examples of from the other files. Initiated on New() because lists don't initial() properly.

attachable_overlays

List of overlays so we can switch them in an out, instead of using Cut() on overlays.

attachments

List of all current attachments on the gun.

automatic

Used to determine if you can target multiple people.

base_gun_icon

the default gun icon_state. change to reskin the gun

burst_amount

How many shots can the weapon shoot in burst? Anything less than 2 and you cannot toggle burst.

burst_delay

The delay in between shots. Lower = less delay = faster.

burst_scatter_mult

Multiplier. Increases or decreases how much bonus scatter is added with each bullet during burst fire (wielded only).

caliber

Determines what kind of bullet is created when the gun is unloaded - used to match rounds to magazines. Set automatically when reloading.

cock_cooldown

world.time value, to prevent COCK COCK COCK COCK

cock_delay

Delay before we can cock again, in tenths of seconds

damage_buildup_mult

Multiplier. Increased and decreased through attachments. Multiplies the projectile's damage bleed (buildup) by this number.

damage_falloff_mult

Multiplier. Increased and decreased through attachments. Multiplies the projectile's damage bleed (falloff) by this number.

damage_mult

Multiplier. Increased and decreased through attachments. Multiplies the projectile's damage by this number.

delay_style

Determines what happens when you fire a gun before its wield or pull time has finished. This one is extra scatter and an acc. malus.

effective_range_max

What maximum range the weapon deals full damage, tapers off using damage_falloff after hitting this value. 0 for no maximum.

effective_range_min

What minimum range the weapon deals full damage, builds up the closer you get. 0 for no minimum.

extra_delay

When burst-firing, this number is extra time before the weapon can fire again. Depends on number of rounds fired.

fa_delay

The delay when firing full-auto

fa_firing

Whether or not the gun is firing full-auto

fa_max_scatter

How bad does the scatter get on full auto?

fa_params

Click parameters to use when firing full-auto

fa_scatter_peak

How many full-auto shots to get to max scatter?

fa_shots

How many shots have been fired using full-auto. Used to figure out scatter

fa_target

The atom we're shooting at while full-autoing

fire_delay

For regular shots, how long to wait before firing again.

fire_delay_group

The group or groups of the gun where a fire delay is applied and the delays applied to each group when the gun is dropped after being fired

Guns with this var set will apply the gun's remaining fire delay to any other guns in the same group

Set as null (does not apply any fire delays to any other gun group) or a list of fire delay groups (string defines) matched with the corresponding fire delays applied

fire_rattle

Does our gun have a unique empty mag sound? If so use instead of pitch shifting.

fire_sounds

If fire_sound is null, it will pick a sound from the list here instead.

guaranteed_delay_time

Storing value for guaranteed delay

gun_category

Only guns of the same category can be fired together while dualwielding.

has_empty_icon

whether gun has icon state of (base_gun_icon)_e

has_open_icon

whether gun has icon state of (base_gun_icon)_o

in_chamber

What is currently in the chamber. Most guns will want something in the chamber upon creation.

last_fired

When it was last fired, related to world.time.

last_moved_mob

Used to fire faster at more than one person.

movement_onehanded_acc_penalty_mult

Multiplier. Increased and decreased through attachments. Multiplies the accuracy/scatter penalty of the projectile when firing onehanded while moving.

muzzle_flash_lum

muzzle flash brightness

pull_time

Storing value for how long pulling a gun takes before you can use it

random_muzzle_chance

Chance for random spawn to give this gun a muzzle attachment.

random_rail_chance

Chance for random spawn to give this gun a rail attachment.

random_spawn_chance

Chance for random attachments to spawn in general.

random_spawn_muzzle

Used when a gun will have a chance to spawn with attachments.

random_spawn_stock

Used when a gun will have a chance to spawn with attachments.

random_spawn_under

Used when a gun will have a chance to spawn with attachments.

random_stock_chance

Chance for random spawn to give this gun a stock attachment.

random_under_chance

Chance for random spawn to give this gun a underbarrel attachment.

recoil

Screen shake when the weapon is fired.

recoil_buildup

The recoil on a dynamic recoil gun

recoil_buildup_limit

The limit at which the recoil on a gun can reach. Usually the maximum value

recoil_loss_per_second

How much recoil_buildup is lost per second. Builds up as time passes, and is set to 0 when a single shot is fired

recoil_unwielded

Multiplier. Increased and decreased through attachments. Multiplies the gun's recoil when unwielded by this number.

scatter

How much the bullet scatters when fired.

scatter_unwielded

Multiplier. Increased and decreased through attachments. Multiplies the projectile's scatter when the gun is unwielded by this number.

starting_attachment_types

What attachments this gun starts with THAT CAN BE REMOVED. Important to avoid nuking the attachments on restocking! Added on New()

target

List of who yer targeting.

told_cant_shoot

So that it doesn't spam them with the fact they cannot hit them.

traits_to_give

velocity_add

Added velocity to fired bullet.

wield_delay

How long between wielding and firing in tenths of seconds

wield_time

Storing value for wield delay.

Proc Details

add_bullet_traits

@bullet_trait_entries: A list of bullet trait entries

has_ammunition

Returns TRUE if the weapon is loaded. Separate proc because there's no single way to check this for all weapons: chamber isn't always loaded, not all weapons use normal magazines etc. load_into_chamber() itself is designed to be called immediately before firing, and isn't suitable.

load_into_chamber

load_into_chamber(), reload_into_chamber(), and clear_jam() do all of the heavy lifting. If you need to change up how a gun fires, just change these procs for that subtype and you're good to go.

remove_bullet_traits

@bullet_traits: A list of bullet trait typepaths or ids

set_bullet_traits

Populate traits_to_give in this proc

unload_chamber

Unload a chambered round, if one exists, and empty the chamber.