gun
Vars | |
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. |
autofire_slow_mult | The multiplier for how much slower this should fire in automatic mode. 1 is normal, 1.2 is 20% slower, 2 is 100% slower, etc. Protected due to it never needing to be edited. |
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. Use modify_burst_amount and set_burst_amount instead of modifying this |
burst_delay | The delay in between shots. Lower = less delay = faster. Use modify_burst_delay and set_burst_delay instead of modifying this |
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_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? |
fire_delay | For regular shots, how long to wait before firing again. Use modify_fire_delay and set_fire_delay instead of modifying this on the fly |
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 |
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. |
gun_firemode | Current selected firemode of the gun. |
gun_firemode_list | List of allowed firemodes. |
gun_user | Current user (holding) of the gun. Set with set_gun_user() |
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. |
mouse_pointer | A custom mouse pointer icon to use when wielded |
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_color | Color of the muzzle flash light effect. |
muzzle_flash_lum | muzzle flash brightness |
projectile_type | The type of projectile that this gun should shoot |
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. |
shots_fired | How many bullets the gun fired while bursting/auto firing |
start_automatic | If this gun should spawn with automatic fire. Protected due to it never needing to be edited. |
start_semiauto | If this gun should spawn with semi-automatic fire. Protected due to it never needing to be edited. |
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 | Currently selected target to fire at. Set with set_target() |
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. |
Procs | |
add_bullet_traits | @bullet_trait_entries: A list of bullet trait entries |
change_target | Update the target if you draged your mouse |
clean_target | Set the target to its turf, so we keep shooting even when it was qdeled |
fire_wrapper | Wrapper proc for the autofire subsystem to ensure the important args aren't null |
force_light | If this gun has a relevant flashlight attachable attached, (de)activate it |
get_fire_delay | getter for fire_delay |
get_gun_user | Getter for gun_user |
handle_view | SIGNAL_HANDLER for COMSIG_CLIENT_RESET_VIEW to ensure the mouse_pointer is set correctly |
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. |
is_civilian_usable | Returns one of the two override values if either are null, preferring the argument value. Otherwise, returns TRUE if it is in a civilian usable category (Handguns or SMGs), FALSE if it is not. |
light_sources | check if the gun contains any light source that is currently turned on. |
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. |
modify_burst_amount | adder for burst_amount |
modify_burst_delay | Adder for burst_delay |
modify_fire_delay | adder for fire_delay |
play_firing_sounds | When the gun is about to shoot this is called to play the specific gun's firing sound. Requires the firing projectile and the gun's user as the first and second argument |
remove_bullet_traits | @bullet_traits: A list of bullet trait typepaths or ids |
reset_fire | Clean all references |
reset_light_range | called by a timer to remove the light range from muzzle flash |
set_auto_firing | Setter proc for fa_firing |
set_bullet_traits | Populate traits_to_give in this proc |
set_burst_amount | setter for burst_amount |
set_burst_delay | Setter for burst_delay |
set_bursting | Setter proc to toggle burst firing |
set_fire_delay | setter for fire_delay |
set_target | Set the target and take care of hard delete |
start_fire | Check if the gun can fire and add it to bucket auto_fire system if needed, or just fire the gun if not |
turn_off_light | This function actually turns the lights on the gun off |
unload_chamber | Unload a chambered round, if one exists, and empty the chamber. |
update_mouse_pointer | Turns the mouse cursor into a crosshair if new_cursor is set to TRUE. If set to FALSE, returns the cursor to its initial icon. |
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.
autofire_slow_mult
The multiplier for how much slower this should fire in automatic mode. 1 is normal, 1.2 is 20% slower, 2 is 100% slower, etc. Protected due to it never needing to be edited.
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. Use modify_burst_amount and set_burst_amount instead of modifying this
burst_delay
The delay in between shots. Lower = less delay = faster. Use modify_burst_delay and set_burst_delay instead of modifying this
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_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?
fire_delay
For regular shots, how long to wait before firing again. Use modify_fire_delay and set_fire_delay instead of modifying this on the fly
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.
gun_firemode
Current selected firemode of the gun.
gun_firemode_list
List of allowed firemodes.
gun_user
Current user (holding) of the gun. Set with set_gun_user()
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.
mouse_pointer
A custom mouse pointer icon to use when wielded
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_color
Color of the muzzle flash light effect.
muzzle_flash_lum
muzzle flash brightness
projectile_type
The type of projectile that this gun should shoot
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.
shots_fired
How many bullets the gun fired while bursting/auto firing
start_automatic
If this gun should spawn with automatic fire. Protected due to it never needing to be edited.
start_semiauto
If this gun should spawn with semi-automatic fire. Protected due to it never needing to be edited.
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
Currently selected target to fire at. Set with set_target()
told_cant_shoot
So that it doesn't spam them with the fact they cannot hit them.
traits_to_give
- An assoc list in the format list(/datum/element/bullet_trait_to_give = list(...args)) that will be given to a projectile with the current ammo datum*
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
change_target
Update the target if you draged your mouse
clean_target
Set the target to its turf, so we keep shooting even when it was qdeled
fire_wrapper
Wrapper proc for the autofire subsystem to ensure the important args aren't null
force_light
If this gun has a relevant flashlight attachable attached, (de)activate it
get_fire_delay
getter for fire_delay
get_gun_user
Getter for gun_user
handle_view
SIGNAL_HANDLER for COMSIG_CLIENT_RESET_VIEW to ensure the mouse_pointer is set correctly
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.
is_civilian_usable
Returns one of the two override values if either are null, preferring the argument value. Otherwise, returns TRUE if it is in a civilian usable category (Handguns or SMGs), FALSE if it is not.
light_sources
check if the gun contains any light source that is currently turned on.
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.
modify_burst_amount
adder for burst_amount
modify_burst_delay
Adder for burst_delay
modify_fire_delay
adder for fire_delay
play_firing_sounds
When the gun is about to shoot this is called to play the specific gun's firing sound. Requires the firing projectile and the gun's user as the first and second argument
remove_bullet_traits
@bullet_traits: A list of bullet trait typepaths or ids
reset_fire
Clean all references
reset_light_range
called by a timer to remove the light range from muzzle flash
set_auto_firing
Setter proc for fa_firing
set_bullet_traits
Populate traits_to_give in this proc
set_burst_amount
setter for burst_amount
set_burst_delay
Setter for burst_delay
set_bursting
Setter proc to toggle burst firing
set_fire_delay
setter for fire_delay
set_target
Set the target and take care of hard delete
start_fire
Check if the gun can fire and add it to bucket auto_fire system if needed, or just fire the gun if not
turn_off_light
This function actually turns the lights on the gun off
unload_chamber
Unload a chambered round, if one exists, and empty the chamber.
update_mouse_pointer
Turns the mouse cursor into a crosshair if new_cursor is set to TRUE. If set to FALSE, returns the cursor to its initial icon.