gun

Vars | |
accuracy_mult | Multiplier. Increased and decreased through attachments. Multiplies the projectile's accuracy by this number. |
---|---|
accuracy_mult_unwielded | same vars as above but for unwielded firing. |
active_attachable | This is only not null when a weapon attachment is activated. All procs of firing get passed to this when it is not null. |
aim_fire_delay | Determines how fire delay is changed when aim mode is active |
aim_fire_delay_mods | Holds the values modifying aim_fire_delay |
aim_slowdown | Slowdown for wielding |
aim_speed_modifier | Determines character slowdown from aim mode. Default is 66% |
aim_time | Time to enter aim mode, generally one second. |
akimbo_additional_delay | If fire delay is 1 second, and akimbo_additional_delay is 0.5, then you'll have to wait 1 second * 0.5 to fire the second gun |
akimbo_scatter_mod | mult to scatter when firing akimbo |
allowed_ammo_types | List of allowed specific types. If trying to reload with something in this list it will succeed. This is mainly for use in internal magazine weapons or scenarios where you do not want to inclue a whole subtype. |
ammo_datum_type | Stored ammo datum. I changed the var name because it was really annoying to find specific cases of 'ammo' in a file full of guns and ammunition. |
ammo_diff | what ammo to use for overcharge |
ammo_level_icon | Whether the gun has ammo level overlays for its icon, mainly for eguns |
ammo_per_shot | How much ammo consumed per shot; normally 1. |
attach_delay | Time it takes to attach src to a master gun. |
attach_features_flags | Flags for attachment functions. |
attachable_allowed | List of allowed attachments, IT MUST INCLUDE THE STARTING ATTACHMENT TYPES OR THEY WILL NOT ATTACH. |
attachable_offset | List of offsets to make attachment overlays not look wonky. |
attachment_overlays | Image list of attachments overlays. |
attachments_by_slot | List of slots a gun can have. |
autoburst_delay | when autobursting, this is the total amount of time before the weapon fires again. If no amount is specified, defaults to fire_delay + extra_delay |
base_gun_icon | the default gun icon_state. change to reskin the gun |
burst_accuracy_bonus | Additive number added to accuracy_mult. |
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 when burst firing, based off burst size |
casings_to_eject | Amount of casings to eject for guns that toggle like revolvers and dbs. |
chamber_closed_message | Message for when the chamber is closed. |
chamber_items | List of stored ammunition items. |
chamber_opened_message | Message for when the chamber is opened. |
charge_cost | how much energy is consumed per shot. |
cock_animation | Animation of the gun Cocking. |
cock_delay | Delay between cocking the gun. |
cock_locked_message | Message for a pump lock. |
cock_message_delay | Delay between given cocked_message. |
cocked_message | Message given to user on cocking. |
cocked_sound | Sound of cocking the gun. |
cool_amount | heat reduction per second |
current_chamber_position | Current selected position of chamber_items, this will determin the next item to be inserted into the chamber. If the gun uses magazines it will be the position of the magazine to be used. If the gun cycles (revolvers), this number will increase by one everytime it cycles until it reaches max_chamber_items, then it will revert back to one. |
damage_falloff_mult | Same as above, for damage bleed (falloff) |
damage_mult | Same as above, for damage. |
default_ammo_type | Default magazine to spawn with. |
deploy_time | If the gun is deployable, the time it takes for the weapon to deploy. |
deployable_item | If the gun has a deployed item.. |
deployed_scatter_change | If the gun is deployed, change the scatter amount by this number. Negative reduces scatter, positive adds. |
detach_delay | Time it takes to detach src to a master gun. |
dry_fire_sound | Sound for the gun firing when empty. |
dual_wield | If this gun is in inactive hands and shooting in akimbo |
empty_sound | Sound played when the gun auto ejects its magazine. |
extra_delay | When burst-firing, this number is extra time before the weapon can fire again. Depends on number of rounds fired. |
fire_animation | State for a fire animation if the gun has any |
fire_delay | For regular shots, how long to wait before firing again. |
fire_rattle | Does our gun have a unique sound when running out of ammo? If so, use this instead of pitch shifting. |
fire_sound | Sound of firing the gun. |
general_codex_key | Key for the codex |
gun_accuracy_mod | Additive to projectile accuracy, after gun_accuracy_mult |
gun_accuracy_mult | Projectile accuracy is multiplied by the number |
gun_crosshair | Crosshair icon of the gun |
gun_features_flags | Innate carateristics of that gun |
gun_fire_angle | If specified, the gun can only fire in a cone forwards with an angle of this var |
gun_firemode | Current selected firemode of the gun. |
gun_firemode_list | List of allowed firemodes. |
gun_scatter | The actual scatter value of the fired projectile |
gun_skill_category | Skill used to operate this gun. |
gun_user | The mob holding the gun |
gunattachment | the current gun attachment, used for attachment aim mode |
hand_reload_sound | Sound for reloading by handfuls |
heat_amount | heat on this gun. at over 100 heat stops you from firing and goes on cooldown |
heat_meter | image we create to keep track of heat |
heat_per_fire | heat that we add every successful fire() |
icon_overlay_x_offset | Whether the icon_state overlay is offset in the x axis |
icon_overlay_y_offset | Whether the icon_state overlay is offset in the Y axis |
iff_marine_damage_falloff | Modifies projectile damage by a % when a marine gets passed, but not hit |
in_chamber | Current object slated for firing. Magazines/Handfuls will make this a projectile. Internal magazines that aren't handfuls will have this be the object in the gun. |
knockdown_threshold | Damage threshold for whether a turret will be knocked down. |
last_cock_message | World.time of the last cocked_message. |
last_cocked | World.time of the last cock. |
last_fired | World.time of last gun firing. |
master_gun | Gun reference if src is an attachment and is attached to a gun. This will be the gun that src is attached to. |
max_chamber_items | Maximum allowed chamber items. If the gun has AMMO_RECIEVER_TOGGLES_OPEN then the total amount in the gun will be the one here. If not, the gun will be able to contain this number + the chamber. If this is zero and doesnt use magazines, reloading will go directly into the chamber. |
max_rounds | If the gun uses magazines, it is the max rounds of the magazine(s). If it has an internal chamber, it is max_chamber_items. |
max_scatter | Maximum scatter |
max_scatter_unwielded | Maximum scatter when wielded |
min_scatter | Minimum scatter |
min_scatter_unwielded | Minimum scatter when wielded |
movement_acc_penalty_mult | Multiplier. Increased and decreased through attachments. Multiplies the accuracy/scatter penalty of the projectile when firing while moving. |
muzzle_flash | Effect for the muzzle flash of the gun. |
muzzle_flash_color | Color of the muzzle flash effect. |
muzzle_flash_lum | Brightness of the muzzle flash effect. |
muzzleflash_iconstate | Icon state of the muzzle flash effect. |
opened_sound | Sounds of opening the guns reciever. (DBs, Martinis opening.) |
overcharge | In overcharge mode? |
overheat_multiplier | multiplier on cool amount to determine overheat time |
overheat_timer | tracks overheat timer ref |
pixel_shift_x | Pixel shift on the X Axis for the attached overlay. |
pixel_shift_y | Pixel shift on the Y Axis for the attached overlay. |
placed_overlay_iconstate | Icon state used for an added overlay for a sentry. Currently only used in Build-A-Sentry. |
reciever_flags | Flags to determin guns ammo/operation. |
recoil | Screen shake when the weapon is fired while wielded. |
recoil_backtime_multiplier | a multiplier of the duration the recoil takes to go back to normal view, this is (recoil*recoil_backtime_multiplier)+1 |
recoil_deviation | this is how much deviation the gun recoil can have, recoil pushes the screen towards the reverse angle you shot + some deviation which this is the max. |
recoil_unwielded | Screen shake when the weapon is fired while unwielded. |
reload_sound | Sound played for reloading. |
rounds | Stored sum of magazine rounds / chamber contents. This is used for anything needing ammo. It is updated on reload/unload/fire |
rounds_per_shot | If the gun uses a magazine, the gun will subtract this from the magazine every fire. |
scatter | How much the bullet currently scattered when last fired. |
scatter_decay | How much scatter decays every decisecond |
scatter_decay_unwielded | How much scatter decays every decisecond |
scatter_increase | How much scatter increases per shot |
scatter_increase_unwielded | How much scatter increases per shot when wielded |
scatter_unwielded | How much the bullet scatters when fired while unwielded. |
sentry_iff_signal | IFF signal for sentries. If it is set here it will be this signal forever. If null the IFF signal will be dependant on the deployer. |
shell_eject_animation | Animation for opening the chamber of a gun. |
shell_speed_mod | Modifies the speed of projectiles fired. |
shots_fired | How many bullets the gun fired while bursting/auto firing |
slot | Slot the gun fits into. |
starting_attachment_types | The attachments this gun starts with on Init |
target | The atom targeted by the user |
turret_flags | Flags that the deployed sentry uses upon deployment. |
turret_range | Range of deployed turret |
type_of_casings | Types of casing it ejects. |
undeploy_time | If the gun is deployable, the time it takes for the weapon to undeploy. Defaults to deploy time |
unload_sound | Sound of unloading the gun. |
wield_delay | How long between wielding and firing in tenths of seconds |
wield_delay_mod | How long ADS takes (time before firing) |
wield_penalty | Extra wield delay for untrained operators |
wield_time | Storing value for above |
windup_checked | Used if a weapon need windup before firing |
windup_delay | Delay for the gun winding up before firing. |
windup_sound | Sound played during windup. |
Procs | |
Fire | Wrapper proc to complete the whole firing process. |
able_to_fire | Checks if the gun can be fired |
activate | This activates the weapon for use. |
activate_attachment | Gets the attachents by slot and activates them. |
activate_muzzle_attachment | Signal handler to activate the muzzle attachement of that gun if it's in our active hand |
activate_rail_attachment | if your attached weapon has aim mode, stops it from aimming if your attached weapon has aim mode, makes it aim Signal handler to activate the rail attachement of that gun if it's in our active hand |
activate_underrail_attachment | Signal handler to activate the underrail attachement of that gun if it's in our active hand |
add_aim_mode_fire_delay | Adds an aim_fire_delay modificatio value |
adjust_current_rounds | Adds or subtracts rounds from the magazine. |
apply_gun_modifiers | Applies gun modifiers to a projectile before firing |
can_attach | Called when the attachment is trying to be attached. If the attachment is allowed to go through, return TRUE. |
change_target | Update the target if you draged your mouse |
clean_gun_user | Null out gun user to prevent hard del |
clean_target | Set the target to it's turf, so we keep shooting even when it was qdeled |
complete_overheat | called by a timer after overheat finishes |
cycle | Cycles the gun, handles ammunition draw |
do_fire | Actually fires the gun, sets up the projectile and fires it. |
do_toggle_firemode | Actually does the toggling of the fire mode |
drop_connected_mag | Checks to see if the current object in chamber is a worn magazine and if so unloads it |
examine_ammo_count | Gives the user a description of the ammunition remaining, as well as other information pertaining to reloading/ammo. |
fill_gun | Fills the gun with ammunition. This is not inlined with Initialize because it could be used outside and needs to sleep. |
fire_after_autonomous_windup | Fire after a fake windup |
get_ammo | Sets and returns the guns ammo type from the current magazine. |
get_ammo_list | returns ammo string icon_states to display in the ammo counter of the HUD. list(normal_state, empty_state) |
get_ammo_object | Gets a projectile to fire from the magazines ammo type. |
get_current_rounds | Getter to draw current rounds. Overwrite if the magazine is not a /ammo_magazine |
get_display_ammo_count | returns ammo count to display in the ammo counter of the HUD |
get_magazine_default_ammo | Getter to draw default ammo type. If the mag has none, overwrite and return null. |
get_magazine_features_flags | Getter to draw magazine_flags features. If the mag has none, overwrite and return null. |
get_magazine_overlay | Getter to draw the magazine overlay on the gun. If the mag has none, overwrite and return null. |
get_magazine_reload_delay | Getter to draw reload delay. If the mag has none, overwrite and return null. |
get_max_rounds | Getter to draw max rounds. |
gun_on_cooldown | Checks if the gun is on cooldown |
has_attachment | Checks the gun to see if it has an attachment of type attachment_type |
make_casing | Generates a casing |
on_attach | This is called when an attachment gun (src) attaches to a gun. |
on_attachment_attach | Called when an attachment is attached to this gun (src). |
on_attachment_detach | Called when an attachment is detached from this gun (src). |
on_detach | This is called when an attachment gun (src) detaches from a gun. |
on_unzoom | Handles unzoom behavior |
play_fire_sound | Plays firing sound when firing |
recalculate_aim_mode_fire_delay | Calculates aim_fire_delay, can't be below 0 |
reload | Handles reloading. Called on attack_by Reload works in one of three ways, depending on the guns flags. First, if the gun is set to magazines, it will do checks based on the magazines vars and if it succeeds it will load the magazine. If the gun uses handfuls, the gun will create or take a handful with one round and insert those. If the gun does not use handfuls, or magazines. It will merely fill the gun with whatever item is inserted. |
remove_aim_mode_fire_delay | Removes an aim_fire_delay modificatio value |
remove_muzzle_flash | Removes muzzle flash viscontents |
reset_fire | Clean all references |
reset_light_range | Turns off gun fire lighting |
set_bursting | Inform the gun if he is currently bursting, to prevent reloading |
set_gun_user | Set the user in argument as gun_user |
set_target | Set the target and take care of hard delete |
setup_bullet_accuracy | Sets the projectile accuracy and scatter |
simulate_recoil | Generates screenshake if the gun has recoil |
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 |
stop_fire | Reset variables used in firing and remove the gun from the autofire system |
tactical_reload | This performs a tactical reload with src using new_magazine to load the gun. |
toggle_auto_eject | Toggles weapons ejecting their magazines when they're empty. This one is one a gun level and is used via right clicking the gun. |
toggle_auto_eject_keybind | Signal handler to toggle automatic magazine ejection |
toggle_firemode | A verb in the right click context menu of the weapon for toggling firemode |
toggle_gun_safety_keybind | Signal handler to toggle the safety of the gun |
unique_action | Performs the unique action. Can be overwritten. This does a few things, depending on the flags of the gun. If the gun doesn't Toggle it will perform a cycle, if it requires operation the gun will check the cycle against the cock delays. If the gun does toggle, Unique action will open the chamber. (Open the barrel on a DB, or the cylinder on a revolver.) |
unload | Handles unloading. Called on attackhand. Draws the chamber_items out first, then in_chamber |
unload_gun | Signal handler to unload that gun if it's in our active hand |
update_ammo_count | Updates the guns rounds and max_rounds vars based on the contents of chamber_items |
update_mouse_pointer | Updates the current mouse pointer to use the gun crosshair or not |
Var Details
accuracy_mult

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

