Inheritance: UnrealBuildTool.ModuleRules
Esempio n. 1
0
    private void Start()
    {
        rb = GetComponent <Rigidbody2D>();
        nightmareScript   = FindObjectOfType <Nightmare>();
        levelLoaderScript = FindObjectOfType <LevelLoader>();

        audioSource = GetComponent <AudioSource>();
    }
 public void AddUpgradeToCharacter(bool isNightmare)
 {
     if (!isNightmare && Explorer != null)
     {
         Explorer.AddUpgrade();
     }
     else if (isNightmare && Nightmare != null)
     {
         Nightmare.AddUpgrade();
     }
 }
 public void AddPowerupToCharacter(bool explorer)
 {
     if (explorer && Explorer != null)
     {
         Explorer.AddRandomPowerup();
     }
     else if (!explorer && Nightmare != null)
     {
         Nightmare.AddRandomPowerup();
     }
 }
 private void HandleUpgrades()
 {
     if (Explorer != null)
     {
         upgradesText.text = "Upgrades: " + Explorer.GetUnmodifiedUpgrades();
     }
     else if (Nightmare != null)
     {
         upgradesText.text = "Upgrades: " + Nightmare.GetUnmodifiedUpgrades();
     }
 }
Esempio n. 5
0
 public static void Load()
 {
     if (Nightmare.IsRunning)
     {
         Nightmare.Unload();
     }
     if (!Nightmare.IsRunning)
     {
         Nightmare.Load();
     }
 }
        public override void CreateGame(Games gameMode)
        {
            switch (gameMode)
            {
            case Games.Classic:
                playerOneLevel = new Level(PlayerIndex.One);
                playerTwoLevel = new Level(PlayerIndex.Two);
                break;

            case Games.Tug:
                playerOneLevel = new Tug_Of_War(PlayerIndex.One);
                playerTwoLevel = new Tug_Of_War(PlayerIndex.Two);
                break;

            case Games.Line:
                playerOneLevel = new LineEmUp(PlayerIndex.One);
                playerTwoLevel = new LineEmUp(PlayerIndex.Two);
                break;

            case Games.Pick:
                playerOneLevel = new PicknDrop(PlayerIndex.One);
                playerTwoLevel = new PicknDrop(PlayerIndex.Two);
                break;

            case Games.Switch:
                playerOneLevel = new SwitcharooBuckaroo(PlayerIndex.One);
                playerTwoLevel = new SwitcharooBuckaroo(PlayerIndex.Two);
                break;

            case Games.Nightmare:
                playerOneLevel = new Nightmare(PlayerIndex.One);
                playerTwoLevel = new Nightmare(PlayerIndex.Two);
                break;

            default:
                Console.WriteLine("The gamemode " + gameMode + " isn't supported in local multiplayer.");
                overlordReference.ReturnToMenu();
                break;
            }

            playerOneController.SetLevelReference(playerOneLevel);
            playerOneController.SetGameMode(gameMode);
            playerOneLevel.gameClassReference = this;

            playerTwoController.SetLevelReference(playerTwoLevel);
            playerTwoController.SetGameMode(gameMode);
            playerTwoLevel.gameClassReference = this;
            gameState = GameState.InGame;

            base.CreateGame(gameMode);
        }
        public override void CreateGame(Games gameMode)
        {
            switch (gameMode)
            {
            case Games.OnlineClassic:
                player      = new Level(PlayerIndex.One);
                otherPlayer = new Level(PlayerIndex.Two);
                break;

            case Games.OnlineTug:
                player      = new Tug_Of_War(PlayerIndex.One);
                otherPlayer = new Tug_Of_War(PlayerIndex.Two);
                break;

            case Games.OnlineLine:
                player      = new LineEmUp(PlayerIndex.One);
                otherPlayer = new LineEmUp(PlayerIndex.Two);
                break;

            case Games.OnlinePick:
                player      = new PicknDrop(PlayerIndex.One);
                otherPlayer = new PicknDrop(PlayerIndex.Two);
                break;

            case Games.OnlineSwitch:
                player      = new SwitcharooBuckaroo(PlayerIndex.One);
                otherPlayer = new SwitcharooBuckaroo(PlayerIndex.Two);
                break;

            case Games.OnlineNightmare:
                player      = new Nightmare(PlayerIndex.One);
                otherPlayer = new Nightmare(PlayerIndex.Two);
                break;

            case Games.OnlineDoubleTrouble:
                player = new DoubleTrouble();
                break;

            default: Console.WriteLine("The gamemode " + gameMode + " isn't supported in online multiplayer.");
                break;
            }

            playerController.SetLevelReference(player);
            playerController.SetGameMode(gameMode);
            player.gameClassReference      = this;
            otherPlayer.gameClassReference = this;
            gameState = GameState.InGame;
        }
        IEnumerator EndingSequence(int winningTeam)
        {
            if (Nightmare != null)
            {
                Nightmare.ControlsFrozen = true;
                CameraFollowScript cameraScript = Nightmare.GetComponent <CameraFollowScript>();
                cameraScript.ZOffset /= 2f;
            }
            else if (Explorer != null)
            {
                Explorer.ControlsFrozen = true;
                CameraFollowScript cameraScript = Explorer.GetComponent <CameraFollowScript>();
                cameraScript.ZOffset /= 2f;
            }
            yield return(new WaitForSeconds(4f));

            EndTheGame(winningTeam);
        }
        private void HandleMirrors()
        {
            if (Mirrors == null || Mirrors.Count == 0)
            {
                return;
            }
            bool explorersActive  = false;
            bool nightmaresActive = false;

            foreach (MirrorBehavior mirror in Mirrors)
            {
                if (mirror.ExplorersActive())
                {
                    explorersActive = true;
                }
                if (mirror.NightmaresActive())
                {
                    nightmaresActive = true;
                }
            }
            int mirrorFadeRank = 0;

            if (Explorer != null)
            {
                mirrorFadeRank = Explorer.GetTalentRank(TalentEnum.MIRROR_FADE_DELAY);
            }
            else if (Nightmare != null)
            {
                mirrorFadeRank = Nightmare.GetTalentRank(TalentEnum.MIRROR_FADE_DELAY);
            }
            float mirrorFadeTime = 3.0f * mirrorFadeRank;

            if ((explorersActive && Explorer != null) || (nightmaresActive && Nightmare != null))
            {
                mirrorActivationTime    = Time.time;
                ShowMirrorNotifications = true;
            }
            else
            {
                ShowMirrorNotifications = Time.time - mirrorActivationTime < mirrorFadeTime;
            }
        }
