public void CreateBlockedExplosionEffect(BaseShotEvent evt, BlockedWeaponNode node) { HitExplosionGraphicsComponent hitExplosionGraphics = node.hitExplosionGraphics; WeaponBlockedComponent weaponBlocked = node.weaponBlocked; Vector3 position = weaponBlocked.BlockPoint - (evt.ShotDirection * hitExplosionGraphics.ExplosionOffset); if (hitExplosionGraphics.UseForBlockedWeapon) { this.DrawExplosionEffect(position, weaponBlocked.BlockNormal, hitExplosionGraphics.ExplosionAsset, hitExplosionGraphics.ExplosionDuration, node); } }
public void CreateExplosionOnEachTarget(HitEvent evt, WeaponNode weapon) { HitExplosionGraphicsComponent hitExplosionGraphics = weapon.hitExplosionGraphics; Vector3 fireDirectionWorld = new MuzzleVisualAccessor(weapon.muzzlePoint).GetFireDirectionWorld(); foreach (HitTarget target in evt.Targets) { ExplosionEvent eventInstance = new ExplosionEvent { ExplosionOffset = -fireDirectionWorld * hitExplosionGraphics.ExplosionOffset, HitDirection = target.HitDirection, Asset = hitExplosionGraphics.ExplosionAsset, Duration = hitExplosionGraphics.ExplosionDuration, Target = target }; base.ScheduleEvent(eventInstance, target.Entity); } if (evt.StaticHit != null) { Vector3 position = evt.StaticHit.Position - (fireDirectionWorld * hitExplosionGraphics.ExplosionOffset); this.DrawExplosionEffect(position, evt.StaticHit.Normal, hitExplosionGraphics.ExplosionAsset, hitExplosionGraphics.ExplosionDuration, weapon); } }