Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Modify based on game rules.
- AShooterGameMode* const Game = GetWorld()->GetAuthGameMode<AShooterGameMode>();
- Damage = Game ? Game->ModifyDamage(Damage, this, DamageEvent, EventInstigator, DamageCauser) : 0.f;
- const float ActualDamage = Super::TakeDamage(Damage, DamageEvent, EventInstigator, DamageCauser);
- if (ActualDamage > 0.f)
- {
- ActualDamage * Defense -= ActualDamage;
- Health -= ActualDamage; // damagecalc
- if (Health <= 0)
- {
- Die(ActualDamage, DamageEvent, EventInstigator, DamageCauser);
- }
- else
- {
- PlayHit(ActualDamage, DamageEvent, EventInstigator ? EventInstigator->GetPawn() : NULL, DamageCauser);
- }
- MakeNoise(1.0f, EventInstigator ? EventInstigator->GetPawn() : this);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement