/obj/item/hardpoint
Hardpoints are any items that attach to a base vehicle, such as wheels/treads, support systems and guns
Vars | |
activatable | Whether hardpoint has activatable ability like shooting or zooming. |
---|---|
activation_sounds | Sounds to play when the module activated/fired. |
allowed_seat | Which seat can use this module. |
ammo | Currently loaded ammo that we shoot from. |
auto_firing | If the gun is currently auto firing. |
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. |
backup_clips | Spare magazines that we can reload from. |
being_repaired | Used to prevent welder click spam. |
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_firing | If the gun is currently burst firing. |
damage_multiplier | Determines how much of any incoming damage is actually taken. |
extra_delay | When burst-firing, this number is extra time before the weapon can fire again. |
fire_cooldown | Delay before a new firing sequence can start. |
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 |
firing_arc | The firing arc of this hardpoint. |
gun_firemode | Current selected firemode of the gun. |
gun_firemode_list | List of allowed firemodes. |
hdpt_layer | Visual layer of hardpoint when on vehicle. |
max_clips | Maximum amount of spare mags. |
muzzle_flash_pos | List of offsets for where to place the muzzle flash for each direction. |
origins | Origin coords of the hardpoint relative to the vehicle. |
owner | The vehicle this hardpoint is installed on. |
projectile_type | The type of projectile to fire |
px_offsets | List of pixel offsets for each direction. |
scatter | How much the bullet scatters when fired, in degrees. |
shots_fired | How many bullets the gun fired while burst firing/auto firing. |
slot | Which slot is this hardpoint in. Purely to check for conflicting hardpoints. |
target | Currently selected target to fire at. Set with set_target(). |
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 fired from the hardpoint. |
Procs | |
apply_buff | Applying passive buffs like damage type resistance, speed, accuracy, cooldowns. |
can_be_removed | Proc to be overridden if you want to have special conditions preventing the removal of the hardpoint. Add chat messages in this proc if you want to tell the player why |
change_target | Update the target if you dragged your mouse. |
clean_target | Set the target to its turf, so we keep shooting even when it was qdeled. |
click_empty | Plays 'click' noise and announced to chat. Usually called when weapon empty. |
display_ammo | Print how much ammo is left to chat. |
fire_wrapper | Wrapper proc for the autofire system to ensure the important args aren't null. |
get_origin_turf | Get turf at hardpoint origin offset, used as the muzzle. |
handle_fire | Actually fires the gun, sets up the projectile and fires it. |
in_firing_arc | Determines whether something is in firing arc of a hardpoint. |
on_install | Apply hardpoint effects to vehicle and self. |
on_uninstall | Remove hardpoint effects from vehicle and self. |
play_firing_sounds | Selects and plays a firing sound from the list. |
recalculate_hardpoint_bonuses | Recalculates hardpoint values based on vehicle modifiers. |
remove_buff | Removing passive buffs like damage type resistance, speed, accuracy, cooldowns. |
reset_fire | Clean all firing references. |
set_auto_firing | Setter proc for the automatic firing flag. |
set_bullet_traits | Populate traits_to_give in this proc |
set_burst_delay | Setter for burst_delay. |
set_burst_firing | Setter proc for the burst firing flag. |
set_fire_cooldown | Start cooldown to respect delay of firemode. |
set_fire_delay | Setter for fire_delay. |
set_target | Set the target and take care of hard delete. |
simulate_scatter | Adjust target based on random scatter angle. |
start_fire | Check if the gun can fire and add it to bucket autofire 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. |
try_fire | Tests if firing should be interrupted, otherwise fires. |
Var Details
activatable
Whether hardpoint has activatable ability like shooting or zooming.
activation_sounds
Sounds to play when the module activated/fired.
allowed_seat
Which seat can use this module.
ammo
Currently loaded ammo that we shoot from.
auto_firing
If the gun is currently auto firing.
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.
backup_clips
Spare magazines that we can reload from.
being_repaired
Used to prevent welder click spam.
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_firing
If the gun is currently burst firing.
damage_multiplier
Determines how much of any incoming damage is actually taken.
extra_delay
When burst-firing, this number is extra time before the weapon can fire again.
fire_cooldown
Delay before a new firing sequence can start.
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
firing_arc
The firing arc of this hardpoint.
gun_firemode
Current selected firemode of the gun.
gun_firemode_list
List of allowed firemodes.
hdpt_layer
Visual layer of hardpoint when on vehicle.
max_clips
Maximum amount of spare mags.
muzzle_flash_pos
List of offsets for where to place the muzzle flash for each direction.
origins
Origin coords of the hardpoint relative to the vehicle.
owner
The vehicle this hardpoint is installed on.
projectile_type
The type of projectile to fire
px_offsets
List of pixel offsets for each direction.
scatter
How much the bullet scatters when fired, in degrees.
shots_fired
How many bullets the gun fired while burst firing/auto firing.
slot
Which slot is this hardpoint in. Purely to check for conflicting hardpoints.
target
Currently selected target to fire at. Set with set_target().
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 fired from the hardpoint.
Proc Details
apply_buff
Applying passive buffs like damage type resistance, speed, accuracy, cooldowns.
can_be_removed
Proc to be overridden if you want to have special conditions preventing the removal of the hardpoint. Add chat messages in this proc if you want to tell the player why
change_target
Update the target if you dragged your mouse.
clean_target
Set the target to its turf, so we keep shooting even when it was qdeled.
click_empty
Plays 'click' noise and announced to chat. Usually called when weapon empty.
display_ammo
Print how much ammo is left to chat.
fire_wrapper
Wrapper proc for the autofire system to ensure the important args aren't null.
get_origin_turf
Get turf at hardpoint origin offset, used as the muzzle.
handle_fire
Actually fires the gun, sets up the projectile and fires it.
in_firing_arc
Determines whether something is in firing arc of a hardpoint.
on_install
Apply hardpoint effects to vehicle and self.
on_uninstall
Remove hardpoint effects from vehicle and self.
play_firing_sounds
Selects and plays a firing sound from the list.
recalculate_hardpoint_bonuses
Recalculates hardpoint values based on vehicle modifiers.
remove_buff
Removing passive buffs like damage type resistance, speed, accuracy, cooldowns.
reset_fire
Clean all firing references.
set_auto_firing
Setter proc for the automatic firing flag.
set_bullet_traits
Populate traits_to_give in this proc
set_burst_delay
Setter for burst_delay.
set_burst_firing
Setter proc for the burst firing flag.
set_fire_cooldown
Start cooldown to respect delay of firemode.
set_fire_delay
Setter for fire_delay.
set_target
Set the target and take care of hard delete.
simulate_scatter
Adjust target based on random scatter angle.
start_fire
Check if the gun can fire and add it to bucket autofire 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.
try_fire
Tests if firing should be interrupted, otherwise fires.