39 lines
719 B
C++
39 lines
719 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "Weapon/LMShotgun.h"
|
|
|
|
#include "Player/LMBulletInfo.h"
|
|
#include "Player/LMPlayer.h"
|
|
|
|
|
|
ALMShotgun::ALMShotgun()
|
|
{
|
|
PrimaryActorTick.bCanEverTick = true;
|
|
}
|
|
|
|
|
|
void ALMShotgun::PrimaryFire()
|
|
{
|
|
if (!Player)
|
|
return;
|
|
|
|
PlaySound(FireSound);
|
|
PlayAnimation(PrimaryFireAnimation);
|
|
|
|
FVector Origin = Player->GetWeaponFiringOrigin();
|
|
FVector Direction = Player->GetAimVector();
|
|
|
|
ClipAmmo--;
|
|
|
|
FLMBulletInfo ShotInfo = FLMBulletInfo(PelletCount, Origin, Direction, WeaponSpread, MaxDistance, DamageFalloff, AmmoType, Damage);
|
|
|
|
Player->FireBullets(ShotInfo);
|
|
}
|
|
|
|
void ALMShotgun::Tick(float DeltaTime)
|
|
{
|
|
Super::Tick(DeltaTime);
|
|
}
|
|
|