Ejemplo n.º 1
0
        protected override bool Run(SimDescription me, bool singleSelection)
        {
            if (!ApplyAll)
            {
                if (MasterController.Settings.SkillStamps.Count == 1)
                {
                    if (!AcceptCancelDialog.Show(Common.Localize("SkillStamp:Prompt", me.IsFemale, new object[] { me })))
                    {
                        return(false);
                    }

                    mChoice = MasterController.Settings.SkillStamps[0];
                }
                else
                {
                    List <Item> allOptions = new List <Item>();
                    foreach (SkillStamp stamp in MasterController.Settings.SkillStamps)
                    {
                        allOptions.Add(new ApplySkillStamp.Item(stamp));
                    }

                    Item choice = new CommonSelection <ApplySkillStamp.Item>(Name, allOptions).SelectSingle();
                    if (choice == null)
                    {
                        return(false);
                    }

                    mChoice = choice.mStamp;
                }
            }

            foreach (KeyValuePair <SkillNames, int> skill in mChoice.Skills)
            {
                if (me.SkillManager.GetSkillLevel(skill.Key) > skill.Value)
                {
                    continue;
                }

                Skill mySkill = me.SkillManager.GetElement(skill.Key);
                if ((mySkill == null) && (skill.Value >= 0))
                {
                    mySkill = me.SkillManager.AddElement(skill.Key);
                }

                if (mySkill != null)
                {
                    try
                    {
                        mySkill.ForceSkillLevelUp(skill.Value);
                    }
                    catch (Exception e)
                    {
                        Common.Exception(me, null, "Skill: " + skill.Key, e);
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        public void UpdateStamp()
        {
            if (mSkillStamps == null)
            {
                return;
            }

            mSkillStamp = SkillStamp.Create(mSkillStamps);
        }
Ejemplo n.º 3
0
 public Item(SkillStamp stamp)
     : base(stamp.Name)
 {
     mStamp = stamp;
 }