// saves the accumulated steps from player in the database
    public void UpdateStepsInDatabase()
    {
        ServerResponse sr = UserRequestLibrary.GetResourcesRequest();

        if (m_locationTrackable)
        {
            BA_Praxis_Library.Resources res = new BA_Praxis_Library.Resources()
            {
                StepCounter     = (int)m_currentStepTracker,
                AncientMaterial = sr.Resources.AncientMaterial,
                ChaosMaterial   = sr.Resources.ChaosMaterial,
                DarkMaterial    = sr.Resources.DarkMaterial,
                NatureMaterial  = sr.Resources.NatureMaterial,
                NeutralMaterial = sr.Resources.NeutralMaterial
            };

            sr = UserRequestLibrary.UpdateResourcesRequest(res);
        }
    }
Example #2
0
    public static void UpdateResourcesForCurrentSelectedCharacter(int materialsGained)
    {
        int currentCharID = PlayerData.currentSelectedCharacter;

        ServerResponse sr = UserRequestLibrary.GetResourcesRequest();

        Resources resources = sr.Resources;

        // if character is adventurer
        if (currentCharID == 0)
        {
            resources.NeutralMaterial += materialsGained;
        }

        // if character is bandit | red ogre | werewolf
        else if (currentCharID == 1 || currentCharID == 5 || currentCharID == 9)
        {
            resources.DarkMaterial += materialsGained;
        }

        // if character is golem | satyr | yeti
        else if (currentCharID == 2 || currentCharID == 6 || currentCharID == 10)
        {
            resources.AncientMaterial += materialsGained;
        }

        // if character is wasp | rat | mandrake
        else if (currentCharID == 8 || currentCharID == 4 || currentCharID == 3)
        {
            resources.NatureMaterial += materialsGained;
        }

        // if character is shade
        else if (currentCharID == 7)
        {
            resources.ChaosMaterial += materialsGained;
        }

        UserRequestLibrary.UpdateResourcesRequest(resources);
    }