Example #1
0
        private void SpawnBoss()
        {
            if (Bosses == null)
            {
                return;
            }

            Point3D p = SpawnPoints[0];

            ConvertOffset(ref p);

            CurrentBoss = Activator.CreateInstance(Bosses[0]) as ShadowguardBoss;
            Bosses.Remove(Bosses[0]);

            if (CurrentBoss != null)
            {
                CurrentBoss.MoveToWorld(p, Map.TerMur);
            }

            if (Bosses.Count == 0)
            {
                CurrentBoss.IsLastBoss = true;
            }

            if (Minax != null && Minax.Alive)
            {
                if (CurrentBoss is Juonar)
                {
                    Minax.Say(1156258); // You shall burn as Trinsic burned at the hands of the Vile Lich Juo'nar!
                }
                else if (CurrentBoss is Anon)
                {
                    Minax.Say(1156259); // Oh Anon my dear! Deal with these pesky intruders will you? Burn them to ASH!
                }
                else if (CurrentBoss is Virtuebane)
                {
                    Minax.Say(1156260); // You didn't think that ridiculous pie trick would work twice in a row? Virtuebane I command thee destroy these vile creatures!
                }
                else
                {
                    Minax.Say(1156261); // And now you shall bow to the King of Kings! Suffer at the hands of the Feudal Lord Ozymandias!
                }
            }
        }
Example #2
0
        public override void ClearItems()
        {
            if (Minax != null)
            {
                Minax.Delete();
            }

            if (Bosses != null)
            {
                ColUtility.Free(Bosses);
                Bosses = null;
            }

            if (CurrentBoss != null)
            {
                if (!CurrentBoss.Deleted)
                {
                    CurrentBoss.Delete();
                }

                CurrentBoss = null;
            }
        }
    public void DoBattle()
    {
        if (BattleHasEnded == false)
        {
            foreach (Monster opponent in CurrentOpponents)
            {
                if (opponent.IsDefeated)
                {
                    opponent.TicksToNextAttack = opponent.AttackSpeed;
                }
                else
                {
                    opponent.TicksToNextAttack--;
                    opponent.TickStatusEffects();
                }
            }
            Player.Instance.TicksToNextAttack--;
            if (Player.Instance.TicksToNextAttack < 0)
            {
                Attack();
                if (CurrentBoss != null)
                {
                    CurrentBoss.OnBeAttacked(Target);
                }
                Player.Instance.TicksToNextAttack = Player.Instance.GetWeaponAttackSpeed();
            }
            foreach (Monster opponent in CurrentOpponents)
            {
                if (opponent.CurrentHP <= 0 && opponent.IsDefeated == false)
                {
                    opponent.CurrentHP = 0;
                    RollForDrops(opponent);
                    opponent.IsDefeated = true;
                    if (CurrentBoss != null)
                    {
                        CurrentBoss.OnDie(opponent);
                    }
                }
                else if (opponent.TicksToNextAttack < 0 && opponent.IsDefeated == false)
                {
                    if (CurrentBoss != null && CurrentBoss.CustomAttacks)
                    {
                        CurrentBoss.OnAttack();
                    }
                    else if (CurrentBoss != null)
                    {
                        CurrentBoss.OnAttack();
                        BeAttacked(opponent);
                    }
                    else
                    {
                        BeAttacked(opponent);
                    }
                    opponent.TicksToNextAttack = opponent.AttackSpeed;
                }
            }
            if (AllOpponentsDefeated())
            {
                if (CurrentDojo != null)
                {
                    CurrentDojo.CurrentOpponent++;
                    if (CurrentDojo.CurrentOpponent >= CurrentDojo.Opponents.Count)
                    {
                        CurrentDojo.LastWinTime = DateTime.Now;
                    }
                }
                WonLastBattle = true;
                EndBattle();
            }
            if (CurrentBoss != null)
            {
                CurrentBoss.TicksToNextSpecialAttack--;
                if (CurrentBoss.TicksToNextSpecialAttack <= 0)
                {
                    CurrentBoss.OnSpecialAttack();
                }
            }

            if (Player.Instance.CurrentHP <= 0)
            {
                Player.Instance.Die();
                WonLastBattle = false;
            }
        }
    }
Example #4
0
    public void DoBattle()
    {
        if (BattleHasEnded == false)
        {
            foreach (Monster opponent in CurrentOpponents)
            {
                if (opponent.IsDefeated)
                {
                    opponent.TicksToNextAttack = opponent.AttackSpeed;
                }
                else
                {
                    opponent.TicksToNextAttack--;
                }
            }
            Player.Instance.TicksToNextAttack--;
            if (Player.Instance.TicksToNextAttack < 0)
            {
                Attack();
                if (CurrentBoss != null)
                {
                    CurrentBoss.OnBeAttacked(Target);
                }
                Player.Instance.TicksToNextAttack = Player.Instance.GetWeaponAttackSpeed();
            }
            foreach (Monster opponent in CurrentOpponents)
            {
                if (opponent.CurrentHP <= 0 && opponent.IsDefeated == false)
                {
                    opponent.CurrentHP = 0;
                    Drop drop = opponent.DropTable.GetDrop();

                    if (LootTracker.Instance.TrackLoot)
                    {
                        foreach (Drop d in opponent.DropTable.AlwaysDrops)
                        {
                            LootTracker.Instance.Inventory.AddDrop(d);
                        }
                        LootTracker.Instance.Inventory.AddDrop(drop);
                    }
                    else
                    {
                        MessageManager.AddMessage("You defeated the " + opponent.Name + ".");
                        foreach (Drop d in opponent.DropTable.AlwaysDrops)
                        {
                            Player.Instance.Inventory.AddDrop(d);
                        }
                        Player.Instance.Inventory.AddDrop(drop);
                    }

                    opponent.IsDefeated = true;
                    if (CurrentBoss != null)
                    {
                        CurrentBoss.OnDie(opponent);
                    }
                }
                else if (opponent.TicksToNextAttack < 0 && opponent.IsDefeated == false)
                {
                    if (CurrentBoss != null && CurrentBoss.CustomAttacks)
                    {
                        CurrentBoss.OnAttack();
                    }
                    else if (CurrentBoss != null)
                    {
                        CurrentBoss.OnAttack();
                        BeAttacked(opponent);
                    }
                    else
                    {
                        BeAttacked(opponent);
                    }
                    opponent.TicksToNextAttack = opponent.AttackSpeed;
                }
            }
            if (AllOpponentsDefeated())
            {
                if (CurrentDojo != null)
                {
                    CurrentDojo.CurrentOpponent++;
                    if (CurrentDojo.CurrentOpponent >= CurrentDojo.Opponents.Count)
                    {
                        CurrentDojo.LastWinTime = DateTime.Now;
                    }
                }
                WonLastBattle = true;
                EndBattle();
            }
            if (CurrentBoss != null)
            {
                CurrentBoss.TicksToNextSpecialAttack--;
                if (CurrentBoss.TicksToNextSpecialAttack <= 0)
                {
                    CurrentBoss.OnSpecialAttack();
                }
            }

            if (Player.Instance.CurrentHP <= 0)
            {
                Player.Instance.Die();
                WonLastBattle = false;
            }
        }
    }