Updated TurnBasedCombat to Include New Combos
This commit is contained in:
parent
e96c3411c0
commit
9b0ef82e7c
BIN
Content/BlueprintAI/AI/AIBruh.uasset
(Stored with Git LFS)
BIN
Content/BlueprintAI/AI/AIBruh.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Combat_UI/Combat_UI.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Combat_UI/Combat_UI.uasset
(Stored with Git LFS)
Binary file not shown.
@ -42,13 +42,13 @@ void UEatableItems::Use(ATempCharacter* Character)
|
||||
if (isAmmoItemType)
|
||||
{
|
||||
TurnBaseCombat = GetWorld()->GetGameState<ATurnBaseCombatV2>();
|
||||
if (TurnBaseCombat->IronResource > 10)
|
||||
if (TurnBaseCombat->ProbertiumResource > 10)
|
||||
{
|
||||
TurnBaseCombat->IronResource += 5;
|
||||
TurnBaseCombat->ProbertiumResource += 5;
|
||||
}
|
||||
if (TurnBaseCombat->SulfurResource > 10)
|
||||
if (TurnBaseCombat->EisResource > 10)
|
||||
{
|
||||
TurnBaseCombat->SulfurResource += 5;
|
||||
TurnBaseCombat->EisResource += 5;
|
||||
}
|
||||
Character->Inventory->RemoveItem(this);
|
||||
}
|
||||
|
@ -95,4 +95,6 @@ public:
|
||||
|
||||
FName Ammo;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite)
|
||||
float ReactionSpeed = 100.0f;
|
||||
};
|
||||
|
@ -39,8 +39,10 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy)
|
||||
HUD->AddToViewport();
|
||||
EnemyActor = Enemy;
|
||||
|
||||
IronResource = 10;
|
||||
SulfurResource = 10;
|
||||
ProbertiumResource = 10;
|
||||
EisResource = 10;
|
||||
AzosResource = 10;
|
||||
IroquoidResource = 10;
|
||||
|
||||
//Disable Character Movement
|
||||
if (ACharacter* PlayerCharacter = Cast<ACharacter>(GetWorld()->GetFirstPlayerController()->GetPawn()))
|
||||
@ -80,12 +82,12 @@ void ATurnBaseCombatV2::EndCombat()
|
||||
|
||||
void ATurnBaseCombatV2::FKeyPressed()
|
||||
{
|
||||
FButtonOnClick();
|
||||
PButtonOnClick();
|
||||
}
|
||||
|
||||
void ATurnBaseCombatV2::WKeyPressed()
|
||||
{
|
||||
WButtonOnClick();
|
||||
EButtonOnClick();
|
||||
}
|
||||
|
||||
void ATurnBaseCombatV2::BeginPlay()
|
||||
@ -109,16 +111,22 @@ void ATurnBaseCombatV2::BeginPlay()
|
||||
BattleLogTextBlock = Cast<UTextBlock>(HUD->GetWidgetFromName("BattleLog"));
|
||||
PlayerHealthBar = Cast<UProgressBar>(HUD->GetWidgetFromName("PlayerHealthBar"));
|
||||
EnemyHealthBar = Cast<UProgressBar>(HUD->GetWidgetFromName("EnemyHealthBar"));
|
||||
IronResourceBar = Cast<UProgressBar>(HUD->GetWidgetFromName("IronResourceBar"));
|
||||
SulfurResourceBar = Cast<UProgressBar>(HUD->GetWidgetFromName("SulfurResourceBar"));
|
||||
ProbertiumResourceBar = Cast<UProgressBar>(HUD->GetWidgetFromName("ProbertiumResourceBar"));
|
||||
EisResourceBar = Cast<UProgressBar>(HUD->GetWidgetFromName("EisResourceBar"));
|
||||
AzosResourceBar = Cast<UProgressBar>(HUD->GetWidgetFromName("AzosResourceBar"));
|
||||
IroquoidResourceBar = Cast<UProgressBar>(HUD->GetWidgetFromName("IroquoidResourceBar"));
|
||||
CastButton = Cast<UButton>(HUD->GetWidgetFromName("CastButton"));
|
||||
FButton = Cast<UButton>(HUD->GetWidgetFromName("FButton"));
|
||||
WButton = Cast<UButton>(HUD->GetWidgetFromName("WButton"));
|
||||
PButton = Cast<UButton>(HUD->GetWidgetFromName("PButton"));
|
||||
EButton = Cast<UButton>(HUD->GetWidgetFromName("EButton"));
|
||||
AButton = Cast<UButton>(HUD->GetWidgetFromName("AButton"));
|
||||
IButton = Cast<UButton>(HUD->GetWidgetFromName("IButton"));
|
||||
BackspaceButton = Cast<UButton>(HUD->GetWidgetFromName("BackspaceButton"));
|
||||
RunButton = Cast<UButton>(HUD->GetWidgetFromName("RunButton"));
|
||||
CastButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::CastButtonOnClick);
|
||||
FButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::FButtonOnClick);
|
||||
WButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::WButtonOnClick);
|
||||
PButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::PButtonOnClick);
|
||||
EButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::EButtonOnClick);
|
||||
AButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::AButtonOnClick);
|
||||
IButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::IButtonOnClick);
|
||||
BackspaceButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::BackspaceButtonOnClick);
|
||||
RunButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::RunButtonOnClick);
|
||||
}
|
||||
@ -131,13 +139,21 @@ void ATurnBaseCombatV2::ExecuteCast(FString Combo)
|
||||
//For each character in the current combo add back the resource
|
||||
for (int i = 0; i < Combo.Len(); i++)
|
||||
{
|
||||
if (Combo[i] == 'F')
|
||||
if (Combo[i] == 'P')
|
||||
{
|
||||
IronResource += 1;
|
||||
ProbertiumResource += 1;
|
||||
}
|
||||
else if (Combo[i] == 'W')
|
||||
else if (Combo[i] == 'E')
|
||||
{
|
||||
SulfurResource += 1;
|
||||
EisResource += 1;
|
||||
}
|
||||
else if (Combo[i] == 'A')
|
||||
{
|
||||
AzosResource += 1;
|
||||
}
|
||||
else if (Combo[i] == 'I')
|
||||
{
|
||||
IroquoidResource += 1;
|
||||
}
|
||||
}
|
||||
CurrentComboString = "";
|
||||
@ -251,41 +267,79 @@ void ATurnBaseCombatV2::CastButtonOnClick()
|
||||
ExecuteCast(CurrentComboString);
|
||||
}
|
||||
|
||||
void ATurnBaseCombatV2::FButtonOnClick()
|
||||
void ATurnBaseCombatV2::PButtonOnClick()
|
||||
{
|
||||
if (ActiveActionPoints >= DefaultActionPoints)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Action Points"));
|
||||
return;
|
||||
}
|
||||
if (IronResource <= 0)
|
||||
if (ProbertiumResource <= 0)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Iron"));
|
||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Probertium"));
|
||||
return;
|
||||
}
|
||||
UseActionPoint();
|
||||
CurrentComboString.AppendChar('F');
|
||||
CurrentComboString.AppendChar('P');
|
||||
UpdateComboString(CurrentComboString);
|
||||
IronResource -= 1;
|
||||
ProbertiumResource -= 1;
|
||||
UpdateResourceBars();
|
||||
}
|
||||
|
||||
void ATurnBaseCombatV2::WButtonOnClick()
|
||||
void ATurnBaseCombatV2::EButtonOnClick()
|
||||
{
|
||||
if (ActiveActionPoints >= DefaultActionPoints)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Action Points"));
|
||||
return;
|
||||
}
|
||||
if (SulfurResource <= 0)
|
||||
if (EisResource <= 0)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Sulfur"));
|
||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Eis"));
|
||||
return;
|
||||
}
|
||||
UseActionPoint();
|
||||
CurrentComboString.AppendChar('W');
|
||||
CurrentComboString.AppendChar('E');
|
||||
UpdateComboString(CurrentComboString);
|
||||
SulfurResource -= 1;
|
||||
EisResource -= 1;
|
||||
UpdateResourceBars();
|
||||
}
|
||||
|
||||
void ATurnBaseCombatV2::AButtonOnClick()
|
||||
{
|
||||
if (ActiveActionPoints >= DefaultActionPoints)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Action Points"));
|
||||
return;
|
||||
}
|
||||
if (AzosResource <= 0)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Azos"));
|
||||
return;
|
||||
}
|
||||
UseActionPoint();
|
||||
CurrentComboString.AppendChar('A');
|
||||
UpdateComboString(CurrentComboString);
|
||||
AzosResource -= 1;
|
||||
UpdateResourceBars();
|
||||
}
|
||||
|
||||
void ATurnBaseCombatV2::IButtonOnClick()
|
||||
{
|
||||
if (ActiveActionPoints >= DefaultActionPoints)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Action Points"));
|
||||
return;
|
||||
}
|
||||
if (IroquoidResource <= 0)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("No More Iroquoid"));
|
||||
return;
|
||||
}
|
||||
UseActionPoint();
|
||||
CurrentComboString.AppendChar('I');
|
||||
UpdateComboString(CurrentComboString);
|
||||
IroquoidResource -= 1;
|
||||
UpdateResourceBars();
|
||||
}
|
||||
|
||||
@ -297,13 +351,21 @@ void ATurnBaseCombatV2::BackspaceButtonOnClick()
|
||||
return;
|
||||
}
|
||||
ReuseActionPoint();
|
||||
if (CurrentComboString.Right(1) == "F")
|
||||
if (CurrentComboString.Right(1) == "P")
|
||||
{
|
||||
IronResource += 1;
|
||||
ProbertiumResource += 1;
|
||||
}
|
||||
else if (CurrentComboString.Right(1) == "W")
|
||||
else if (CurrentComboString.Right(1) == "E")
|
||||
{
|
||||
SulfurResource += 1;
|
||||
EisResource += 1;
|
||||
}
|
||||
else if (CurrentComboString.Right(1) == "A")
|
||||
{
|
||||
AzosResource += 1;
|
||||
}
|
||||
else if (CurrentComboString.Right(1) == "I")
|
||||
{
|
||||
IroquoidResource += 1;
|
||||
}
|
||||
CurrentComboString.RemoveAt(CurrentComboString.Len() - 1);
|
||||
UpdateComboString(CurrentComboString);
|
||||
@ -351,14 +413,18 @@ void ATurnBaseCombatV2::UpdateBattleLog()
|
||||
|
||||
void ATurnBaseCombatV2::UpdateResourceBars() const
|
||||
{
|
||||
IronResourceBar->SetPercent(IronResource / 10.0f);
|
||||
SulfurResourceBar->SetPercent(SulfurResource / 10.0f);
|
||||
ProbertiumResourceBar->SetPercent(ProbertiumResource / 10.0f);
|
||||
EisResourceBar->SetPercent(EisResource / 10.0f);
|
||||
AzosResourceBar->SetPercent(AzosResource / 10.0f);
|
||||
IroquoidResourceBar->SetPercent(IroquoidResource / 10.0f);
|
||||
}
|
||||
|
||||
void ATurnBaseCombatV2::ToggleButtons() const
|
||||
{
|
||||
FButton->SetIsEnabled(!FButton->GetIsEnabled());
|
||||
WButton->SetIsEnabled(!WButton->GetIsEnabled());
|
||||
PButton->SetIsEnabled(!PButton->GetIsEnabled());
|
||||
EButton->SetIsEnabled(!EButton->GetIsEnabled());
|
||||
AButton->SetIsEnabled(!AButton->GetIsEnabled());
|
||||
IButton->SetIsEnabled(!IButton->GetIsEnabled());
|
||||
BackspaceButton->SetIsEnabled(!BackspaceButton->GetIsEnabled());
|
||||
CastButton->SetIsEnabled(!CastButton->GetIsEnabled());
|
||||
RunButton->SetIsEnabled(!RunButton->GetIsEnabled());
|
||||
|
@ -27,10 +27,15 @@ public:
|
||||
int DefaultActionPoints = 3;
|
||||
UPROPERTY(EditDefaultsOnly)
|
||||
int ActiveActionPoints = 0;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly)
|
||||
int IronResource = 10; // F
|
||||
int ProbertiumResource = 10;
|
||||
UPROPERTY(EditDefaultsOnly)
|
||||
int SulfurResource = 10; // W
|
||||
int EisResource = 10;
|
||||
UPROPERTY(EditDefaultsOnly)
|
||||
int AzosResource = 10;
|
||||
UPROPERTY(EditDefaultsOnly)
|
||||
int IroquoidResource = 10;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly)
|
||||
UNiagaraSystem* GunEffect;
|
||||
@ -51,11 +56,26 @@ public:
|
||||
UPROPERTY(EditAnywhere)
|
||||
TMap<FString, int32> ValidCombos =
|
||||
{
|
||||
{"F", 10},
|
||||
{"W", 10},
|
||||
{"WW", 15},
|
||||
{"FW", 20},
|
||||
{"FFW", 30}
|
||||
{"P", 5},
|
||||
{"PP", 15},
|
||||
{"PPP", 20},
|
||||
{"E", 5},
|
||||
{"EE", 15},
|
||||
{"EEE", 20},
|
||||
{"A", 5},
|
||||
{"AA", 15},
|
||||
{"AAA", 20},
|
||||
{"I", 5},
|
||||
{"II", 15},
|
||||
{"III", 20},
|
||||
{"IA", 15},
|
||||
{"IIA", 20},
|
||||
{"EP", 15},
|
||||
{"EEP", 20},
|
||||
{"AE", 15},
|
||||
{"AAE", 20},
|
||||
{"PI", 15},
|
||||
{"PPI", 20}
|
||||
};
|
||||
|
||||
FString BattleLog;
|
||||
@ -92,40 +112,41 @@ private:
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UTextBlock* TurnIndicatorTextBlock;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UTextBlock* CurrentComboTextBlock;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UTextBlock* BattleLogTextBlock;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UTextBlock* ActionPointsTextBlock;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UProgressBar* PlayerHealthBar;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UProgressBar* EnemyHealthBar;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UProgressBar* IronResourceBar;
|
||||
|
||||
UProgressBar* ProbertiumResourceBar;
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UProgressBar* SulfurResourceBar;
|
||||
UProgressBar* EisResourceBar;
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UProgressBar* AzosResourceBar;
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UProgressBar* IroquoidResourceBar;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UButton* CastButton;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UButton* FButton;
|
||||
|
||||
UButton* PButton;
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UButton* WButton;
|
||||
UButton* EButton;
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UButton* AButton;
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UButton* IButton;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UButton* BackspaceButton;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UButton* RunButton;
|
||||
|
||||
@ -133,14 +154,16 @@ private:
|
||||
void CastButtonOnClick();
|
||||
|
||||
UFUNCTION()
|
||||
void FButtonOnClick();
|
||||
|
||||
void PButtonOnClick();
|
||||
UFUNCTION()
|
||||
void WButtonOnClick();
|
||||
void EButtonOnClick();
|
||||
UFUNCTION()
|
||||
void AButtonOnClick();
|
||||
UFUNCTION()
|
||||
void IButtonOnClick();
|
||||
|
||||
UFUNCTION()
|
||||
void BackspaceButtonOnClick();
|
||||
|
||||
UFUNCTION()
|
||||
void RunButtonOnClick();
|
||||
|
||||
|
4
the_twilight_abyss.uproject.DotSettings
Normal file
4
the_twilight_abyss.uproject.DotSettings
Normal file
@ -0,0 +1,4 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Azos/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Iroquoid/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Probertium/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
Loading…
Reference in New Issue
Block a user