Russian roulette now ends after a player dies. Still need to let the minigame manager know and add logic for moving to the next game, cleanup, ending a round, etc
This commit is contained in:
53
code/Minigames/RussianRoulette/RussianPistol.cs
Normal file
53
code/Minigames/RussianRoulette/RussianPistol.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using LuckerGame.Entities.Weapons;
|
||||
using Sandbox;
|
||||
|
||||
namespace LuckerGame.Minigames.RussianRoulette;
|
||||
|
||||
public partial class RussianPistol : Weapon
|
||||
{
|
||||
public override string ModelPath => "weapons/rust_pistol/rust_pistol.vmdl";
|
||||
public override string ViewModelPath => "weapons/rust_pistol/v_rust_pistol.vmdl";
|
||||
|
||||
public override string WeaponName => "Russian Pistol";
|
||||
|
||||
protected override List<string> HitTags => new List<string> { "victim" };
|
||||
|
||||
public override CitizenAnimationHelper.HoldTypes HoldType => CitizenAnimationHelper.HoldTypes.Pistol;
|
||||
|
||||
public override int MaxAmmo => 6;
|
||||
|
||||
protected override float Damage => 1000f;
|
||||
|
||||
[ClientRpc]
|
||||
protected virtual void ShootEffects()
|
||||
{
|
||||
Game.AssertClient();
|
||||
|
||||
Particles.Create( "particles/pistol_muzzleflash.vpcf", EffectEntity, "muzzle" );
|
||||
|
||||
Pawn.SetAnimParameter( "b_attack", true );
|
||||
ViewModelEntity?.SetAnimParameter( "fire", true );
|
||||
}
|
||||
|
||||
public override void PrimaryAttack()
|
||||
{
|
||||
if ( Random.Shared.Next( 1, Ammo + 1 ) == 1)
|
||||
{
|
||||
ShootEffects();
|
||||
Pawn.PlaySound( "rust_pistol.shoot" );
|
||||
ShootBullet( 0.01f, 100, Damage, 10 );
|
||||
}
|
||||
else
|
||||
{
|
||||
Pawn.PlaySound( "denyundo" );
|
||||
}
|
||||
Ammo--;
|
||||
}
|
||||
|
||||
protected override void Animate()
|
||||
{
|
||||
Pawn.SetAnimParameter( "holdtype", (int)CitizenAnimationHelper.HoldTypes.Pistol );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user