Example #1
0
 public override void use()
 {
     playSound(launch, true, false);
     playSound3d(moveSound, true, false);
     z         = origTarget.z;
     direction = Degrees.GetDegreesBetween(x, y, origTarget.x, origTarget.y);
 }
        public void call()
        {
            showInList = true;
            isCalling  = true;
            z          = Mission.player.z;
            direction  = Degrees.GetDegreesBetween(x, y, Mission.player.x, Mission.player.y);
            int minutes = (int)(Degrees.getDistanceBetween(x, y,
                                                           Mission.player.x, Mission.player.y)
                                /
                                speed  //this gives total hours
                                *
                                60.0); //convert to minutes

            if (minutes <= 1)
            {
                playMessage(DSound.SoundPath + "\\rf0.wav");
            }
            else if (minutes >= 2 && minutes <= 9)
            {
                playMessage(DSound.SoundPath + String.Format("\\rf{0}.wav", minutes));
            }
            else
            {
                SelfVoice.NLS("#" + minutes + "&mius.wav", true, true);                 //playMessage(DSound.SoundPath + "\\rf10.wav");
            }
        }
 public void processRoute()
 {
     if (currentNode().target)
     {
         direction = Degrees.GetDegreesBetween(x, y, currentNode().x, currentNode().y);
     }
 }
Example #4
0
        public override void onTick()
        {
            if (isFinished())
            {
                fireDisposeEvent();
                return;
            }
            if (finished && performing)
            {
                //The weapon is done doing what it needs to do, but a sound is still playing.
                //Do not free this weapon until the sound is done playing or the program will act up.
                if (hitSound != null)
                {
                    performing = DSound.isPlaying(hitSound);
                }
                return;
            }

            performing = true;
            if ((Math.Abs(Environment.TickCount - time)) / 1000 < 2)
            {
                return;
            }
            playSound3d(missileSound, false, true);
            if (!inVerticalRange(10))
            {
                if (z > origTarget.z)
                {
                    z -= 10;
                }
                if (z < origTarget.z)
                {
                    z += 10;
                }
                if (Math.Abs(z - origTarget.z) <= 10)
                {
                    z = origTarget.z;
                }
            }
            direction = Degrees.GetDegreesBetween(x, y, origTarget.x, origTarget.y);
            base.onTick();
            if (inFiringRange())
            {
                missileSound.stop();
                hitSound = target.loadSound(target.soundPath + "m3-" + Common.getRandom(1, 2) + ".wav");
                target.playSound(hitSound, true, false);
                // Since the boss aircraft has 10,000 damage, let's not let the player kill them with one cruise missile.
                // However, the missile should wipe out everything else it contacts.
                fireHitEvent(target, (target is JuliusAircraft)? 1500:100000);
                finished = true;
                return;
            }
            if (totalDistance > 30.0 || !Weapons.isValidLock(origTarget) || finished)
            {
                missileSound.stop();
                finished   = true;
                performing = (hitSound != null && DSound.isPlaying(hitSound)) || (expl != null && DSound.isPlaying(expl));
            }
        }
Example #5
0
 public override void use()
 {
     direction = Degrees.GetDegreesBetween(x, y, origTarget.x, origTarget.y);
     z         = origTarget.z;
     playSound(launchSound, true, false);
     if (!isAI)
     {
         DXInput.startFireEffect();
     }
 }
Example #6
0
        public override void onTick()
        {
            if (isFinished())
            {
                fireDisposeEvent();
                return;
            }
            if (finished && performing)
            {
                //The weapon is done doing what it needs to do, but a sound is still playing.
                //Do not free this weapon until the sound is done playing or the program will act up.
                if (hitSound != null)
                {
                    performing = DSound.isPlaying(hitSound);
                }
                return;
            }

            performing = true;
            playSound3d(missileSound, false, true);
            if (!inVerticalRange(10))
            {
                if (z > origTarget.z)
                {
                    z -= 10;
                }
                if (z < origTarget.z)
                {
                    z += 10;
                }
                if (Math.Abs(z - origTarget.z) <= 10)
                {
                    z = origTarget.z;
                }
            }
            direction = Degrees.GetDegreesBetween(x, y, origTarget.x, origTarget.y);
            base.onTick();
            if (inFiringRange())
            {
                missileSound.stop();
                hitSound = target.loadSound(target.soundPath + "m3-" + Common.getRandom(1, 2) + ".wav");
                target.playSound(hitSound, true, false);
                target.hit(target.damage, Interaction.Cause.destroyedByWeapon);
                fireHitEvent(target, target.damage);
                finished = true;
                return;
            }
            if (totalDistance > 30.0 || !Weapons.isValidLock(origTarget) || finished)
            {
                missileSound.stop();
                finished   = true;
                performing = false;
            }
        }
 public void uncall()
 {
     showInList   = false;
     direction    = Degrees.GetDegreesBetween(x, y, sx, sy);
     isCalling    = false;
     isConnecting = false;
     time         = 0;
     neutralizeSpeed(1500.0);
     if (message != null && DSound.isPlaying(message))
     {
         message.Stop();
     }
 }
Example #8
0
 public override void use()
 {
     direction = Degrees.GetDegreesBetween(x, y, origTarget.x, origTarget.y);
     z         = origTarget.z;
     time      = Environment.TickCount;
     playSound(launchSound, true, false);
     if (isAI)
     {
         if (origTarget is Aircraft)
         {
             ((Aircraft)origTarget).notifyOf(Notifications.missileLaunch, true);
         }
         return;
     }
     DXInput.startCruiseMissileEffect();
     fox = loadSound(soundPath + "fox3.wav");
     playSound(fox, true, false);
 }
        public override void move()
        {
            if (firstLoad)
            {
                playSound(moveSound, true, true);
                firstLoad = false;
            }
            performDeaths();
            if (readyToTerminate())
            {
                if (moveSound != null)
                {
                    moveSound.Stop();
                }
                isProjectorStopped = true;
                return;
            }
            if (!isRequestedTerminated)
            {
                base.move();
                playSound(moveSound, false, true);
                base.updateTotalDistance();

                if (isCalling)
                {
                    z = Mission.player.z;
                    if (!isConnecting)
                    {
                        direction = Degrees.GetDegreesBetween(x, y, Mission.player.x, Mission.player.y);
                    }
                    if (isConnecting)
                    {
                        useFuel();
                    }
                }                 //if calling
                else              //not calling
                {
                    direction = Degrees.GetDegreesBetween(x, y, sx, sy);
                }
            }
        }
        public void call()
        {
            showInList = true;
            isCalling  = true;
            z          = Mission.player.z;
            direction  = Degrees.GetDegreesBetween(x, y, Mission.player.x, Mission.player.y);
            int minutes = (int)(Degrees.getDistanceBetween(x, y, Mission.player.x, Mission.player.y) / speed * 60);             // We need the minutes instead of hours here.

            if (minutes <= 1)
            {
                playMessage(DSound.SoundPath + "\\rf0.wav");
            }
            else if (minutes >= 2 && minutes <= 9)
            {
                playMessage($"{DSound.SoundPath}\\rf{minutes}.wav");
            }
            else
            {
                SelfVoice.NLS("#" + minutes + "&mius.wav", true, true);                 //playMessage(DSound.SoundPath + "\\rf10.wav");
            }
        }