blob: 1bc74ed1173ebf546746eef2d0514485e464a325 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
using Sandbox;
namespace MurderGame;
public partial class Knife : Weapon
{
public override string ModelPath => "weapons/swb/melee/bayonet/w_bayonet.vmdl";
public override string ViewModelPath => "weapons/swb/melee/bayonet/v_bayonet.vmdl";
public override string HandsModelPath => "weapons/swb/hands/rebel/v_hands_rebel.vmdl";
public override float PrimaryRate => 1f;
public Knife()
{
Ammo = -1;
MaxAmmo = -1;
}
[ClientRpc]
protected virtual void ShootEffects(bool hit)
{
Game.AssertClient();
Pawn.SetAnimParameter( "b_attack", true );
ViewModelEntity?.SetAnimParameter( hit ? "swing" : "swing_miss" , true );
}
public override void PrimaryAttack()
{
Pawn.PlaySound( "bayonet.slash" );
ShootEffects( Melee( 100, 100 ) );
}
protected override void Animate()
{
Pawn.SetAnimParameter( "holdtype", (int)CitizenAnimationHelper.HoldTypes.Swing );
}
}
|