made all jammable objects have the same duration for the jamming effect and the jamming sound, except for Infantry which have a longer sound time

This commit is contained in:
FateJH 2019-12-30 09:35:26 -05:00
parent 6c76997675
commit 9c0738e864
2 changed files with 7 additions and 33 deletions

View file

@ -128,7 +128,7 @@ trait JammableBehavior {
val radius = cause.projectile.profile.DamageRadius
JammingUnit.FindJammerDuration(cause.projectile.profile, obj) match {
case Some(dur) if Vector3.DistanceSquared(cause.hit_pos, cause.target.Position) < radius * radius =>
StartJammeredSound(obj)
StartJammeredSound(obj, dur)
StartJammeredStatus(obj, dur)
case _ => ;
}
@ -148,7 +148,7 @@ trait JammableBehavior {
jammedSound = true
import scala.concurrent.ExecutionContext.Implicits.global
jammeredSoundTimer.cancel
jammeredSoundTimer = context.system.scheduler.scheduleOnce(30 seconds, self, JammableUnit.ClearJammeredSound())
jammeredSoundTimer = context.system.scheduler.scheduleOnce(dur seconds, self, JammableUnit.ClearJammeredSound())
}
}