same vars as above but for unwielded firing.
active_attachable

This is only not null when a weapon attachment is activated. All procs of firing get passed to this when it is not null.
aim_fire_delay

Determines how fire delay is changed when aim mode is active
aim_fire_delay_mods

Holds the values modifying aim_fire_delay
aim_slowdown

Slowdown for wielding
aim_speed_modifier

Determines character slowdown from aim mode. Default is 66%
aim_time

Time to enter aim mode, generally one second.
akimbo_additional_delay

If fire delay is 1 second, and akimbo_additional_delay is 0.5, then you'll have to wait 1 second * 0.5 to fire the second gun
akimbo_scatter_mod

mult to scatter when firing akimbo
allowed_ammo_types

List of allowed specific types. If trying to reload with something in this list it will succeed. This is mainly for use in internal magazine weapons or scenarios where you do not want to inclue a whole subtype.
ammo_datum_type

Stored ammo datum. I changed the var name because it was really annoying to find specific cases of 'ammo' in a file full of guns and ammunition.
ammo_diff

what ammo to use for overcharge
ammo_level_icon

Whether the gun has ammo level overlays for its icon, mainly for eguns
ammo_per_shot

How much ammo consumed per shot; normally 1.
attach_delay

Time it takes to attach src to a master gun.
attach_features_flags

