diff --git a/Content/Audio/Makai-Symphony-Dragon-Castle.uasset b/Content/Audio/Makai-Symphony-Dragon-Castle.uasset new file mode 100644 index 0000000..d26184e Binary files /dev/null and b/Content/Audio/Makai-Symphony-Dragon-Castle.uasset differ diff --git a/Content/Audio/Makai-Symphony-Dragon-Castle_Cue.uasset b/Content/Audio/Makai-Symphony-Dragon-Castle_Cue.uasset new file mode 100644 index 0000000..8834cf1 Binary files /dev/null and b/Content/Audio/Makai-Symphony-Dragon-Castle_Cue.uasset differ diff --git a/Content/BattleField/Multiplayer/BP_BattleGameMode.uasset b/Content/BattleField/Multiplayer/BP_BattleGameMode.uasset index ce38b8d..66c11c6 100644 Binary files a/Content/BattleField/Multiplayer/BP_BattleGameMode.uasset and b/Content/BattleField/Multiplayer/BP_BattleGameMode.uasset differ diff --git a/Content/BattleField/Multiplayer/BattleFieldMap.umap b/Content/BattleField/Multiplayer/BattleFieldMap.umap index 9d0bed5..a863b50 100644 Binary files a/Content/BattleField/Multiplayer/BattleFieldMap.umap and b/Content/BattleField/Multiplayer/BattleFieldMap.umap differ diff --git a/Content/BattleField/SinglePlayer/BP_SinglePlayerGM.uasset b/Content/BattleField/SinglePlayer/BP_SinglePlayerGM.uasset index 0a6b17d..0ee3e8d 100644 Binary files a/Content/BattleField/SinglePlayer/BP_SinglePlayerGM.uasset and b/Content/BattleField/SinglePlayer/BP_SinglePlayerGM.uasset differ diff --git a/Content/BattleField/SinglePlayer/OfflineBattleFieldMap.umap b/Content/BattleField/SinglePlayer/OfflineBattleFieldMap.umap index a70b900..1c9eb2a 100644 Binary files a/Content/BattleField/SinglePlayer/OfflineBattleFieldMap.umap and b/Content/BattleField/SinglePlayer/OfflineBattleFieldMap.umap differ diff --git a/Content/MainMenu/MainMenuLevel.umap b/Content/MainMenu/MainMenuLevel.umap index d882ad5..ffd179c 100644 Binary files a/Content/MainMenu/MainMenuLevel.umap and b/Content/MainMenu/MainMenuLevel.umap differ diff --git a/Content/StarterContent/Architecture/SM_AssetPlatform.uasset b/Content/StarterContent/Architecture/SM_AssetPlatform.uasset index 91af545..184b41e 100644 Binary files a/Content/StarterContent/Architecture/SM_AssetPlatform.uasset and b/Content/StarterContent/Architecture/SM_AssetPlatform.uasset differ diff --git a/Content/StarterContent/Props/SM_Stairs.uasset b/Content/StarterContent/Props/SM_Stairs.uasset index 5a868ee..bc1cadd 100644 Binary files a/Content/StarterContent/Props/SM_Stairs.uasset and b/Content/StarterContent/Props/SM_Stairs.uasset differ diff --git a/Content/Troopers/projectiles/BP_DefaultProjectile.uasset b/Content/Troopers/projectiles/BP_DefaultProjectile.uasset index 18875aa..9102bbc 100644 Binary files a/Content/Troopers/projectiles/BP_DefaultProjectile.uasset and b/Content/Troopers/projectiles/BP_DefaultProjectile.uasset differ diff --git a/Content/Troopers/projectiles/BP_Explosion.uasset b/Content/Troopers/projectiles/BP_Explosion.uasset new file mode 100644 index 0000000..cc37fc1 Binary files /dev/null and b/Content/Troopers/projectiles/BP_Explosion.uasset differ diff --git a/Content/Troopers/projectiles/BP_Fireball.uasset b/Content/Troopers/projectiles/BP_Fireball.uasset index 3a5feb6..ef19298 100644 Binary files a/Content/Troopers/projectiles/BP_Fireball.uasset and b/Content/Troopers/projectiles/BP_Fireball.uasset differ diff --git a/Content/Troopers/projectiles/BP_MyExplosion.uasset b/Content/Troopers/projectiles/BP_MyExplosion.uasset index 06ea15c..ae43b41 100644 Binary files a/Content/Troopers/projectiles/BP_MyExplosion.uasset and b/Content/Troopers/projectiles/BP_MyExplosion.uasset differ diff --git a/Content/Troopers/projectiles/MyMyExplosion.uasset b/Content/Troopers/projectiles/MyMyExplosion.uasset deleted file mode 100644 index 52cfe7a..0000000 Binary files a/Content/Troopers/projectiles/MyMyExplosion.uasset and /dev/null differ diff --git a/Source/TurnBasedTutorial/BattleMode/BattleGameMode.cpp b/Source/TurnBasedTutorial/BattleMode/BattleGameMode.cpp index 016aff9..fa50582 100644 --- a/Source/TurnBasedTutorial/BattleMode/BattleGameMode.cpp +++ b/Source/TurnBasedTutorial/BattleMode/BattleGameMode.cpp @@ -19,6 +19,7 @@ ABattleGameMode::ABattleGameMode() void ABattleGameMode::BeginPlay() { Super::BeginPlay(); + // UGameplayStatics::PlaySound2D(GetWorld(), BackgroundSound); } auto ABattleGameMode::GetMyGameState() const { @@ -137,6 +138,8 @@ void ABattleGameMode::PostLogin(APlayerController *NewPlayer) { // 0-indexation Cast(NewPlayer)->SetPlayerIndex( CurrentNumberOfPlayers - 1); + Cast(NewPlayer)-> + StartPlayingMusic(BackgroundSound); UE_LOG(LogTemp, Warning, TEXT("%d"), CurrentNumberOfPlayers); if (CurrentNumberOfPlayers == 2) { UE_LOG(LogTemp, Warning, TEXT("Game Start")); diff --git a/Source/TurnBasedTutorial/BattleMode/BattleGameMode.h b/Source/TurnBasedTutorial/BattleMode/BattleGameMode.h index c411706..c19e163 100644 --- a/Source/TurnBasedTutorial/BattleMode/BattleGameMode.h +++ b/Source/TurnBasedTutorial/BattleMode/BattleGameMode.h @@ -27,6 +27,9 @@ public: // void CycleTurns(); protected: + UPROPERTY(BlueprintReadWrite, EditAnywhere) + USoundBase *BackgroundSound; + UPROPERTY() TArray LoadedBpAssets; diff --git a/Source/TurnBasedTutorial/BattleMode/BattlePlayerController.cpp b/Source/TurnBasedTutorial/BattleMode/BattlePlayerController.cpp index aa67c9f..25857d9 100644 --- a/Source/TurnBasedTutorial/BattleMode/BattlePlayerController.cpp +++ b/Source/TurnBasedTutorial/BattleMode/BattlePlayerController.cpp @@ -147,6 +147,11 @@ uint8 ABattlePlayerController::GetPlayerIndex() const { return PlayerIndex; } +void ABattlePlayerController::StartPlayingMusic_Implementation( + USoundBase *BackgroundSound) const { + UGameplayStatics::PlaySound2D(GetWorld(), BackgroundSound); +} + // float AMyPlayerController::SetCurrentActionAndReturnRadius(int action) { // return GetMyPlayerState()->SetCurrentActionAndReturnRadius(action); // diff --git a/Source/TurnBasedTutorial/BattleMode/BattlePlayerController.h b/Source/TurnBasedTutorial/BattleMode/BattlePlayerController.h index c5e090d..e0ac385 100644 --- a/Source/TurnBasedTutorial/BattleMode/BattlePlayerController.h +++ b/Source/TurnBasedTutorial/BattleMode/BattlePlayerController.h @@ -50,6 +50,9 @@ public: // UFUNCTION(Client, Reliable) // void SetEnemySelection(const TArray &Troopers) const; + UFUNCTION(Client, Reliable) + void StartPlayingMusic(USoundBase *BackgroundSound) const; + private: UPROPERTY(EditAnywhere) TSubclassOf WidgetClass; diff --git a/Source/TurnBasedTutorial/BattleMode/BattlePlayerState.cpp b/Source/TurnBasedTutorial/BattleMode/BattlePlayerState.cpp index 6c0928c..93fcfaa 100644 --- a/Source/TurnBasedTutorial/BattleMode/BattlePlayerState.cpp +++ b/Source/TurnBasedTutorial/BattleMode/BattlePlayerState.cpp @@ -61,7 +61,7 @@ void ABattlePlayerState::SetEnemySelection_Implementation( } void ABattlePlayerState::MoveTrooper_Implementation(ATrooper *Trooper, - FVector Location) { + FVector Location) { Location.Z = 0.0f; if (Trooper->CheckMoveCorrectness(Location)) { Trooper->MoveTrooper(Location); @@ -87,8 +87,8 @@ void ABattlePlayerState::MoveTrooper_Implementation(ATrooper *Trooper, // } void ABattlePlayerState::Attack_Implementation(ATrooper *Attacker, - FVector Location, - int ActionIndex) { + FVector Location, + int ActionIndex) { if (Attacker->CheckAttackCorrectness(Location, ActionIndex)) { Attacker->Attack(ActionIndex, Location); // for (const auto Trooper : Troopers) { @@ -156,8 +156,9 @@ void ABattlePlayerState::OnPlayerAction(const FHitResult &HitResult) { return; } - if (NewlySelectedTrooper == nullptr || !NewlySelectedTrooper-> - IsValidLowLevel() || NewlySelectedTrooper->GetPlayerIndex() != + if (HitResult.GetActor()->ActorHasTag(FName("Floor")) || + NewlySelectedTrooper != nullptr && + NewlySelectedTrooper->GetPlayerIndex() != PlayerIndex) { if (SelectedTrooper != nullptr && SelectedTrooper-> IsValidLowLevel()) { diff --git a/Source/TurnBasedTutorial/BattleMode/Singleplayer/SinglePlayerGM.cpp b/Source/TurnBasedTutorial/BattleMode/Singleplayer/SinglePlayerGM.cpp index 64d327a..0a8af20 100644 --- a/Source/TurnBasedTutorial/BattleMode/Singleplayer/SinglePlayerGM.cpp +++ b/Source/TurnBasedTutorial/BattleMode/Singleplayer/SinglePlayerGM.cpp @@ -2,6 +2,7 @@ #include "SinglePlayerGM.h" #include "SinglePlayerGS.h" +#include "TurnBasedTutorial/BattleMode/BattlePlayerController.h" ASinglePlayerGM::ASinglePlayerGM() : Super() { @@ -18,4 +19,6 @@ void ASinglePlayerGM::BeginPlay() { void ASinglePlayerGM::PostLogin(APlayerController *NewPlayer) { AGameMode::PostLogin(NewPlayer); + Cast(NewPlayer)-> + StartPlayingMusic(BackgroundSound); } diff --git a/TurnBased.uproject b/TurnBased.uproject index 8485d6b..fd638db 100644 --- a/TurnBased.uproject +++ b/TurnBased.uproject @@ -1,6 +1,6 @@ { "FileVersion": 3, - "EngineAssociation": "4.27", + "EngineAssociation": "{B4FE6467-4579-3D84-B22A-558A3D607596}", "Category": "", "Description": "", "Modules": [