Example #1
0
        public List <Skill> getSkills(IChoiceProvider provider, OGLContext context)
        {
            List <Skill> res    = new List <Skill>();
            int          offset = provider.GetChoiceOffset(this, UniqueID, Amount);

            for (int c = 0; c < Amount; c++)
            {
                String counter = "";
                if (c + offset > 0)
                {
                    counter = "_" + (c + offset).ToString();
                }
                Choice cho = provider.GetChoice(UniqueID + counter);
                if (cho != null && cho.Value != "")
                {
                    res.Add(context.GetSkill(cho.Value, Source));
                }
            }
            return(res);
        }
 public string ToString(Monster monster, OGLContext context)
 {
     if (Skill != null)
     {
         try
         {
             Skill s = context.GetSkill(Skill, monster.Source);
             if (s.Base != Ability.None)
             {
                 return(Skill + " " + (monster.getAbility(s.Base) / 2 - 5 + Bonus).ToString("+#;-#;+0") + (Text != null && Text != "" ? " (" + Text + ")" : ""));
             }
         }
         catch (Exception) { }
     }
     if (Ability != Ability.None)
     {
         return(Skill + " " + (monster.getAbility(Ability) / 2 - 5 + Bonus).ToString("+#;-#;+0") + (Text != null && Text != "" ? " (" + Text + ")" : ""));
     }
     return(ToString());
 }