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.

57 lines
901 B
C++

#include "Weapon/LMWeapon.h"
#include "Weapon/LMWeaponDataStructure.h"
void ULMWeapon::Initialize()
{
WeaponDataStructure =* WeaponRow.GetRow<FLMWeaponDataStructure>(TEXT(""));
}
bool ULMWeapon::HasAmmoInClip()
{
if(CurrentClipAmmo > 0)
{
return true;
}
return false;
}
bool ULMWeapon::HasAmmoInInventory()
{
if (CurrentAmmoInInventory > 0)
{
return true;
}
return false;
}
void ULMWeapon::Reload()
{
//Do design reload logic
OnReload();
if(HasAmmoInClip())
{
if(CurrentAmmoInInventory >= WeaponDataStructure.MaxClipAmmo)
{
CurrentClipAmmo = WeaponDataStructure.MaxClipAmmo;
CurrentAmmoInInventory -= WeaponDataStructure.MaxClipAmmo;
}
else
{
CurrentClipAmmo = CurrentAmmoInInventory;
CurrentAmmoInInventory = 0;
}
}
}
void ULMWeapon::AddAmmo(int AmountOfAmmoToGet)
{
CurrentAmmoInInventory += AmountOfAmmoToGet;
}
void ULMWeapon::Fire()
{
//Fire
}