Flags for attachment functions.
attachable_allowed

List of allowed attachments, IT MUST INCLUDE THE STARTING ATTACHMENT TYPES OR THEY WILL NOT ATTACH.
attachable_offset

List of offsets to make attachment overlays not look wonky.
attachment_overlays

Image list of attachments overlays.
attachments_by_slot

List of slots a gun can have.
autoburst_delay

when autobursting, this is the total amount of time before the weapon fires again. If no amount is specified, defaults to fire_delay + extra_delay
base_gun_icon

the default gun icon_state. change to reskin the gun
burst_accuracy_bonus

Additive number added to accuracy_mult.
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 when burst firing, based off burst size
casings_to_eject

Amount of casings to eject for guns that toggle like revolvers and dbs.
chamber_closed_message

Message for when the chamber is closed.
chamber_items

List of stored ammunition items.
chamber_opened_message

Message for when the chamber is opened.
charge_cost

how much energy is consumed per shot.
cock_animation

Animation of the gun Cocking.
cock_delay

Delay between cocking the gun.
cock_locked_message

Message for a pump lock.
cock_message_delay

Delay between given cocked_message.
cocked_message

Message given to user on cocking.
cocked_sound

Sound of cocking the gun.
cool_amount

heat reduction per second
current_chamber_position

