예제 #1
0
        public void GenerateNew()
        {
            Tile placing;
            UnitManager.Reset();
            RemoveAll();
            MovementManager.Reset();
            Depth++;
            Add(new Components.Watcher());
            var landscape = Landscape.Generator.Generate();
            foreach (var item in landscape)
            {
                Add(item);
            }
            Func<Tile> randPathable = () => landscape.Where(x => x is StoneFloor).ElementAt(Rand.Int(landscape.Where(x => x is StoneFloor).Count()));
            placing = randPathable();
            Hero = new Hero(placing.X, placing.Y);
            Reader.Read();
            for (int i = 0; i < Depth; i++)
            {
                switch (Reader.CurrentSettings.Mode)
                {
                    case Settings.Gamemode.Classic:
                        placing = randPathable();
                        /*Add(new Zombie(placing.X, placing.Y));
                        placing = randPathable();
                        if ((i+1) % 3 == 0)
                            Add(new Ghost(placing.X, placing.Y));
                        placing = randPathable();
                        if ((i + 1) % 5 == 0)*/
                            Add(new Xplodeling(placing.X, placing.Y));
                        break;
                    case Settings.Gamemode.ZombieMadness:
                        for (int c = 0; c < Math.Pow(2, Depth); c++)
                        {
                            placing = randPathable();
                            Add(new Zombie(placing.X, placing.Y));
                        }
                        break;
                    case Settings.Gamemode.GhostyStuff:
                        placing = randPathable();
                        Add(new Ghost(placing.X, placing.Y));
                        break;
                    case Settings.Gamemode.GodMode:
                        Hero.Health = int.MaxValue;
                        for (int c = 0; c < Math.Pow(5, Depth); c++)
                        {
                            placing = randPathable();
                            Add(new Zombie(placing.X, placing.Y));
                        }
                        break;
                    default:
                        break;
                }

            }
            Add(Hero);
            Exit = landscape.Where(x => x is Ladder).Single();
        }
예제 #2
0
파일: Unit.cs 프로젝트: AlexSolari/sRogue
 protected virtual void Attack(Unit Target)
 {
     Target.Hit(Damage);
 }
예제 #3
0
파일: Ghost.cs 프로젝트: AlexSolari/sRogue
 protected override void Attack(Unit Target)
 {
     Health += 1.5;
     base.Attack(Target);
 }
예제 #4
0
 protected override void Attack(Unit Target)
 {
     base.Attack(Target);
     Die();
 }