Esempio n. 10
0
        private void SpawnEnemy(EntityData entityData, GameTime gameTime)
        {
            if (entityData.Type == EntityType.BOSS)
            {
                Boss boss = new Boss(spriteBatch, game, audioManager, gameTime, "boss" + enemySpawnCounter.ToString(), this);
                boss.position = entityData.Position;
                addEntity(boss);
                levelManager.stopBgScroll();
            }
            else if (entityData.Type == EntityType.NIGHTMARE)
            {
                Nightmare nightmare = new Nightmare(spriteBatch, game, audioManager, this, "nightmare" + enemySpawnCounter.ToString());
                nightmare.onDie += new Nightmare.PowerupReleaseHandle(ReleasePowerup);
                nightmare.position = entityData.Position;
                addEntity(nightmare);
            }
            else if (entityData.Type == EntityType.BLUE_BLOOD_VESSEL)
            {
                BlueBloodvessel bloodvessel = new BlueBloodvessel(spriteBatch, game, audioManager, this, "blue_bloodvessel" + enemySpawnCounter.ToString());
                bloodvessel.onDie += new BlueBloodvessel.PowerupReleaseHandle(ReleasePowerup);
                //bloodvessel.position = entityData.Position;
                addEntity(bloodvessel);
            }
            else if (entityData.Type == EntityType.RED_BLOOD_VESSEL)
            {
                RedBloodvessel bloodvessel = new RedBloodvessel(spriteBatch, game, audioManager, this, "red_bloodvessel" + enemySpawnCounter.ToString());
                //bloodvessel.onDie += new RedBloodvessel.PowerupReleaseHandle(ReleasePowerup);
                bloodvessel.position = entityData.Position;
                addEntity(bloodvessel);
            }
            else if (entityData.Type == EntityType.PURPLE_BLOOD_VESSEL)
            {
                PurpleBloodvessel bloodvessel = new PurpleBloodvessel(spriteBatch, game, audioManager, this, "purple_bloodvessel" + enemySpawnCounter.ToString());
                //bloodvessel.onDie += new PurpleBloodvessel.PowerupReleaseHandle(ReleasePowerup);
                bloodvessel.position = entityData.Position;
                addEntity(bloodvessel);
            }
            else if (entityData.Type == EntityType.DARK_THOUGHT)
            {
                DarkThought darkThought = new DarkThought(spriteBatch, game, audioManager, gameTime, "darkthought" + enemySpawnCounter.ToString(), this, entityData.PathFinding);
                darkThought.onDie += new DarkThought.PowerupReleaseHandle(ReleasePowerup);
                darkThought.position = entityData.Position;
                addEntity(darkThought);
            }
            else if (entityData.Type == EntityType.INNER_DEMON)
            {
                InnerDemon innerDemon = new InnerDemon(spriteBatch, game, audioManager, "inner_demon" + enemySpawnCounter.ToString(), this, entityData.PathFinding);
                innerDemon.onDie += new InnerDemon.PowerupReleaseHandle(ReleasePowerup);
                innerDemon.position = entityData.Position;
                addEntity(innerDemon);
            }
            else if (entityData.Type == EntityType.DARK_WHISPER)
            {
                DarkWhisper darkWhisper = new DarkWhisper(spriteBatch, game, audioManager, "dark_whisper" + enemySpawnCounter.ToString(), this, entityData.PathFinding);
                darkWhisper.onDie += new DarkWhisper.PowerupReleaseHandle(ReleasePowerup);
                darkWhisper.position = entityData.Position;
                addEntity(darkWhisper);
            }
            else if (entityData.Type == EntityType.WEAPON_POWERUP_SPREAD)
            {
                WeaponPowerupSpread wpnPowerupSpread = new WeaponPowerupSpread(spriteBatch, game, "wpnPowerupSpread" + enemySpawnCounter.ToString(), entityData.Position);
                addEntity(wpnPowerupSpread);
            }
            else if (entityData.Type == EntityType.WEAPON_POWERUP_RAPID)
            {
                WeaponPowerupRapid wpnPowerupRapid = new WeaponPowerupRapid(spriteBatch, game, "wpnPowerupRapid" + enemySpawnCounter.ToString(), entityData.Position);
                addEntity(wpnPowerupRapid);
            }
            else if (entityData.Type == EntityType.HEALTH_POWERUP)
            {
                HealthPowerup healthPowerup = new HealthPowerup(spriteBatch, game, "healthPowerup" + enemySpawnCounter.ToString(), entityData.Position);
                addEntity(healthPowerup);
            }

            enemySpawnCounter++;
        }
