Exemplo n.º 1
0
 public override void OnInteract()
 {
     base.OnInteract();
     PlayerScreen playerScreen = PlayerScreen.GetInst();
     if (playerScreen.HasFuel)
     {
         if (trex == null)
         {
             new Sound3D("PlaneEngine", scene.FindEntity("Plane").Transformation.GetPosition());
             playerScreen.AddJournalEntry("It won't start. Search outside for a tool.");
             playerScreen.RemoveMarker(scene.FindEntity("Plane").Transformation);
             trex = (AnimatedModel)scene.FindEntity("TRex");
             trex.SetVisible(true);
             trex.Model.GetAnimationLayer().SetActiveAnimation("TRexIdle", false);
             trexSound = new Sound3D("TRexIdle", trex.Transformation.GetPosition());
             trexSound.Looped = true;
             //cameraLerpTime = -0.25f;
         }
     }
     else
     {
         playerScreen.AddJournalEntry("It's out of fuel. If only there were a gas station here.");
         if (!playerScreen.HasAlertedGasStation)
         {
             playerScreen.RemoveMarker(scene.FindEntity("Plane").Transformation);
             playerScreen.AddMarker(scene.FindEntity("GasStation").Transformation);
             playerScreen.HasAlertedGasStation = true;
         }
     }
 }
Exemplo n.º 2
0
 public override void OnInteract()
 {
     base.OnInteract();
     PlayerScreen playerScreen = PlayerScreen.GetInst();
     if (!hasStarted)
     {
         if (playerScreen.ActivatedPower)
         {
             playerScreen.AddJournalEntry("Wait for the tank to fill");
             hasStarted = true;
             fillSound = new Sound3D("GasFill", parent.Transformation.GetPosition());
             fillSound.Looped = true;
             if (playerScreen.HasAlertedGasStation)
                 playerScreen.RemoveMarker(parent.GetScene().FindEntity("GasStation").Transformation);
         }
         else
         {
             playerScreen.AddJournalEntry("Turn on the power first");
         }
     }
     if (hasStarted && fuelTime <= 0.0f)
     {
         playerScreen.FuelCount += 1;
         if (playerScreen.FuelCount < PlayerScreen.RequiredFuelCount)
         {
             string journalStatus = "Picked up fuel (" + playerScreen.FuelCount + "/" + PlayerScreen.RequiredFuelCount + ")";
             playerScreen.AddJournalEntry(journalStatus);
         }
         else
         {
             playerScreen.HasFuel = true;
             playerScreen.AddJournalEntry("Proceed to the Hangar");
             playerScreen.AddMarker(parent.GetScene().FindEntity("Plane").Transformation);
         }
         playerScreen.HasFuel = true;
         InteractObject door = (InteractObject)this.parent.GetScene().FindEntity("HangarDoor");
         HangarDoorNode doorNode = (HangarDoorNode)door.GetInteractNode();
         doorNode.SetLocked(true);
         this.parent.GetScene().RemoveEntity(parent);
     }
 }
Exemplo n.º 3
0
 public override void OnUpdate()
 {
     base.OnUpdate();
     if (hasStarted)
     {
         fuelTime -= Time.GameTime.ElapsedTime;
         if (fuelTime <= 0.0f)
         {
             fuelTime = 0.0f;
             if (fillSound != null)
             {
                 fillSound.Paused = true;
                 new Sound3D("GasFinish", parent.Transformation.GetPosition());
                 fillSound = null;
             }
         }
     }
 }
Exemplo n.º 4
0
 public override void OnInteract()
 {
     PlayerScreen playerScreen = PlayerScreen.GetInst();
     if (isLocked)
     {
         playerScreen.AddJournalEntry("It's jammed. Try another entrance.");
         new Sound3D("MetalDoorLocked", this.oldPos);
     }
     else
     {
         if (playerScreen.ActivatedPower)
         {
             Sound3D sound = new Sound3D("ElectricDoorOpen", this.oldPos);
             OPEN_DOOR_TIME = sound.PlayLength;
             OpenDoor();
         }
         else
         {
             playerScreen.AddJournalEntry("It's locked. Turn on the power first.");
             new Sound3D("MetalDoorLocked", this.oldPos);
         }
     }
 }
Exemplo n.º 5
0
        protected virtual void UpdateSounds()
        {
            if (body.IsGrounded && Vector3.DistanceSquared(lastPos, body.Position) > footstepThreshold)
            {
                lastPos = body.Position;
                Sound2D sound = new Sound3D("Footstep", body.Position);

            }
        }