public MonsterCardInstance RunStrategy(EnemyInstance self, BattleContext context) { float result = Random.Range(0f, 1.0f); MonsterCardInstance card = null; for (int cnt = 0; cnt < _probabilities.Length; cnt++) { result -= _probabilities[cnt]; if (result <= 0.0f) { if (self.GetCards().GetCount() > cnt) { card = self.GetCards().Get(cnt); } break; } } return(card); }
public MonsterCardInstance RunStrategy(EnemyInstance self, BattleContext context) { _currentSequence = (_currentSequence + 1) % _sequence.Length; return(self.GetCards().Get(_sequence[_currentSequence])); }