Esempio n. 11
0
        public void Update(GameTime gameTime)
        {
            if (!spawningPaused && !tutorial)
            {
                timer += (uint)gameTime.ElapsedGameTime.Milliseconds;
            }
            else if (!tutorial)
            {
                spawningPaused = !allEnemiesDead();
            }

            CheckSpawnQueue(gameTime);
            collisionManager.checkCollision();
            Vector2 tmpPlayerPosition = Vector2.Zero;

            for (int i = 0; i < entityList.Count; i++)
            {
                if (entityList[i].Type == EntityType.BOSS || entityList[i].Type == EntityType.NIGHTMARE || entityList[i].Type == EntityType.INNER_DEMON || entityList[i].Type == EntityType.LESSER_DEMON || entityList[i].Type == EntityType.DARK_WHISPER)
                {
                    if (player != null)
                    {
                        entityList[i].Target = player.position;
                    }
                }
                entityList[i].Update(gameTime);
                if (entityList[i].KillMe == true)
                {
                    killList.Add(entityList[i]);
                }
            }

            for (int i = 0; i < bulletList.Count; i++)
            {
                bulletList[i].Update(gameTime);
                if (bulletList[i].rangeExceded())
                {
                    bulletList.RemoveAt(i);
                }
            }

            if (killList.Count > 0)
            {
                RemoveEntity();
            }

            #region spawn_enemies_dev
            if(bool.Parse(game.config.getValue("Debug", "SpawnKeys")))
            {
                spawnEnemies.Update(gameTime);
                if (spawnEnemies.One == true)
                {
                    int count = EntityCount(EntityType.NIGHTMARE);
                    Nightmare nightmare = new Nightmare(spriteBatch, game, audioManager, this, "nightmare_spawned" + count.ToString());
                    nightmare.onDie += new Nightmare.PowerupReleaseHandle(ReleasePowerup);
                    nightmare.position.X = 0.0f;
                    float newY = random.Next(50, game.Window.ClientBounds.Bottom - 50);
                    nightmare.position.X = 0.0f;
                    nightmare.position.Y = newY;
                    while (addEntity(nightmare) == false)
                    {
                        count++;
                        nightmare.Alias = "nightmare" + count.ToString();
                    }
                }

                if (spawnEnemies.Two == true)
                {
                    int count = EntityCount(EntityType.BLUE_BLOOD_VESSEL);
                    BlueBloodvessel bloodvessel = new BlueBloodvessel(spriteBatch, game, audioManager, this, "bloodvessel_spawned" + count.ToString());
                    //bloodvessel.onDie += new BlueBloodvessel.PowerupReleaseHandle(ReleasePowerup);
                    bloodvessel.position.X = 0.0f;
                    float newY = random.Next(50, game.Window.ClientBounds.Bottom - 50);
                    bloodvessel.position.X = 0.0f;
                    bloodvessel.position.Y = newY;
                    while (addEntity(bloodvessel) == false)
                    {
                        count++;
                        bloodvessel.Alias = "bloodvessel" + count.ToString();
                    }

                }

                if (spawnEnemies.Three == true)
                {
                    int count = EntityCount(EntityType.DARK_THOUGHT);
                    Vector2 waypoint = new Vector2(100.0f, game.Window.ClientBounds.Center.Y);
                    Path waypoints = new Path(waypoint);
                    waypoint = new Vector2(200.0f, 200.0f);
                    waypoints.AddPath(waypoint);
                    waypoint = new Vector2(1000.0f, 600.0f);
                    waypoints.AddPath(waypoint);
                    DarkThought darkThought = new DarkThought(spriteBatch, game, audioManager, gameTime, "darkthought_spawned" + count.ToString(), this, waypoints);
                    darkThought.onDie += new DarkThought.PowerupReleaseHandle(ReleasePowerup);
                    darkThought.position.X = 100.0f;
                    darkThought.position.Y = 100.0f;
                    while (addEntity(darkThought) == false)
                    {
                        count++;
                        darkThought.Alias = "darkthought" + count.ToString();
                    }
                }

                if (spawnEnemies.Four == true)
                {
                    int count = EntityCount(EntityType.DARK_WHISPER);
                    DarkWhisper darkWhisper = new DarkWhisper(spriteBatch, game, audioManager, "dark_whisper_spawned" + count.ToString(), this, null);
                    darkWhisper.onDie += new DarkWhisper.PowerupReleaseHandle(ReleasePowerup);
                    darkWhisper.position.X = 200.0f;
                    darkWhisper.position.Y = 200.0f;
                    while (addEntity(darkWhisper) == false)
                    {
                        count++;
                        darkWhisper.Alias = "dark_whisper_spawned" + count.ToString();
                    }
                }

                if (spawnEnemies.Five == true)
                {
                    int count = EntityCount(EntityType.INNER_DEMON);
                    Vector2 waypoint = new Vector2(100.0f, game.Window.ClientBounds.Center.Y);
                    Path waypoints = new Path(waypoint);
                    waypoint = new Vector2(200.0f, 200.0f);
                    waypoints.AddPath(waypoint);
                    waypoint = new Vector2(1000.0f, 600.0f);
                    waypoints.AddPath(waypoint);
                    InnerDemon innerDemon = new InnerDemon(spriteBatch, game, audioManager, "inner_demon_spawned" + count.ToString(), this, waypoints);
                    innerDemon.onDie += new InnerDemon.PowerupReleaseHandle(ReleasePowerup);
                    innerDemon.position.X = 200.0f;
                    innerDemon.position.Y = 200.0f;
                    while (addEntity(innerDemon) == false)
                    {
                        count++;
                        innerDemon.Alias = "inner_demon_spawned" + count.ToString();
                    }
                }
                #endregion spawn_enemies_dev
            }
        }
