Ejemplo n.º 1
0
        public override bool battle()
        {
            int    rand    = Random_.Next(0, 2);
            string monster = getRandomMonster();

            if (monster != null)
            {
                if (rand == 0)
                {
                    Console.WriteLine("You got surrounded by enemies!");
                    normalFight oFight = new normalFight(monster, oHero);
                    oFight.startFight(this);

                    if (oHero.getLife() < 1)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
            public static bool IsHitHelp(float rate, uint uiFactor)
            {
                uint count = (uint)(rate * uiFactor);

                return((uint)Random_.Range(0, uiFactor - 1) < count ? true : false);
            }