Beispiel #1
0
        private void Attack(string[] param)
        {
            //TODO: Implement when room is complete
            Attack attack = null;
            Player p      = Player.GetInstance();

            try
            {
                switch (param[0])
                {
                case "special":
                    attack = p.GetAttack("intermediate");
                    break;

                case "ultimate":
                    attack = p.GetAttack("advanced");
                    break;

                default:
                    attack = p.GetAttack(null);
                    break;
                }
            }catch (Exception) { Console.WriteLine("Huh? Who are you trying to hit?"); attack = p.GetAttack(null); }


            //TODO: Integrate rooms and enemies
            CommandPost.GetInstance().AddCommand(new AttackCommand(p, attack, p));
            CommandPost.GetInstance().AddCommand(RiposteCommand.GetInstance());
        }
Beispiel #2
0
 public override void ActivateEffect(Entity attacker, Entity defender)
 {
     for (int i = 0; i < NumberOfHits; ++i)
     {
         CommandPost.GetInstance().AddCommand(new AttackCommand(attacker, new Repeater(this, int.MaxValue), defender));
         RiposteCommand.GetInstance().ToRiposte(defender);
     }
 }
Beispiel #3
0
        public override void Execute()
        {
            foreach (Enemy e in attackers)
            {
                CommandPost.GetInstance().AddCommand(new AttackCommand(e, e.Weapon, Player.GetInstance()));
            }

            attackers.Clear();
        }
Beispiel #4
0
        public override void ActivateEffect(Entity attacker, Entity defender)
        {
            ArrayList enemies = Game.GetInstance().CurrentRoom.EnemyList;

            enemies.Remove(defender);
            foreach (Enemy e in enemies)
            {
                CommandPost.GetInstance().AddCommand(new AttackCommand(attacker, attack, e));
            }
            attack.ActivateEffect(attacker, defender);
        }
Beispiel #5
0
        private void Attack(string[] param)
        {
            //TODO: Implement when room is complete
            Attack attack = null;
            Player p      = Player.GetInstance();
            Enemy  e      = null;

            try
            {
                string[] target = param[0].Split('.');
                int      c      = 1;

                if (target.Length > 1)
                {
                    c = int.Parse(target[0]);
                }

                e = Game.GetInstance().CurrentRoom.GetEnemy(target[target.Length == 1 ? 0 : 1], c);

                if (e == null)
                {
                    throw new Exception();
                }

                attack = p.GetAttack(null);
                if (param.Length > 1)
                {
                    switch (param[1])
                    {
                    case "special":
                        attack = p.GetAttack("intermediate");
                        break;

                    case "ultimate":
                        attack = p.GetAttack("advanced");
                        break;

                    default:
                        break;
                    }
                }


                //TODO: Integrate rooms and enemies
                CommandPost.GetInstance().AddCommand(new AttackCommand(p, attack, e));
                CommandPost.GetInstance().AddCommand(RiposteCommand.GetInstance());
            }
            catch (Exception) { Console.WriteLine("Huh? Who are you trying to hit?"); return; }
        }
Beispiel #6
0
        public void Loop()
        {
            CommandInterpreter ci = CommandInterpreter.GetInstance();
            CommandPost        cp = CommandPost.GetInstance();

            while (active)
            {
                func();
                Console.Write(">>");
                string input = Console.ReadLine().ToLower();
                ci.Interpret(input);
                cp.Execute();
            }

            Console.WriteLine("All right. We'll miss you. We aren't great shots.");
        }
Beispiel #7
0
 public override void ActivateEffect(Entity attacker, Entity defender)
 {
     CommandPost.GetInstance().AddCommand(new AttackCommand(attacker, new FeedbackAttack("", Roll(Damage.Max, Damage.Min)), attacker));
 }