예제 #1
0
    // Update is called once per frame
    void Update()
    {
        getTurn();

        if (AttackBoost.boostAppliedWarrior == true && AttackBoost.statRevertedWarrior == false && currentTurn == AttackBoost.boostEndWarrior)
        {
            WarriorScript.setAttackStat(10);
            AttackBoost.statRevertedWarrior = true;
            print("Stat reverted for Warrior");
        }        //end if

        if (AttackBoost.boostAppliedMage == true && AttackBoost.statRevertedMage == false && currentTurn == AttackBoost.boostEndMage)
        {
            MageScript.setAttackStat(5);
            AttackBoost.statRevertedMage = true;
            print("Stat reverted for Mage");
        }        //end if

        if (WarriorScript.getCurrentHP() > 100)
        {
            WarriorScript.setHP(100);
        }        //end if

        if (MageScript.getCurrentHP() > 80)
        {
            MageScript.setHP(80);
        }        //end if
    }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        GameObject warriorStatText = GameObject.Find("WarriorStatText");

        warriorStats      = warriorStatText.GetComponent <Text>();
        warriorStats.text = "Warrior - HP: " + WarriorScript.getCurrentHP() + "/"
                            + WarriorScript.getMaxHP() + " MP: " + WarriorScript.getCurrentMP() + "/" + WarriorScript.getMaxMP();
    }
예제 #3
0
 public void onPotionWarrior()
 {
     if (WarriorScript.getCurrentHP() + 50 >= 100)
     {
         WarriorScript.setHP(100);
     }        //end if
     else
     {
         WarriorScript.setHP(WarriorScript.getCurrentHP() + 50);
     } //end else
     BattleTurn.currentTurn++;
 }     //end onPotion
예제 #4
0
    public void onMoreHealWarrior()
    {
        if (BattleTurn.playerCurrentMP >= 12)
        {
            if (BattleTurn.currentTurn % 4 == 0)
            {
                WarriorScript.setHP(WarriorScript.getCurrentHP() + BattleTurn.playerMagicStat + 20);
                WarriorScript.setMP(WarriorScript.getCurrentMP() - 12);
            }            //end if

            if (BattleTurn.currentTurn % 4 == 1)
            {
                WarriorScript.setHP(WarriorScript.getCurrentHP() + BattleTurn.playerMagicStat + 20);
                MageScript.setMP(MageScript.getCurrentMP() - 12);
            }

            BattleTurn.currentTurn++;
        }
        else if (BattleTurn.playerCurrentMP < 12)
        {
            errorSound.Play();
        } //end else if
    }     //end onMoreHealWarrior
예제 #5
0
    public void getTurn()
    {
        //if % = 0, then its Warrior turn
        if (currentTurn % 4 == 0)
        {
            playerAttackStat  = WarriorScript.getAttackStat();
            playerDefenseStat = WarriorScript.getDefenseStat();
            playerSpeedStat   = WarriorScript.getSpeedStat();
            playerMagicStat   = WarriorScript.getMagicStat();
            playerCurrentHP   = WarriorScript.getCurrentHP();
            playerMaxHP       = WarriorScript.getMaxHP();
            playerCurrentMP   = WarriorScript.getCurrentMP();
            playerMaxMP       = WarriorScript.getMaxMP();
        }        //end if

        //if % = 1, then its Mage turn
        if (currentTurn % 4 == 1)
        {
            playerAttackStat  = MageScript.getAttackStat();
            playerDefenseStat = MageScript.getDefenseStat();
            playerSpeedStat   = MageScript.getSpeedStat();
            playerMagicStat   = MageScript.getMagicStat();
            playerCurrentHP   = MageScript.getCurrentHP();
            playerMaxHP       = MageScript.getMaxHP();
            playerCurrentMP   = MageScript.getCurrentMP();
            playerMaxMP       = MageScript.getMaxMP();
        }        //end if

        //if % = 2, then its Enemy1 turn
        if (currentTurn % 4 == 2 && EnemyScript.getCurrentHP() > 0)
        {
            int randomTarget;
            randomTarget = Random.Range(1, 100);
            print(randomTarget);


            if (randomTarget <= 50)
            {
                WarriorScript.setHP(WarriorScript.getCurrentHP() - EnemyScript.getAttackStat() + WarriorScript.getDefenseStat() - 10);
            }            //end if
            if (randomTarget > 50)
            {
                MageScript.setHP(MageScript.getCurrentHP() - EnemyScript.getAttackStat() + MageScript.getDefenseStat() - 10);
            }    //end if
            currentTurn++;
        }        //end if
        else if (currentTurn % 4 == 2)
        {
            currentTurn++;
        }

        //if % = 3, then its Enemy2 turn
        if (currentTurn % 4 == 3 && Enemy2Script.getCurrentHP() > 0)
        {
            int randomTarget;
            randomTarget = Random.Range(1, 100);
            print(randomTarget);

            if (randomTarget <= 50)
            {
                WarriorScript.setHP(WarriorScript.getCurrentHP() - Enemy2Script.getAttackStat() + WarriorScript.getDefenseStat() - 10);
            }            //end if
            if (randomTarget > 50)
            {
                MageScript.setHP(MageScript.getCurrentHP() - Enemy2Script.getAttackStat() + MageScript.getDefenseStat() - 10);
            }    //end if
            currentTurn++;
        }        //end if
        else if (currentTurn % 4 == 3)
        {
            currentTurn++;
        }
    }//end getTurn
예제 #6
0
 // Update is called once per frame
 void Update()
 {
     warriorStats.text = "Warrior - HP: " + WarriorScript.getCurrentHP() + "/"
                         + WarriorScript.getMaxHP() + " MP: " + WarriorScript.getCurrentMP() + "/" + WarriorScript.getMaxMP();
 }