Exemple #1
0
    public int alterResources(int humanResource, int aiResource) //
    {
        if (humanPlayer.yearOfPlenty == true)                    // If year of plenty is played
        {
            humanResource++;
            humanPlayer.chosenResources++; // Tracks how many resoruces generated
            if (humanPlayer.chosenResources == 2)
            {
                dev.endYearOfPlenty();
                spritesOff();
                humanPlayer.chosenResources = 0;
                return(humanResource);
            }
        }

        if (humanPlayer.monopoly == true) //If monopoly is played
        {
            if (aiResource > 0)
            {
                humanResource = humanResource + aiResource;
                aiResource    = 0;
                stealing      = true;
                return(humanResource);
            }
            dev.endMonopoly();
            spritesOff();
        }

        if (humanPlayer.trading == true) // If trading
        {
            humanResource++;
            humanPlayer.trading = false;
            announcements.text  = " ";
            spritesOff();
            return(humanResource);
        }

        if (humanPlayer.threeToOneTrade == true) // If ttrading three to one
        {
            humanResource       = humanResource - 3;
            humanPlayer.trading = true;
            announcements.text  = "Choose a resource to gain";
            return(humanResource);
        }

        return(humanResource);
    }