diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index dd19601..aa4856d 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -3,7 +3,7 @@ [/Script/EngineSettings.GameMapsSettings] GameDefaultMap=/Game/Legumix/MainMenu/LVL_MainMenu.LVL_MainMenu GlobalDefaultGameMode=/Game/Legumix/BP_GameMode.BP_GameMode_C -EditorStartupMap=/Game/Legumix/Levels/LVL_GYM_00.LVL_GYM_00 +EditorStartupMap=/Game/Legumix/Levels/LVL_TEST_003.LVL_TEST_003 GameInstanceClass=/Game/Legumix/BP_GameInstance.BP_GameInstance_C [/Script/Engine.RendererSettings] diff --git a/Content/Legumix/Drops/BP_AmmoPack.uasset b/Content/Legumix/Drops/BP_AmmoPack.uasset index 47b93b0..f6e61cc 100644 --- a/Content/Legumix/Drops/BP_AmmoPack.uasset +++ b/Content/Legumix/Drops/BP_AmmoPack.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ea97fb259ec4d45f0113cafcdbac6977f07ae0f0b44653a507bc5fabcfe0e580 -size 36895 +oid sha256:a663745532696929ac007d56b40249ce71e2f141b9bd28a0199a8542b108cab7 +size 2519 diff --git a/Content/Legumix/Drops/BP_DropRevolver.uasset b/Content/Legumix/Drops/BP_DropRevolver.uasset new file mode 100644 index 0000000..74a39c7 --- /dev/null +++ b/Content/Legumix/Drops/BP_DropRevolver.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e56ca9e4a3f512aefb7d9d1a0914c3f00a7b5ab18d6c32ac6d30e57be7fabd6 +size 34961 diff --git a/Content/Legumix/Drops/BP_DropShotgun.uasset b/Content/Legumix/Drops/BP_DropShotgun.uasset new file mode 100644 index 0000000..0518f37 --- /dev/null +++ b/Content/Legumix/Drops/BP_DropShotgun.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c323a5669a06a5314d372d57edcd1638bbb828178a9e7c9b6299d245dc6f3794 +size 35513 diff --git a/Content/Legumix/Drops/BP_HealthPack.uasset b/Content/Legumix/Drops/BP_HealthPack.uasset index 7a17212..208c515 100644 --- a/Content/Legumix/Drops/BP_HealthPack.uasset +++ b/Content/Legumix/Drops/BP_HealthPack.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c7fcc9655484fdc1ff6c4b04363ffce15be0efd046b1280fa25ea1681ea8f984 -size 37994 +oid sha256:5e2f39e549b5f598278cb14832e87390b3c05da6d4a7e07daa45e29ed4b6af04 +size 36664 diff --git a/Content/Legumix/Drops/BP_ItemDrop.uasset b/Content/Legumix/Drops/BP_ItemDrop.uasset index b3e5007..c2d2027 100644 --- a/Content/Legumix/Drops/BP_ItemDrop.uasset +++ b/Content/Legumix/Drops/BP_ItemDrop.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:851274749e8bb9e7378a8ec14d2f68578b28aaa00718b2642496c3a657513eab -size 15573 +oid sha256:73ae85ddcd1470d666846a20907e78c325f50fb29558676bc22b82130083f5bb +size 2567 diff --git a/Content/Legumix/Drops/BP_ItemDropRevolver.uasset b/Content/Legumix/Drops/BP_ItemDropRevolver.uasset new file mode 100644 index 0000000..21d5d61 --- /dev/null +++ b/Content/Legumix/Drops/BP_ItemDropRevolver.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:399afd6908549a615fbcdf3cebfb431de83e38ba3a78596b0543c96146d5fb3d +size 15295 diff --git a/Content/Legumix/Drops/BP_ItemDropShotgun.uasset b/Content/Legumix/Drops/BP_ItemDropShotgun.uasset new file mode 100644 index 0000000..da8765f --- /dev/null +++ b/Content/Legumix/Drops/BP_ItemDropShotgun.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01bf381d14441f71614ae276d4242b3f017904487896ba27dc0e2fff172c8606 +size 15670 diff --git a/Content/Legumix/Drops/C_AmmoPackDropRate.uasset b/Content/Legumix/Drops/C_AmmoPackDropRate.uasset index 591846b..c6a65b2 100644 --- a/Content/Legumix/Drops/C_AmmoPackDropRate.uasset +++ b/Content/Legumix/Drops/C_AmmoPackDropRate.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7a31f19ca0afdf6dd5444538c95eb209d8b503feae769cf72f2b321baff0dd13 -size 5038 +oid sha256:cf27bb0791609cedcffaff35e505744d7d13bec44341d2eb15001f4192e9dd04 +size 5113 diff --git a/Source/LegumeMix/Private/Ammo/LMItemDropComponent.cpp b/Source/LegumeMix/Private/Ammo/LMItemDropComponent.cpp index 8fcf066..8a90783 100644 --- a/Source/LegumeMix/Private/Ammo/LMItemDropComponent.cpp +++ b/Source/LegumeMix/Private/Ammo/LMItemDropComponent.cpp @@ -28,11 +28,11 @@ void ULMItemDropComponent::TryDropItems() if (ALMPlayer* Player = Cast(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0))) { Result = FMath::RandRange(0.f, 1.f); - const FLMAmmoData Ammo = Player->GetWeaponManager()->GetAmmoData(AmmoType); - const float Percentage = static_cast(Ammo.AmmoCount) / static_cast(Ammo.MaxAmmo); + const FLMAmmoData Test = Player->GetWeaponManager()->GetAmmoDataMap().FindRef(AmmoType); + const float Percentage = static_cast(Test.AmmoCount) / static_cast(Test.MaxAmmo); const float DropChance = DropChanceAtRemainingAmmo->GetFloatValue(Percentage); - - FString Random = FString::Printf(TEXT("Drop Chance of %f for ammo (%i / %i) %f with random at %f"), DropChance, Ammo.AmmoCount, Ammo.MaxAmmo, Percentage, Result); + + FString Random = FString::Printf(TEXT("Drop Chance of %f for ammo (%i / %i) %f with random at %f"), DropChance, Test.AmmoCount, Test.MaxAmmo, Percentage, Result); GEngine->AddOnScreenDebugMessage(INDEX_NONE, 5.f, FColor::Green, Random); if (DropChance >= Result) { diff --git a/Source/LegumeMix/Public/Ammo/LMAmmoType.h b/Source/LegumeMix/Public/Ammo/LMAmmoType.h index 3d84e1d..0857bc2 100644 --- a/Source/LegumeMix/Public/Ammo/LMAmmoType.h +++ b/Source/LegumeMix/Public/Ammo/LMAmmoType.h @@ -3,6 +3,6 @@ UENUM(BlueprintType) enum class EAmmoType : uint8 { - EAT_RadishAmmo UMETA(DisplayName = "Radish Ammo"), - EAT_CornAmmo UMETA(DisplayName = "Corn Ammo") + EAT_RadishAmmo UMETA(DisplayName = "Revolver Ammo"), + EAT_CornAmmo UMETA(DisplayName = "Shotgun Ammo") }; \ No newline at end of file diff --git a/Source/LegumeMix/Public/Weapon/LMWeaponManager.h b/Source/LegumeMix/Public/Weapon/LMWeaponManager.h index 31e4b36..acd6f5a 100644 --- a/Source/LegumeMix/Public/Weapon/LMWeaponManager.h +++ b/Source/LegumeMix/Public/Weapon/LMWeaponManager.h @@ -58,6 +58,8 @@ public: UFUNCTION(BlueprintCallable) void CreateTracer(EAmmoType Ammo, FVector EndLocation, FRotator Direction); + TMap GetAmmoDataMap() { return AmmoData; } + public: UPROPERTY(BlueprintAssignable, BlueprintCallable, Category=Legumix) FOnWeaponFiredSignature WeaponFired;