Beispiel #1
0
        private void CheckFirstRun()
        {
            var bodyStats = App.DatabaseBodyStats.SelectLastBodyStats().Result;

            if (bodyStats.Count == 0)
            {
                BodyStats bodyStat = new BodyStats();
                bodyStat.Height              = 0;
                bodyStat.Weight              = 0;
                bodyStat.WaistCircumference  = 0;
                bodyStat.ThighCircumference  = 0;
                bodyStat.BicepsCircumference = 0;
                App.DatabaseBodyStats.SaveItemAsync(bodyStat);
            }
            var Records = App.DatabasePersonalRecord.SelectHighestRecord().Result;

            if (Records.Count == 0)
            {
                PersonalRecord personalRecord = new PersonalRecord();
                personalRecord.Benchpress = 0;
                personalRecord.Deathlift  = 0;
                personalRecord.Squat      = 0;
                App.DatabasePersonalRecord.SaveItemAsync(personalRecord);
            }
        }
 public ActivityNode(string flavorText, BodyStats mainStress, BodyStats sideStress, string flavorImage)
 {
     this.FlavorText  = flavorText;
     this.MainStress  = mainStress;
     this.SideStress  = sideStress;
     this.FlavorImage = flavorImage;
 }
Beispiel #3
0
        public ActionResult AddBodyStatus(int id)
        {
            //ViewBag.data = id;
            BodyStats bodyStats = new BodyStats();

            bodyStats.UserId = id;
            return(View(bodyStats));
        }
Beispiel #4
0
 public void ChangeStats(BodyStats mainStress, BodyStats sideStress, bool addStress)
 {
     popupFrame.SetActive(true);
     CalculateStress(mainStress);
     if (addStress)
     {
         CalculateStress(sideStress);
     }
 }
Beispiel #5
0
        public ActionResult EditBodyStats(int UserId, int id)
        {
            BodyStatsBusinessLayer bodyStatsBusinessLayer = new BodyStatsBusinessLayer();



            BodyStats bodyStats = bodyStatsBusinessLayer.GetBodyStats(UserId).Single(b => b.BodyStatId == id);

            return(View(bodyStats));
        }
Beispiel #6
0
        public static StatsList CreateStatsListWithDefaultValues()
        {
            AttackStats  attackStats  = new AttackStats(0, 0, 0, 0, 0);
            DefenceStats defenceStats = new DefenceStats(0, 0, 0, 0, 0);
            BodyStats    body         = new BodyStats(0, 0);
            CritStats    crit         = new CritStats(0, 0);
            StatsList    stats        = new StatsList(attackStats, defenceStats, body, crit);

            return(stats);
        }
Beispiel #7
0
 public void UpdateBodyInfo()
 {
     if (m_Spirit.transform.parent != null)
     {
         m_Body      = m_Spirit.transform.parent.gameObject;
         m_BodyStats = m_Body.GetComponent <BodyStats>();
     }
     else
     {
         m_Body = null;
     }
 }
Beispiel #8
0
        public ActionResult AddBodyStatus(BodyStats bodyStats)
        {
            if (ModelState.IsValid)
            {
                BodyStatsBusinessLayer bodyStatsBusinessLayer = new BodyStatsBusinessLayer();
                bodyStatsBusinessLayer.AddBodyStats(bodyStats);


                return(RedirectToAction("BodyStats", new { id = bodyStats.UserId }));
            }

            return(View());
        }
