Guest User

PWNWeapon_Melee.h

a guest
Mar 11th, 2015
183
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. #pragma once
  4.  
  5. #include "PWNWeapon.h"
  6. #include "PWNDamageType_Melee.h"
  7. #include "PWNWeapon_Melee.generated.h"
  8.  
  9. USTRUCT()
  10. struct FTraceLocation
  11. {
  12.     GENERATED_USTRUCT_BODY()
  13.  
  14.     UPROPERTY()
  15.     FVector LocFrom;
  16.  
  17.     UPROPERTY()
  18.     FVector LocTo;     
  19.     float AnimPos;
  20.    
  21. };
  22.  
  23. /**
  24. *
  25. */
  26. UCLASS()
  27. class APWNWeapon_Melee : public APWNWeapon
  28. {
  29.     GENERATED_UCLASS_BODY()
  30.  
  31.     void Tick(float DeltaTime) override;
  32.     void AttackStart(const TEnumAsByte<EMovementDirectionEnum::EMovementDirection> attackDirection = EMovementDirectionEnum::MOVEMENTDIRECTION_NoDirection) override;
  33.     void AttackStop() override;
  34.  
  35.     /*********************/
  36.     /*** Serialisation ***/
  37.     /*********************/
  38.     UPWNSerialiser* Serialise();
  39.     void DeSerialise(UPWNSerialiser* mySavedData);
  40.     /*********************/
  41.  
  42. protected:
  43.     void UpdateAttackDirectionAnimset() override;
  44.     void SetAssetReferences_Specific() override;
  45.     void SpawnAssets_Specific() override;
  46.     void SetAssets_Specific() override;
  47.    
  48.     void ArmState_PreAttacking_Start(float const startPosPct = 0.0f) override;
  49.     void ArmState_Attacking_Start(float const startPosPct = 0.0f) override;
  50.     void ArmState_PostAttacking_Start(float const startPosPct = 0.0f) override;
  51.     void ArmState_AttackReturning_Start(float const startPosPct = 0.0f) override;
  52.     void ArmState_AttackRebounding_Start(float const startPosPct = 0.0f) override;
  53.  
  54.     // Tracing
  55.     int NumTracesDone; // Debug
  56.     bool IsAttackTracing;
  57.     FCollisionQueryParams TraceSweepParameters;
  58.     FCollisionObjectQueryParams TraceSweepQueryPararameters;   
  59.     FPointDamageEvent DamageEvent;
  60.     FTraceLocation TraceLocCurr;
  61.     FTraceLocation TraceLocPrev;
  62.     FMontageDetails TraceMontageCurrDetails;
  63.     FMontageDetails TraceMontagePrevDetails;
  64.  
  65.     TArray<FTraceLocation> GetSubTraceLocsOrthogonal(FTraceLocation prevLoc, FTraceLocation currLoc, uint32 numIntermTraces);
  66.     TArray<FTraceLocation> GetSubTraceLocsParallel(FTraceLocation prevLoc, FTraceLocation currLoc, uint32 numIntermTraces);
  67.     void TraceAttack();
  68.     float AttackTraceSweepRadius;
  69.     FTraceLocation GetTraceLocation();
  70.     void ProcessAttackTick(float prevAnimPosition, float currAnimPosition);
  71.     TArray<FString> ActorsHitInThisStrike;
  72.     void CleanupAfterStrike();
  73.  
  74.     // Tracing
  75.     UPROPERTY()
  76.     FName TraceSocketNameBase;
  77.     UPROPERTY()
  78.     FName TraceSocketNameTip;
  79.     TArray<FTraceLocation> TraceLocs;
  80.     bool CheckIfActorHasBeenHit(AActor* hitActor);
  81.  
  82.     // Directional Attacks
  83.     // Refs
  84.     UPROPERTY()
  85.     FString ConstRef_ArmAnimSet_Attacking_Left_NoDirection_BP;
  86.     UPROPERTY()
  87.     FString ConstRef_ArmAnimSet_Attacking_Left_ForwardCenter_BP;
  88.     UPROPERTY()
  89.     FString ConstRef_ArmAnimSet_Attacking_Left_ForwardRight_BP;
  90.     UPROPERTY()
  91.     FString ConstRef_ArmAnimSet_Attacking_Left_CenterRight_BP;
  92.     UPROPERTY()
  93.     FString ConstRef_ArmAnimSet_Attacking_Left_BackRight_BP;
  94.     UPROPERTY()
  95.     FString ConstRef_ArmAnimSet_Attacking_Left_BackCenter_BP;
  96.     UPROPERTY()
  97.     FString ConstRef_ArmAnimSet_Attacking_Left_BackLeft_BP;
  98.     UPROPERTY()
  99.     FString ConstRef_ArmAnimSet_Attacking_Left_CenterLeft_BP;
  100.     UPROPERTY()
  101.     FString ConstRef_ArmAnimSet_Attacking_Left_ForwardLeft_BP;
  102.  
  103.     UPROPERTY()
  104.     FString ConstRef_ArmAnimSet_Attacking_Right_NoDirection_BP;
  105.     UPROPERTY()                              
  106.     FString ConstRef_ArmAnimSet_Attacking_Right_ForwardCenter_BP;
  107.     UPROPERTY()                              
  108.     FString ConstRef_ArmAnimSet_Attacking_Right_ForwardRight_BP;
  109.     UPROPERTY()                              
  110.     FString ConstRef_ArmAnimSet_Attacking_Right_CenterRight_BP;
  111.     UPROPERTY()                              
  112.     FString ConstRef_ArmAnimSet_Attacking_Right_BackRight_BP;
  113.     UPROPERTY()                              
  114.     FString ConstRef_ArmAnimSet_Attacking_Right_BackCenter_BP;
  115.     UPROPERTY()                              
  116.     FString ConstRef_ArmAnimSet_Attacking_Right_BackLeft_BP;
  117.     UPROPERTY()                              
  118.     FString ConstRef_ArmAnimSet_Attacking_Right_CenterLeft_BP;
  119.     UPROPERTY()                              
  120.     FString ConstRef_ArmAnimSet_Attacking_Right_ForwardLeft_BP;
  121.    
  122.     // Animsets
  123.     UPROPERTY()
  124.     APWNAnimSet_Attacking* ArmAnimSet_Attacking_NoDirection;
  125.     UPROPERTY()
  126.     APWNAnimSet_Attacking* ArmAnimSet_Attacking_ForwardCenter;
  127.     UPROPERTY()
  128.     APWNAnimSet_Attacking* ArmAnimSet_Attacking_ForwardRight;
  129.     UPROPERTY()
  130.     APWNAnimSet_Attacking* ArmAnimSet_Attacking_CenterRight;
  131.     UPROPERTY()
  132.     APWNAnimSet_Attacking* ArmAnimSet_Attacking_BackRight;
  133.     UPROPERTY()
  134.     APWNAnimSet_Attacking* ArmAnimSet_Attacking_BackCenter;
  135.     UPROPERTY()
  136.     APWNAnimSet_Attacking* ArmAnimSet_Attacking_BackLeft;
  137.     UPROPERTY()
  138.     APWNAnimSet_Attacking* ArmAnimSet_Attacking_CenterLeft;
  139.     UPROPERTY()
  140.     APWNAnimSet_Attacking* ArmAnimSet_Attacking_ForwardLeft;
  141. };
RAW Paste Data