Current selected position of chamber_items, this will determin the next item to be inserted into the chamber. If the gun uses magazines it will be the position of the magazine to be used. If the gun cycles (revolvers), this number will increase by one everytime it cycles until it reaches max_chamber_items, then it will revert back to one.
damage_falloff_mult

Same as above, for damage bleed (falloff)
damage_mult

Same as above, for damage.
default_ammo_type

Default magazine to spawn with.
deploy_time

If the gun is deployable, the time it takes for the weapon to deploy.
deployable_item

If the gun has a deployed item..
deployed_scatter_change

If the gun is deployed, change the scatter amount by this number. Negative reduces scatter, positive adds.
detach_delay

Time it takes to detach src to a master gun.
dry_fire_sound

Sound for the gun firing when empty.
dual_wield

If this gun is in inactive hands and shooting in akimbo
empty_sound

Sound played when the gun auto ejects its magazine.
extra_delay

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

State for a fire animation if the gun has any
fire_delay

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

Does our gun have a unique sound when running out of ammo? If so, use this instead of pitch shifting.
fire_sound

Sound of firing the gun.
general_codex_key

Key for the codex
gun_accuracy_mod

Additive to projectile accuracy, after gun_accuracy_mult
gun_accuracy_mult

Projectile accuracy is multiplied by the number
gun_crosshair

