diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index b792816..f3f6b2f 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -128,3 +128,15 @@ CompressionQualityModifier=1.000000 AutoStreamingThreshold=0.000000 SoundCueCookQualityIndex=-1 +[/Script/GameplayDebugger.GameplayDebuggerConfig] +CategorySlot1=One +CategorySlot2=Two +CategorySlot3=Three +CategorySlot4=Four +CategorySlot5=Five +CategorySlot6=Six +CategorySlot7=Seven +CategorySlot8=Eight +CategorySlot9=Nine +CategorySlot0=Zero + diff --git a/Content/Blueprints/Combat_UI/CombatCharacter.uasset b/Content/Blueprints/Combat_UI/CombatCharacter.uasset index 8d884e7..6078475 100644 --- a/Content/Blueprints/Combat_UI/CombatCharacter.uasset +++ b/Content/Blueprints/Combat_UI/CombatCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d41dd0f4c13a2823d7cda168b1109dfa219681d8f7fda30c966830823dc227a6 -size 71310 +oid sha256:53c111471c3a161fb4ed5408ebeac5cfca08d224652308dbb07cac6d7b829d6b +size 76303 diff --git a/Content/Blueprints/Items/AmmoItem.uasset b/Content/Blueprints/Items/AmmoItem.uasset new file mode 100644 index 0000000..9991ade --- /dev/null +++ b/Content/Blueprints/Items/AmmoItem.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d7e4e608a5183142630757d1496d08c76ac9cdcb16b039c3b2e51848ab89d9d +size 6552 diff --git a/Content/Blueprints/Items/ItemsInWorld/BP_AmmoItem.uasset b/Content/Blueprints/Items/ItemsInWorld/BP_AmmoItem.uasset new file mode 100644 index 0000000..fa2720b --- /dev/null +++ b/Content/Blueprints/Items/ItemsInWorld/BP_AmmoItem.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:733e8e625dc0b5a4b8e64f50ccda5397cdeb71aa75470f42b44a4c2606730875 +size 31844 diff --git a/Content/Blueprints/Items/ItemsInWorld/BP_HealingJellyItem.uasset b/Content/Blueprints/Items/ItemsInWorld/BP_HealingJellyItem.uasset index 5e94613..b53dd84 100644 --- a/Content/Blueprints/Items/ItemsInWorld/BP_HealingJellyItem.uasset +++ b/Content/Blueprints/Items/ItemsInWorld/BP_HealingJellyItem.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:32388bd47d08a69c1f782c682fdf67358fb2fdd5f9dd821ed9fc97d66a0bda70 -size 31327 +oid sha256:14abf326c7821612e3c60b5312759ae40948cadf47a909bf25201e0dfa39ea7d +size 31322 diff --git a/Content/Blueprints/Player/BP_MyTempCharacter.uasset b/Content/Blueprints/Player/BP_MyTempCharacter.uasset index 21e9727..b161173 100644 --- a/Content/Blueprints/Player/BP_MyTempCharacter.uasset +++ b/Content/Blueprints/Player/BP_MyTempCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9f65775451fb2105a879b7ceed94887ea520b41464c773052234285414565157 -size 54763 +oid sha256:8e348a27c5a931226dba531ec739fec1e28b9f912e91b46078ed811fe50f06bd +size 54956 diff --git a/Content/Images/ammoicon.uasset b/Content/Images/ammoicon.uasset new file mode 100644 index 0000000..f2ed9de --- /dev/null +++ b/Content/Images/ammoicon.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c3fc688d58293f796f23824c1478b40cf0d62f868547a7f0e6bf25a471db496 +size 9826 diff --git a/Content/Levels/MerchantPrototype.umap b/Content/Levels/MerchantPrototype.umap index ea85903..e1f4942 100644 --- a/Content/Levels/MerchantPrototype.umap +++ b/Content/Levels/MerchantPrototype.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:838c48c134383d4b1db178233640e11ef2c4bcd49102f53648cf621dd1dcbf8a -size 27100 +oid sha256:c5cc473e60c24da835baacec54217c1f6c675c42c29643b889f07bff057a9c95 +size 34830 diff --git a/Content/Levels/Top_layer_level.umap b/Content/Levels/Top_layer_level.umap index a338efc..dbb4467 100644 --- a/Content/Levels/Top_layer_level.umap +++ b/Content/Levels/Top_layer_level.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b12ca45d23f48747799c368c38e00f316adb025ea913272a4a36b69ec4b30fa3 -size 247139 +oid sha256:3ddfcf9a4f7c3b3ab626893a0d6d13cac4483f9a471bbdba97d0d00efc563dd7 +size 248803 diff --git a/Source/the_twilight_abyss/BaseItems/InventoryComponent.cpp b/Source/the_twilight_abyss/BaseItems/InventoryComponent.cpp index a208bd0..2c808c8 100644 --- a/Source/the_twilight_abyss/BaseItems/InventoryComponent.cpp +++ b/Source/the_twilight_abyss/BaseItems/InventoryComponent.cpp @@ -40,13 +40,11 @@ bool UInventoryComponent::AddItem(class UBaseItem* BaseItem) BaseItem->StoredItems = this; BaseItem->World = GetWorld(); bool isNewItem = true; - // for every item in inventory for (auto & Item : Items) { //if the item is the same as the item that is being added if (Item->ItemDisplayName.ToString() == BaseItem->ItemDisplayName.ToString()) { - //add the amount of the item that is being added to the item in the inventory Item->StackCount++; UE_LOG(LogTemp, Display, TEXT("ITEM STACKCOUNT: %d"), Item->StackCount); isNewItem = false; diff --git a/Source/the_twilight_abyss/BaseItems/Items/BaseItem.cpp b/Source/the_twilight_abyss/BaseItems/Items/BaseItem.cpp index 2fac2d1..40ea61b 100644 --- a/Source/the_twilight_abyss/BaseItems/Items/BaseItem.cpp +++ b/Source/the_twilight_abyss/BaseItems/Items/BaseItem.cpp @@ -14,3 +14,4 @@ void UBaseItem::Use(ATempCharacter* Character) { } + diff --git a/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h b/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h index 346966f..613c763 100644 --- a/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h +++ b/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h @@ -53,6 +53,9 @@ public: UPROPERTY(EditAnywhere, Category = "Item") bool isDamageBuffItem; + UPROPERTY(EditAnywhere, Category = "Item") + bool isAmmoItemType; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Item") int32 StackCount = 1; @@ -69,4 +72,5 @@ public: //This is the same as the use item class but its in BP instead UFUNCTION(BlueprintImplementableEvent) void OnUse(class ATempCharacter* Character); + }; diff --git a/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp b/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp index ceae474..c481d7b 100644 --- a/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp +++ b/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp @@ -16,13 +16,12 @@ void UEatableItems::Use(ATempCharacter* Character) { if(Character) { - if(isHealingItem == true) + if(isHealingItem) { if (Character->Health < 100) { Character->Health += 10; UE_LOG(LogTemp, Display, TEXT("Healed")); - //delete itself Character->Inventory->RemoveItem(this); } else if (Character->Health >= 100) @@ -30,18 +29,27 @@ void UEatableItems::Use(ATempCharacter* Character) UE_LOG(LogTemp, Display, TEXT("Health is full")); } } - if(isDamageBuffItem == true) + + if(isDamageBuffItem) { // need to add the damage buff functionality here UE_LOG(LogTemp, Display, TEXT("Damage Buffed")); Character->Inventory->RemoveItem(this); } - } - /* - when player uses the item syrengine to debuff enemies - detect what enemie actors the player is fighting with - lower their damage by a value. - */ + if (isAmmoItemType) + { + TurnBaseCombat = GetWorld()->GetGameState(); + if (TurnBaseCombat->IronResource > 10) + { + TurnBaseCombat->IronResource += 5; + } + if (TurnBaseCombat->SulfurResource > 10) + { + TurnBaseCombat->SulfurResource += 5; + } + Character->Inventory->RemoveItem(this); + } + } } diff --git a/Source/the_twilight_abyss/BaseItems/Items/EatableItems.h b/Source/the_twilight_abyss/BaseItems/Items/EatableItems.h index d636bcd..dadfc27 100644 --- a/Source/the_twilight_abyss/BaseItems/Items/EatableItems.h +++ b/Source/the_twilight_abyss/BaseItems/Items/EatableItems.h @@ -4,6 +4,7 @@ #include "CoreMinimal.h" #include "BaseItem.h" +#include "the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.h" #include "EatableItems.generated.h" /** @@ -19,4 +20,9 @@ class THE_TWILIGHT_ABYSS_API UEatableItems : public UBaseItem protected: virtual void Use(class ATempCharacter* Character) override; + + +private: + + ATurnBaseCombatV2* TurnBaseCombat; }; diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index 42a36fe..6710218 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -5,10 +5,11 @@ #include "Blueprint/UserWidget.h" #include "the_twilight_abyss/BaseItems/InventoryComponent.h" #include "the_twilight_abyss/BaseItems/Items/BaseItem.h" -#include "Components/CapsuleComponent.h" #include "GameFramework/CharacterMovementComponent.h" #include "the_twilight_abyss/MerchantInteraction/Interaction.h" #include +#include "Components/SphereComponent.h" +#include "Kismet/KismetMathLibrary.h" // CONSTRUCTOR @@ -33,8 +34,14 @@ void ATempCharacter::BeginPlay() PlayerCapsule = GetCapsuleComponent(); TArray AllActorsInScene; + //MAKE SURE POST PROCESSING IS IN THE SCENE OR GAME WILL CRASH UGameplayStatics::GetAllActorsOfClass(GetWorld(), APostProcessVolume::StaticClass(), AllActorsInScene); PostProcessVolume = Cast(AllActorsInScene[0]); + + Enemy = TEXT("Enemy"); + UGameplayStatics::GetAllActorsWithTag(GetWorld(), Enemy, AIActors); + + Ammo = TEXT("Ammo"); } //Binds the input we made in the setup player component to the forward vector @@ -55,10 +62,26 @@ void ATempCharacter::Sneak() { UnCrouch(); PostProcessVolume->Settings.VignetteIntensity = 0.0f; + for (AActor* Actor : AIActors) + { + USphereComponent* SphereComponent = Actor->FindComponentByClass(); + if (SphereComponent != nullptr) + { + SphereComponent->SetSphereRadius(40.0f); //default value + } + } } else { Crouch(); + for (AActor* Actor : AIActors) + { + USphereComponent* SphereComponent = Actor->FindComponentByClass(); + if (SphereComponent != nullptr) + { + SphereComponent->SetSphereRadius(15.0f); + } + } PostProcessVolume->Settings.VignetteIntensity = 0.8f; } @@ -129,6 +152,10 @@ void ATempCharacter::LineTraceLogic() { UE_LOG(LogTemp, Display, TEXT("Not Enough Gold")); } + if(OutHit.GetActor()->ActorHasTag(Ammo)) + { + OutHit.GetActor()->Destroy(); + } } // if the actor hit has the interaction component/script then it will activate the code @@ -182,11 +209,7 @@ void ATempCharacter::InputDisabler() PlayerController->bShowMouseCursor = true; disableTab = true; - if (ThisCamera == nullptr) - { - return; - } - else + if (ThisCamera != nullptr) { OriginalCameraLocation = ThisCamera->GetComponentLocation(); OriginalCameraRotation = ThisCamera->GetComponentRotation(); @@ -210,11 +233,7 @@ void ATempCharacter::InputEnabler() UE_LOG(LogTemp, Display, TEXT("Enabling Inputs")); disableTab = true; TraceDistance = 300; - if (ThisCamera == nullptr) - { - return; - } - else + if (ThisCamera != nullptr) { ThisCamera->SetWorldLocation(OriginalCameraLocation); ThisCamera->SetWorldRotation(OriginalCameraRotation); diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h index f162b7f..57675b2 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h @@ -6,7 +6,6 @@ #include "GameFramework/Character.h" #include "the_twilight_abyss/BaseItems/Items/BaseItem.h" #include "Camera/CameraComponent.h" -#include "Kismet/KismetMathLibrary.h" #include "Engine/PostProcessVolume.h" #include "TempCharacter.generated.h" @@ -89,4 +88,11 @@ public: bool disableTab = false; APostProcessVolume* PostProcessVolume; + + TArray AIActors; + + FName Enemy; + + FName Ammo; + };