gun
Vars | |
adjust_fire_select_icon_state_on_safety | If true, we put "safety_" before fire_select_icon_state_prefix's prefix. ex. "safety_laser_single" |
---|---|
allowed_ammo_types | Allowed base types of magazines with the gun |
ammo_x_offset | Used for positioning ammo count overlay on sprite |
blacklisted_ammo_types | Incompatible magazines with the gun |
bolt_drop_sound | sound of dropping the bolt or releasing a slide |
bolt_drop_sound_volume | volume of bolt drop/slide release |
bolt_locked | Used for locking bolt and open bolt guns. Set a bit differently for the two but prevents firing when true for both. |
bolt_type | The bolt type of the gun, affects quite a bit of functionality, see gun.dm in defines for bolt types: BOLT_TYPE_STANDARD; BOLT_TYPE_LOCKING; BOLT_TYPE_OPEN; BOLT_TYPE_NO_BOLT |
bolt_wording | Phrasing of the bolt in examine and notification messages; ex: bolt, slide, etc. |
burst_delay | The rate of fire when firing in a burst. Not the delay between bursts |
burst_size | how many shots per burst, Ex: most machine pistols, M90, some ARs are 3rnd burst, while others like the GAR and laser minigun are 2 round burst. |
can_be_sawn_off | Whether the gun can be sawn off by sawing tools |
cartridge_wording | Phrasing of the cartridge in examine and notification messages; ex: bullet, shell, dart, etc. |
casing_ejector | whether the gun ejects the chambered casing |
current_cooldown | This prevents gun from firing until the coodown is done, affected by lag |
currently_firing_burst | Are we firing a burst? If so, dont fire again until burst is done |
default_ammo_type | Compatible magazines with the gun |
default_attachments | Attachments spawned on initialization. Should also be in valid attachments or it SHOULD(once i add that) fail |
default_firemode | after initializing, we set the firemode to this |
eject_empty_sound | sound of ejecting an empty magazine |
eject_sound | Sound of ejecting a magazine |
eject_sound_vary | whether eject sound should vary |
eject_sound_volume | volume of ejecting a magazine |
empty_alarm | Whether the gun alarms when empty or not. |
empty_alarm_sound | empty alarm sound (if enabled) |
empty_alarm_vary | whether empty alarm sound varies |
empty_alarm_volume | empty alarm volume sound |
empty_autoeject | Do we eject the magazine upon runing out of ammo? |
empty_indicator | Whether the sprite has a visible indicator for being empty or not. |
fire_delay | The rate of fire when firing full auto and semi auto, and between bursts; for bursts its fire delay + burst_delay after every burst |
fire_select_icon_state_prefix | BASICALLY: the little button you select firing modes from? this is jsut the prefix of the icon state of that. For example, if we set it as "laser", the fire select will use "laser_single" and so on. |
firemode_index | Firemode index, due to code shit this is the currently selected firemode |
gun_firemodes | Our firemodes, subtract and add to this list as needed. NOTE that the autofire component is given on init when FIREMODE_FULLAUTO is here. |
gun_firenames | A acoc list that determines the names of firemodes. Use if you wanna be weird and set the name of say, FIREMODE_OTHER to "Underbarrel grenade launcher" for example. |
has_safety | Does this gun have a saftey and thus can toggle it? |
internal_cell | if the gun's cell cannot be replaced |
internal_magazine | Whether the gun has an internal magazine or a detatchable one. Overridden by BOLT_TYPE_NO_BOLT. |
load_empty_sound | sound when inserting an empty magazine |
load_sound | sound when inserting magazine |
load_sound_vary | whether loading sound should vary |
load_sound_volume | volume of loading sound |
lock_back_sound | sound of when the bolt is locked back manually |
lock_back_sound_vary | whether lock back varies |
lock_back_sound_volume | volume of lock back |
mag_display | Whether the sprite has a visible magazine or not |
mag_display_ammo | Whether the sprite has a visible ammo display or not |
magazine | Actual magazine currently contained within the gun |
magazine_wording | Phrasing of the magazine in examine and notification messages; ex: magazine, box, etx |
manufacturer | The manufacturer of this weapon. For flavor mostly. If none, this will not show. |
min_recoil | Used if the guns recoil is lower then the min, it clamps the highest recoil |
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. |
rack_delay | length between individual racks |
rack_sound | sound of racking |
rack_sound_vary | whether racking sound should vary |
rack_sound_volume | volume of racking |
recent_rack | time of the most recent rack, used for cooldown purposes |
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. |
safety | If the saftey on? If so, we can't fire the weapon |
safety_multiplier | multiplier for this gun's misfire chances. Closer to 0 is better. |
safety_wording | The wording of safety. Useful for guns that have a non-standard safety system, like a revolver |
sealed_magazine | Whether the gun can be reloaded |
semi_auto | Whether the gun has to be racked each shot or not. |
show_ammo_capacity_on_magazine_sprite | Do we show how much ammo is left on the sprite? In increments of 20. |
show_magazine_on_sprite | Whether the sprite has a visible magazine or not |
show_magazine_on_sprite_ammo | Whether the sprite has a visible ammo display or not |
slot_available | Number of attachments that can fit on a given slot |
slot_offsets | Offsets for the slots on this gun. should be indexed by SLOT and then by X/Y |
special_mags | Whether the gun supports multiple special mag types |
spread | How much the bullet scatters when fired while wielded. |
spread_unwielded | How much the bullet scatters when fired while unwielded. |
tac_reloads | Whether the gun can be tacloaded by slapping a fresh magazine directly on it |
tactical_reload_delay | If we have the 'snowflake mechanic,' how long should it take to reload? |
trigger_guard | trigger guard on the weapon. Used for hulk mutations and ashies. I honestly dont know how usefult his is, id avoid touching it |
unique_mag_sprites_for_variants | Whether the gun supports multiple special mag types |
valid_attachments | The types of attachments allowed, a list of types. SUBTYPES OF AN ALLOWED TYPE ARE ALSO ALLOWED |
wield_delay | How long between wielding and firing in tenths of seconds |
wield_slowdown | Slowdown for wielding |
wield_time | Storing value for above |
zoom_amt | Distance in TURFs to move the user's screen forward (the "zoom" effect) |
zoomable | Whether the gun generates a Zoom action on creation |
Procs | |
blow_up | used for sawing guns, causes the gun to fire without the input of the user |
on_unwield | triggered on unwield of two handed item |
on_wield | triggered on wield of two handed item |
process_fire | Handles everything involving firing. |
sawoff | Used on init or try_sawoff |
try_sawoff | Handles all the logic of sawing off guns, |
Var Details
adjust_fire_select_icon_state_on_safety
If true, we put "safety_" before fire_select_icon_state_prefix's prefix. ex. "safety_laser_single"
allowed_ammo_types
Allowed base types of magazines with the gun
ammo_x_offset
Used for positioning ammo count overlay on sprite
blacklisted_ammo_types
Incompatible magazines with the gun
bolt_drop_sound
sound of dropping the bolt or releasing a slide
bolt_drop_sound_volume
volume of bolt drop/slide release
bolt_locked
Used for locking bolt and open bolt guns. Set a bit differently for the two but prevents firing when true for both.
bolt_type
The bolt type of the gun, affects quite a bit of functionality, see gun.dm in defines for bolt types: BOLT_TYPE_STANDARD; BOLT_TYPE_LOCKING; BOLT_TYPE_OPEN; BOLT_TYPE_NO_BOLT
bolt_wording
Phrasing of the bolt in examine and notification messages; ex: bolt, slide, etc.
burst_delay
The rate of fire when firing in a burst. Not the delay between bursts
burst_size
how many shots per burst, Ex: most machine pistols, M90, some ARs are 3rnd burst, while others like the GAR and laser minigun are 2 round burst.
can_be_sawn_off
Whether the gun can be sawn off by sawing tools
cartridge_wording
Phrasing of the cartridge in examine and notification messages; ex: bullet, shell, dart, etc.
casing_ejector
whether the gun ejects the chambered casing
current_cooldown
This prevents gun from firing until the coodown is done, affected by lag
currently_firing_burst
Are we firing a burst? If so, dont fire again until burst is done
default_ammo_type
Compatible magazines with the gun
default_attachments
Attachments spawned on initialization. Should also be in valid attachments or it SHOULD(once i add that) fail
default_firemode
after initializing, we set the firemode to this
eject_empty_sound
sound of ejecting an empty magazine
eject_sound
Sound of ejecting a magazine
eject_sound_vary
whether eject sound should vary
eject_sound_volume
volume of ejecting a magazine
empty_alarm
Whether the gun alarms when empty or not.
empty_alarm_sound
empty alarm sound (if enabled)
empty_alarm_vary
whether empty alarm sound varies
empty_alarm_volume
empty alarm volume sound
empty_autoeject
Do we eject the magazine upon runing out of ammo?
empty_indicator
Whether the sprite has a visible indicator for being empty or not.
fire_delay
The rate of fire when firing full auto and semi auto, and between bursts; for bursts its fire delay + burst_delay after every burst
fire_select_icon_state_prefix
BASICALLY: the little button you select firing modes from? this is jsut the prefix of the icon state of that. For example, if we set it as "laser", the fire select will use "laser_single" and so on.
firemode_index
Firemode index, due to code shit this is the currently selected firemode
gun_firemodes
Our firemodes, subtract and add to this list as needed. NOTE that the autofire component is given on init when FIREMODE_FULLAUTO is here.
gun_firenames
A acoc list that determines the names of firemodes. Use if you wanna be weird and set the name of say, FIREMODE_OTHER to "Underbarrel grenade launcher" for example.
has_safety
Does this gun have a saftey and thus can toggle it?
internal_cell
if the gun's cell cannot be replaced
internal_magazine
Whether the gun has an internal magazine or a detatchable one. Overridden by BOLT_TYPE_NO_BOLT.
load_empty_sound
sound when inserting an empty magazine
load_sound
sound when inserting magazine
load_sound_vary
whether loading sound should vary
load_sound_volume
volume of loading sound
lock_back_sound
sound of when the bolt is locked back manually
lock_back_sound_vary
whether lock back varies
lock_back_sound_volume
volume of lock back
mag_display
Whether the sprite has a visible magazine or not
mag_display_ammo
Whether the sprite has a visible ammo display or not
magazine
Actual magazine currently contained within the gun
magazine_wording
Phrasing of the magazine in examine and notification messages; ex: magazine, box, etx
manufacturer
The manufacturer of this weapon. For flavor mostly. If none, this will not show.
min_recoil
Used if the guns recoil is lower then the min, it clamps the highest recoil
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.
rack_delay
length between individual racks
rack_sound
sound of racking
rack_sound_vary
whether racking sound should vary
rack_sound_volume
volume of racking
recent_rack
time of the most recent rack, used for cooldown purposes
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.
safety
If the saftey on? If so, we can't fire the weapon
safety_multiplier
multiplier for this gun's misfire chances. Closer to 0 is better.
safety_wording
The wording of safety. Useful for guns that have a non-standard safety system, like a revolver
sealed_magazine
Whether the gun can be reloaded
semi_auto
Whether the gun has to be racked each shot or not.
show_ammo_capacity_on_magazine_sprite
Do we show how much ammo is left on the sprite? In increments of 20.
show_magazine_on_sprite
Whether the sprite has a visible magazine or not
show_magazine_on_sprite_ammo
Whether the sprite has a visible ammo display or not
slot_available
Number of attachments that can fit on a given slot
slot_offsets
Offsets for the slots on this gun. should be indexed by SLOT and then by X/Y
special_mags
Whether the gun supports multiple special mag types
spread
How much the bullet scatters when fired while wielded.
spread_unwielded
How much the bullet scatters when fired while unwielded.
tac_reloads
Whether the gun can be tacloaded by slapping a fresh magazine directly on it
tactical_reload_delay
If we have the 'snowflake mechanic,' how long should it take to reload?
trigger_guard
trigger guard on the weapon. Used for hulk mutations and ashies. I honestly dont know how usefult his is, id avoid touching it
unique_mag_sprites_for_variants
Whether the gun supports multiple special mag types
valid_attachments
The types of attachments allowed, a list of types. SUBTYPES OF AN ALLOWED TYPE ARE ALSO ALLOWED
wield_delay
How long between wielding and firing in tenths of seconds
wield_slowdown
Slowdown for wielding
wield_time
Storing value for above
zoom_amt
Distance in TURFs to move the user's screen forward (the "zoom" effect)
zoomable
Whether the gun generates a Zoom action on creation
Proc Details
blow_up
used for sawing guns, causes the gun to fire without the input of the user
on_unwield
triggered on unwield of two handed item
on_wield
triggered on wield of two handed item
process_fire
Handles everything involving firing.
- gun.dm is still a fucking mess, and I will document everything next time i get to it... for now this will suffice.
Returns TRUE or FALSE depending on if it actually fired a shot. Arguments:
- target - The atom we are trying to hit.
- user - The living mob firing the gun, if any.
- message - Do we show the usual messages? eg. "x fires the y!"
- params - Is the params string from byond /atom/proc/Click code, see that documentation.
- zone_override - The bodypart we attempt to hit, sometimes hits another.
- bonus_spread - Adds this value to spread, in this case used by dual wielding.
- burst_firing - Not to be confused with currently_firing_burst. This var is TRUE when we are doing a burst except for the first shot in a burst, as to override the spam burst checks.
- spread_override - Bullet spread is forcibly set to this. This is usually because of bursts attempting to share the same burst trajectory.
- iteration - Which shot in a burst are we in.
sawoff
Used on init or try_sawoff
try_sawoff
Handles all the logic of sawing off guns,