Crosshair icon of the gun
gun_features_flags

Innate carateristics of that gun
gun_fire_angle

If specified, the gun can only fire in a cone forwards with an angle of this var
gun_firemode

Current selected firemode of the gun.
gun_firemode_list

List of allowed firemodes.
gun_scatter

The actual scatter value of the fired projectile
gun_skill_category

Skill used to operate this gun.
gun_user

The mob holding the gun
gunattachment

the current gun attachment, used for attachment aim mode
hand_reload_sound

Sound for reloading by handfuls
heat_amount

heat on this gun. at over 100 heat stops you from firing and goes on cooldown
heat_meter

image we create to keep track of heat
heat_per_fire

heat that we add every successful fire()
icon_overlay_x_offset

Whether the icon_state overlay is offset in the x axis
icon_overlay_y_offset

Whether the icon_state overlay is offset in the Y axis
iff_marine_damage_falloff

Modifies projectile damage by a % when a marine gets passed, but not hit
in_chamber

Current object slated for firing. Magazines/Handfuls will make this a projectile. Internal magazines that aren't handfuls will have this be the object in the gun.
knockdown_threshold

Damage threshold for whether a turret will be knocked down.
last_cock_message

World.time of the last cocked_message.
last_cocked

World.time of the last cock.
last_fired

World.time of last gun firing.
master_gun

Gun reference if src is an attachment and is attached to a gun. This will be the gun that src is attached to.
max_chamber_items

Maximum allowed chamber items. If the gun has AMMO_RECIEVER_TOGGLES_OPEN then the total amount in the gun will be the one here. If not, the gun will be able to contain this number + the chamber. If this is zero and doesnt use magazines, reloading will go directly into the chamber.
max_rounds

If the gun uses magazines, it is the max rounds of the magazine(s). If it has an internal chamber, it is max_chamber_items.
max_scatter

Maximum scatter
max_scatter_unwielded

