예제 #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());
        }
예제 #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);
     }
 }
예제 #3
0
 public static CommandPost GetInstance()
 {
     if (cp == null)
     {
         cp = new CommandPost();
     }
     return(cp);
 }
예제 #4
0
파일: Command.cs 프로젝트: ares454/OO-Final
        public override void Execute()
        {
            foreach (Enemy e in attackers)
            {
                CommandPost.GetInstance().AddCommand(new AttackCommand(e, e.Weapon, Player.GetInstance()));
            }

            attackers.Clear();
        }
예제 #5
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);
        }
예제 #6
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; }
        }
예제 #7
0
파일: Game.cs 프로젝트: ares454/OO-Final
        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.");
        }
예제 #8
0
 public override void ActivateEffect(Entity attacker, Entity defender)
 {
     CommandPost.GetInstance().AddCommand(new AttackCommand(attacker, new FeedbackAttack("", Roll(Damage.Max, Damage.Min)), attacker));
 }