예제 #1
0
    public void ingnore()
    {
//		UFE.StartGame (0);
        CharacterInfo[] selectableCharacters = UFE.GetVersusModeSelectableCharacters();
        CharacterInfo   character1           = selectableCharacters [6];

        UFE.SetPlayer(1, character1);
        UFE.StartGame(0);
    }
예제 #2
0
    void characterUpgrade()
    {
        CharacterInfo[] selectableCharacters = UFE.GetVersusModeSelectableCharacters();
        CharacterInfo   character1           = selectableCharacters [characterUpgradeValue];

        UFE.SetPlayer(1, character1);
        UFE.HideScreen(UFE.currentScreen);
        UFE.successUI(0f);
    }
예제 #3
0
    public void store()
    {
        PlayerPrefs.SetInt("UARMR", 1);
//		UFE.buyCheck = true;
        buyArmourOnce = true;
        CharacterInfo[] selectableCharacters = UFE.GetVersusModeSelectableCharacters();
        CharacterInfo   character1           = selectableCharacters [7];

        UFE.SetPlayer(1, character1);
        boughtArmour = true;
        UFE.StartGame(0);
    }
예제 #4
0
    void characterUpgrade()
    {
        CharacterInfo[] selectableCharacters = UFE.GetVersusModeSelectableCharacters();
        CharacterInfo   character            = selectableCharacters [characterUpgradeValue];

        UFE.SetPlayer(1, character);
        IntroScreen.characterValue = 100;
        if (newLife <= 500 / 2)
        {
            UFE.updateEnergy(0f);
        }
        else
        {
            UFE.StartGame(0);
        }
    }