Maximum scatter when wielded
min_scatter

Minimum scatter
min_scatter_unwielded

Minimum scatter when wielded
movement_acc_penalty_mult

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

Effect for the muzzle flash of the gun.
muzzle_flash_color

Color of the muzzle flash effect.
muzzle_flash_lum

Brightness of the muzzle flash effect.
muzzleflash_iconstate

Icon state of the muzzle flash effect.
opened_sound

Sounds of opening the guns reciever. (DBs, Martinis opening.)
overcharge

In overcharge mode?
overheat_multiplier

multiplier on cool amount to determine overheat time
overheat_timer

tracks overheat timer ref
pixel_shift_x

Pixel shift on the X Axis for the attached overlay.
pixel_shift_y

Pixel shift on the Y Axis for the attached overlay.
placed_overlay_iconstate

Icon state used for an added overlay for a sentry. Currently only used in Build-A-Sentry.
reciever_flags

Flags to determin guns ammo/operation.
recoil

Screen shake when the weapon is fired while wielded.
recoil_backtime_multiplier

a multiplier of the duration the recoil takes to go back to normal view, this is (recoil*recoil_backtime_multiplier)+1
recoil_deviation

this is how much deviation the gun recoil can have, recoil pushes the screen towards the reverse angle you shot + some deviation which this is the max.
recoil_unwielded

Screen shake when the weapon is fired while unwielded.
reload_sound

Sound played for reloading.
rounds

Stored sum of magazine rounds / chamber contents. This is used for anything needing ammo. It is updated on reload/unload/fire
rounds_per_shot

If the gun uses a magazine, the gun will subtract this from the magazine every fire.
scatter

How much the bullet currently scattered when last fired.
scatter_decay

How much scatter decays every decisecond
scatter_decay_unwielded

How much scatter decays every decisecond
scatter_increase

How much scatter increases per shot
scatter_increase_unwielded

How much scatter increases per shot when wielded
scatter_unwielded

How much the bullet scatters when fired while unwielded.
sentry_iff_signal

IFF signal for sentries. If it is set here it will be this signal forever. If null the IFF signal will be dependant on the deployer.
shell_eject_animation

Animation for opening the chamber of a gun.
shell_speed_mod

Modifies the speed of projectiles fired.
shots_fired

How many bullets the gun fired while bursting/auto firing
slot

Slot the gun fits into.
starting_attachment_types

The attachments this gun starts with on Init
target

The atom targeted by the user
turret_flags

Flags that the deployed sentry uses upon deployment.
turret_range

Range of deployed turret
type_of_casings

Types of casing it ejects.
undeploy_time

If the gun is deployable, the time it takes for the weapon to undeploy. Defaults to deploy time
unload_sound

Sound of unloading the gun.
wield_delay

How long between wielding and firing in tenths of seconds
wield_delay_mod

How long ADS takes (time before firing)
wield_penalty

Extra wield delay for untrained operators
wield_time

Storing value for above
windup_checked

Used if a weapon need windup before firing
windup_delay

Delay for the gun winding up before firing.
windup_sound

