diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index 8b30120..1fba0b6 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -17,7 +17,7 @@ ManualIPAddress= +ActiveGameNameRedirects=(OldGameName="TP_ThirdPerson",NewGameName="/Script/the_twilight_abyss") [/Script/EngineSettings.GameMapsSettings] -EditorStartupMap=/Game/Levels/CombatTest.CombatTest +EditorStartupMap=/Game/Levels/Prototype.Prototype LocalMapOptions= TransitionMap=None bUseSplitscreen=True @@ -26,7 +26,7 @@ ThreePlayerSplitscreenLayout=FavorTop FourPlayerSplitscreenLayout=Grid bOffsetPlayerGamepadIds=False GameInstanceClass=/Script/Engine.GameInstance -GameDefaultMap=/Game/Levels/CombatTest.CombatTest +GameDefaultMap=/Game/Levels/Prototype.Prototype ServerDefaultMap=/Engine/Maps/Entry.Entry GlobalDefaultGameMode=/Game/Merchant/BP_MerchantGameMode.BP_MerchantGameMode_C GlobalDefaultServerGameMode=None diff --git a/Source/the_twilight_abyss/TurnBasedCombat/TurnBaseCombat.cpp b/Source/the_twilight_abyss/TurnBasedCombat/TurnBaseCombat.cpp index 1fa088c..8856b35 100644 --- a/Source/the_twilight_abyss/TurnBasedCombat/TurnBaseCombat.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombat/TurnBaseCombat.cpp @@ -172,8 +172,11 @@ void ATurnBaseCombat::SwitchTurn() //TurnIndicatorTextBlock->SetText(FText::FromString(bIsPlayerTurn ? "Enemy Turn" : "Player Turn")); //bIsPlayerTurn = !bIsPlayerTurn; TurnIndicatorTextBlock->SetText(FText::FromString("Enemy Turn")); - DamagePlayer(10); - TurnIndicatorTextBlock->SetText(FText::FromString("Player Turn")); + ToggleButtons(); + //wait for 2 seconds + FTimerHandle UnusedHandle; + GetWorldTimerManager().SetTimer(UnusedHandle, this, &ATurnBaseCombat::EnemyTurn, 2.0f, false); + //activeActor = bIsPlayerTurn ? enemyActor : playerActor; } @@ -277,3 +280,18 @@ void ATurnBaseCombat::UpdateResourceBars() const IronResourceBar->SetPercent(IronResource / 10.0f); SulfurResourceBar->SetPercent(SulfurResource / 10.0f); } + +void ATurnBaseCombat::ToggleButtons() const +{ + FButton->SetIsEnabled(!FButton->bIsEnabled); + WButton->SetIsEnabled(!WButton->bIsEnabled); + BackspaceButton->SetIsEnabled(!BackspaceButton->bIsEnabled); + CastButton->SetIsEnabled(!CastButton->bIsEnabled); +} + +void ATurnBaseCombat::EnemyTurn() +{ + DamagePlayer(10); + TurnIndicatorTextBlock->SetText(FText::FromString("Player Turn")); + ToggleButtons(); +} diff --git a/Source/the_twilight_abyss/TurnBasedCombat/TurnBaseCombat.h b/Source/the_twilight_abyss/TurnBasedCombat/TurnBaseCombat.h index ccde118..bb755c9 100644 --- a/Source/the_twilight_abyss/TurnBasedCombat/TurnBaseCombat.h +++ b/Source/the_twilight_abyss/TurnBasedCombat/TurnBaseCombat.h @@ -138,4 +138,6 @@ private: void ClearBattleLog(); void UpdateBattleLog(); void UpdateResourceBars() const; + void ToggleButtons() const; + void EnemyTurn(); };