Beispiel #9
0
 private void SaveBodyStatData(BodyStats bodyStat)
 {
     if (App.IsNumber(WeightE.Text))
     {
         bodyStat.Weight = App.setNumber(WeightE.Text);
     }
     else
     {
         ErrorL.Text = "Zadej pouze číslo";
     }
     if (App.IsNumber(HeightE.Text))
     {
         bodyStat.Height = App.setNumber(HeightE.Text);
     }
     else
     {
         ErrorL.Text = "Zadej pouze číslo";
     }
     if (App.IsNumber(WaistE.Text))
     {
         bodyStat.WaistCircumference = App.setNumber(WaistE.Text);
     }
     else
     {
         ErrorL.Text = "Zadej pouze číslo";
     }
     if (App.IsNumber(ThighE.Text))
     {
         bodyStat.ThighCircumference = App.setNumber(ThighE.Text);
     }
     else
     {
         ErrorL.Text = "Zadej pouze číslo";
     }
     if (App.IsNumber(BicepsE.Text))
     {
         bodyStat.BicepsCircumference = App.setNumber(BicepsE.Text);
     }
     else
     {
         ErrorL.Text = "Zadej pouze číslo";
     }
     bodyStat.Date = DateE.Date.ToString();
     bodyStat.Date = bodyStat.Date.Remove(bodyStat.Date.Length - 8);
     App.DatabaseBodyStats.SaveItemAsync(bodyStat);
 }
Beispiel #10
0
    private void CalculateStress(BodyStats stresser)
    {
        switch (stresser)
        {
        case (BodyStats.HEART):
            hrt--;
            break;

        case (BodyStats.MIND):
            mind--;
            break;

        case (BodyStats.STRENGTH):
            str--;
            break;

        default:
            endu--;
            break;
        }
    }
Beispiel #11
0
 private void SaveBodyStats()
 {
     if (string.IsNullOrEmpty(HeightE.Text) && string.IsNullOrEmpty(WeightE.Text) && string.IsNullOrEmpty(WaistE.Text) && string.IsNullOrEmpty(ThighE.Text) && string.IsNullOrEmpty(BicepsE.Text))
     {
         ErrorL.TextColor = Color.FromHex("#FF4081");
         ErrorL.Text      = "Nevložil si data";
     }
     else
     {
         ErrorL.Text = "STATISTIKY TĚLA";
         var       bodyStats = App.DatabaseBodyStats.SelectLastBodyStats().Result;
         BodyStats bodyStat  = new BodyStats();
         bodyStat.Weight              = bodyStats[0].Weight;
         bodyStat.Height              = bodyStats[0].Height;
         bodyStat.WaistCircumference  = bodyStats[0].WaistCircumference;
         bodyStat.ThighCircumference  = bodyStats[0].ThighCircumference;
         bodyStat.BicepsCircumference = bodyStats[0].BicepsCircumference;
         SaveBodyStatData(bodyStat);
         ErrorL.Text = "Úspěšně uloženo";
         Application.Current.MainPage = new MenuPage();
     }
 }
Beispiel #12
0
        private static void StartDay()
        {
            var player = GameInstance.Instance.CurrentPlayer;

            Console.WriteLine("\nNew day. What will it bring?");
            ConsoleHelper.LogUserMessage("Current health is {0}hp", BodyStats.GetTotalHealth(GameInstance.Instance.CurrentPlayer));
            ConsoleHelper.FilterInput("Press enter to make a move and see what this day brought you", new ConsoleKey[] { ConsoleKey.Enter });

            var dayEvent = EventWeight.Pick(new List <EventWeight> {
                new EventWeight {
                    Event = EventType.None, PickWeight = 20
                },
                new EventWeight {
                    Event = EventType.VillageAproach, PickWeight = 15
                },
                new EventWeight {
                    Event = EventType.MonsterEncounter, PickWeight = 65
                }
            });

            switch (dayEvent)
            {
            case EventType.None:
                HandleNoneEncounter();
                break;

            case EventType.VillageAproach:
                HandleVillageEncounter();
                break;

            case EventType.MonsterEncounter:
                HandleMonsterEncounter();
                break;

            default:
                break;
            }
        }
 void DealStressToUser(BodyStats mainStress, BodyStats sideStress, bool causeStress)
 {
     dayManager.GetComponent <DayGameManager>().ChangeStats(mainStress, sideStress, causeStress);
 }
Beispiel #14
0
 public void PartialRegenerate(int buff = 0)
 {
     PartialRegenerate_Action(buff);
     Console.WriteLine("You have healed up a little bit.");
     ConsoleHelper.LogUserMessage("Current health is {0}hp", BodyStats.GetTotalHealth(this));
 }