| 50 | } |
| 51 | |
| 52 | float AEnemy::TakeDamage(float DamageAmount, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser) |
| 53 | { |
| 54 | HandleDamage(DamageAmount); |
| 55 | CombatTarget = EventInstigator->GetPawn(); |
| 56 | |
| 57 | if (IsInsideAttackRadius()) |
| 58 | { |
| 59 | EnemyState = EEnemyState::EES_Attacking; |
| 60 | } |
| 61 | else if (IsOutsideAttackRadius()) |
| 62 | { |
| 63 | ChaseTarget(); |
| 64 | } |
| 65 | |
| 66 | return DamageAmount; |
| 67 | } |
| 68 | |
| 69 | void AEnemy::Destroyed() |
| 70 | { |
nothing calls this directly
no outgoing calls
no test coverage detected