Exemple #1
0
 public void SetDefaultValues()
 {
     MyGold    = 1000;
     stamina   = 50;
     intellect = 10;
     strength  = 0;
     ResetStats();
     MyXp.Initialize(0, Mathf.Floor(100 * MyLevel * Mathf.Pow(MyLevel, 0.5f)));
     levelText.text = MyLevel.ToString();
     initPos        = transform.parent.position;
     UIManager.MyInstance.UpdateStatsText(intellect, stamina, strength);
 }
Exemple #2
0
        public async Task <IActionResult> AddXp(AddXp model)
        {
            if (!ModelState.IsValid)
            {
                return(Redirect("/"));
            }
            var xp = new MyXp {
                Title = model.Title,
                value = model.Value
            };
            await _services.AddXp(xp);

            return(Redirect("/"));
        }
Exemple #3
0
    private IEnumerator Ding()
    {
        while (!MyXp.IsFull)
        {
            yield return(null);
        }

        MyLevel++;
        ding.SetTrigger("Ding");
        levelText.text      = MyLevel.ToString();
        MyXp.MyMaxValue     = 100 * MyLevel * Mathf.Pow(MyLevel, 0.5f);
        MyXp.MyMaxValue     = Mathf.Floor(MyXp.MyMaxValue);
        MyXp.MyCurrentValue = MyXp.MyOverflow;
        MyXp.Reset();
        stamina   += IncreaseBaseStat();
        intellect += IncreaseBaseStat();
        ResetStats();
        if (MyXp.MyCurrentValue >= MyXp.MyMaxValue)
        {
            StartCoroutine(Ding());
        }
    }