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; } } }
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); } }
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; } } } }
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); } } }
protected virtual void UpdateSounds() { if (body.IsGrounded && Vector3.DistanceSquared(lastPos, body.Position) > footstepThreshold) { lastPos = body.Position; Sound2D sound = new Sound3D("Footstep", body.Position); } }