public bool attemptDie() { //On-death powerup activation if (HasPowerup("Retro")) { if (Powerups["Retro"] is RetroPort && History.CanRevert() && RetroGame.AvailableSand > 0) { Powerups["Retro"].Activate(InputAction.None); return(false); } } else if (HasPowerup("Health")) { if (Powerups["Health"] is FullHealthPickup) { Powerups["Health"].Activate(InputAction.None); return(false); } } SoundManager.PlaySoundOnce("PlayerDead", playInReverseDuringReverse: true); Alive = false; if (RetroGame.getMainLiveHero() == null) { RetroGame.GameOver(); return(true); } LevelManager levelManager = RetroGame.EscapeScreen.levelManager; levelManager.SetCameraMode(RetroGame.EscapeScreen.levelManager.CameraMode); return(true); }
public void revive(Vector2?atPosition = null) { Alive = true; health = REVIVE_HEALTH; LevelManager levelManager = RetroGame.EscapeScreen.levelManager; levelManager.SetCameraMode(RetroGame.EscapeScreen.levelManager.CameraMode); if (playerPrisoner != null) { levelManager.collectablesToRemove.Add(playerPrisoner); playerPrisoner = null; } if (atPosition != null) { position = atPosition.Value; } updateCurrentLevelAndTile(); flashWithColor(Color.Cyan.withAlpha(150), 2, 0.75f); }