Пример #1
0
 public static Effect ParseLittleEffect(string littleEffect)
 {
     Effect e = new Effect();
     if (littleEffect != "")
     {
         string[] data = littleEffect.Split('#');
         if (data[0] != "-1")
         {
             e.ID = Convert.ToInt32(data[0], 16);
         }
         if (data.Length > 1)
         {
             if (data[1] != "")
             {
                 e.Des.Min = Convert.ToInt32(data[1], 16);
             }
         }
         if (data.Length > 2)
         {
             if (data[2] != "")
             {
                 e.Des.Max = Convert.ToInt32(data[2], 16);
             }
         }
         if (data.Length > 4)
         {
             if (data[4] != "")
             {
                 if (data[4].Contains("+"))
                 {
                     string[] desEffect = data[4].Split('d');
                     e.Des.Min = int.Parse(desEffect[0]);
                     e.Des.Max = int.Parse(desEffect[1].Split('+')[0]);
                     e.Des.Fix = int.Parse(data[4].Split('+')[1]);
                 }
             }
         }
     }
     return e;
 }
Пример #2
0
 public Effect CreateRandomEffect(Effect effect)
 {
     Effect newEffect = new Effect();
     newEffect.ID = effect.ID;
     if (IsWeaponEffect(effect.ID))
     {
         newEffect.Des.Min = effect.Des.Min + effect.Des.Fix;
         newEffect.Des.Fix = effect.Des.Fix;
         newEffect.Des.Max = effect.Des.Max + effect.Des.Fix;
     }
     else
     {
         newEffect.Des.Max = effect.Des.Max;
         newEffect.Des.Fix = Utilities.Basic.Rand(effect.Des.Min, effect.Des.Max) + effect.Des.Fix;
         newEffect.Des.Max = newEffect.Des.Fix;
     }
     return newEffect;
 }