コード例 #1
0
    private void addSkills16()
    {
        EnemyBoardSkill setFoursToEmpty = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(3, 2), (Orb o) => o.getOrbValue() == ORB_VALUE.FOUR, 0.1f, skillTrans);

        setFoursToEmpty.addSetSkill(0.1f, (Orb o) => ORB_VALUE.EMPTY);
        skillList.Add(setFoursToEmpty);

        Func <ORB_VALUE, OrbSpawnRate> incNullify = (ORB_VALUE orbVal) => orbVal == ORB_VALUE.NULLIFY ? OrbSpawnRate.INCREASED : Board.getDefaultOrbSpawnRates()[(int)orbVal];

        skillList.Add(EnemyOrbSkill.Create(() => GameController.Instance.isTurnMod(3), incNullify, 1, skillTrans));

        skillList.Add(EnemyAttack.Create(() => GameController.Instance.isTurnMod(3, 1), false, () => Player.Instance.gameObject, () => - currState.damage, skillTrans));
    }
コード例 #2
0
    private void addSkills11()
    {
        Func <Enemy> getEnemy = () => {
            foreach (Enemy e in GameController.Instance.getCurrEnemies())
            {
                if (e.getEnemyID() != getEnemyID())
                {
                    return(e);
                }
            }
            return(null);
        };

        skillList.Add(EnemyHPBuff.Create(() => GameController.Instance.isTurnMod(2), EnemyBuffs.DMG_ABSORB, getEnemy, 1, skillTrans));

        EnemyBoardSkill  oneEmptyPerDigit = null;
        Func <Orb, bool> randDigits       = (Orb o) => {
            System.Random rand = new System.Random(getRandomSeedByTurn(oneEmptyPerDigit));
            for (int i = 0; i < 10; i++)
            {
                List <Orb> currDigit = new List <Orb>();
                for (int j = 0; j < Board.COLUMNS; j++)
                {
                    for (int k = 0; k < Board.ROWS; k++)
                    {
                        Orb z = Board.Instance.getOrb(j, k);
                        if (z.getOrbValue() == (ORB_VALUE)i)
                        {
                            currDigit.Add(z);
                        }
                    }
                }
                if (o.getIntValue() == i && currDigit[rand.Next(currDigit.Count)] == o)
                {
                    return(true);
                }
            }
            return(false);
        };

        oneEmptyPerDigit = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(2), randDigits, 0.1f, skillTrans);
        oneEmptyPerDigit.addSetSkill(0.1f, (Orb o) => ORB_VALUE.EMPTY);
        skillList.Add(oneEmptyPerDigit);

        Func <ORB_VALUE, OrbSpawnRate> incAnti = (ORB_VALUE orbVal) => orbVal == ORB_VALUE.POISON ? OrbSpawnRate.INCREASED : Board.getDefaultOrbSpawnRates()[(int)orbVal];

        skillList.Add(EnemyOrbSkill.Create(() => GameController.Instance.isTurnMod(2, 1), incAnti, 1, skillTrans));

        skillList.Add(EnemyAttack.Create(() => true, false, () => Player.Instance.gameObject, () => (currState.currHealth - currState.maxHealth) / 2 - 100, skillTrans));
        skillList.Add(EnemyAttack.Create(() => GameController.Instance.isTurnMod(2), false, () => gameObject, () => currState.currHealth / 2, skillTrans));
    }
コード例 #3
0
    // to-do: go ham on turns when minibosses die for attack and skill 3
    private void addSkills3()
    {
        EnemyTimer decOnPlayer = EnemyTimer.Create(() => true, 3f, -1, skillTrans);

        decOnPlayer.addIncSkill((Orb o) => - 1);
        skillList.Add(decOnPlayer);

        EnemyBoardSkill setFoursToNullify = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(4), (Orb o) => o.getOrbValue() == ORB_VALUE.FOUR, 0.1f, skillTrans);

        setFoursToNullify.addSetSkill(0.1f, (Orb o) => ORB_VALUE.NULLIFY);
        skillList.Add(setFoursToNullify);

        Func <bool> wtu = () => {
            List <Enemy> eList = GameController.Instance.getCurrEnemies();
            foreach (Enemy e in eList)
            {
                if (e.getState().number == 6)
                {
                    return(false);
                }
            }
            return(GameController.Instance.isTurnMod(4, 3));
        };
        EnemyBoardSkill setHealsToAnti = EnemyBoardSkill.MarkIfSkill(wtu, (Orb o) => o.getOrbValue() == ORB_VALUE.ZERO, 0.1f, skillTrans);

        setHealsToAnti.addSetSkill(0.1f, (Orb o) => ORB_VALUE.POISON);
        skillList.Add(setHealsToAnti);


        Func <Orb, bool> allOrbsLessThan = (Orb o) => {
            int range = 3 + (3 - GameController.Instance.getCurrEnemies().Count);
            return(o.isDigit() && o.getIntValue() <= range);
        };
        EnemyBoardSkill markLess = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(3), allOrbsLessThan, 0.1f, skillTrans);

        skillList.Add(markLess);
        Func <int> getDmg = () => {
            List <Orb> markedOrbs = Board.Instance.getAllMarkedOrbsBy(getSkillID(markLess, markLess.getActivatedTurn()), null);
            int        sum        = 0;
            foreach (Orb o in markedOrbs)
            {
                if (o.isDigit())
                {
                    sum += o.getIntValue();
                }
            }
            return(sum * -9);
        };

        skillList.Add(EnemyAttack.Create(() => GameController.Instance.isTurnMod(3), false, () => Player.Instance.gameObject, getDmg, skillTrans));
    }
