Summary

Methods

Abandon()server
Releases the gun's controller, or the player it is starting up for, and retracts the gun.
Returns the barrel angles that aim the offset barrel at a local position.
Returns the barrel angles that aim at the controller's crosshair.
Returns the position the controller's crosshair points at, up to 8192 units away.
Allows only the remover, colour, material and no-collide tools on the gun.
Creates the gun's spotlight, switched off, if it does not exist.
Turns the gun's spotlight off and removes its projected texture.
Draw()client
Draws the gun's model.
Turns the gun's spotlight on, creating it and its projected texture if needed.
Sets the bunker gun model and shadow physics, centres the barrel and starts the motion controller.
Removes the gun's spotlight and cone and releases its controller.
Turns the barrel towards the controller's view, a few degrees per tick.
Sets the gun's stored angular velocity towards the given angles, within its turn range.
Spawns a gun on the barricade the player is looking at, or on a new frozen barricade.
Spawns a frozen Combine barricade under the gun and parents the gun to it.
Makes a player the gun's controller.
Think()server
Fires the gun while its controller holds attack and releases it when they die, fall over, walk away or leave.
Turns the stored barrel angles up to 5 degrees towards the controller's crosshair.
Lets a Combine player take over the gun, or leave it when they already control it.

Methods

Releases the gun's controller, or the player it is starting up for, and retracts the gun.

Tells the player's client with ZAR3_S to restore their controls, stops shooting and centres the barrel.

Returns the barrel angles that aim the offset barrel at a local position.

A port of CFuncTank::AimBarrelAt from the Source SDK, with the barrel offset taken from a map file.

Parameters

  • parentTarget Vector The target, local to the gun

Returns

  • Angle The local barrel angles

Returns the barrel angles that aim at the controller's crosshair.

A port of CFuncTank::AimBarrelAtPlayerCrosshair from the Source SDK.

Returns

  • Angle The local barrel angles

Returns the position the controller's crosshair points at, up to 8192 units away.

A port of CFuncTank::CalcPlayerCrosshairTarget from the Source SDK.

Returns

  • Vector The hit position

Allows only the remover, colour, material and no-collide tools on the gun.

Parameters

  • ply
  • tr
  • mode

Returns

  • Boolean Whether the tool may be used

Creates the gun's spotlight, switched off, if it does not exist.

Searches for the spotlight's cone entity afterwards so it can be removed with the gun.

Turns the gun's spotlight off and removes its projected texture.

Draws the gun's model.

Turns the gun's spotlight on, creating it and its projected texture if needed.

Sets the bunker gun model and shadow physics, centres the barrel and starts the motion controller.

Removes the gun's spotlight and cone and releases its controller.

Turns the barrel towards the controller's view, a few degrees per tick.

The pose parameters are set here because the Source func_tank does the same in its physics simulation. Yaw is limited to 60 degrees each way and pitch to -35 to 50.

Returns

  • Number SIM_NOTHING

Sets the gun's stored angular velocity towards the given angles, within its turn range.

A port of CFuncTank::RotateTankToAngles from the Source SDK. Unused.

Parameters

  • angles Angle The angles to turn to

Returns

  • Boolean Whether the angles were clamped to the gun's range

Spawns a gun on the barricade the player is looking at, or on a new frozen barricade.

Refuses, with a chat message, when the barricade already has a gun.

Parameters

  • ply Player The player spawning the gun
  • tr Map The player's eye trace; tr.Entity is replaced by a new barricade if needed

Returns

  • Entity The new barricade when one was created, otherwise the gun; nil on failure

Spawns a frozen Combine barricade under the gun and parents the gun to it.

Removing the barricade removes the gun. Used when restoring saved guns.

Makes a player the gun's controller.

Plays the activate sequence, turns the player's flashlight off and tells their client with the ZAR3_S net message to hide the view model and send attacks to the gun. The player becomes the controller once the sequence ends, and is the gun's PendingController until then. Does nothing when the gun is in use or starting up, or the player already controls a gun.

Parameters

  • ply Player The player taking over

Fires the gun while its controller holds attack and releases it when they die, fall over, walk away or leave.

Shoots an AR2 tracer bullet for 26 damage every 0.05 seconds, credited to the controller. Thinks every frame.

Returns

  • Boolean true, so the next think time is used

Turns the stored barrel angles up to 5 degrees towards the controller's crosshair.

A port of CFuncTank::TrackTarget from the Source SDK. Unused: its call in ENT:Think is commented out because the crosshair aiming does not work.

Lets a Combine player take over the gun, or leave it when they already control it.

Non-Combine players are told the gun will not move.

Parameters

  • activator
  • caller

Defined in