Ejemplo n.º 1
0
 public void CheckForVictory1v1(Character f1, Character f2)
 {
     if (f1.CurrentHealth <= 0)
     {
         if (PlayerWatchingFight)
         {
             fightPanel.UpdateTextLog(f1.FirstName + " " + f1.LastName + " is down!");
             fightPanel.UpdateTextLog(f2.FirstName + " has " + f2.CurrentHealth + " health left.");
             fightPanel.UpdateTextLog(f2.FirstName + " " + f2.LastName + " wins!");
         }
         f2.GainExperience(500);
         f1.GainExperience(250);
         FightManager.PayOut(Audience, f2, f1, false);
         FightOver = true;
         FightPlanButton.GetComponent <FightPlanListButton> ().FightHasBeen(f2);
     }
     else if (f2.CurrentHealth <= 0)
     {
         if (PlayerWatchingFight)
         {
             fightPanel.UpdateTextLog(f2.FirstName + " " + f2.LastName + " is down!");
             fightPanel.UpdateTextLog(f1.FirstName + " has " + f1.CurrentHealth + " health left.");
             fightPanel.UpdateTextLog(f1.FirstName + " " + f1.LastName + " wins!");
         }
         f1.GainExperience(500);
         f2.GainExperience(250);
         FightManager.PayOut(Audience, f1, f2, false);
         FightOver = true;
         FightPlanButton.GetComponent <FightPlanListButton> ().FightHasBeen(f1);
     }
 }
Ejemplo n.º 2
0
    public void FightRoundTick()
    {
        FightTick(f1, f2, Audience);
        Audience.RegularAudienceAppreciationAdjustment(f1, f2, LastDamageDone, false);
        CheckForVictory1v1(f1, f2);
        FightTick(f2, f1, Audience);
        CheckForVictory1v1(f1, f2);
        Audience.RegularAudienceAppreciationAdjustment(f2, f1, LastDamageDone, false);

        //Report damage every ten ticks
        if (TickCount > 9 && TickCount % 5 == 0 && !FightOver)
        {
            if (PlayerWatchingFight)
            {
                string attackReport = f1.FirstName + " did " + f1damageToReport + " damage to " + f2.FirstName;
                fightPanel.UpdateTextLog(attackReport);
                f1damageToReport = 0;
                attackReport     = f2.FirstName + " did " + f2damageToReport + " damage " + f1.FirstName;
                fightPanel.UpdateTextLog(attackReport);
                f2damageToReport = 0;
                fightPanel.UpdateTextLog("This was tick " + TickCount);
                fightPanel.fighterBox1.UpdateHealthAndEnergy();
                fightPanel.fighterBox2.UpdateHealthAndEnergy();
            }
        }

        if (TickCount > 19 && TickCount % 20 == 0 && !FightOver && PlayerWatchingFight)
        {
            //	fightPanel.UpdateTextLog("The audience has " + Audience.AudienceAppreciation + "appreciation for this fight.");
        }

        if (TickCount >= 120)
        {
            if (PlayerWatchingFight)
            {
                fightPanel.UpdateTextLog("The fight is at and end. A draw!");
                fightPanel.UpdateTextLog(f1.FirstName + " has " + f1.CurrentHealth + " health left.");
                fightPanel.UpdateTextLog(f2.FirstName + " has " + f2.CurrentHealth + " health left.");
            }
            f1.GainExperience(400);
            f2.GainExperience(400);
            FightManager.PayOut(Audience, f2, f1, true);
            FightPlanButton.GetComponent <FightPlanListButton> ().FightHasBeen(null);
        }

        TickCount++;
    }