diff --git a/Content/Weapons/PhieraDerTuphello/BP_PhieraDerTuphelloWeapon.uasset b/Content/Weapons/PhieraDerTuphello/BP_PhieraDerTuphelloWeapon.uasset index 75d1e36..36dc940 100644 --- a/Content/Weapons/PhieraDerTuphello/BP_PhieraDerTuphelloWeapon.uasset +++ b/Content/Weapons/PhieraDerTuphello/BP_PhieraDerTuphelloWeapon.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f62b5620daf880504b986fd9d796f23686c2fae0c5d4ca7950ecf73073d8953e -size 23920 +oid sha256:b5f6968aefb94201d23109df13b4ebe9221a377afb4df7dcc0113ade1c809de2 +size 24748 diff --git a/Source/vampires/Weapons/GunWeapon.cpp b/Source/vampires/Weapons/GunWeapon.cpp index c2d9ce8..2238213 100644 --- a/Source/vampires/Weapons/GunWeapon.cpp +++ b/Source/vampires/Weapons/GunWeapon.cpp @@ -9,6 +9,7 @@ #include "vampires/ObjectPoolManager.h" #include "vampires/PlayerCharacter.h" #include "vampires/Projectile.h" +#include "vampires/ProjectileDataAsset.h" #include "vampires/VampirePlayerController.h" #include "vampires/Interfaces/Pools.h" @@ -24,8 +25,47 @@ void AGunWeapon::BeginPlay() void AGunWeapon::FireWeaponAction_Implementation() { Super::FireWeaponAction_Implementation(); +} - if (ProjectileTemplate && OverlappedEnemies.Num() > 0) +bool AGunWeapon::UpgradeWeapon_Implementation() +{ + if (!Super::UpgradeWeapon_Implementation()) return false; + + switch (CurrentLevel) + { + case 1: + ProjectilesPerActivation++; + break; + case 2: + ProjectileTemplate->DamagableEnemies += 2; + break; + case 3: + ProjectilesPerActivation++; + break; + case 4: + Damage += 5.0f; + break; + case 5: + ProjectileTemplate->DamagableEnemies += 2; + break; + case 6: + Damage += 5.0f; + ProjectileTemplate->ProjectileSpeed *= 1.50f; + break; + case 7: + ProjectileTemplate->DamagableEnemies += 2; + break; + default: + return false; + } + + ResetWeaponTimer(); + return true; +} + +void AGunWeapon::FireProjectile() +{ + if (ProjectileTemplate && OverlappedEnemies.Num() > 0) { AGameModeBase* gamemode = UGameplayStatics::GetGameMode(GetWorld()); @@ -66,6 +106,8 @@ void AGunWeapon::FireWeaponAction_Implementation() SpawnProjectile(projectile, UKismetMathLibrary::GetDirectionUnitVector(actorLocation, BottomLeft)); projectile = objectPoolManager->GetObject(); SpawnProjectile(projectile, UKismetMathLibrary::GetDirectionUnitVector(actorLocation, BottomRight)); + + Super::FireProjectile(); } } } diff --git a/Source/vampires/Weapons/GunWeapon.h b/Source/vampires/Weapons/GunWeapon.h index f4f3ec9..ec54ac3 100644 --- a/Source/vampires/Weapons/GunWeapon.h +++ b/Source/vampires/Weapons/GunWeapon.h @@ -23,6 +23,11 @@ protected: public: virtual void FireWeaponAction_Implementation() override; + virtual bool UpgradeWeapon_Implementation() override; + +protected: + virtual void FireProjectile() override; + private: void SpawnProjectile(AActor* projectile, FVector direction); };