示例#1
0
        private static TwitchBat SpecialBatSpawn()
        {
            TwitchBat bat = new TwitchBat(Vector2.Zero, 1);;

            if (Game1.player.CombatLevel >= 10 && Game1.random.NextDouble() < 0.25)
            {
                bat = new TwitchBat(Vector2.Zero, 9999);
                bat.focusedOnFarmers      = true;
                bat.wildernessFarmMonster = true;
            }
            else if (Game1.player.CombatLevel >= 8 && Game1.random.NextDouble() < 0.5)
            {
                bat = new TwitchBat(Vector2.Zero, 81);
                bat.focusedOnFarmers      = true;
                bat.wildernessFarmMonster = true;
            }
            else if (Game1.player.CombatLevel >= 5 && Game1.random.NextDouble() < 0.5)
            {
                bat = new TwitchBat(Vector2.Zero, 41);
                bat.focusedOnFarmers      = true;
                bat.wildernessFarmMonster = true;
            }
            else
            {
                bat = new TwitchBat(Vector2.Zero, 1);
                bat.focusedOnFarmers      = true;
                bat.wildernessFarmMonster = true;
            }
            return(bat);
        }
示例#2
0
        public static void AddMonsterToSpawnFromType(TwitchMobType type, string name, bool tiny = false)
        {
            switch (type)
            {
            case TwitchMobType.Slime:
                TwitchSlime slime = new TwitchSlime(Vector2.Zero, Game1.player.deepestMineLevel);
                if (tiny)
                {
                    slime.willDestroyObjectsUnderfoot = false;
                    slime.moveTowardPlayer(4);
                    slime.Scale     = (float)(0.50 + (double)Game1.random.Next(-5, 10) / 100.0);
                    slime.MaxHealth = slime.MaxHealth / 4;
                    slime.Health    = slime.MaxHealth;
                }
                SpawnTwitchNPC(name, slime);
                break;

            case TwitchMobType.Crab:
                SpawnTwitchNPC(name, new TwitchCrab(Vector2.Zero));
                break;

            case TwitchMobType.Bug:
                TwitchBug bug = new TwitchBug(Vector2.Zero, -1);
                bug.faceDirection(Game1.random.Next(4));
                SpawnTwitchNPC(name, bug);
                break;

            case TwitchMobType.Fly:
                TwitchFly fly = new TwitchFly(Vector2.Zero, false);
                fly.focusedOnFarmers = true;
                SpawnTwitchNPC(name, fly);
                break;

            case TwitchMobType.Bat:
                TwitchBat bat = SpecialBatSpawn();
                bat.focusedOnFarmers = true;
                SpawnTwitchNPC(name, bat);
                break;

            case TwitchMobType.BigSlime:
                SpawnTwitchNPC(name, new TwitchBigSlime(Vector2.Zero));
                break;
            }
        }