void ASBombActor::OnRep_Exploded() { if (bExploded) { SimulateExplosion(); } }
void ASBombActor::OnExplode() { if (bExploded) return; // Notify the clients to simulate the explosion bExploded = true; // Run on server side (OnExplode is executed on the server) too SimulateExplosion(); // Apply damage to player, enemies and environmental objects TArray<AActor*> IgnoreActors; UGameplayStatics::ApplyRadialDamage(this, ExplosionDamage, GetActorLocation(), ExplosionRadius, DamageType, IgnoreActors, this, nullptr); // TODO: Apply radial impulse to supporting objects }
void ASBombActor::OnExplode() { if (bExploded) { return; } bExploded = true; // Runs on all clients (NetMulticast) SimulateExplosion(); // Apply damage to player, enemies and environmental objects TArray<AActor*> IgnoreActors; UGameplayStatics::ApplyRadialDamage(this, ExplosionDamage, GetActorLocation(), ExplosionRadius, DamageType, IgnoreActors, this, nullptr); DrawDebugSphere(GetWorld(), GetActorLocation(), ExplosionRadius, 32, FColor::Red, false, 1.5f); }
void ASBombActor::OnExplode() { if (bExploded) return; // Notify the clients to simulate the explosion bExploded = true; // Run on server side SimulateExplosion(); // Apply damage to player, enemies and environmental objects TArray<AActor*> IgnoreActors; UGameplayStatics::ApplyRadialDamage(this, ExplosionDamage, GetActorLocation(), ExplosionRadius, DamageType, IgnoreActors, this, NULL); // TODO: Deal Damage to objects that support it // TODO: Apply radial impulse to supporting objects // TODO: Prepare to destroy self }