60 lines
964 B
C++
60 lines
964 B
C++
#include "Weapon/LMWeapon.h"
|
|
|
|
#include "Weapon/LMWeaponDataStructure.h"
|
|
|
|
void ULMWeapon::Initialize(FVector MeshLocation)
|
|
{
|
|
WeaponDataStructure =* WeaponRow.GetRow<FLMWeaponDataStructure>(TEXT(""));
|
|
|
|
//Get FVector de la position de l'arme
|
|
|
|
}
|
|
|
|
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
|
|
}
|
|
|