namespace ProjectI.Enemies { // Immutable launch snapshot. Cooldowns, targets and projectiles belong to actors. public readonly struct EnemyAttackTuning { public readonly float Damage, Cooldown, Speed, Turn, TrackingDuration, StopDistance; public readonly bool FullFlightTracking, Tracer; public readonly EnemyProjectileWaveSettings Wave; public EnemyAttackTuning(BoltAttackDefinition bolt, bool tracer, bool normalBolt = true) { var attack = bolt; normalBolt &= tracer && bolt != null; Damage = attack != null ? attack.damage * (normalBolt ? bolt.normalBoltDamageScale : 1) : 0; Cooldown = attack != null ? attack.attackCooldown * (normalBolt ? bolt.normalBoltCooldownScale : 1) : 0; Speed = bolt != null ? bolt.projectileSpeed * (normalBolt ? bolt.normalBoltSpeedScale : 1) : 0; Turn = bolt != null ? bolt.projectileTurnDegrees * (normalBolt ? bolt.normalBoltTurnScale : 1) : 0; TrackingDuration = bolt != null ? bolt.projectileTrackingDuration : 0; StopDistance = bolt != null ? bolt.trackingStopDistance : 0; FullFlightTracking = normalBolt && bolt.normalBoltFullFlightTracking; Tracer = tracer && bolt != null; Wave = Tracer ? new EnemyProjectileWaveSettings(bolt.projectileWaveAmplitudeDegrees, bolt.projectileWaveFrequencyHz, bolt.projectileJitterAmplitudeDegrees, bolt.projectileJitterFrequencyHz) : default; } } }