コード例 #1
0
ファイル: Hero.cs プロジェクト: foolmoron/Retroverse
        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);
        }
コード例 #2
0
ファイル: Hero.cs プロジェクト: foolmoron/Retroverse
        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);
        }