Example #1
0
    public override void Execute()
    {
        if (RequareTime > 1)
        {
            RequareTime--;
            _clock.text = RequareTime.ToString();
        }
        else
        {
            for (int i = 0; i < SelSurv.Count; i++)
            {
                SelSurv[i].Status = "Idle";
                SelSurv[i].Unlock();
            }

            for (int i = 0; i < SelSurv.Count; i++)
            {
                CurLoc.ZombiesAmount -= (int)SelSurv[i].SpecBonus.SoldierBonus * 2 + 1;

                if (CurLoc.ZombiesAmount <= 0)
                {
                    CurLoc.ZombiesAmount = 0;
                    break;
                }
            }

            if (Danger != 0)
            {
                int chance = Random.Range(0, 100);

                if (chance > 0 && chance < Danger)
                {
                    int tempRange = Random.Range(0, SelSurv.Count);
                    SelSurv[tempRange].Status = "Die at Killing Zombies mission";
                    SelSurv[tempRange].Die();
                }
            }

            CurLoc.ChangeInfestedStatus();

            foreach (Survivor surv in SelSurv)
            {
                if (surv.Alive)
                {
                    surv.Train(new SpecialisationBonus(0, 1, 0, 0, 0));
                }
            }

            _clock.transform.parent.gameObject.SetActive(false);
            MainScript.ActiveMissions.Remove(this);
        }
    }
Example #2
0
    public override void Execute()
    {
        if (RequareTime > 1)
        {
            RequareTime--;
            _clock.text = RequareTime.ToString();
        }
        else
        {
            Index   tempId           = CurLoc.GetComponent <Location>().Id;
            Vector3 tempPos          = CurLoc.transform.localPosition;
            int     tempSiblingIndex = CurLoc.transform.GetSiblingIndex();

            GameObject newGameObj = GameObject.Instantiate(Resources.Load("Prefabs/Locations/SecureMall")) as GameObject;
            newGameObj.transform.SetParent(MainScript.transform);
            newGameObj.transform.SetSiblingIndex(tempSiblingIndex);
            newGameObj.transform.localPosition = tempPos;
            newGameObj.GetComponent <Location>().Initialize(tempId);
            newGameObj.GetComponent <Location>().Neighbours = CurLoc.Neighbours;
            GameObject.Destroy(MainScript.Map[tempId.x][tempId.y].gameObject);
            MainScript.Map[tempId.x][tempId.y]     = newGameObj.GetComponent <Location>();
            MainScript.Map[tempId.x][tempId.y + 1] = newGameObj.GetComponent <Location>();
            newGameObj.GetComponent <Location>().NeighboursAttached = false;

            foreach (Location loc in newGameObj.GetComponent <Location>().Neighbours)
            {
                loc.NeighboursAttached = false;
                loc.Neighbours.Clear();
                loc.UpdateNeighbours();
            }
            newGameObj.GetComponent <Location>().Reclaim();

            for (int i = 0; i < SelSurv.Count; i++)
            {
                SelSurv[i].Unlock();
            }

            foreach (Survivor surv in SelSurv)
            {
                if (surv.Alive)
                {
                    surv.Train(new SpecialisationBonus(0, 0, 1, 0, 0));
                }
            }

            MainScript.ActiveMissions.Remove(this);
        }
    }
Example #3
0
 public override bool CheckConditions()
 {
     if (CurLoc.ZombiesAmount > 0)
     {
         Status = "Ther are to many zombies at this location";
         return(false);
     }
     else if (CurLoc.ZombiesAmount == 0 && !CurLoc.CheckNeighbours())
     {
         Status = "This location is to far from fort";
         return(false);
     }
     else
     {
         return(true);
     }
 }
Example #4
0
    public override void Execute()
    {
        if (RequareTime > 1)
        {
            RequareTime--;
            _clock.text = RequareTime.ToString();
        }
        else
        {
            CurLoc.Reclaim();
            _clock.transform.parent.gameObject.SetActive(false);

            for (int i = 0; i < SelSurv.Count; i++)
            {
                SelSurv[i].Status = "Idle";
                SelSurv[i].Unlock();
            }

            if (Danger != 0)
            {
                int chance = Random.Range(0, 100);

                if (chance > 0 && chance < Danger)
                {
                    int tempRange = Random.Range(0, SelSurv.Count);
                    SelSurv[tempRange].Status = "Die at Reclaim Area mission";
                    SelSurv[tempRange].Die();
                }
            }

            foreach (Survivor surv in SelSurv)
            {
                if (surv.Alive)
                {
                    surv.Train(new SpecialisationBonus(0, 0, 1, 0, 0));
                }
            }

            MainScript.ActiveMissions.Remove(this);
        }
    }