示例#1
0
文件: One.cs 项目: AM636E/dotNet
        public void Beat( Unit target )
        {
            Console.WriteLine( this.name + " beat " + target.Name + " and redused his life to " + target.Life;

            target.GetKick( this.power );

            if( target.Life <= 0 )
            {
                target.Die( );
            }
        }
示例#2
0
文件: Unit.cs 项目: AM636E/dotNet
        public void Beat( Unit target )
        {
            Console.Write( this.name + " \a attacked " + target.Name  );
            if (!this.isDied && (this.Sighn != target.Sighn))
            {
                target.GetKick(this.power);

                if (target.Life <= 0)
                {
                    target.Die();
                }
                else
                {
                    Console.WriteLine(" and redused his life to " + target.Life);
                }
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(" but This is a friend");
                Console.ResetColor();
            }
        }