Updated Combat System to Disengage from Combat
This commit is contained in:
parent
5b60412cf9
commit
45374da8bb
BIN
Content/BlueprintAI/AI/BT_Bruh.uasset
(Stored with Git LFS)
BIN
Content/BlueprintAI/AI/BT_Bruh.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.
@ -122,10 +122,12 @@ void ATurnBaseCombatV2::BeginPlay()
|
||||
FButton = Cast<UButton>(HUD->GetWidgetFromName("FButton"));
|
||||
WButton = Cast<UButton>(HUD->GetWidgetFromName("WButton"));
|
||||
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);
|
||||
BackspaceButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::BackspaceButtonOnClick);
|
||||
RunButton->OnClicked.AddDynamic(this, &ATurnBaseCombatV2::RunButtonOnClick);
|
||||
}
|
||||
|
||||
void ATurnBaseCombatV2::ExecuteCast(FString Combo)
|
||||
@ -315,6 +317,14 @@ void ATurnBaseCombatV2::BackspaceButtonOnClick()
|
||||
UpdateResourceBars();
|
||||
}
|
||||
|
||||
void ATurnBaseCombatV2::RunButtonOnClick()
|
||||
{
|
||||
UBlackboardComponent* EnemyBlackboard = Cast<AAIController>(EnemyActor->GetInstigatorController())->GetBlackboardComponent();
|
||||
|
||||
EnemyBlackboard->SetValueAsBool("IsInCombat", false);
|
||||
EndCombat();
|
||||
}
|
||||
|
||||
void ATurnBaseCombatV2::UpdateComboString(FString NewCombo) const
|
||||
{
|
||||
CurrentComboTextBlock->SetText(FText::FromString(NewCombo));
|
||||
@ -358,6 +368,7 @@ void ATurnBaseCombatV2::ToggleButtons() const
|
||||
WButton->SetIsEnabled(!WButton->GetIsEnabled());
|
||||
BackspaceButton->SetIsEnabled(!BackspaceButton->GetIsEnabled());
|
||||
CastButton->SetIsEnabled(!CastButton->GetIsEnabled());
|
||||
RunButton->SetIsEnabled(!RunButton->GetIsEnabled());
|
||||
}
|
||||
|
||||
void ATurnBaseCombatV2::EnemyTurn()
|
||||
|
@ -126,6 +126,9 @@ private:
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UButton* BackspaceButton;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UButton* RunButton;
|
||||
|
||||
UFUNCTION()
|
||||
void CastButtonOnClick();
|
||||
|
||||
@ -138,6 +141,9 @@ private:
|
||||
UFUNCTION()
|
||||
void BackspaceButtonOnClick();
|
||||
|
||||
UFUNCTION()
|
||||
void RunButtonOnClick();
|
||||
|
||||
void UpdateComboString(FString NewCombo) const;
|
||||
void UpdateActionPoints() const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user