Esempio n. 1
0
        public TrapSkillData FindSkill(Guid id)
        {
            TrapSkillData trapSkillDatum;

            List <TrapSkillData> .Enumerator enumerator = this.fSkills.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    TrapSkillData current = enumerator.Current;
                    if (current.ID != id)
                    {
                        continue;
                    }
                    trapSkillDatum = current;
                    return(trapSkillDatum);
                }
                return(null);
            }
            finally
            {
                ((IDisposable)enumerator).Dispose();
            }
        }
Esempio n. 2
0
 public void AdjustLevel(int delta)
 {
     this.fLevel += delta;
     this.fLevel  = Math.Max(1, this.fLevel);
     if (this.fInitiative != -2147483648)
     {
         Trap initiative = this;
         initiative.Initiative = initiative.Initiative + delta;
         this.fInitiative      = Math.Max(1, this.fInitiative);
     }
     foreach (TrapAttack fAttack in this.fAttacks)
     {
         if (fAttack.Attack != null)
         {
             PowerAttack attack = fAttack.Attack;
             attack.Bonus         = attack.Bonus + delta;
             fAttack.Attack.Bonus = Math.Max(1, fAttack.Attack.Bonus);
         }
         string str = AI.ExtractDamage(fAttack.OnHit);
         if (str != "")
         {
             DiceExpression diceExpression = DiceExpression.Parse(str);
             if (diceExpression != null)
             {
                 DiceExpression diceExpression1 = diceExpression.Adjust(delta);
                 if (diceExpression1 != null && diceExpression.ToString() != diceExpression1.ToString())
                 {
                     fAttack.OnHit = fAttack.OnHit.Replace(str, string.Concat(diceExpression1, " damage"));
                 }
             }
         }
         string str1 = AI.ExtractDamage(fAttack.OnMiss);
         if (str1 != "")
         {
             DiceExpression diceExpression2 = DiceExpression.Parse(str1);
             if (diceExpression2 != null)
             {
                 DiceExpression diceExpression3 = diceExpression2.Adjust(delta);
                 if (diceExpression3 != null && diceExpression2.ToString() != diceExpression3.ToString())
                 {
                     fAttack.OnMiss = fAttack.OnMiss.Replace(str1, string.Concat(diceExpression3, " damage"));
                 }
             }
         }
         string str2 = AI.ExtractDamage(fAttack.Effect);
         if (str2 == "")
         {
             continue;
         }
         DiceExpression diceExpression4 = DiceExpression.Parse(str2);
         if (diceExpression4 == null)
         {
             continue;
         }
         DiceExpression diceExpression5 = diceExpression4.Adjust(delta);
         if (diceExpression5 == null || !(diceExpression4.ToString() != diceExpression5.ToString()))
         {
             continue;
         }
         fAttack.Effect = fAttack.Effect.Replace(str2, string.Concat(diceExpression5, " damage"));
     }
     foreach (TrapSkillData fSkill in this.fSkills)
     {
         TrapSkillData dC = fSkill;
         dC.DC = dC.DC + delta;
     }
 }