Sound played during windup.
Proc Details
Fire
Wrapper proc to complete the whole firing process.
able_to_fire
Checks if the gun can be fired
activate
This activates the weapon for use.
activate_attachment
Gets the attachents by slot and activates them.
activate_muzzle_attachment
Signal handler to activate the muzzle attachement of that gun if it's in our active hand
activate_rail_attachment
if your attached weapon has aim mode, stops it from aimming if your attached weapon has aim mode, makes it aim Signal handler to activate the rail attachement of that gun if it's in our active hand
activate_underrail_attachment
Signal handler to activate the underrail attachement of that gun if it's in our active hand
add_aim_mode_fire_delay
Adds an aim_fire_delay modificatio value
adjust_current_rounds
Adds or subtracts rounds from the magazine.
apply_gun_modifiers
Applies gun modifiers to a projectile before firing
can_attach
Called when the attachment is trying to be attached. If the attachment is allowed to go through, return TRUE.
change_target
Update the target if you draged your mouse
clean_gun_user
Null out gun user to prevent hard del
clean_target
Set the target to it's turf, so we keep shooting even when it was qdeled
complete_overheat
called by a timer after overheat finishes
cycle
Cycles the gun, handles ammunition draw
do_fire
Actually fires the gun, sets up the projectile and fires it.
do_toggle_firemode
Actually does the toggling of the fire mode
drop_connected_mag
Checks to see if the current object in chamber is a worn magazine and if so unloads it
examine_ammo_count
Gives the user a description of the ammunition remaining, as well as other information pertaining to reloading/ammo.
fill_gun
Fills the gun with ammunition. This is not inlined with Initialize because it could be used outside and needs to sleep.
fire_after_autonomous_windup
Fire after a fake windup
get_ammo
Sets and returns the guns ammo type from the current magazine.
get_ammo_list
returns ammo string icon_states to display in the ammo counter of the HUD. list(normal_state, empty_state)
get_ammo_object
Gets a projectile to fire from the magazines ammo type.
get_current_rounds
Getter to draw current rounds. Overwrite if the magazine is not a /ammo_magazine
get_display_ammo_count
returns ammo count to display in the ammo counter of the HUD
get_magazine_default_ammo
Getter to draw default ammo type. If the mag has none, overwrite and return null.
get_magazine_features_flags
Getter to draw magazine_flags features. If the mag has none, overwrite and return null.
get_magazine_overlay
Getter to draw the magazine overlay on the gun. If the mag has none, overwrite and return null.
get_magazine_reload_delay
Getter to draw reload delay. If the mag has none, overwrite and return null.
get_max_rounds
Getter to draw max rounds.
gun_on_cooldown
Checks if the gun is on cooldown
has_attachment
Checks the gun to see if it has an attachment of type attachment_type
make_casing
Generates a casing
on_attach
This is called when an attachment gun (src) attaches to a gun.
on_attachment_attach
Called when an attachment is attached to this gun (src).
on_attachment_detach
Called when an attachment is detached from this gun (src).
on_detach
This is called when an attachment gun (src) detaches from a gun.
on_unzoom
Handles unzoom behavior
play_fire_sound
Plays firing sound when firing
recalculate_aim_mode_fire_delay
Calculates aim_fire_delay, can't be below 0
reload
Handles reloading. Called on attack_by Reload works in one of three ways, depending on the guns flags. First, if the gun is set to magazines, it will do checks based on the magazines vars and if it succeeds it will load the magazine. If the gun uses handfuls, the gun will create or take a handful with one round and insert those. If the gun does not use handfuls, or magazines. It will merely fill the gun with whatever item is inserted.
remove_aim_mode_fire_delay
Removes an aim_fire_delay modificatio value
remove_muzzle_flash
Removes muzzle flash viscontents
reset_fire
Clean all references
reset_light_range
Turns off gun fire lighting
set_bursting
Inform the gun if he is currently bursting, to prevent reloading
set_gun_user
Set the user in argument as gun_user
set_target
Set the target and take care of hard delete
setup_bullet_accuracy
Sets the projectile accuracy and scatter
simulate_recoil
Generates screenshake if the gun has recoil
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
stop_fire
Reset variables used in firing and remove the gun from the autofire system
tactical_reload
This performs a tactical reload with src using new_magazine to load the gun.
toggle_auto_eject
Toggles weapons ejecting their magazines when they're empty. This one is one a gun level and is used via right clicking the gun.
toggle_auto_eject_keybind
Signal handler to toggle automatic magazine ejection
toggle_firemode
A verb in the right click context menu of the weapon for toggling firemode
toggle_gun_safety_keybind
Signal handler to toggle the safety of the gun
unique_action
Performs the unique action. Can be overwritten. This does a few things, depending on the flags of the gun. If the gun doesn't Toggle it will perform a cycle, if it requires operation the gun will check the cycle against the cock delays. If the gun does toggle, Unique action will open the chamber. (Open the barrel on a DB, or the cylinder on a revolver.)
unload
Handles unloading. Called on attackhand. Draws the chamber_items out first, then in_chamber
unload_gun
Signal handler to unload that gun if it's in our active hand
update_ammo_count
Updates the guns rounds and max_rounds vars based on the contents of chamber_items
update_mouse_pointer
Updates the current mouse pointer to use the gun crosshair or not