diff --git a/Source/the_twilight_abyss/Quest/Quest.cpp b/Source/the_twilight_abyss/Quest/Quest.cpp index 451a80c..ade9822 100644 --- a/Source/the_twilight_abyss/Quest/Quest.cpp +++ b/Source/the_twilight_abyss/Quest/Quest.cpp @@ -33,6 +33,11 @@ bool UQuest::WorldStateMatch(UWorldState* A, UWorldState* B) if (A->Items.IsEmpty() && !B->Items.IsEmpty()) return false; for (UBaseItem* Item : B->Items) { + if (A->Items.IndexOfByPredicate([Item](const UBaseItem* AItem) { return AItem->ItemID == Item->ItemID; }) == -1) + { + UE_LOG(LogTemp, Warning, TEXT("WorldState Predicate Failed")); + return false; + } if (!A->Items.Contains(Item) && Item->StackCount > A->Items[A->Items.IndexOfByPredicate([Item](const UBaseItem* AItem) { return AItem->ItemID == Item->ItemID; })]->StackCount) { return false; diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusSystem.h b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusSystem.h index 1076de3..f751ceb 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusSystem.h +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusSystem.h @@ -48,7 +48,7 @@ public: UPROPERTY() UWrapBox* StatusIconsBox; - UPROPERTY() + UPROPERTY(VisibleAnywhere) TArray ActiveStatusEffects; protected: diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp index af2285b..e0c006b 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp @@ -316,6 +316,7 @@ void ATurnBaseCombatV2::ExecuteCast(FString Combo) StatusSystem->AddStatusEffect(TempThornsStatusEffect, 1, false); StatusEffects.Add(TempThornsStatusEffect); AddBattleLogMessage("Player Casted Thorns"); + StatusTextBlock->SetColorAndOpacity(FSlateColor(FLinearColor(1.0f, 1.0f, 1.0f, 1.0f))); StatusTextBlock->SetText(FText::FromString("Casted Thorns")); const FString Command3 = FString::Printf(TEXT("PlayStatusAnimation")); HUD->CallFunctionByNameWithArguments(*Command3, AR, nullptr, true); @@ -326,6 +327,7 @@ void ATurnBaseCombatV2::ExecuteCast(FString Combo) StatusSystem->AddStatusEffect(TempDOTStatusEffect, 1, false); StatusEffects.Add(TempDOTStatusEffect); AddBattleLogMessage("Player Casted DOT"); + StatusTextBlock->SetColorAndOpacity(FSlateColor(FLinearColor(1.0f, 1.0f, 1.0f, 1.0f))); StatusTextBlock->SetText(FText::FromString("Casted DOT")); const FString Command3 = FString::Printf(TEXT("PlayStatusAnimation")); HUD->CallFunctionByNameWithArguments(*Command3, AR, nullptr, true); @@ -336,6 +338,7 @@ void ATurnBaseCombatV2::ExecuteCast(FString Combo) StatusSystem->AddStatusEffect(TempDamageDownStatusEffect, 1); StatusEffects.Add(TempDamageDownStatusEffect); AddBattleLogMessage("Player Casted DamageDown"); + StatusTextBlock->SetColorAndOpacity(FSlateColor(FLinearColor(1.0f, 1.0f, 1.0f, 1.0f))); StatusTextBlock->SetText(FText::FromString("Enemy Damage Down")); const FString Command3 = FString::Printf(TEXT("PlayStatusAnimation")); HUD->CallFunctionByNameWithArguments(*Command3, AR, nullptr, true); @@ -653,7 +656,7 @@ void ATurnBaseCombatV2::RunButtonOnClick() { if (FMath::RandRange(0.0f, 1.0f) >= EscapePercentage) { - GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Escape Failed")); + StatusTextBlock->SetColorAndOpacity(FSlateColor(FLinearColor(1.0f, 0.0f, 0.0f, 1.0f))); StatusTextBlock->SetText(FText::FromString("Escape Failed")); FOutputDeviceNull AR; const FString Command3 = FString::Printf(TEXT("PlayStatusAnimation")); @@ -781,6 +784,7 @@ void ATurnBaseCombatV2::EnemyTurn() } else { + StatusTextBlock->SetColorAndOpacity(FSlateColor(FLinearColor(1.0f, 1.0f, 1.0f, 1.0f))); StatusTextBlock->SetText(FText::FromString("Missed")); FOutputDeviceNull AR; const FString Command3 = FString::Printf(TEXT("PlayStatusAnimation")); @@ -804,6 +808,6 @@ void ATurnBaseCombatV2::ToggleButtonIfResourceAvailable() const else AButton->SetIsEnabled(false); if (IroquoidResource >= 1) IButton->SetIsEnabled(true); else IButton->SetIsEnabled(false); - if (Cast(PlayerActor)->Inventory->GetItemAmount(0) >= 1) HealButton->SetIsEnabled(true); + if (Cast(PlayerActor)->Inventory->GetItemAmount(0) >= 1 && *PlayerHealth < 100.0f) HealButton->SetIsEnabled(true); else HealButton->SetIsEnabled(false); }