AddExperience() public method

public AddExperience ( int amountToAdd ) : void
amountToAdd int
return void
 protected void GainExperience()
 {
     if (skillExperience != null)
     {
         skillExperience.AddExperience(experiencePerSuccessfulUsage);
     }
 }
Beispiel #2
0
        public void CopyExperience()
        {
            Condition[] conditions = SetupConditions();

            Experience teacher = new Experience();
            Experience student = new Experience();

            Activity victory   = new Activity("Victory", null);
            Activity defeat    = new Activity("Defeat", null);
            Activity stalemate = new Activity("Stalemate", null);

            Condition[] victorySituation = new Condition[] { conditions[0], conditions[2], conditions[4] };
            teacher.AddSuccessfulExperience(victory, victorySituation);

            Condition[] defeatSituation = new Condition[] { conditions[1], conditions[3], conditions[5] };
            teacher.AddFailedExperience(defeat, defeatSituation);

            Condition[] otherSituation = new Condition[] { conditions[6], conditions[7], conditions[8] };
            teacher.AddExperience(stalemate, otherSituation);

            string teacherStatus = teacher.ToString();

            teacher.CopyRecentExperienceTo(student);

            string studentStatus = student.ToString();

            Assert.IsTrue(teacherStatus.Equals(studentStatus));
        }
Beispiel #3
0
    private void DisplayWonFightPopup()
    {
        EnableChallenge();

        challengeDescription.text = tempChallenge.ChallengeSuccessDescription + "\n\nYou are awarded " + tempChallenge.ExperienceReward + " XP, " + tempChallenge.ItemReward.ItemName + ", and " + tempChallenge.MoneyReward + " dollars!";
        Experience.AddExperience();
        UpdateExperienceBar();

        DisableChallengeButtons();

        Invoke("DisablePopups", 6f);
    }
Beispiel #4
0
 void Die()
 {
     if (health <= 0)
     {
         health = 0;
         if (!hasAddedXP)
         {
             Experience.AddExperience();
             hasAddedXP = true;
         }
         ui.BossDieUI();
         Destroy(gameObject);
     }
 }
Beispiel #5
0
    public void CompleteChallengeAndReward()
    {
        DisableChallengeButtons();

        tempChallenge.CheckSkill();
        tempChallenge.Complete();
        tempChallenge.Reward();

        challengeDescription.text = tempChallenge.ChallengeSuccessDescription + "\n\nYou are awarded " + tempChallenge.ExperienceReward + " XP, " + tempChallenge.ItemReward.ItemName + ", and " + tempChallenge.MoneyReward + " dollars!";
        Experience.AddExperience();
        UpdateExperienceBar();

        Invoke("DisablePopups", 6f);
    }
Beispiel #6
0
    public void CompleteOpportunityAndReward()
    {
        DisableOpportunityButtons();

        tempOpportunity.CheckSkill();
        tempOpportunity.Complete();
        tempOpportunity.Reward();

        opportunityDescription.text = tempOpportunity.OpportunitySuccessDescription + "\n\nYou are awarded " + tempOpportunity.ExperienceReward + " XP, " + tempOpportunity.ItemReward.ItemName + ", and " + tempOpportunity.MoneyReward + " dollars!";
        Experience.AddExperience();
        UpdateExperienceBar();

        Invoke("DisablePopups", 6f);
    }
Beispiel #7
0
 protected void GainExperience()
 {
     experience.AddExperience(experienceForSuccessfulUsage);
 }