Ejemplo n.º 1
0
 public void AtacarBase4(Soldier aSoldier)
 {
     aSoldier.GetComponent <CaptureFourthBase>().Cost = -99;
     aSoldier.GetComponent <CaptureBase>().Cost       = 1;
     aSoldier.GetComponent <BlockBridge>().Cost       = 1;
     RequestNewPlan(aSoldier.GetComponent <GoapAgent>());
 }
Ejemplo n.º 2
0
 private void AtacarBase2(Soldier soldier)
 {
     if (soldier.MyTransform.GetComponent <CaptureThirdBase>())
     {
         soldier.GetComponent <CaptureSecondBase>().Cost = -99;
         soldier.GetComponent <CaptureThirdBase>().Cost  = 1;
         RequestNewPlan(soldier.GetComponent <GoapAgent>());
     }
 }
Ejemplo n.º 3
0
 public void DecideBase2(Soldier aSoldier)
 {
     if (IsBase2Nossa(aSoldier))
     {
         AtacarBase3(aSoldier);
     }
     else
     {
         AtacarBase2(aSoldier);
     }
 }
Ejemplo n.º 4
0
 public bool Base1HasEnemys(Soldier aSoldier)
 {
     if (FindObjectsOfType <Base>().
         Where(b => (b.name.Equals("SE") && aSoldier.MyTeam == Teams.RedTeam && b.MemberOfTeamBlue.Count > b.MemberOfTeamRed.Count) ||
               (b.name.Equals("NE") && aSoldier.MyTeam == Teams.BlueTeam && b.MemberOfTeamRed.Count > b.MemberOfTeamBlue.Count)).Count() > 0)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 5
0
        /*#############################
        ###   CONTROLA PONTE      ###
        #############################*/

        public bool IsBase1Nossa(Soldier aSoldier)
        {
            if (FindObjectsOfType <Base>().
                Where(b => (b.name.Equals("SE") && aSoldier.MyTeam == Teams.RedTeam && b.MyTeam == Teams.RedTeam) ||
                      (b.name.Equals("NE") && aSoldier.MyTeam == Teams.BlueTeam && b.MyTeam == Teams.BlueTeam)).Count() > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 6
0
 public void DoWaitFlag(Soldier aSoldier, bool wait)
 {
     if (wait)
     {
         print("TM: ESPERA PELA BANDEIRA");
         aSoldier.GetComponent <WaitForFlag>().Cost = -99;
         RequestNewPlan(aSoldier.GetComponent <GoapAgent>());
     }
     else
     {
         aSoldier.GetComponent <WaitForFlag>().Cost = 1;
         RequestNewPlan(aSoldier.GetComponent <GoapAgent>());
     }
 }
Ejemplo n.º 7
0
        public void DecidePonte(Soldier aSoldier)
        {
            if (Base1HasEnemys(aSoldier))   //base 1 tem algum enimigo?
            {
                if (IsBase1Nossa(aSoldier)) //se a base ainda for nossa, esperam na ponte
                {
                    VoltaPonte(aSoldier);
                }

                else //se não ajuda a recuperar
                {
                    RecuperaBase1(aSoldier);
                }
            }
            else //se nao tem inimigos, ataca a base 4
            {
                AtacarBase4(aSoldier);
            }
        }