diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index f2c8de09..698bc190 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -150,4 +150,5 @@ ManualIPAddress= +PropertyRedirects=(OldName="/Script/D1.MasterAI.MainWeaponCollisionComponent",NewName="/Script/D1.MasterAI.RightWeaponCollisionComponent") +PropertyRedirects=(OldName="/Script/D1.MasterAI.RightWeaponCollisionComponent",NewName="/Script/D1.MasterAI.MainCollisionComponent") +PropertyRedirects=(OldName="/Script/D1.MasterAI.LeftWeaponCollisionComponent",NewName="/Script/D1.MasterAI.SubCollisionComponent") ++PropertyRedirects=(OldName="/Script/D1.CombatPlayerCharacter.Weapon",NewName="/Script/D1.CombatPlayerCharacter.StartingEquipment") diff --git a/Content/CombatSystem/Blueprints/Actor/BP_ToughShield.uasset b/Content/CombatSystem/Blueprints/Actor/BP_ToughShield.uasset new file mode 100644 index 00000000..426af099 Binary files /dev/null and b/Content/CombatSystem/Blueprints/Actor/BP_ToughShield.uasset differ diff --git a/Content/CombatSystem/Blueprints/BP_CombatCharacter.uasset b/Content/CombatSystem/Blueprints/BP_CombatCharacter.uasset index 4d86f80a..a75b9999 100644 Binary files a/Content/CombatSystem/Blueprints/BP_CombatCharacter.uasset and b/Content/CombatSystem/Blueprints/BP_CombatCharacter.uasset differ diff --git a/Content/ParagonKwang/Animations/ABP_Kwang.uasset b/Content/ParagonKwang/Animations/ABP_Kwang.uasset index 5fbe0fd0..41805698 100644 Binary files a/Content/ParagonKwang/Animations/ABP_Kwang.uasset and b/Content/ParagonKwang/Animations/ABP_Kwang.uasset differ diff --git a/Content/ParagonKwang/Animations/Defense/BlockLoop1.uasset b/Content/ParagonKwang/Animations/Defense/BlockLoop1.uasset new file mode 100644 index 00000000..c7223ec5 Binary files /dev/null and b/Content/ParagonKwang/Animations/Defense/BlockLoop1.uasset differ diff --git a/Content/ParagonKwang/Animations/Defense/Deflect_InPlace_Anim1.uasset b/Content/ParagonKwang/Animations/Defense/Deflect_InPlace_Anim1.uasset new file mode 100644 index 00000000..758542b1 Binary files /dev/null and b/Content/ParagonKwang/Animations/Defense/Deflect_InPlace_Anim1.uasset differ diff --git a/Content/ParagonKwang/Characters/Heroes/Kwang/Meshes/Kwang_GDC.uasset b/Content/ParagonKwang/Characters/Heroes/Kwang/Meshes/Kwang_GDC.uasset index 64866ba6..7fc57cb2 100644 Binary files a/Content/ParagonKwang/Characters/Heroes/Kwang/Meshes/Kwang_GDC.uasset and b/Content/ParagonKwang/Characters/Heroes/Kwang/Meshes/Kwang_GDC.uasset differ diff --git a/Content/ParagonKwang/Characters/Heroes/Kwang/Meshes/Kwang_Skeleton.uasset b/Content/ParagonKwang/Characters/Heroes/Kwang/Meshes/Kwang_Skeleton.uasset index 20a138cf..825c085e 100644 Binary files a/Content/ParagonKwang/Characters/Heroes/Kwang/Meshes/Kwang_Skeleton.uasset and b/Content/ParagonKwang/Characters/Heroes/Kwang/Meshes/Kwang_Skeleton.uasset differ diff --git a/Source/D1/Actor/BaseShield.cpp b/Source/D1/Actor/BaseShield.cpp index 7414d334..9bd87cb6 100644 --- a/Source/D1/Actor/BaseShield.cpp +++ b/Source/D1/Actor/BaseShield.cpp @@ -3,3 +3,34 @@ #include "Actor/BaseShield.h" +#include "Components/CollisionComponent.h" +#include "Components/CombatComponent.h" +#include "GameFramework/Character.h" + +void ABaseShield::OnEquipped() +{ + SetIsEquipped(true); + AActor* owner = GetOwner(); + if (!owner) + return; + CombatComponent = owner->GetComponentByClass(); + CombatComponent->OnCombatToggled.BindUObject(this, &ABaseWeapon::ToggleWeaponCombat); + + OwnerStateManager = owner->GetComponentByClass(); + + if (CombatComponent->GetCombatEnabled()) + AttachActor(HandSocketName); + else + AttachActor(AttachSocketName); + + CombatComponent->SetShieldWeapon(this); + + CollisionComponent->SetCollisionMeshComponent(GetItemMesh()); + CollisionComponent->AddActorToIgnore(GetOwner()); +} + +void ABaseShield::OnUnequipped() +{ + Super::OnUnequipped(); + CombatComponent->SetShieldWeapon(nullptr); +} diff --git a/Source/D1/Actor/BaseShield.h b/Source/D1/Actor/BaseShield.h index 3895a216..f3e1a1e5 100644 --- a/Source/D1/Actor/BaseShield.h +++ b/Source/D1/Actor/BaseShield.h @@ -13,5 +13,8 @@ UCLASS() class D1_API ABaseShield : public ABaseWeapon { GENERATED_BODY() - + +public: + virtual void OnEquipped() override; + virtual void OnUnequipped() override; }; diff --git a/Source/D1/Actor/BaseWeapon.cpp b/Source/D1/Actor/BaseWeapon.cpp index 4839c578..eb02a955 100644 --- a/Source/D1/Actor/BaseWeapon.cpp +++ b/Source/D1/Actor/BaseWeapon.cpp @@ -55,7 +55,7 @@ void ABaseWeapon::OnEquipped() OwnerStateManager = owner->GetComponentByClass(); - if (CombatComponent->GetCombatEnabled()) + if (CombatComponent->GetCombatEnabled()) //TODO : 방패 착용 후 Toggle Event 시 Weapon의 소켓이 안바뀌는 버그 AttachActor(HandSocketName); else AttachActor(AttachSocketName); diff --git a/Source/D1/Actor/BaseWeapon.h b/Source/D1/Actor/BaseWeapon.h index 21510939..fe06cc17 100644 --- a/Source/D1/Actor/BaseWeapon.h +++ b/Source/D1/Actor/BaseWeapon.h @@ -24,7 +24,7 @@ public: public: //override - void OnEquipped() override; + virtual void OnEquipped() override; public: //Delegate diff --git a/Source/D1/Animation/CombatAnimInstance.cpp b/Source/D1/Animation/CombatAnimInstance.cpp index 40d96355..361031da 100644 --- a/Source/D1/Animation/CombatAnimInstance.cpp +++ b/Source/D1/Animation/CombatAnimInstance.cpp @@ -20,7 +20,10 @@ void UCombatAnimInstance::NativeInitializeAnimation() UCombatComponent* CombatComponent = Character->GetComponentByClass(); ensure(CombatComponent); if(IsValid(CombatComponent)) + { CombatComponent->OnCombatToggled.BindUObject(this, &UCombatAnimInstance::UpdateCombatEnabled); + CombatComponent->OnBlockingSet.BindUObject(this, &UCombatAnimInstance::OnBlockingSet_Event); + } } } @@ -51,3 +54,8 @@ void UCombatAnimInstance::UpdateCombatEnabled(bool combatEnabled) { CombatEnabled = combatEnabled; } + +void UCombatAnimInstance::OnBlockingSet_Event(bool bIsBlock) +{ + IsBlocking = bIsBlock; +} diff --git a/Source/D1/Animation/CombatAnimInstance.h b/Source/D1/Animation/CombatAnimInstance.h index c9ff66ed..d341e9f2 100644 --- a/Source/D1/Animation/CombatAnimInstance.h +++ b/Source/D1/Animation/CombatAnimInstance.h @@ -25,7 +25,8 @@ public: public: //Delegate void UpdateCombatEnabled(bool combatEnabled); - + void OnBlockingSet_Event(bool bIsBlock); + private: UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="References", meta=(AllowPrivateAccess="true")) TObjectPtr Character; @@ -47,4 +48,7 @@ private: ECombatType CombatType; UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true")) bool CombatEnabled; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true")) + bool IsBlocking; }; diff --git a/Source/D1/CombatPlayerCharacter.cpp b/Source/D1/CombatPlayerCharacter.cpp index 99f7fe80..96e45207 100644 --- a/Source/D1/CombatPlayerCharacter.cpp +++ b/Source/D1/CombatPlayerCharacter.cpp @@ -124,9 +124,12 @@ void ACombatPlayerCharacter::BeginPlay() FActorSpawnParameters spawnParam; spawnParam.Owner = this; spawnParam.Instigator = this; - ABaseEquippable* SpawnItem = Cast(GetWorld()->SpawnActor(Weapon, &GetActorTransform(), spawnParam)); - if (SpawnItem) - SpawnItem->OnEquipped(); + for (auto Equipment : StartingEquipment) + { + ABaseEquippable* SpawnItem = Cast(GetWorld()->SpawnActor(Equipment, &GetActorTransform(), spawnParam)); + if (SpawnItem) + SpawnItem->OnEquipped(); + } //Setting Timeline - if you set on Constructor, Can not get Curve FOnTimelineFloat TimelineFloatCallback; @@ -945,6 +948,8 @@ bool ACombatPlayerCharacter::CanPerformBlock() inputContainer.AddTag(FCombatGameplayTags::Get().Character_State_GeneralActionState); ReturnValue &= !StateManagerComponent->IsCurrentStateEqualToAny(inputContainer); + ReturnValue &= CombatComponent->GetCombatEnabled(); + ReturnValue &= IsValid(CombatComponent->GetShieldWeapon()); return ReturnValue; } diff --git a/Source/D1/CombatPlayerCharacter.h b/Source/D1/CombatPlayerCharacter.h index 3d7b111b..9356a433 100644 --- a/Source/D1/CombatPlayerCharacter.h +++ b/Source/D1/CombatPlayerCharacter.h @@ -203,9 +203,10 @@ public: TObjectPtr StatsComponent; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Components", meta=(AllowPrivateAccess="true")) TObjectPtr TargetingComponent; - - UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Weapon", meta = (AllowPrivateAccess = "true")) - TSubclassOf Weapon; + + //TODO : 방패 착용 후 Toggle Event 시 Weapon의 소켓이 안바뀌는 버그 + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Equipment", meta = (AllowPrivateAccess = "true")) + TArray> StartingEquipment; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hit", meta = (AllowPrivateAccess = "true")) FName PelvisBoneName; diff --git a/Source/D1/Components/CombatComponent.cpp b/Source/D1/Components/CombatComponent.cpp index f7b2285e..ce3d7243 100644 --- a/Source/D1/Components/CombatComponent.cpp +++ b/Source/D1/Components/CombatComponent.cpp @@ -57,7 +57,7 @@ void UCombatComponent::SetBlockingState(bool enableBlocking) if(enableBlocking != bIsBlocking) { bIsBlocking = enableBlocking; + OnBlockingSet.Execute(bIsBlocking); } - onBlockingSet.Execute(bIsBlocking); // TODO : 이거 맞나? } diff --git a/Source/D1/Components/CombatComponent.h b/Source/D1/Components/CombatComponent.h index 9e3b2e2b..7f6f884a 100644 --- a/Source/D1/Components/CombatComponent.h +++ b/Source/D1/Components/CombatComponent.h @@ -62,5 +62,5 @@ private: public: //Delegate FOnCombatToggled OnCombatToggled; - FOnBlockingSet onBlockingSet; + FOnBlockingSet OnBlockingSet; };