cw_hands weapon
Weapon defined in core/entities/weapons/cw_hands
Defines the cw_hands weapon, a character's bare hands, which punch with primary fire and knock on doors with
secondary fire.
A punch damages and pushes what the owner looks at within 64 units and can knock out a player it would leave at 30
health or less. The PlayerCanThrowPunch, PlayerCanPunchEntity, PlayerCanPunchKnockout,
PlayerAdjustNextPunchInfo and PlayerCanKnockOnDoor hooks control it. The hands are removed instead of dropped.
Summary
Methods
Primary.Damage.PlayerCanKnockOnDoor allows it.NextMeleeAttack and NextIdle floats.Methods
Plays the fists draw animation and delays the first punch by one second.
Allows the hands to be holstered at any time.
Sets the fist hold type.
Removes the hands instead of dropping them.
Allows the hands to be removed.
SWEP:PlayKnockSound()
shared gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:216Plays the door knock sound, and on the server also on the owner's client.
SWEP:PlayPunchAnimation()
shared gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:331Plays the next punch animation, alternating left and right fists.
On the server it also runs the animation on the owner's client.
SWEP:PrimaryAttack()
shared gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:118Throws a punch that damages, pushes or knocks out what the owner looks at within 64 units.
A player left at 30 health or less is knocked out for 15 seconds if PlayerCanPunchKnockout allows it.
Runs PlayerCanThrowPunch, PlayerCanPunchEntity, PlayerPunchEntity, PlayerPunchKnockout,
PlayerPunchThrown and PlayerAdjustNextPunchInfo, which can change the attack delays.
Damages the entity in front of the owner within 64 units with a club hit of Primary.Damage.
Plays the hit sound after a short delay. The server also runs it on the owner's client for the sound.
Does nothing; the hands cannot reload.
SWEP:SecondaryAttack()
shared gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:192Knocks on the door the owner looks at within 64 units if PlayerCanKnockOnDoor allows it.
Fires PlayerKnockOnDoor afterwards.
SWEP:SetupDataTables()
shared gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:271Sets up the networked NextMeleeAttack and NextIdle floats.
Overridden to show no shooting effects.
SWEP:UpdateNextIdle()
shared gamemodes/catwork/gamemode/core/entities/weapons/cw_hands/shared.lua:281Sets the next idle time to when the current view model sequence ends.