예제 #5
0
    public virtual void GoToMainMenu()
    {
        int Fight = PlayerPrefs.GetInt("FIGHTTAG");

        newLife = (int)(PlayerPrefs.GetFloat("HEALTH"));
        string level_fgt = PlayerPrefs.GetString("LEVEL");

        if (level_fgt.Equals("LEVELI"))
        {
            level = 1;
        }
        else if (level_fgt.Equals("LEVELII"))
        {
            level = 2;
        }
        else if (level_fgt.Equals("LEVELIII"))
        {
            level = 3;
        }

//		Fight = 0;
//		level = 3;
//		PlayerPrefs.SetInt ("FIGHTTAG", Fight);
//		PlayerPrefs.SetString("LEVEL","LEVELIII");
        //loading fight depending upon fight and levels

        switch (Fight)
        {
        case 0:
            if (level == 3)
            {
                hanumanValue   = 25;
                characterValue = 19;
            }
            else if (level == 2)
            {
                characterValue = 10;
                hanumanValue   = 9;
            }
            else
            {
                characterValue = 1;
            }
            break;

        case 1:
            if (level == 3)
            {
                hanumanValue   = 23;
                characterValue = 20;
            }
            else if (level == 2)
            {
                characterValue             = 11;
                hanumanValue               = 14;
                WeaponPopUp.level2buygadha = false;
            }
            else
            {
                characterValue = 2;
                hanumanValue   = 0;
            }
            break;

        case 2:
            if (level == 3)
            {
                hanumanValue   = 24;
                characterValue = 21;
                level          = 31;
            }
            else if (level == 2)
            {
                characterValue = 12;
                hanumanValue   = 15;
                WeaponPopUp.level2buyarmour = false;
            }
            else
            {
                characterValue = 3;
                hanumanValue   = 6;
            }
            break;

        case 3:
            if (level == 3)
            {
            }
            else if (level == 2)
            {
                characterValue = 13;
                hanumanValue   = 16;
                WeaponPopUp.level2buygadha2 = false;
            }
            else
            {
                characterValue = 4;
                hanumanValue   = 7;
            }
            break;

        case 4:
            if (level == 3)
            {
            }
            if (level == 2)
            {
                hanumanValue   = 17;
                characterValue = 18;
                level          = 21;
            }
            else
            {
                characterValue = 5;
                hanumanValue   = 8;
            }
            break;

        default:
            characterValue = 1;
            hanumanValue   = 0;
            break;
        }
        UFE.StartVersusModeScreen();
        UFE.StartPlayerVersusCpu();
        CharacterInfo[] selectableCharacters = UFE.GetVersusModeSelectableCharacters();
        CharacterInfo   character1           = selectableCharacters [hanumanValue];
        CharacterInfo   character2           = selectableCharacters [characterValue];

        UFE.SetPlayer(1, character1);
        UFE.SetPlayer(2, character2);

// loading stage for fights depending upon level
        if (level == 1)
        {
            UFE.config.selectedStage = UFE.config.stages [0];
        }
        else if (level == 2)
        {
            UFE.config.selectedStage = UFE.config.stages [1];
        }
        else if (level == 21)
        {
            UFE.config.selectedStage = UFE.config.stages [2];
        }
        else if (level == 3)
        {
            UFE.config.selectedStage = UFE.config.stages [3];
        }
        else if (level == 31)
        {
            UFE.config.selectedStage = UFE.config.stages [4];
        }


// loading Hanuman character by checking whether user bought weapon or not
        switch (characterValue)
        {
        // level 1 cases
        case 1:
            if (WeaponPopUp.buygadha1 == true)
            {
                characterUpgradeValue = 0;
                this.characterUpgrade();
            }
            else
            {
                UFE.Warning(0f);
            }
            break;

        case 2:
            if (WeaponPopUp.buygadha2 == true)
            {
                characterUpgradeValue = 6;
                this.characterUpgrade();
            }
            else
            {
                UFE.secondPopUp(0f);
            }
            break;

        case 3:
            if (WeaponPopUp.buyArmour1 == true)
            {
                characterUpgradeValue = 7;
                this.characterUpgrade();
            }
            else
            {
                UFE.thirdPopUp(0f);
            }
            break;

        case 4:
            if (WeaponPopUp.buygadha3 == true)
            {
                characterUpgradeValue = 8;
                this.characterUpgrade();
            }
            else
            {
                UFE.fourthPopUp(0f);
            }
            break;

        case 5:
            if (WeaponPopUp.buyArmour2 == true)
            {
                characterUpgradeValue = 9;
                this.characterUpgrade();
            }
            else
            {
                UFE.fifthPopUp(0f);
            }
            break;

        case 10:
            if (WeaponPopUp.level2buygadha == true)
            {
                characterUpgradeValue = 14;
                this.characterUpgrade();
            }
            else
            {
//				UFE.StartGame(0);
                UFE.WarningLevel2(0f);
            }
            break;

        case 11:
            if (WeaponPopUp.level2buyarmour == true)
            {
                characterUpgradeValue = 15;
                this.characterUpgrade();
            }
            else
            {
                UFE.treemanWarning2Popup(0);
            }
            break;

        case 12:
            if (WeaponPopUp.level2buygadha2 == true)
            {
                characterUpgradeValue = 16;
                this.characterUpgrade();
            }
            else
            {
                UFE.treemanWarning3Popup(0);
            }
            break;

        case 13:
            if (WeaponPopUp.level2buyarmour2 == true)
            {
                characterUpgradeValue = 17;
                this.characterUpgrade();
            }
            else
            {
                UFE.treemanWarning4Popup(0);
            }
            break;

        case 18:
            if (WeaponPopUp.level2buyarmour3 == true)
            {
                characterUpgradeValue = 25;
                this.characterUpgrade();
            }
            else
            {
                UFE.lankiniWarningPopUp(0);
            }
            break;

        case 19:
            if (WeaponPopUp.level3buygadha == true)
            {
                characterUpgradeValue = 23;
                this.characterUpgrade();
            }
            else
            {
                UFE.WarningLevel3(0);
            }
            break;

        case 20:
            if (WeaponPopUp.level3buygadha2 == true)
            {
                characterUpgradeValue = 24;
                this.characterUpgrade();
            }
            else
            {
                UFE.MahiravanaWarningPopup(0);
            }
            break;

        case 21:
            if (WeaponPopUp.level3buyarmour == true)
            {
                characterUpgradeValue = 22;
                this.characterUpgrade();
            }
            else
            {
                UFE.indrajithWarningPopUp(0);
            }
            break;

        default:
            UFE.StartGame(0);
            break;
        }
    }
    public virtual void OnCharacterSelectionAllowed(int characterIndex, int player)
    {
        // If we haven't started loading a different screen....
        if (!this.closing)
        {
            // Check if we are trying to select or deselect a character...
            if (characterIndex >= 0 && characterIndex < this.selectableCharacters.Length)
            {
                // If we are selecting a character, check if the player has already selected a character...
                if (
                    player == 1 && UFE.config.player1Character == null ||
                    player == 2 && UFE.config.player2Character == null
                    )
                {
                    // If the player hasn't selected any character yet, process the request...
                    this.SetHoverIndex(player, characterIndex);
                    CharacterInfo character = this.selectableCharacters[characterIndex];
                    if (this.selectSound != null)
                    {
                        UFE.PlaySound(this.selectSound);
                    }
                    if (character != null && character.selectionSound != null)
                    {
                        UFE.PlaySound(character.selectionSound);
                    }
                    UFE.SetPlayer(player, character);


                    // And check if we should start loading the next screen...
                    if (
                        UFE.config.player1Character != null &&
                        (UFE.config.player2Character != null || UFE.gameMode == GameMode.StoryMode)
                        )
                    {
                        this.GoToNextScreen();
                    }
                }
            }
            else if (characterIndex < 0)
            {
                if (
                    // If we are trying to deselect a character, check if at least one player has selected a character
                    UFE.config.player1Character != null || UFE.config.player2Character != null
                    ||
                    // In network games, we also allow to return to the previous screen if the one of the player
                    // doesn't have a character selected and he press the back button. We want to return to the
                    // previous screen even if the other player has a character selected.
                    UFE.gameMode == GameMode.NetworkGame
                    &&
                    (
                        player == 1 && UFE.config.player1Character == null ||
                        player == 2 && UFE.config.player2Character == null
                    )
                    )
                {
                    // In that case, check if the player that wants to deselect his current character has already
                    // selected a character and try to deselect that character.
                    if (
                        player == 1 && UFE.config.player1Character != null ||
                        player == 2 && UFE.config.player2Character != null
                        )
                    {
                        if (this.cancelSound != null)
                        {
                            UFE.PlaySound(this.cancelSound);
                        }
                        UFE.SetPlayer(player, null);
                    }
                }
                else
                {
                    // If none of the players has selected a character and one of the player wanted to deselect
                    // his current character, that means that the player wants to return to the previous menu instead.
                    this.GoToPreviousScreen();
                }
            }
        }
    }