コード例 #4
0
    private void addSkills36()
    {
        EnemyBoardSkill setSixToStop = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(3, 1), (Orb o) => o.getOrbValue() == ORB_VALUE.SIX, 0.1f, skillTrans);

        setSixToStop.addSetSkill(0.1f, (Orb o) => ORB_VALUE.STOP);
        skillList.Add(setSixToStop);

        EnemyBoardSkill clearNullify = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(3, 2), (Orb o) => o.getOrbValue() == ORB_VALUE.NULLIFY, 0.1f, skillTrans);

        clearNullify.addRmvSkill(0.1f);
        skillList.Add(clearNullify);

        skillList.Add(EnemyAttack.Create(() => GameController.Instance.isTurnMod(3), false, () => Player.Instance.gameObject, () => - currState.damage, skillTrans));
    }
コード例 #5
0
    private void addSkills9()
    {
        EnemyTimer setOnPlayer = EnemyTimer.Create(() => true, 9f, -1, skillTrans);

        setOnPlayer.addSetSkill((Orb o) => o.getOrbValue() == ORB_VALUE.ZERO ? ORB_VALUE.NINE : o.getOrbValue());
        skillList.Add(setOnPlayer);

        EnemyBoardSkill setFivesToNullify = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(4, 2), (Orb o) => o.getOrbValue() == ORB_VALUE.FIVE, 0.1f, skillTrans);

        setFivesToNullify.addSetSkill(0.1f, (Orb o) => ORB_VALUE.NULLIFY);
        skillList.Add(setFivesToNullify);

        Func <bool> wtu = () => {
            List <Enemy> eList = GameController.Instance.getCurrEnemies();
            foreach (Enemy e in eList)
            {
                if (e.getState().number == 6)
                {
                    return(false);
                }
            }
            return(GameController.Instance.isTurnMod(4, 1));
        };
        EnemyBoardSkill setNinesToStop = EnemyBoardSkill.MarkIfSkill(wtu, (Orb o) => o.getOrbValue() == ORB_VALUE.NINE, 0.1f, skillTrans);

        setNinesToStop.addSetSkill(0.1f, (Orb o) => ORB_VALUE.STOP);
        skillList.Add(setNinesToStop);

        Func <Orb, bool> allOrbsGreaterThan = (Orb o) => {
            int range = 6 - (3 - GameController.Instance.getCurrEnemies().Count);
            return(o.isDigit() && o.getIntValue() >= range);
        };
        EnemyBoardSkill markGreater = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(3, 2), allOrbsGreaterThan, 0.1f, skillTrans);

        skillList.Add(markGreater);
        Func <int> getDmg = () => {
            List <Orb> markedOrbs = Board.Instance.getAllMarkedOrbsBy(getSkillID(markGreater, markGreater.getActivatedTurn()), null);
            int        sum        = 0;
            foreach (Orb o in markedOrbs)
            {
                if (o.isDigit())
                {
                    sum += o.getIntValue();
                }
            }
            return(sum * -3);
        };

        skillList.Add(EnemyAttack.Create(() => GameController.Instance.isTurnMod(3, 2), false, () => Player.Instance.gameObject, getDmg, skillTrans));
    }
コード例 #6
0
    private void addSkills25()
    {
        EnemyBoardSkill setFivesToAnti = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(3), (Orb o) => o.getOrbValue() == ORB_VALUE.FIVE, 0.1f, skillTrans);

        setFivesToAnti.addSetSkill(0.1f, (Orb o) => ORB_VALUE.POISON);
        skillList.Add(setFivesToAnti);

        EnemyBoardSkill setHealToNullify = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(3, 1), (Orb o) => o.getOrbValue() == ORB_VALUE.ZERO, 0.1f, skillTrans);

        setHealToNullify.addSetSkill(0.1f, (Orb o) => ORB_VALUE.NULLIFY);
        skillList.Add(setHealToNullify);

        skillList.Add(EnemyAttack.Create(() => GameController.Instance.isTurnMod(3, 2), false, () => Player.Instance.gameObject, () => - currState.damage, skillTrans));
    }
コード例 #7
0
    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));
    }
コード例 #8
0
    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));
    }
コード例 #9
0
    private void addSkills6()
    {
        EnemyTimer rmvOnPlayer = EnemyTimer.Create(() => true, 6f, -1, skillTrans);

        rmvOnPlayer.addRmvSkill((Orb o) => o.isDigit() && o.isEven());
        skillList.Add(rmvOnPlayer);

        Func <ORB_VALUE, OrbSpawnRate> decreasedEvens = (ORB_VALUE orbVal) => {
            if ((int)orbVal <= 9)
            {
                return((int)orbVal % 2 == 0 ? OrbSpawnRate.DECREASED : OrbSpawnRate.INCREASED);
            }
            return(Board.getDefaultOrbSpawnRates()[(int)orbVal]);
        };

        skillList.Add(EnemyOrbSkill.Create(() => true, decreasedEvens, -1, skillTrans));

        Func <bool>     wtu           = () => GameController.Instance.getCurrEnemies().Count == 1 ? GameController.Instance.isTurnMod(2) : false;
        EnemyBoardSkill set369ToEmpty = EnemyBoardSkill.MarkIfSkill(wtu, (Orb o) => o.getOrbValue() == ORB_VALUE.THREE || o.getOrbValue() == ORB_VALUE.SIX || o.getOrbValue() == ORB_VALUE.NINE, 0.1f, skillTrans);

        set369ToEmpty.addSetSkill(0.1f, (Orb o) => ORB_VALUE.EMPTY);
        skillList.Add(set369ToEmpty);

        EnemyBoardSkill markAll = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(3, 1), (Orb o) => true, 0.1f, skillTrans);

        skillList.Add(markAll);
        Func <int> getDmg = () => {
            List <Orb> markedOrbs = Board.Instance.getAllMarkedOrbsBy(getSkillID(markAll, markAll.getActivatedTurn()), null);
            int        sum        = 0;
            foreach (Orb o in markedOrbs)
            {
                if (o.isDigit())
                {
                    sum += o.getIntValue();
                }
            }
            return(sum * -6);
        };

        skillList.Add(EnemyAttack.Create(() => GameController.Instance.isTurnMod(3, 1), false, () => Player.Instance.gameObject, getDmg, skillTrans));
    }
コード例 #10
0
    private void addSkills13()
    {
        Func <Enemy> getEnemy = () => {
            foreach (Enemy e in GameController.Instance.getCurrEnemies())
            {
                if (e.getEnemyID() != getEnemyID())
                {
                    return(e);
                }
            }
            return(null);
        };
        Func <GameObject> getGameObject = () => {
            foreach (Enemy e in GameController.Instance.getCurrEnemies())
            {
                if (e.getEnemyID() != getEnemyID())
                {
                    return(e.gameObject);
                }
            }
            return(null);
        };

        skillList.Add(EnemyAttack.Create(() => GameController.Instance.isTurnMod(2, 1), false, getGameObject, () => - getEnemy().getState().currHealth / 2, skillTrans));
        skillList.Add(EnemyHPBuff.Create(() => GameController.Instance.isTurnMod(2, 1), EnemyBuffs.DMG_REFLECT, getEnemy, 1, skillTrans));

        EnemyBoardSkill incAll = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(2), (Orb o) => true, 0f, skillTrans);

        incAll.addIncSkill(0.05f, (Orb o) => 1);
        skillList.Add(incAll);

        Func <ORB_VALUE, OrbSpawnRate> incNullify = (ORB_VALUE orbVal) => orbVal == ORB_VALUE.NULLIFY ? OrbSpawnRate.INCREASED : Board.getDefaultOrbSpawnRates()[(int)orbVal];

        skillList.Add(EnemyOrbSkill.Create(() => GameController.Instance.isTurnMod(2), incNullify, 1, skillTrans));

        skillList.Add(EnemyAttack.Create(() => true, false, () => Player.Instance.gameObject, () => - GameController.Instance.getCurrTurn() * 50 - 100, skillTrans));
    }
コード例 #11
0
    private void addSkills97()
    {
        Func <ORB_VALUE, OrbSpawnRate> noneOverFive = (ORB_VALUE orbVal) => ((int)orbVal >= 5 && (int)orbVal <= 9) ? OrbSpawnRate.NONE : Board.getDefaultOrbSpawnRates()[(int)orbVal];

        skillList.Add(EnemyOrbSkill.Create(() => true, noneOverFive, -1, skillTrans));

        Func <List <Vector2Int> > rand2Cols = () => {
            List <Vector2Int> cols = new List <Vector2Int>();
            int col1 = (GameController.Instance.getCurrTurn()) % Board.COLUMNS, col2 = (GameController.Instance.getCurrTurn() + 2) % Board.COLUMNS;
            for (int r = Board.ROWS - 1; r >= 0; r--)
            {
                cols.Add(new Vector2Int(col1, r));
                cols.Add(new Vector2Int(col2, r));
            }
            return(cols);
        };
        EnemyBoardSkill inc2Cols = EnemyBoardSkill.MarkOrderSkill(() => GameController.Instance.isTurnMod(2), rand2Cols, 0.1f, skillTrans);

        inc2Cols.addIncSkill(0.1f, (Orb o) => 1);
        skillList.Add(inc2Cols);
        EnemyBoardSkill setNinesToAnti = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(2, 1), (Orb o) => o.getOrbValue() == ORB_VALUE.NINE, 0.1f, skillTrans);

        setNinesToAnti.addSetSkill(0.1f, (Orb o) => ORB_VALUE.POISON);
        skillList.Add(setNinesToAnti);

        Func <bool>     wtu1         = () => GameController.Instance.isTurnMod(2);
        EnemyBoardSkill markAllStops = EnemyBoardSkill.MarkIfSkill(wtu1, (Orb o) => o.getOrbValue() == ORB_VALUE.POISON, 0.1f, skillTrans);

        markAllStops.addMarkRemainSkill();
        skillList.Add(markAllStops);
        Func <int> getHeals = () => 33 * Board.Instance.getAllMarkedOrbsBy(getSkillID(markAllStops, markAllStops.getLastActivatedTurn()), null).Count;

        skillList.Add(EnemyAttack.Create(wtu1, true, () => gameObject, getHeals, skillTrans));
        Func <ORB_VALUE, OrbSpawnRate> maxOverFive = (ORB_VALUE orbVal) => ((int)orbVal >= 5 && (int)orbVal <= 9) ? OrbSpawnRate.MAX : Board.getDefaultOrbSpawnRates()[(int)orbVal];

        skillList.Add(EnemyOrbSkill.Create(wtu1, maxOverFive, 0, skillTrans));
        EnemyBoardSkill clearStops = EnemyBoardSkill.MarkIfSkill(wtu1, (Orb o) => o.getOrbValue() == ORB_VALUE.POISON, 0, skillTrans);

        clearStops.addRmvSkill(0.1f);
        skillList.Add(clearStops);

        Func <bool>     wtu2      = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(2, 1) : true;
        EnemyBoardSkill mark2Cols = EnemyBoardSkill.MarkOrderSkill(wtu2, rand2Cols, 0.1f, skillTrans);

        skillList.Add(mark2Cols);
        Func <int> getDmg = () => {
            int sum1 = 0, sum2 = 0;
            int col1 = (GameController.Instance.getCurrTurn()) % Board.COLUMNS, col2 = (GameController.Instance.getCurrTurn() + 2) % Board.COLUMNS;
            for (int r = Board.ROWS - 1; r >= 0; r--)
            {
                if (Board.Instance.getOrb(col1, r).isDigit())
                {
                    sum1 += Board.Instance.getOrb(col1, r).getIntValue();
                }
                if (Board.Instance.getOrb(col2, r).isDigit())
                {
                    sum2 += Board.Instance.getOrb(col2, r).getIntValue();
                }
            }
            return(-sum1 * sum2);
        };

        skillList.Add(EnemyAttack.Create(wtu2, false, () => Player.Instance.gameObject, getDmg, skillTrans));
    }
コード例 #12
0
    private void addSkills89()
    {
        Func <ORB_VALUE, OrbSpawnRate> decNullify = (ORB_VALUE orbVal) => orbVal == ORB_VALUE.NULLIFY ? OrbSpawnRate.DECREASED : Board.getDefaultOrbSpawnRates()[(int)orbVal];

        skillList.Add(EnemyOrbSkill.Create(() => true, decNullify, -1, skillTrans));

        EnemyBoardSkill setNinesToStop = EnemyBoardSkill.MarkIfSkill(() => GameController.Instance.isTurnMod(2), (Orb o) => o.getOrbValue() == ORB_VALUE.NINE, 0.1f, skillTrans);

        setNinesToStop.addSetSkill(0.1f, (Orb o) => ORB_VALUE.STOP);
        skillList.Add(setNinesToStop);
        Func <List <Vector2Int> > rand2Rows = () => {
            List <Vector2Int> rows = new List <Vector2Int>();
            int row1 = (GameController.Instance.getCurrTurn()) % Board.ROWS, row2 = (GameController.Instance.getCurrTurn() + 2) % Board.ROWS;
            for (int c = 0; c < Board.COLUMNS; c++)
            {
                rows.Add(new Vector2Int(c, row1));
                rows.Add(new Vector2Int(c, row2));
            }
            return(rows);
        };
        EnemyBoardSkill inc2Rows = EnemyBoardSkill.MarkOrderSkill(() => GameController.Instance.isTurnMod(2, 1), rand2Rows, 0.1f, skillTrans);

        inc2Rows.addIncSkill(0.1f, (Orb o) => 1);
        skillList.Add(inc2Rows);

        Func <bool>     wtu1         = () => GameController.Instance.isTurnMod(2, 1);
        EnemyBoardSkill markAllStops = EnemyBoardSkill.MarkIfSkill(wtu1, (Orb o) => o.getOrbValue() == ORB_VALUE.STOP, 0.1f, skillTrans);

        markAllStops.addMarkRemainSkill();
        skillList.Add(markAllStops);
        Func <int> getHeals = () => 33 * Board.Instance.getAllMarkedOrbsBy(getSkillID(markAllStops, markAllStops.getLastActivatedTurn()), null).Count;

        skillList.Add(EnemyAttack.Create(wtu1, true, () => gameObject, getHeals, skillTrans));
        Func <ORB_VALUE, OrbSpawnRate> maxOverFive = (ORB_VALUE orbVal) => ((int)orbVal >= 5 && (int)orbVal <= 9) ? OrbSpawnRate.MAX : Board.getDefaultOrbSpawnRates()[(int)orbVal];

        skillList.Add(EnemyOrbSkill.Create(wtu1, maxOverFive, 0, skillTrans));
        EnemyBoardSkill clearStops = EnemyBoardSkill.MarkIfSkill(wtu1, (Orb o) => o.getOrbValue() == ORB_VALUE.STOP, 0, skillTrans);

        clearStops.addRmvSkill(0.1f);
        skillList.Add(clearStops);

        Func <bool>     wtu2      = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(2) : true;
        EnemyBoardSkill mark2Rows = EnemyBoardSkill.MarkOrderSkill(wtu2, rand2Rows, 0.1f, skillTrans);

        skillList.Add(mark2Rows);
        Func <int> getDmg = () => {
            int sum1 = 0, sum2 = 0;
            int row1 = (GameController.Instance.getCurrTurn()) % Board.ROWS, row2 = (GameController.Instance.getCurrTurn() + 2) % Board.ROWS;
            for (int c = 0; c < Board.COLUMNS; c++)
            {
                if (Board.Instance.getOrb(c, row1).isDigit())
                {
                    sum1 += Board.Instance.getOrb(c, row1).getIntValue();
                }
                if (Board.Instance.getOrb(c, row2).isDigit())
                {
                    sum2 += Board.Instance.getOrb(c, row2).getIntValue();
                }
            }
            return(-sum1 * sum2);
        };

        skillList.Add(EnemyAttack.Create(wtu2, false, () => Player.Instance.gameObject, getDmg, skillTrans));
    }
コード例 #13
0
    private void addSkills81()
    {
        Func <bool>     wtu0       = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(4, 1) : GameController.Instance.isTurnMod(2);
        EnemyBoardSkill onesToStop = EnemyBoardSkill.MarkIfSkill(wtu0, (Orb o) => o.getOrbValue() == ORB_VALUE.ONE, 0.1f, skillTrans);

        onesToStop.addSetSkill(0.1f, (Orb o) => ORB_VALUE.STOP);
        skillList.Add(onesToStop);

        Func <bool>     wtu1            = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(4, 3) : GameController.Instance.isTurnMod(2, 1);
        EnemyBoardSkill sevensToNullify = EnemyBoardSkill.MarkIfSkill(wtu1, (Orb o) => o.getOrbValue() == ORB_VALUE.SEVEN, 0.1f, skillTrans);

        sevensToNullify.addSetSkill(0.1f, (Orb o) => ORB_VALUE.NULLIFY);
        skillList.Add(sevensToNullify);

        Func <bool>      wtu2    = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(2, 1) : true;
        Func <Orb, bool> is369   = (Orb o) => o.isUnmarked() && (o.getOrbValue() == ORB_VALUE.THREE || o.getOrbValue() == ORB_VALUE.SIX || o.getOrbValue() == ORB_VALUE.NINE);
        EnemyBoardSkill  mark369 = EnemyBoardSkill.MarkIfSkill(wtu2, is369, 0.1f, skillTrans);

        mark369.addMarkRemainSkill();
        skillList.Add(mark369);
        Func <int> getDmg = () => {
            List <Orb> markedOrbs = Board.Instance.getAllMarkedOrbsBy(getSkillID(mark369, mark369.getLastActivatedTurn()), null);
            int        sum        = 0;
            foreach (Orb o in markedOrbs)
            {
                sum += o.getIntValue();
            }
            return(-sum * markedOrbs.Count);
        };
        Func <bool> wtu2a = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(2) : true;

        skillList.Add(EnemyAttack.Create(wtu2a, false, () => Player.Instance.gameObject, getDmg, skillTrans));
        Func <Orb, bool> markedBy369 = (Orb o) => o.getIsMarkedBy(getSkillID(mark369, mark369.getLastActivatedTurn()));
        EnemyBoardSkill  clear369    = EnemyBoardSkill.MarkIfSkill(wtu2a, markedBy369, 0, skillTrans);

        clear369.addRmvSkill(0.1f);
        skillList.Add(clear369);

        Func <bool>      wtu3      = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(2, 1) : false;
        EnemyBoardSkill  markPivot = null;
        Func <Orb, bool> getPivot  = (Orb o) => {
            for (int c = 0; c < Board.COLUMNS; c++)
            {
                for (int r = 0; r < Board.ROWS; r++)
                {
                    if (Board.Instance.getOrb(c, r).getIsMarkedBy(getSkillID(markPivot, markPivot.getActivatedTurn())))
                    {
                        return(false);
                    }
                }
            }
            System.Random rand          = new System.Random(getRandomSeedByTurn(markPivot));
            List <Orb>    potentialOrbs = new List <Orb>();
            for (int c = 0; c < Board.COLUMNS; c++)
            {
                for (int r = 0; r < Board.ROWS; r++)
                {
                    if (Board.Instance.getOrb(c, r).isUnmarked())
                    {
                        potentialOrbs.Add(Board.Instance.getOrb(c, r));
                    }
                }
            }
            int pivotIndex = rand.Next(potentialOrbs.Count);
            if (potentialOrbs.Count > 0 && o == potentialOrbs[pivotIndex])
            {
                return(true);
            }
            return(false);
        };

        markPivot = EnemyBoardSkill.MarkIfSkill(wtu3, getPivot, 0.1f, skillTrans, 0);
        markPivot.addMarkRemainSkill();
        skillList.Add(markPivot);
        Func <bool> wtu3a = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(2) : false;
        Func <List <Vector2Int> > plusPivot = () => {
            List <Vector2Int> plus  = new List <Vector2Int>();
            Vector2Int        pivot = new Vector2Int(-1, -1);
            for (int c = 0; c < Board.COLUMNS; c++)
            {
                for (int r = 0; r < Board.ROWS; r++)
                {
                    if (Board.Instance.getOrb(c, r).getIsMarkedBy(getSkillID(markPivot, markPivot.getLastActivatedTurn())))
                    {
                        pivot = new Vector2Int(c, r);
                    }
                }
            }
            if (pivot.x != -1 && pivot.y != -1)
            {
                bool reachedEnd = false;
                for (int offset = 0; !reachedEnd; offset++)
                {
                    reachedEnd = true;
                    if (pivot.x + offset < Board.COLUMNS)
                    {
                        plus.Add(new Vector2Int(pivot.x + offset, pivot.y));
                        reachedEnd = false;
                    }
                    if (pivot.y + offset < Board.ROWS)
                    {
                        plus.Add(new Vector2Int(pivot.x, pivot.y + offset));
                        reachedEnd = false;
                    }
                    if (pivot.x - offset >= 0)
                    {
                        plus.Add(new Vector2Int(pivot.x - offset, pivot.y));
                        reachedEnd = false;
                    }
                    if (pivot.y - offset >= 0)
                    {
                        plus.Add(new Vector2Int(pivot.x, pivot.y - offset));
                        reachedEnd = false;
                    }
                }
            }
            plus = plus.Distinct().ToList();
            return(plus);
        };
        EnemyBoardSkill decPlusPivot = EnemyBoardSkill.MarkOrderSkill(wtu3a, plusPivot, 0.1f, skillTrans);

        decPlusPivot.addRmvSkill(0.1f);
        skillList.Add(decPlusPivot);

        Func <bool>     wtu4    = () => GameController.Instance.getCurrEnemies().Count != 2;
        EnemyBoardSkill decPlus = EnemyBoardSkill.MarkOrderSkill(wtu4, null, 0.1f, skillTrans);

        decPlus.addRmvSkill(0.1f);
        skillList.Add(decPlus);
    }
コード例 #14
0
    private void addMedSkill(int index)
    {
        System.Random rand = new System.Random(getRandomSeedByFloor());
        Func <bool> wtu    = () => true;
        Func <ORB_VALUE, OrbSpawnRate> newSpawnRates;

        switch (index)
        {
        case 0:
            wtu = () => GameController.Instance.isTurnMod(3, RNG.Next(3));
            EnemyBoardSkill clearPattern = null;
            clearPattern = EnemyBoardSkill.MarkOrderSkill(wtu, () => getRandomPattern(clearPattern), 0.1f, skillTrans, 1);
            clearPattern.addRmvSkill(0);
            skillList.Add(clearPattern);
            break;

        case 1:
            int numHealReduce = rand.Next(1, 3);
            newSpawnRates = (ORB_VALUE orbVal) => orbVal == ORB_VALUE.ZERO ? OrbSpawnRate.DECREASED : Board.getDefaultOrbSpawnRates()[(int)orbVal];
            wtu           = () => GameController.Instance.isTurnMod(2 * numHealReduce, RNG.Next(numHealReduce));
            skillList.Add(EnemyOrbSkill.Create(wtu, newSpawnRates, numHealReduce, skillTrans));
            break;

        case 2:
            wtu = () => GameController.Instance.isTurnMod(3, RNG.Next(3));
            EnemyBoardSkill setOneDigitAsRand = null;
            Func <Orb, bool> markAllOneDigit  = (Orb o) => {
                System.Random rand2 = new System.Random(getRandomSeedByTurn(setOneDigitAsRand));
                int digitToMark     = rand2.Next(1, 10);
                return(o.getIntValue() == digitToMark);
            };
            Func <Orb, ORB_VALUE> changeDigit = (Orb o) => {
                System.Random rand2 = new System.Random(getRandomSeedByTurn(setOneDigitAsRand));
                List <ORB_VALUE> possibleOrbVals = new List <ORB_VALUE>();
                for (int i = 1; i < 10; i++)
                {
                    possibleOrbVals.Add((ORB_VALUE)i);
                }
                possibleOrbVals.Remove(o.getOrbValue());
                return(possibleOrbVals[rand2.Next(possibleOrbVals.Count)]);
            };
            setOneDigitAsRand = EnemyBoardSkill.MarkIfSkill(wtu, markAllOneDigit, 0.1f, skillTrans);
            setOneDigitAsRand.addSetSkill(0.1f, changeDigit);
            skillList.Add(setOneDigitAsRand);
            break;

        case 3:
            wtu = () => GameController.Instance.isTurnMod(3, RNG.Next(3));
            EnemyBoardSkill replaceWithEmpty = null;
            replaceWithEmpty = EnemyBoardSkill.MarkOrderSkill(wtu, () => getRandomPattern(replaceWithEmpty), 0.1f, skillTrans, 1);
            replaceWithEmpty.addSetSkill(0.1f, (Orb o) => ORB_VALUE.EMPTY);
            skillList.Add(replaceWithEmpty);
            break;

        case 4:
            wtu = () => GameController.Instance.isTurnMod(3, RNG.Next(3));
            EnemyBoardSkill replaceWithStop = null;
            replaceWithStop = EnemyBoardSkill.MarkOrderSkill(wtu, () => getOneLine(replaceWithStop), 0.1f, skillTrans, 1);
            replaceWithStop.addSetSkill(0.1f, (Orb o) => ORB_VALUE.STOP);
            skillList.Add(replaceWithStop);
            break;

        case 5:
            wtu = () => GameController.Instance.isTurnMod(3, RNG.Next(3));
            EnemyBoardSkill allHealsToEmpty = EnemyBoardSkill.MarkIfSkill(wtu, (Orb o) => o.getOrbValue() == ORB_VALUE.ZERO, 0.1f, skillTrans, 1);
            allHealsToEmpty.addSetSkill(0.1f, (Orb o) => ORB_VALUE.EMPTY);
            skillList.Add(allHealsToEmpty);
            break;

        case 6:
            newSpawnRates = (ORB_VALUE orbVal) => OrbSpawnRate.NORMAL;
            skillList.Add(EnemyOrbSkill.Create(wtu, newSpawnRates, -1, skillTrans));
            break;

        case 7:
            int numEmptyInc = rand.Next(1, 3);
            newSpawnRates = (ORB_VALUE orbVal) => orbVal == ORB_VALUE.EMPTY ? OrbSpawnRate.INCREASED : Board.getDefaultOrbSpawnRates()[(int)orbVal];
            wtu           = () => GameController.Instance.isTurnMod(2 * numEmptyInc, RNG.Next(numEmptyInc));
            skillList.Add(EnemyOrbSkill.Create(wtu, newSpawnRates, numEmptyInc, skillTrans));
            break;

        case 8:
            EnemyBuffs hpBuff = (EnemyBuffs)(rand.Next(3) + 1);
            skillList.Add(EnemyHPBuff.Create(() => GameController.Instance.isTurnMod(3, RNG.Next(3)), hpBuff, () => this, 1, skillTrans));
            break;

        case 9:
            wtu = () => GameController.Instance.isTurnMod(3, RNG.Next(3));
            EnemyBoardSkill decFourLines = null;
            decFourLines = EnemyBoardSkill.MarkOrderSkill(wtu, () => getFourLines(decFourLines), 0.1f, skillTrans, 1);
            decFourLines.addIncSkill(0.1f, (Orb o) => - 1);
            skillList.Add(decFourLines);
            break;
        }
    }
コード例 #15
0
    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;
        }
    }
コード例 #16
0
    private void addSkills64()
    {
        Func <bool>     wtu0        = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(4) : GameController.Instance.isTurnMod(2);
        EnemyBoardSkill healsToAnti = EnemyBoardSkill.MarkIfSkill(wtu0, (Orb o) => o.getOrbValue() == ORB_VALUE.ZERO, 0.1f, skillTrans);

        healsToAnti.addSetSkill(0.1f, (Orb o) => ORB_VALUE.POISON);
        skillList.Add(healsToAnti);

        Func <bool>     wtu1         = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(4, 2) : GameController.Instance.isTurnMod(2, 1);
        EnemyBoardSkill fivesToEmpty = EnemyBoardSkill.MarkIfSkill(wtu1, (Orb o) => o.getOrbValue() == ORB_VALUE.FIVE, 0.1f, skillTrans);

        fivesToEmpty.addSetSkill(0.1f, (Orb o) => ORB_VALUE.EMPTY);
        skillList.Add(fivesToEmpty);

        Func <bool>      wtu2    = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(2) : true;
        Func <Orb, bool> is248   = (Orb o) => o.isUnmarked() && (o.getOrbValue() == ORB_VALUE.TWO || o.getOrbValue() == ORB_VALUE.FOUR || o.getOrbValue() == ORB_VALUE.EIGHT);
        EnemyBoardSkill  mark248 = EnemyBoardSkill.MarkIfSkill(wtu2, is248, 0.1f, skillTrans);

        mark248.addMarkRemainSkill();
        skillList.Add(mark248);
        Func <int> getDmg = () => {
            List <Orb> markedOrbs = Board.Instance.getAllMarkedOrbsBy(getSkillID(mark248, mark248.getLastActivatedTurn()), null);
            int        sum        = 0;
            foreach (Orb o in markedOrbs)
            {
                sum += o.getIntValue();
            }
            return(-sum * markedOrbs.Count);
        };
        Func <bool> wtu2a = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(2, 1) : true;

        skillList.Add(EnemyAttack.Create(wtu2a, false, () => Player.Instance.gameObject, getDmg, skillTrans));
        Func <Orb, bool> markedBy248 = (Orb o) => o.getIsMarkedBy(getSkillID(mark248, mark248.getLastActivatedTurn()));
        EnemyBoardSkill  clear248    = EnemyBoardSkill.MarkIfSkill(wtu2a, markedBy248, 0, skillTrans);

        clear248.addRmvSkill(0.1f);
        skillList.Add(clear248);

        Func <bool>      wtu3      = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(2) : false;
        EnemyBoardSkill  markPivot = null;
        Func <Orb, bool> getPivot  = (Orb o) => {
            for (int c = 0; c < Board.COLUMNS; c++)
            {
                for (int r = 0; r < Board.ROWS; r++)
                {
                    if (Board.Instance.getOrb(c, r).getIsMarkedBy(getSkillID(markPivot, markPivot.getActivatedTurn())))
                    {
                        return(false);
                    }
                }
            }
            System.Random rand          = new System.Random(getRandomSeedByTurn(markPivot));
            List <Orb>    potentialOrbs = new List <Orb>();
            for (int c = 0; c < Board.COLUMNS; c++)
            {
                for (int r = 0; r < Board.ROWS; r++)
                {
                    if (Board.Instance.getOrb(c, r).isUnmarked())
                    {
                        potentialOrbs.Add(Board.Instance.getOrb(c, r));
                    }
                }
            }
            int pivotIndex = rand.Next(potentialOrbs.Count);
            if (potentialOrbs.Count > 0 && o == potentialOrbs[pivotIndex])
            {
                return(true);
            }
            return(false);
        };

        markPivot = EnemyBoardSkill.MarkIfSkill(wtu3, getPivot, 0.1f, skillTrans, 0);
        markPivot.addMarkRemainSkill();
        skillList.Add(markPivot);
        Func <bool> wtu3a = () => GameController.Instance.getCurrEnemies().Count == 2 ? GameController.Instance.isTurnMod(2, 1) : false;
        Func <List <Vector2Int> > plusPivot = () => {
            List <Vector2Int> plus  = new List <Vector2Int>();
            Vector2Int        pivot = new Vector2Int(-1, -1);
            for (int c = 0; c < Board.COLUMNS; c++)
            {
                for (int r = 0; r < Board.ROWS; r++)
                {
                    if (Board.Instance.getOrb(c, r).getIsMarkedBy(getSkillID(markPivot, markPivot.getLastActivatedTurn())))
                    {
                        pivot = new Vector2Int(c, r);
                    }
                }
            }
            if (pivot.x != -1 && pivot.y != -1)
            {
                bool reachedEnd = false;
                for (int offset = 0; !reachedEnd; offset++)
                {
                    reachedEnd = true;
                    if (pivot.x + offset < Board.COLUMNS)
                    {
                        plus.Add(new Vector2Int(pivot.x + offset, pivot.y));
                        reachedEnd = false;
                    }
                    if (pivot.y + offset < Board.ROWS)
                    {
                        plus.Add(new Vector2Int(pivot.x, pivot.y + offset));
                        reachedEnd = false;
                    }
                    if (pivot.x - offset >= 0)
                    {
                        plus.Add(new Vector2Int(pivot.x - offset, pivot.y));
                        reachedEnd = false;
                    }
                    if (pivot.y - offset >= 0)
                    {
                        plus.Add(new Vector2Int(pivot.x, pivot.y - offset));
                        reachedEnd = false;
                    }
                }
            }
            plus = plus.Distinct().ToList();
            return(plus);
        };
        EnemyBoardSkill clearPlusPivot = EnemyBoardSkill.MarkOrderSkill(wtu3a, plusPivot, 0.1f, skillTrans);

        clearPlusPivot.addRmvSkill(0.1f);
        skillList.Add(clearPlusPivot);

        Func <bool>     wtu4      = () => GameController.Instance.getCurrEnemies().Count != 2;
        EnemyBoardSkill clearPlus = EnemyBoardSkill.MarkOrderSkill(wtu4, null, 0.1f, skillTrans);

        clearPlus.addRmvSkill(0.1f);
        skillList.Add(clearPlus);
    }
コード例 #17
0
    private void addEasySkill(int index)
    {
        System.Random rand = new System.Random(getRandomSeedByFloor());
        Func <bool> wtu    = () => true;
        Func <ORB_VALUE, OrbSpawnRate> newSpawnRates;

        switch (index)
        {
        case 0:
            int numShuffles = rand.Next(1, 3);
            wtu = () => GameController.Instance.isTurnMod(numShuffles, RNG.Next(numShuffles));
            skillList.Add(EnemyBoardSkill.ShuffleSkill(wtu, numShuffles * 5, 0.075f, skillTrans));
            break;

        case 1:
            EnemyBoardSkill clearOneLine = null;
            clearOneLine = EnemyBoardSkill.MarkOrderSkill(wtu, () => getOneLine(clearOneLine), 0.1f, skillTrans);
            clearOneLine.addRmvSkill(0);
            skillList.Add(clearOneLine);
            break;

        case 2:
            bool healSelfOnly = RNG.Next(2) == 0;
            int percentHeal   = rand.Next(1, 6);
            wtu = () => GameController.Instance.isTurnMod(percentHeal, RNG.Next(percentHeal));
            Func <GameObject> getTarget = () => healSelfOnly ? gameObject : GameController.Instance.getCurrEnemies()[RNG.Next(GameController.Instance.getCurrEnemies().Count)].gameObject;
            Func <int> getDmg           = () => getTarget().GetComponent <Enemy>().getState().maxHealth *percentHeal / 10;
            skillList.Add(EnemyAttack.Create(wtu, true, getTarget, getDmg, skillTrans));
            break;

        case 3:
            EnemyBoardSkill setOneLineEmpty = null;
            setOneLineEmpty = EnemyBoardSkill.MarkOrderSkill(wtu, () => getOneLine(setOneLineEmpty), 0.1f, skillTrans, 1);
            setOneLineEmpty.addSetSkill(0.1f, (Orb o) => ORB_VALUE.EMPTY);
            skillList.Add(setOneLineEmpty);
            break;

        case 4:
            wtu = () => GameController.Instance.isTurnMod(3, RNG.Next(3));
            EnemyBoardSkill clearFourLines = null;
            clearFourLines = EnemyBoardSkill.MarkOrderSkill(wtu, () => getFourLines(clearFourLines), 0.1f, skillTrans, 1);
            clearFourLines.addRmvSkill(0);
            skillList.Add(clearFourLines);
            break;

        case 5:
            wtu = () => GameController.Instance.isTurnMod(3, RNG.Next(3));
            EnemyBoardSkill clearAllHeals = EnemyBoardSkill.MarkIfSkill(wtu, (Orb o) => o.getOrbValue() == ORB_VALUE.ZERO, 0.1f, skillTrans, 1);
            clearAllHeals.addRmvSkill(0);
            skillList.Add(clearAllHeals);
            break;

        case 6:
            newSpawnRates = (ORB_VALUE orbVal) => orbVal == ORB_VALUE.NULLIFY ? OrbSpawnRate.DECREASED : Board.getDefaultOrbSpawnRates()[(int)orbVal];
            skillList.Add(EnemyOrbSkill.Create(wtu, newSpawnRates, -1, skillTrans));
            break;

        case 7:
            newSpawnRates = (ORB_VALUE orbVal) => orbVal == (ORB_VALUE)rand.Next(1, 10) ? OrbSpawnRate.MAX : Board.getDefaultOrbSpawnRates()[(int)orbVal];
            wtu           = () => GameController.Instance.isTurnMod(3, RNG.Next(3));
            skillList.Add(EnemyOrbSkill.Create(wtu, newSpawnRates, 1, skillTrans));
            break;

        case 8:
            EnemyBuffs hpBuff       = (EnemyBuffs)(rand.Next(3) + 1);
            Func <Enemy> getTarget2 = () => GameController.Instance.getCurrEnemies()[RNG.Next(GameController.Instance.getCurrEnemies().Count)];
            skillList.Add(EnemyHPBuff.Create(() => GameController.Instance.isTurnMod(2, RNG.Next(2)), hpBuff, getTarget2, 1, skillTrans));
            break;

        case 9:
            EnemyBoardSkill decOneLine = null;
            decOneLine = EnemyBoardSkill.MarkOrderSkill(wtu, () => getOneLine(decOneLine), 0.1f, skillTrans);
            decOneLine.addIncSkill(0.1f, (Orb o) => - 1);
            skillList.Add(decOneLine);
            break;
        }
    }