private void addSkills19() { EnemyBoardSkill antiRow = null; Func <List <Vector2Int> > randOrbPerRow = () => { System.Random rand = new System.Random(getRandomSeedByTurn(antiRow)); List <int> remainingCols = new List <int>(); for (int i = 0; i < Board.COLUMNS; i++) { remainingCols.Add(i); } List <Vector2Int> chosenOrbs = new List <Vector2Int>(); for (int r = Board.ROWS - 1; r >= 0; r--) { int randCol = rand.Next(remainingCols.Count); chosenOrbs.Add(new Vector2Int(remainingCols[randCol], r)); remainingCols.RemoveAt(randCol); } return(chosenOrbs); }; antiRow = EnemyBoardSkill.MarkOrderSkill(() => GameController.Instance.isTurnMod(3, 1), randOrbPerRow, 0.1f, skillTrans, 1); antiRow.addSetSkill(0.1f, (Orb o) => ORB_VALUE.POISON); skillList.Add(antiRow); skillList.Add(EnemyHPBuff.Create(() => GameController.Instance.isTurnMod(4, 2), EnemyBuffs.DMG_MITI_50, () => this, 1, skillTrans)); EnemyTimer DOT = EnemyTimer.Create(() => true, 2f, -1, skillTrans); DOT.addDOTSkill(() => 2); skillList.Add(DOT); skillList.Add(EnemyAttack.Create(() => true, false, () => Player.Instance.gameObject, () => (int)(-GameController.Instance.getTimeOnFloor() * 5), skillTrans)); }
private void addSkills17() { EnemyBoardSkill stopCol = null; Func <List <Vector2Int> > randOrbPerCol = () => { System.Random rand = new System.Random(getRandomSeedByTurn(stopCol)); List <int> remainingRows = new List <int>(); for (int i = 0; i < Board.ROWS; i++) { remainingRows.Add(i); } remainingRows.Add(rand.Next(Board.ROWS)); List <Vector2Int> chosenOrbs = new List <Vector2Int>(); for (int c = 0; c < Board.COLUMNS; c++) { int randRow = rand.Next(remainingRows.Count); chosenOrbs.Add(new Vector2Int(c, remainingRows[randRow])); remainingRows.RemoveAt(randRow); } return(chosenOrbs); }; stopCol = EnemyBoardSkill.MarkOrderSkill(() => GameController.Instance.isTurnMod(3), randOrbPerCol, 0.1f, skillTrans, 1); stopCol.addSetSkill(0.1f, (Orb o) => ORB_VALUE.STOP); skillList.Add(stopCol); skillList.Add(EnemyHPBuff.Create(() => GameController.Instance.isTurnMod(4), EnemyBuffs.DMG_MITI_50, () => this, 1, skillTrans)); EnemyTimer DOT = EnemyTimer.Create(() => true, 2f, -1, skillTrans); DOT.addDOTSkill(() => 5); DOT.addTimeDelay(1f); skillList.Add(DOT); skillList.Add(EnemyAttack.Create(() => true, false, () => Player.Instance.gameObject, () => (int)(-GameController.Instance.getTimeOnFloor() * 2), skillTrans)); }
protected override void addAllSkills() { EnemyOrbSkill equalRates = EnemyOrbSkill.Create(() => true, (ORB_VALUE o) => o <= ORB_VALUE.NINE ? OrbSpawnRate.NORMAL : OrbSpawnRate.DECREASED, -1, skillTrans); skillList.Add(equalRates); EnemyTimer evenGrowth = EnemyTimer.Create(() => true, 2f, -1, skillTrans); evenGrowth.addDOTSkill(() => - 2 * (int)GameController.Instance.getState().timeOnTurn); skillList.Add(evenGrowth); EnemyHPBuff randHPBuff = EnemyHPBuff.Create(() => GameController.Instance.isTurnMod(4), default, () => this, 2, skillTrans);
private void addSkills28() { Func <Enemy> getTarget = () => GameController.Instance.getCurrEnemies()[RNG.Next(GameController.Instance.getCurrEnemies().Count)]; skillList.Add(EnemyHPBuff.Create(() => GameController.Instance.isTurnMod(3, 2), EnemyBuffs.DMG_REFLECT, getTarget, 1, skillTrans)); EnemyBoardSkill decEight = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(3), (Orb o) => o.getOrbValue() == ORB_VALUE.EIGHT, 0.1f, skillTrans); decEight.addIncSkill(0.1f, (Orb o) => - 3); skillList.Add(decEight); EnemyTimer DOT8 = EnemyTimer.Create(() => GameController.Instance.isTurnMod(3, 1), 1f, 1, skillTrans); DOT8.addDOTSkill(() => - 8); skillList.Add(DOT8); skillList.Add(EnemyAttack.Create(() => GameController.Instance.isTurnMod(3, 2), false, () => Player.Instance.gameObject, () => - currState.damage, skillTrans)); }
private void addSkills27() { Func <Enemy> getTarget = () => GameController.Instance.getCurrEnemies()[RNG.Next(GameController.Instance.getCurrEnemies().Count)]; skillList.Add(EnemyHPBuff.Create(() => GameController.Instance.isTurnMod(3, 1), EnemyBuffs.DMG_MITI_50, getTarget, 1, skillTrans)); EnemyBoardSkill decSeven = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(3, 2), (Orb o) => o.getOrbValue() == ORB_VALUE.SEVEN, 0.1f, skillTrans); decSeven.addIncSkill(0.1f, (Orb o) => - 2); skillList.Add(decSeven); EnemyTimer DOT7 = EnemyTimer.Create(() => GameController.Instance.isTurnMod(3), 1f, 1, skillTrans); DOT7.addDOTSkill(() => - 7); skillList.Add(DOT7); skillList.Add(EnemyAttack.Create(() => GameController.Instance.isTurnMod(3, 1), false, () => Player.Instance.gameObject, () => - currState.damage, skillTrans)); }
private void addHardSkill(int index) { System.Random rand = new System.Random(getRandomSeedByFloor()); Func <bool> wtu = () => true; Func <ORB_VALUE, OrbSpawnRate> newSpawnRates; bool markZeroAndFives = currState.number % 5 == 0; bool isAnti = RNG.Next(2) == 0; switch (index) { case 0: int numNullify = rand.Next(1, 3); wtu = () => GameController.Instance.isTurnMod(2 * numNullify, RNG.Next(numNullify)); Func <Orb, bool> randZeros = (Orb o) => { List <Orb> currZeros = new List <Orb>(); for (int i = 0; i < Board.COLUMNS; i++) { for (int j = 0; j < Board.ROWS; j++) { Orb z = Board.Instance.getOrb(i, j); if (z.getOrbValue() == ORB_VALUE.ZERO) { currZeros.Add(z); } } } for (int i = 0; i < numNullify && currZeros.Count > 0; i++) { int orb = rand.Next(currZeros.Count); if (currZeros[orb] == o) { return(true); } currZeros.RemoveAt(orb); } return(false); }; EnemyBoardSkill zerosToNullify = EnemyBoardSkill.MarkIfSkill(wtu, randZeros, 0.1f, skillTrans); zerosToNullify.addSetSkill(0.1f, (Orb o) => ORB_VALUE.NULLIFY); skillList.Add(zerosToNullify); break; case 1: int numOrbReduce = rand.Next(1, 4); newSpawnRates = (ORB_VALUE orbVal) => { if (markZeroAndFives) { return(orbVal == ORB_VALUE.ZERO || orbVal == ORB_VALUE.FIVE ? OrbSpawnRate.DECREASED : Board.getDefaultOrbSpawnRates()[(int)orbVal]); } return(orbVal <= ORB_VALUE.NINE && (int)orbVal % 2 == 0 ? OrbSpawnRate.DECREASED : Board.getDefaultOrbSpawnRates()[(int)orbVal]); }; wtu = () => GameController.Instance.isTurnMod(2 * numOrbReduce, RNG.Next(numOrbReduce)); skillList.Add(EnemyOrbSkill.Create(wtu, newSpawnRates, numOrbReduce, skillTrans)); break; case 2: wtu = () => GameController.Instance.isTurnMod(3, RNG.Next(3)); Func <Orb, bool> evensOrFives = (Orb o) => o.isDigit() && o.getIntValue() % (markZeroAndFives ? 5 : 2) == 0; EnemyBoardSkill clearEvensOrFives = EnemyBoardSkill.MarkIfSkill(wtu, evensOrFives, 0.1f, skillTrans); clearEvensOrFives.addRmvSkill(0); skillList.Add(clearEvensOrFives); break; case 3: wtu = () => GameController.Instance.isTurnMod(3, RNG.Next(3)); EnemyBoardSkill replaceWithAntiOrStop = null; replaceWithAntiOrStop = EnemyBoardSkill.MarkOrderSkill(wtu, () => getRandomPattern(replaceWithAntiOrStop), 0.1f, skillTrans, 1); replaceWithAntiOrStop.addSetSkill(0.1f, (Orb o) => isAnti ? ORB_VALUE.POISON : ORB_VALUE.STOP); skillList.Add(replaceWithAntiOrStop); break; case 4: wtu = () => GameController.Instance.isTurnMod(4, RNG.Next(4)); EnemyBoardSkill emptyFourLines = null; emptyFourLines = EnemyBoardSkill.MarkOrderSkill(wtu, () => getFourLines(emptyFourLines), 0.1f, skillTrans, 1); emptyFourLines.addSetSkill(0.1f, (Orb o) => ORB_VALUE.EMPTY); skillList.Add(emptyFourLines); break; case 5: wtu = () => GameController.Instance.isTurnMod(3, RNG.Next(3)); EnemyBoardSkill allHealsToAntiOrStop = EnemyBoardSkill.MarkIfSkill(wtu, (Orb o) => o.getOrbValue() == ORB_VALUE.ZERO, 0.1f, skillTrans, 1); allHealsToAntiOrStop.addSetSkill(0.1f, (Orb o) => isAnti ? ORB_VALUE.POISON : ORB_VALUE.STOP); skillList.Add(allHealsToAntiOrStop); break; case 6: int numNoneZeroTurns = rand.Next(1, 3); newSpawnRates = (ORB_VALUE orbVal) => orbVal == ORB_VALUE.ZERO ? OrbSpawnRate.NONE : Board.getDefaultOrbSpawnRates()[(int)orbVal]; wtu = () => GameController.Instance.isTurnMod(2 * numNoneZeroTurns, RNG.Next(numNoneZeroTurns)); skillList.Add(EnemyOrbSkill.Create(wtu, newSpawnRates, numNoneZeroTurns, skillTrans)); break; case 7: int antiOrStop = rand.Next(2, 4); newSpawnRates = (ORB_VALUE orbVal) => orbVal == (antiOrStop == 2 ? ORB_VALUE.POISON : ORB_VALUE.STOP) ? OrbSpawnRate.INCREASED : Board.getDefaultOrbSpawnRates()[(int)orbVal]; wtu = () => GameController.Instance.isTurnMod(antiOrStop, RNG.Next(antiOrStop - 1)); skillList.Add(EnemyOrbSkill.Create(wtu, newSpawnRates, 1, skillTrans)); break; case 8: int numTimerTurns = rand.Next(1, 3); wtu = () => GameController.Instance.isTurnMod(2 * numTimerTurns, RNG.Next(numTimerTurns)); EnemyTimer numDOT = EnemyTimer.Create(wtu, Mathf.Clamp(currState.number / 10f, 0f, 10f), numTimerTurns, skillTrans); numDOT.addDOTSkill(() => - currState.number); skillList.Add(numDOT); break; case 9: int numDecrement = rand.Next(1, 4); wtu = () => GameController.Instance.isTurnMod(numDecrement + 2, RNG.Next(numDecrement)); EnemyBoardSkill decrementPattern = null; decrementPattern = EnemyBoardSkill.MarkOrderSkill(wtu, () => getRandomPattern(decrementPattern), 0.1f, skillTrans, numDecrement); decrementPattern.addIncSkill(0.1f, (Orb o) => - numDecrement); skillList.Add(decrementPattern); break; } }