Ejemplo n.º 1
0
 public void SetBattle(Player player, Monster monster, Floor floor)
 {
     _player = player;
     _monster = monster;
     _floor = floor;
     _counter = 0;
     _enemyAttackTime = 0;
     _playerAttackTime = 0;
     _playerTurn = true;
 }
Ejemplo n.º 2
0
 public override bool Event(Player player, Floor floor)
 {
     switch (_type)
     {
         case MapObjectType.ShopBody1:
         case MapObjectType.ShopBody2:
             break;
         case MapObjectType.GoldShop:
             _shop.SetShop(0);
             _shop.Active = true;
             player.Active = false;
             break;
     }
     return false;
 }
Ejemplo n.º 3
0
 public override bool Event(Player player, Floor floor)
 {
     _battle.SetBattle(player, (Monster)MemberwiseClone(), floor);
     _battle.Active = true;
     player.StopMove();
     player.Active = false;
     return false;
 }
Ejemplo n.º 4
0
 public override bool Event(Player player, Floor floor)
 {
     bool access = true;
     switch (_type)
     {
         case MapObjectType.Floor1:
             break;
         case MapObjectType.Block1:
             access = false;
             break;
         case MapObjectType.DownStair1:
         case MapObjectType.DownStair2:
             player.CurrentFloor--;
             break;
         case MapObjectType.UpStair1:
         case MapObjectType.UpStair2:
             player.CurrentFloor++;
             break;
         case MapObjectType.YellowKey:
             player.YellowKey++;
             floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
             _dialogue.AddDialogue(Dialogue.DialogueLocation.Middle, "系統資訊", "獲得一把黃鑰匙", Dialogue.FaceLoaction.None, null);
             _audioPlayer.Play(AudioPlayer.SoundEffect.GetItem);
             break;
         case MapObjectType.BlueKey:
             player.BlueKey++;
             floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
             _dialogue.AddDialogue(Dialogue.DialogueLocation.Middle, "系統資訊", "獲得一把藍鑰匙", Dialogue.FaceLoaction.None, null);
             _audioPlayer.Play(AudioPlayer.SoundEffect.GetItem);
             break;
         case MapObjectType.RedKey:
             player.RedKey++;
             floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
             _dialogue.AddDialogue(Dialogue.DialogueLocation.Middle, "系統資訊", "獲得一把紅鑰匙", Dialogue.FaceLoaction.None, null);
             _audioPlayer.Play(AudioPlayer.SoundEffect.GetItem);
             break;
         case MapObjectType.MonsterBook:
             return true;
         case MapObjectType.RedPotion:
             player.Hp += 150;
             floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
             _dialogue.AddDialogue(Dialogue.DialogueLocation.Middle, "系統資訊", "生命增加 150 點", Dialogue.FaceLoaction.None, null);
             _audioPlayer.Play(AudioPlayer.SoundEffect.GetItem);
             break;
         case MapObjectType.BluePotion:
             player.Hp += 500;
             floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
             _dialogue.AddDialogue(Dialogue.DialogueLocation.Middle, "系統資訊", "生命增加 500 點", Dialogue.FaceLoaction.None, null);
             _audioPlayer.Play(AudioPlayer.SoundEffect.GetItem);
             break;
         case MapObjectType.RedCrystal:
             player.Atk += 2;
             floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
             _dialogue.AddDialogue(Dialogue.DialogueLocation.Middle, "系統資訊", "攻擊增加 2 點", Dialogue.FaceLoaction.None, null);
             _audioPlayer.Play(AudioPlayer.SoundEffect.GetItem);
             break;
         case MapObjectType.BlueCrystal:
             player.Def += 2;
             floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
             _dialogue.AddDialogue(Dialogue.DialogueLocation.Middle, "系統資訊", "防禦增加 2 點", Dialogue.FaceLoaction.None, null);
             _audioPlayer.Play(AudioPlayer.SoundEffect.GetItem);
             break;
         case MapObjectType.YellowDoor:
             if(player.YellowKey > 0)
             {
                 player.YellowKey--;
                 floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
                 _audioPlayer.Play(AudioPlayer.SoundEffect.OpenDoor);
                 break;
             }
             else
             {
                 access = false;
                 break;
             }
         case MapObjectType.BlueDoor:
             if (player.BlueKey > 0)
             {
                 player.BlueKey--;
                 floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
                 _audioPlayer.Play(AudioPlayer.SoundEffect.OpenDoor);
                 break;
             }
             else
             {
                 access = false;
                 break;
             }
         case MapObjectType.RedDoor:
             if (player.RedKey > 0)
             {
                 player.RedKey--;
                 floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
                 _audioPlayer.Play(AudioPlayer.SoundEffect.OpenDoor);
                 break;
             }
             else
             {
                 access = false;
                 break;
             }
         case MapObjectType.TeleportStaf:
             floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
             break;
         case MapObjectType.Sword1:
             player.Atk += 10;
             floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
             _dialogue.AddDialogue(Dialogue.DialogueLocation.Middle, "系統資訊", "取得鐵劍,攻擊增加 10 點", Dialogue.FaceLoaction.None, null);
             _audioPlayer.Play(AudioPlayer.SoundEffect.GetItem);
             break;
         case MapObjectType.Sword2:
         case MapObjectType.Sword3:
         case MapObjectType.Sword4:
         case MapObjectType.Sword5:
         case MapObjectType.Shield1:
             player.Def += 8;
             floor.SetMapObject(player.NextPosition, MapObjectType.Floor1);
             _dialogue.AddDialogue(Dialogue.DialogueLocation.Middle, "系統資訊", "取得鐵盾,防禦增加 8 點", Dialogue.FaceLoaction.None, null);
             _audioPlayer.Play(AudioPlayer.SoundEffect.GetItem);
             break;
         case MapObjectType.Shield2:
         case MapObjectType.Shield3:
         case MapObjectType.Shield4:
         case MapObjectType.Shield5:
             break;
     }
     return access;
 }
Ejemplo n.º 5
0
 public abstract bool Event(Player player, Floor floor);
Ejemplo n.º 6
0
 private Tower()
 {
     _floors = new Floor[_maxFloor];
     for (int i = 0; i < _maxFloor; i++)
         _floors[i] = new Floor();
 }