Example #1
0
 public bool CheckDying(ACharacter character)
 {
     if (CurrentHP <= character.CharacterStats.HP * 0.3)
     {
         return(true);
     }
     return(false);
 }
Example #2
0
 public bool CheckAlive(ACharacter character, List <ACharacter> characterOrder)
 {
     if (CurrentHP <= 0)
     {
         CurrentHP = 0;
         CurrentSP = 0;
         characterOrder.Remove(character);
         return(true);
     }
     return(false);
 }
Example #3
0
        public AMenuSelectAction GetMenuAction(int CurrentIndex, Image EnemyMenuCursor, Grid SubMenuGrid, List <IBehavior> behaviorList, List <string> itemsList, ACharacter player)
        {
            var listBox = (ListBox)SubMenuGrid.Children[2];

            switch (CurrentIndex)
            {
            case 0:
                EnemyMenuCursor.Visibility = Visibility.Visible;
                return(new BattlePageTargetMenuAction());

            case 1:
                SubMenuGrid.Visibility = Visibility.Visible;
                var behavior = behaviorList.GetRange(2, behaviorList.Count - 2);

                foreach (IBehavior b in behavior)
                {
                    if (player.CharacterStatus.CurrentMP >= b.Cost)
                    {
                        b.IsUsableSkill = true;
                    }
                    else
                    {
                        b.IsUsableSkill = false;
                    }
                }

                listBox.ItemsSource = behavior;

                return(new BattlePageSubMenuAction());

            case 3:
                SubMenuGrid.Visibility = Visibility.Visible;
                listBox.ItemsSource    = itemsList;

                return(new BattlePageSubMenuAction());

            case 4:
                EnemyMenuCursor.Visibility = Visibility.Visible;
                return(new BattlePageTargetMenuAction());
            }

            return(null);
        }