weapon setup

This commit is contained in:
2026-01-20 00:12:14 -05:00
parent 7d48a2d40b
commit 16e03e2360
6 changed files with 234 additions and 5 deletions

View File

@@ -8,6 +8,8 @@ AWeaponBase::AWeaponBase()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
bReplicates = true;
WeaponMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Weapon Component"));
}
@@ -15,6 +17,13 @@ AWeaponBase::AWeaponBase()
void AWeaponBase::BeginPlay()
{
Super::BeginPlay();
// AMMO_REPACK.AddDynamic(this, &AWeaponBase::MagRepacking);
for (int i = 0; i < RESERVE_MAG_COUNT; i++)
{
// AMagazineActor* mag = new AMagazineActor();
// mag->SetAmmoValues(MAX_AMMO_COUNT);
// ActiveMags.Add(mag);
}
}
@@ -25,3 +34,15 @@ void AWeaponBase::Tick(float DeltaTime)
}
void AWeaponBase::MagRepacking()
{
RESERVE_AMMO_POOL_DEFAULT -= 1;
if (RESERVE_AMMO_POOL_DEFAULT <= 0)
{
RESERVE_AMMO_POOL_DEFAULT = 0;
// for (AMagazineActor* mag : ActiveMags)
// {
// mag->hasReserveAmmo = false;
// }
}
}