Beispiel #1
0
 public void Interact(Player p)
 {
     if (interaction != null)
     {
         interaction.PropAction(p);
     }
 }
Beispiel #2
0
 public ZombieState(Zombie aZombie, Player nPlayer, Map aMap)
 {
     zombie = aZombie;
     player = nPlayer;
     rand = new Random(zombie.ThisID);
     iMap = aMap;
 }
Beispiel #3
0
 /// <summary>
 /// Puts zombies everywhere.
 /// </summary>
 /// <param name="numOfZombies">Number of zombies you want put.</param>
 /// <param name="p">The player, needed for zombie AI.</param>
 public static void PutZombiesEverywhere(int numOfZombies, Player p)
 {
     bool zomPlaced = false;
     Random r = new Random();
     for (int i = 0; i < Math.Abs(numOfZombies); i++)
     {
         zomPlaced = false;
         while (zomPlaced == false)
         {
             int x = r.Next(map.Width);
             int y = r.Next(map.Height);
             if (map.GetBlockAt(x, y).Passable)
             {
                 zomPlaced = true;
                 map.AddObjectAt(EntityFactory.CreateZombie(p), x, y);
             }
         }
     }
 }
Beispiel #4
0
 public WanderState(Zombie aZombie, Player nPlayer)
     : base(aZombie, nPlayer)
 {
     graphic = new Sprite("zombie_wander_bmp");
 }
Beispiel #5
0
        protected void LoadData()
        {
            player = new Player("player_bmp");
            player.AddSkill(new Skill(SkillNames.MEDICAL_SKILL));

            player.Inventory.Add(ItemFactory.CreateDefaultItem());
            player.Inventory.Add(ItemFactory.CreateDefaultItem());
            player.Inventory.Add(ItemFactory.CreateDefaultItem());

            player.Inventory.Add(ItemFactory.CreateBandage(player));
            player.Inventory.Add(ItemFactory.CreateBandage(player));

            Weapon sword2 = WeaponFactory.CreateSword();
            sword2.Name = "OTHER Sword";
            player.Inventory.Add(sword2);
            player.Inventory.Add(WeaponFactory.CreateSword());

            map = new Map(30, 30);
            map.AddObjectAt(player, 5, 5);
            Zombie lZack = new Zombie(player, map);
            map.AddObjectAt(lZack, 10, 10);

            Room lRoom = new Room(new Coord(8, 8), 5, 5, MapGenObject.Direction.SOUTH);
            lRoom.Construct(map);

            Door d = new Door("door_closed_bmp");
            d.Interaction = new UseDoorPAbility(d);
            map.GetBlockAt(5, 10).AddObject(d);

            ToggleSwitch lSwitch = new ToggleSwitch();
            lSwitch.ConnectedProp = d;
            lSwitch.OnGraphic = new Sprite("toggle_off");
            lSwitch.OffGraphic = new Sprite("toggle_on");
            map.AddObjectAt(lSwitch, 7, 7);

            camera = new Camera(player, Game.VISBLE_MAP_WIDTH, Game.VISBLE_MAP_HEIGHT, map);

            Item item = new Item("item_bmp");
            map.GetBlockAt(3, 3).AddObject(item);
        }
Beispiel #6
0
 public HuntState(Zombie aZombie, Player nPlayer)
     : base(aZombie, nPlayer)
 {
     graphic = new Sprite("zombie_hunt_bmp");
 }
Beispiel #7
0
 public ZombieState(Zombie aZombie, Player nPlayer)
 {
     zombie = aZombie;
     player = nPlayer;
     rand = new Random(zombie.ThisID);
 }