gun 
Vars | |
accuracy | Gun accuracy (without distance accuracy) |
---|---|
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. |
bayonet | Currently attached bayonet. |
bayonet_overlay | Currently used bayonet overlay. |
bayonet_x_offset | Offsets bayonet's overlay pixel_x by this value. |
bayonet_y_offset | Offsets bayonet's overlay pixel_y by this value. |
can_bayonet | Whether user can attach/detach bayonets to/from this gun. |
current_skin | The skin choice if we had a reskin |
gun_light | Currently attached flashlight. |
on_rack | Guns can be placed on racks |
pb_knockback | Responsible for the range of the throwing back when shooting at point blank range |
skin_options | Lazy list of gun visual skins. Filled on Initialize() in proc/update_gun_skins() |
starting_attachment_types | The attachments this gun starts with on Init |
unique_rename | Allows renaming with a pen |
unique_reskin | Allows reskinning |
Procs | |
ZoomGrantCheck | Proc which will be called when the gun receives the COMSIG_ITEM_EQUIPPED signal. |
add_skin | Adds skin in associative lazy list: skin_options[skin_name] = skin_icon_state |
do_recoil | animate recoil for gun |
set_bayonet | Sets gun's bayonet and do all the necessary updates |
set_gun_light | Sets gun's flashlight and do all the necessary updates |
Var Details
accuracy 
Gun accuracy (without distance accuracy)
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.
bayonet 
Currently attached bayonet.
bayonet_overlay 
Currently used bayonet overlay.
bayonet_x_offset 
Offsets bayonet's overlay pixel_x by this value.
bayonet_y_offset 
Offsets bayonet's overlay pixel_y by this value.
can_bayonet 
Whether user can attach/detach bayonets to/from this gun.
current_skin 
The skin choice if we had a reskin
gun_light 
Currently attached flashlight.
on_rack 
Guns can be placed on racks
pb_knockback 
Responsible for the range of the throwing back when shooting at point blank range
skin_options 
Lazy list of gun visual skins. Filled on Initialize() in proc/update_gun_skins()
starting_attachment_types 
The attachments this gun starts with on Init
unique_rename 
Allows renaming with a pen
unique_reskin 
Allows reskinning
Proc Details
ZoomGrantCheck
Proc which will be called when the gun receives the COMSIG_ITEM_EQUIPPED
signal.
This happens if the mob picks up the gun, or equips it to any of their slots.
If the slot is anything other than either of their hands (such as the back slot), un-zoom them, and Remove
the zoom action button from the mob.
Otherwise, Grant
the mob the zoom action button.
Arguments:
- source - the gun that got equipped, which is
src
. - user - the mob equipping the gun.
- slot - the slot the gun is getting equipped to.
add_skin
Adds skin in associative lazy list: skin_options[skin_name] = skin_icon_state
Arguments:
- skin_name - what skin name user will see.
- skin_icon_state - which icon_state will be used for the gun.
do_recoil
animate recoil for gun
set_bayonet
Sets gun's bayonet and do all the necessary updates
set_gun_light
Sets gun's flashlight and do all the necessary updates