public override void Execute() { if (RequareTime > 1) { RequareTime--; _clock.text = RequareTime.ToString(); } else { foreach (Survivor selSurv in SelSurv) { if (selSurv.SpecBonus.LeaderBonus >= 1) { for (int i = 0; i < CurLoc.SpotSurv.Count; i++) { MainScript.AddSurvivor(CurLoc.SpotSurv[i]); } break; } } CurLoc.SpotSurv.Clear(); for (int i = 0; i < SelSurv.Count; i++) { 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 Reacruting survivors mission"; SelSurv[tempRange].Die(); } } foreach (Survivor surv in SelSurv) { if (surv.Alive) { surv.Train(new SpecialisationBonus(1, 0, 0, 0, 0)); } } _clock.transform.parent.gameObject.SetActive(false); MainScript.ActiveMissions.Remove(this); } }
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); } }
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); } }
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); } }
public override void Execute() { if (RequareTime > 1) { RequareTime--; _clock.text = RequareTime.ToString(); } else { for (int i = 0; i < SelSurv.Count; i++) { if (CurLoc.SurvPres.Count > 1 && SelSurv[i].SpecBonus.ScavangerBonus > 1) { int spotAmount = Random.Range(1, CurLoc.SurvPres.Count); for (int j = 0; j < spotAmount; j++) { CurLoc.SpotSurv.Add(CurLoc.SurvPres[j]); } break; } else if (CurLoc.SurvPres.Count != 0 && SelSurv[i].SpecBonus.ScavangerBonus >= 0) { int spotAmount = Random.Range(1, CurLoc.SurvPres.Count); for (int j = 0; j < spotAmount; j++) { CurLoc.SpotSurv.Add(CurLoc.SurvPres[j]); if (j > 1) { break; } } break; } else if (CurLoc.SurvPres.Count == 0) { break; } } CurLoc.Scouted = true; for (int i = 0; i < SelSurv.Count; i++) { 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 Scouting area mission"; SelSurv[tempRange].Die(); } } 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); } }