예제 #1
0
파일: Player.cs 프로젝트: pietroiusti/HFCS
 public void Equip(Game.WeaponName weaponName)
 {
     foreach (Weapon w in this.Inventory)
     {
         if (w.Name == weaponName) fEquippedWeapon = w;
     }
 }
예제 #2
0
파일: Form1.cs 프로젝트: pietroiusti/HFCS
        public Form1()
        {
            InitializeComponent();

            var boundaries = new Rectangle(78, 57, 420, 155);
            fGame = new Game(boundaries);
            fPicBoxesWeapons = new List<PictureBox>() { PicBoxBow, PicBoxPotionBlue, PicBoxSword, PicBoxMace, PicBoxPotionRed };
            fPicBoxesEnemies = new List<PictureBox>() { PicBoxBat, PicBoxGhost, PicBoxGhoul };
            fPicBoxesInventory = new List<PictureBox>() { PicBoxInvBow, PicBoxInvPotionBlue, PicBoxInvSword, PicBoxInvMace, PicBoxInvPotionRed };

            UpdateCharacters();
        }
예제 #3
0
파일: Player.cs 프로젝트: pietroiusti/HFCS
        public void Attack(Game.Direction direction, Random random)
        {
            if (fEquippedWeapon == null)
                return;
            else
            {
                fEquippedWeapon.Attack(direction, random);
                if (fEquippedWeapon is IPotion)

                    // might need to make sure some gui stuff gets done after this.
                    fEquippedWeapon = null;
            }
        }
예제 #4
0
파일: Weapon.cs 프로젝트: pietroiusti/HFCS
        protected bool DamageEnemy(Game game, Point playerLocation,
                                    Game.Direction direction, int distance, int damage, 
                                    Random rnd)
        {
            foreach (Enemy enemy in game.Enemies)
            {
                if (enemy.Nearby(playerLocation, distance, direction))
                    enemy.TakeHit(damage, rnd);
                    return true;
            }

            game.MovePlayer(direction);
            return false;
        }
예제 #5
0
파일: Enemy.cs 프로젝트: pietroiusti/HFCS
 public bool Nearby(Point locationToCheck, int distance, Game.Direction direction)
 {
     return true;
 }
예제 #6
0
 public override void Attack(Game.Direction direction, Random rnd)
 {
     throw new NotImplementedException();
 }
예제 #7
0
파일: Weapon.cs 프로젝트: pietroiusti/HFCS
 public abstract void Attack(Game.Direction direction, Random rnd);