Esempio n. 12
0
 protected override void OnTarget(Mobile from, object targ)
 {
     if (targ is BaseCreature)
     {
         BaseCreature bc = (BaseCreature)targ;
         if (from.InRange(bc, 1))
         {
             if (bc.ControlMaster != from)
             {
                 from.SendMessage("You can only put a bridle on your own animal!");
             }
             else
             {
                 if (targ is WildHorse)
                 {
                     Horse h = new Horse();
                     h.Body = bc.Body;
                     ConvertAnimal(bc, h);
                     br.Consume();
                 }
                 else if (targ is Llama)
                 {
                     RidableLlama rl = new RidableLlama();
                     ConvertAnimal(bc, rl);
                     br.Consume();
                 }
                 else if (targ is WildDesertOstard)
                 {
                     DesertOstard dost = new DesertOstard();
                     ConvertAnimal(bc, dost);
                     br.Consume();
                 }
                 else if (targ is WildFireSteed)
                 {
                     FireSteed fs = new FireSteed();
                     ConvertAnimal(bc, fs);
                     br.Consume();
                 }
                 else if (targ is WildForestOstard)
                 {
                     ForestOstard fost = new ForestOstard();
                     ConvertAnimal(bc, fost);
                     br.Consume();
                 }
                 else if (targ is WildFrenziedOstard)
                 {
                     FrenziedOstard fzost = new FrenziedOstard();
                     ConvertAnimal(bc, fzost);
                     br.Consume();
                 }
                 else if (targ is WildHiryu)
                 {
                     Hiryu hi = new Hiryu();
                     ConvertAnimal(bc, hi);
                     br.Consume();
                 }
                 else if (targ is WildLesserHiryu)
                 {
                     LesserHiryu lh = new LesserHiryu();
                     ConvertAnimal(bc, lh);
                     br.Consume();
                 }
                 else if (targ is WildNightmare)
                 {
                     Nightmare nm = new Nightmare();
                     ConvertAnimal(bc, nm);
                     br.Consume();
                 }
                 else if (targ is WildRidgeback)
                 {
                     Ridgeback rb = new Ridgeback();
                     ConvertAnimal(bc, rb);
                     br.Consume();
                 }
                 else if (targ is WildSavageRidgeback)
                 {
                     SavageRidgeback sr = new SavageRidgeback();
                     ConvertAnimal(bc, sr);
                     br.Consume();
                 }
                 else if (targ is WildSilverSteed)
                 {
                     SilverSteed ss = new SilverSteed();
                     ConvertAnimal(bc, ss);
                     br.Consume();
                 }
                 else if (targ is WildSwampDragon)
                 {
                     SwampDragon sd = new SwampDragon();
                     ConvertAnimal(bc, sd);
                     br.Consume();
                 }
                 else
                 {
                     from.SendMessage("You can't put a bridle on that.");
                 }
             }
         }
         else
         {
             from.SendMessage("That's too far away");
         }
     }
     else
     {
         from.SendMessage("You can't put a bridle on that.");
     }
 }
        public void InstantiateCharacter()
        {
            PlayerStateContainer playerContainer = PlayerStateContainer.Instance;

            if (playerContainer.TeamSelection == PlayerStateContainer.EXPLORER)
            {
                float   spawnLocationX = (UnityEngine.Random.Range(1, levelChunks.GetLength(0) - 1) * 16) + 2;
                float   spawnLocationY = (UnityEngine.Random.Range(levelChunks.GetLength(1) / 2, levelChunks.GetLength(1)) * 16) + 2;
                Vector3 spawnLocation  = new Vector3(spawnLocationX, spawnLocationY);
                switch (playerContainer.ExplorerSelection)
                {
                case PlayerStateContainer.DOUBLE_JUMP_EXPLORER:
                    Explorer = PhotonNetwork.Instantiate(doubleJumpPrefab.name, spawnLocation, Quaternion.identity, 0)
                               .GetComponent <BaseExplorer>();
                    break;

                case PlayerStateContainer.JETPACK_EXPLORER:
                    Explorer = PhotonNetwork.Instantiate(jetpackPrefab.name, spawnLocation, Quaternion.identity, 0)
                               .GetComponent <BaseExplorer>();
                    break;

                case PlayerStateContainer.DASH_EXPLORER:
                    Explorer = PhotonNetwork.Instantiate(dashPrefab.name, spawnLocation, Quaternion.identity, 0)
                               .GetComponent <BaseExplorer>();
                    break;
                }
                if (Explorer != null)
                {
                    Explorer.SendTalentsToNetwork();
                    Explorer.SendNameToNetwork();
                    Camera.main.transform.position = Explorer.transform.position;
                }
                ChangeMaskColor(0f);
            }
            else if (playerContainer.TeamSelection == PlayerStateContainer.NIGHTMARE)
            {
                float   spawnLocationX = (UnityEngine.Random.Range(1, levelChunks.GetLength(0) - 1) * 16) + 2;
                float   spawnLocationY = (UnityEngine.Random.Range(0, levelChunks.GetLength(1) / 2) * 16) + 2;
                Vector3 spawnLocation  = new Vector3(spawnLocationX, spawnLocationY);
                switch (playerContainer.NightmareSelection)
                {
                case PlayerStateContainer.GHAST:
                    Nightmare = PhotonNetwork.Instantiate(ghastPrefab.name, spawnLocation, Quaternion.identity, 0)
                                .GetComponent <BaseNightmare>();
                    break;

                case PlayerStateContainer.CRYO:
                    Nightmare = PhotonNetwork.Instantiate(cryoPrefab.name, spawnLocation, Quaternion.identity, 0)
                                .GetComponent <BaseNightmare>();
                    break;

                case PlayerStateContainer.GOBLIN:
                    Nightmare = PhotonNetwork.Instantiate(goblinPrefab.name, spawnLocation, Quaternion.identity, 0)
                                .GetComponent <BaseNightmare>();
                    break;
                }
                if (Nightmare != null)
                {
                    Nightmare.SendTalentsToNetwork();
                    Nightmare.SendNameToNetwork();
                    Camera.main.transform.position = Nightmare.gameObject.transform.position;
                }
                ChangeMaskColor(0f);
            }
            else
            {
                ChangeMaskColor(0.5f);
            }
        }