public void Capture() { if (Random.Range(0, Enemy.GetMaxHealth()) < Enemy.GetCurrentHealth()) { CUI.DisplayLine("Capture failed!"); } else { dragon_action = DragonAction.None; captured = true; CUI.CaptureDragon(); CUI.DisplayLine(Enemy.GetName() + " captured!"); GameObject.Find("Enemy").GetComponent <SpriteRenderer>().enabled = false; if (Player.GetNumDragons() < 4) { Player.AddDragon(Enemy.GetName(), -1); CUI.Wait(); } else { CUI.ReplaceDragon(); } } }