Commit 9e5a4a90 authored by Сигусов Виталий Алексеевич's avatar Сигусов Виталий Алексеевич
Browse files

added new features

parent 0d3e8c46
No related merge requests found
Showing with 94 additions and 11 deletions
+94 -11
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -10,7 +10,8 @@
"LoadingPhase": "Default",
"AdditionalDependencies": [
"Engine",
"AIModule"
"AIModule",
"UMG"
]
}
],
......
[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Game/ThirdPerson/Maps/ThirdPersonMap.ThirdPersonMap
EditorStartupMap=/Game/ThirdPerson/Maps/ThirdPersonMap.ThirdPersonMap
GlobalDefaultGameMode="/Script/AIStealthTask.AIStealthTaskGameMode"
GlobalDefaultGameMode=/Game/Blueprints/NewGameMode.NewGameMode_C
[/Script/Engine.RendererSettings]
r.ReflectionMethod=1
......@@ -72,6 +72,7 @@ ManualIPAddress=
[CoreRedirects]
+ClassRedirects=(OldName="/Script/AIStealthTask.AICharacter",NewName="/Script/AIStealthTask.STAICharacter")
+ClassRedirects=(OldName="/Script/AIStealthTask.HealthAmmountBTDecorator",NewName="/Script/AIStealthTask.HealthAmountBTDecorator")
+ClassRedirects=(OldName="/Script/AIStealthTask.FindSoundService",NewName="/Script/AIStealthTask.DealDamageService")
[/Script/Engine.PhysicsSettings]
PhysicErrorCorrection=(PingExtrapolation=0.100000,PingLimit=100.000000,ErrorPerLinearDifference=1.000000,ErrorPerAngularDifference=1.000000,MaxRestoredStateError=1.000000,MaxLinearHardSnapDistance=400.000000,PositionLerp=0.000000,AngleLerp=0.400000,LinearVelocityCoefficient=100.000000,AngularVelocityCoefficient=10.000000,ErrorAccumulationSeconds=0.500000,ErrorAccumulationDistanceSq=15.000000,ErrorAccumulationSimilarity=100.000000)
......
......@@ -70,6 +70,7 @@ bEnableLegacyInputScales=True
bEnableMotionControls=True
bFilterInputByPlatformUser=False
bShouldFlushPressedKeysOnViewportFocusLost=True
bEnableDynamicComponentInputBinding=True
bAlwaysShowTouchInterface=False
bShowConsoleOnFourFingerTap=True
bEnableGestureRecognizer=False
......@@ -78,6 +79,7 @@ DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown
DefaultViewportMouseLockMode=LockOnCapture
FOVScale=0.011110
DoubleClickTime=0.200000
+ActionMappings=(ActionName="Interact",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=E)
DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput
DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent
DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks
......
No preview for this file type
No preview for this file type
File added
File added
File added
No preview for this file type
File added
File added
No preview for this file type
File added
File added
File added
File added
......@@ -11,6 +11,7 @@ ABaseAICharacter::ABaseAICharacter()
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
WalkSoundComponent=CreateDefaultSubobject<UWalkSoundComponent>("WalkSoundComponent");
HealthComponent=CreateDefaultSubobject<UHealthComponent>("HealthComponent");
}
// Called when the game starts or when spawned
......
......@@ -23,7 +23,7 @@ ASTAICharacter::ASTAICharacter(const FObjectInitializer& ObjInit)
GetCharacterMovement()->MaxWalkSpeed = 500.f;
GetCharacterMovement()->MinAnalogWalkSpeed = 20.f;
GetCharacterMovement()->BrakingDecelerationWalking = 2000.f;
StateSignComponent=CreateDefaultSubobject<UAIStateSignComponent>("StateSignComponent");
}
void ASTAICharacter::Tick(float DeltaTime)
......
// Fill out your copyright notice in the Description page of Project Settings.
#include "AI/Services/DealDamageService.h"
#include "AIController.h"
#include "StealthTestAIPerceptionComponent.h"
#include "AIStealthTask/AIStealthTaskCharacter.h"
#include "BehaviorTree/BlackboardComponent.h"
#include "Engine/DamageEvents.h"
UDealDamageService::UDealDamageService()
{
}
void UDealDamageService::TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds)
{
if(const auto Blackboard=OwnerComp.GetBlackboardComponent())
{
const FVector TraceStart=OwnerComp.GetOwner()->GetActorLocation();
const FVector TraceEnd=Cast<AActor>(Blackboard->GetValueAsObject("EnemyActor"))->GetActorLocation();
if(FVector::Distance(TraceStart,TraceEnd)<300.0f){
FCollisionQueryParams CollisionParams;
CollisionParams.AddIgnoredActor(OwnerComp.GetOwner());
FHitResult HitResult;
GetWorld()->LineTraceSingleByChannel(HitResult,TraceStart,TraceEnd,ECollisionChannel::ECC_Visibility,CollisionParams);
DrawDebugLine(GetWorld(),TraceStart,TraceEnd,FColor::Red,false,3.0f,0,3.0f);
if(HitResult.bBlockingHit)
{
const auto Player=Cast<AAIStealthTaskCharacter>(HitResult.GetActor());
if(Player)
{
FPointDamageEvent PointDamageEvent;
Player->TakeDamage(25.0f,PointDamageEvent,Cast<AController>(OwnerComp.GetOwner()),OwnerComp.GetOwner());
}
}
}
}
Super::TickNode(OwnerComp, NodeMemory, DeltaSeconds);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment