Ejemplo n.º 1
0
        public static void AdjustPowerLevel(CreaturePower cp, int delta)
        {
            if (cp.Attack != null)
            {
                PowerAttack attack = cp.Attack;
                attack.Bonus = attack.Bonus + delta;
            }
            string str = AI.ExtractDamage(cp.Details);

            if (str != "")
            {
                DiceExpression diceExpression = DiceExpression.Parse(str);
                if (diceExpression != null)
                {
                    DiceExpression diceExpression1 = diceExpression.Adjust(delta);
                    if (diceExpression1 != null && diceExpression.ToString() != diceExpression1.ToString())
                    {
                        cp.Details = cp.Details.Replace(str, string.Concat(diceExpression1, " damage"));
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public static void AdjustPowerLevel(CreaturePower cp, int delta)
        {
            if (cp.Attack != null)
            {
                cp.Attack.Bonus += delta;
            }

            // Adjust power damage
            string dmg_str = AI.ExtractDamage(cp.Details);

            if (dmg_str != "")
            {
                DiceExpression exp = DiceExpression.Parse(dmg_str);
                if (exp != null)
                {
                    DiceExpression exp_adj = exp.Adjust(delta);
                    if ((exp_adj != null) && (exp.ToString() != exp_adj.ToString()))
                    {
                        cp.Details = cp.Details.Replace(dmg_str, exp_adj + " damage");
                    }
                }
            }
        }