// Stalls the person at its goal house protected virtual IEnumerator Stall() { if (HouseManager.houses.ContainsKey(goalIndex)) { House h = HouseManager.houses[goalIndex]; if (h.HasAvailableStallSpace()) { MoveToPosition(h.AddStalledPerson(this)); stalledAt.Add(h); yield return(new WaitForSeconds(stallTime)); h.RemoveStalledPerson(this); stalledAt.Remove(h); if (spriteRenderer.color == storeColor) { UnHighlight(); } CompletePath(); } else { CompletePath(); } } else { CompletePath(); } }
// If the targeted house exists and has open space, go attack it protected override void Attack() { if (HouseManager.houses.ContainsKey(goalIndex)) { House h = HouseManager.houses[goalIndex]; if (h.HasAvailableStallSpace()) { MoveToPosition(h.AddStalledPerson(this)); stalledAt.Add(h); StartCoroutine(Shoot(h)); } else { CompletePath(); } } else { CompletePath(); } }