Beispiel #1
0
        public override int takeDamage(int damage, int xTrajectory, int yTrajectory, bool isBomb, double addedPrecision, Farmer who)
        {
            int result = base.takeDamage(damage, xTrajectory, yTrajectory, isBomb, addedPrecision, who);

            if (Health <= 0)
            {
                ModEntry.BossDeath(currentLocation, this, difficulty);
            }
            ModEntry.MakeBossHealthBar(Health, MaxHealth);
            return(result);
        }
Beispiel #2
0
        public override int takeDamage(int damage, int xTrajectory, int yTrajectory, bool isBomb, double addedPrecision, Farmer who)
        {
            int result = base.takeDamage(damage, xTrajectory, yTrajectory, isBomb, addedPrecision, who);

            if (Health <= 0)
            {
                ModEntry.BossDeath(currentLocation, this, difficulty);
            }
            else
            {
                if (Game1.random.NextDouble() < 0.5f)
                {
                    currentLocation.characters.Add(new GreenSlime(Position, (int)(120 * difficulty)));
                }

                currentLocation.characters[currentLocation.characters.Count - 1].setTrajectory(xTrajectory / 8 + Game1.random.Next(-20, 20), yTrajectory / 8 + Game1.random.Next(-20, 20));
                currentLocation.characters[currentLocation.characters.Count - 1].willDestroyObjectsUnderfoot = false;
                currentLocation.characters[currentLocation.characters.Count - 1].moveTowardPlayer(20);
            }
            ModEntry.MakeBossHealthBar(Health, MaxHealth);
            return(result);
        }