This repository has been archived on 2025-04-18. You can view files and clone it, but cannot push or open issues or pull requests.

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);
}