private void Start() { _o = Overlord._instance; if (_o.eventsCompleted % 10 == 0 && _o.eventsCompleted != 0) { locations[rng.Next(locations.Length)].SetEvent(_o.CreateEvent(_o.bossFights)); } else { int c = 0; for (int i = 0; i < numEventsRound; i++) { c = (c + rng.Next(locations.Length)) % locations.Length; for (int j = 0; j < locations.Length; j++) { if (locations[c].locationEvent != null) { continue; } Overlord.EventTypes et = events[rng.Next(events.Length)]; locations[c].SetEvent(_o.GetRandomEvent(et)); break; } } } hpText.text = "HP: " + PlayerPrefs.GetInt("player_health", 100).ToString(); insanityText.text = "Insanity: " + _o.enemyLevel; for (int i = 0; i < itemsUI.Length; i++) { if (i < _o.inventory.Count) { itemsUI[i].enabled = true; itemsUI[i].item = _o.inventory[i]; itemsUI[i].tooltip = itemTooltip; Image img = itemsUI[i].gameObject.GetComponent <Image>(); img.sprite = _o.inventory[i].artwork; img.color = Color.white; } else { itemsUI[i].enabled = false; } } }
// Use this for initialization void Start() { _o = FindObjectOfType <Overlord>(); player = FindObjectOfType <Player>(); // Get and Display Enemies if (_o.currentEvent == null) { Debug.LogWarning("[Manager::Start] No enemies in Overlord to populate fight."); _o.currentEvent = _o.CreateEvent(_o.sentinelFights); } for (int i = 0; i < _o.currentEvent.enemies.Length; i++) { CreateEnemy(i); } SetTarget(_enemies[0]); foreach (Enemy e in _enemies) { turns.Enqueue(e); } turns.Enqueue(player); // Create draft and discard piles discard = new List <Card>(); pile = new List <Card>(_o.collection); pile = Collection.Shuffle(pile); // Store Token-Color pairs in a dictionary for convenience for (int i = 0; i < tokenColors.Length; i++) { tokenColorsDict[tokenColors[i].type] = tokenColors[i].value; } // Initialize selectedTokens with each token at 0 foreach (Collection.TokenTypes token in System.Enum.GetValues(typeof(Collection.TokenTypes))) { selectedTokens[token] = 0; } // Display Information DisplayHabilities(); DisplayInventory(); // Start the Fight turns.Peek().StartTurn(); }