예제 #1
0
        public void AddSpecialization(string name)
        {
            if (!CharacterObject.CanAffordSpecialization)
            {
                return;
            }


            int price = CharacterObject.Options.KarmaSpecialization;

            //If data file contains {4} this crashes but...
            string upgradetext =             //TODO WRONG
                                 $"{LanguageManager.Instance.GetString("String_ExpenseLearnSpecialization")} {DisplayName} ({name})";

            SkillSpecialization nspec = new SkillSpecialization(name, false);

            ExpenseLogEntry entry = new ExpenseLogEntry();

            entry.Create(price * -1, upgradetext, ExpenseType.Karma, DateTime.Now);
            entry.Undo = new ExpenseUndo().CreateKarma(KarmaExpenseType.AddSpecialization, nspec.InternalId);

            CharacterObject.ExpenseEntries.Add(entry);

            Specializations.Add(nspec);
            CharacterObject.Karma -= price;
        }
예제 #2
0
        public void Upgrade()
        {
            if (!CanUpgradeCareer)
            {
                return;
            }

            int    price = UpgradeKarmaCost();
            int    intTotalBaseRating = TotalBaseRating;
            string strSkillType       = "String_ExpenseActiveSkill";

            if (IsKnowledgeSkill)
            {
                strSkillType = "String_ExpenseKnowledgeSkill";
            }
            //If data file contains {4} this crashes but...
            string upgradetext =
                $"{LanguageManager.GetString(strSkillType, GlobalOptions.Language)} {DisplayNameMethod(GlobalOptions.Language)} {intTotalBaseRating} 🡒 {(intTotalBaseRating + 1)}";

            ExpenseLogEntry entry = new ExpenseLogEntry(CharacterObject);

            entry.Create(price * -1, upgradetext, ExpenseType.Karma, DateTime.Now);
            entry.Undo = new ExpenseUndo().CreateKarma(intTotalBaseRating == 0 ? KarmaExpenseType.AddSkill : KarmaExpenseType.ImproveSkill, InternalId);

            CharacterObject.ExpenseEntries.Add(entry);

            Karma += 1;
            CharacterObject.Karma -= price;
        }
예제 #3
0
        public void Upgrade()
        {
            if (!CanUpgradeCareer)
            {
                return;
            }

            int    price        = UpgradeKarmaCost();
            string strSkillType = "String_ExpenseActiveSkill";

            if (IsKnowledgeSkill)
            {
                strSkillType = "String_ExpenseKnowledgeSkill";
            }
            //If data file contains {4} this crashes but...
            string upgradetext =
                $"{LanguageManager.Instance.GetString(strSkillType)} {DisplayName} {LearnedRating} -> {(LearnedRating + 1)}";

            ExpenseLogEntry entry = new     ExpenseLogEntry();

            entry.Create(price * -1, upgradetext, ExpenseType.Karma, DateTime.Now);
            entry.Undo = new ExpenseUndo().CreateKarma(LearnedRating == 0 ? KarmaExpenseType.AddSkill : KarmaExpenseType.ImproveSkill, Id.ToString());

            CharacterObject.ExpenseEntries.Add(entry);

            Karma += 1;
            CharacterObject.Karma -= price;
        }
예제 #4
0
        public void Upgrade()
        {
            if (CharacterObject.Created)
            {
                if (!CareerIncrease)
                {
                    return;
                }

                int intPrice = UpgradeKarmaCost();

                //If data file contains {4} this crashes but...
                string strUpgradetext =
                    $"{LanguageManager.GetString("String_ExpenseSkillGroup", GlobalOptions.Language)} {DisplayName} {Rating} 🡒 {(Rating + 1)}";

                ExpenseLogEntry objEntry = new ExpenseLogEntry(_objCharacter);
                objEntry.Create(intPrice * -1, strUpgradetext, ExpenseType.Karma, DateTime.Now);
                objEntry.Undo = new ExpenseUndo().CreateKarma(Rating == 0 ? KarmaExpenseType.AddSkill : KarmaExpenseType.ImproveSkill, Name);

                CharacterObject.ExpenseEntries.AddWithSort(objEntry);

                CharacterObject.Karma -= intPrice;
            }

            Karma += 1;
        }
예제 #5
0
        public void AddSpecialization(string name)
        {
            int price = IsKnowledgeSkill ? CharacterObject.Options.KarmaKnowledgeSpecialization : CharacterObject.Options.KarmaSpecialization;

            int     intExtraSpecCost      = 0;
            int     intTotalBaseRating    = TotalBaseRating;
            decimal decSpecCostMultiplier = 1.0m;

            foreach (Improvement objLoopImprovement in CharacterObject.Improvements)
            {
                if (objLoopImprovement.Minimum <= intTotalBaseRating &&
                    (string.IsNullOrEmpty(objLoopImprovement.Condition) || (objLoopImprovement.Condition == "career") == CharacterObject.Created || (objLoopImprovement.Condition == "create") != CharacterObject.Created) && objLoopImprovement.Enabled)
                {
                    if (objLoopImprovement.ImprovedName == SkillCategory)
                    {
                        if (objLoopImprovement.ImproveType == Improvement.ImprovementType.SkillCategorySpecializationKarmaCost)
                        {
                            intExtraSpecCost += objLoopImprovement.Value;
                        }
                        else if (objLoopImprovement.ImproveType == Improvement.ImprovementType.SkillCategorySpecializationKarmaCostMultiplier)
                        {
                            decSpecCostMultiplier *= objLoopImprovement.Value / 100.0m;
                        }
                    }
                }
            }
            if (decSpecCostMultiplier != 1.0m)
            {
                price = decimal.ToInt32(decimal.Ceiling(price * decSpecCostMultiplier));
            }
            price += intExtraSpecCost; //Spec

            if (price > CharacterObject.Karma)
            {
                return;
            }

            //If data file contains {4} this crashes but...
            string upgradetext = //TODO WRONG
                                 $"{LanguageManager.GetString("String_ExpenseLearnSpecialization", GlobalOptions.Language)} {DisplayNameMethod(GlobalOptions.Language)} ({name})";

            SkillSpecialization nspec = new SkillSpecialization(name, false, this);

            ExpenseLogEntry entry = new ExpenseLogEntry(CharacterObject);

            entry.Create(price * -1, upgradetext, ExpenseType.Karma, DateTime.Now);
            entry.Undo = new ExpenseUndo().CreateKarma(KarmaExpenseType.AddSpecialization, nspec.InternalId);

            CharacterObject.ExpenseEntries.Add(entry);

            Specializations.Add(nspec);
            CharacterObject.Karma -= price;
        }
예제 #6
0
        public void Upgrade()
        {
            if (!CareerIncrease) return;

            int price = UpgradeKarmaCost();

            //If data file contains {4} this crashes but...
            string upgradetext =
                $"{LanguageManager.Instance.GetString("String_ExpenseSkillGroup")} {DisplayName} {Rating} -> {(Rating + 1)}";

            ExpenseLogEntry entry = new ExpenseLogEntry();
            entry.Create(price * -1, upgradetext, ExpenseType.Karma, DateTime.Now);
            entry.Undo = new ExpenseUndo().CreateKarma(Rating == 0 ? KarmaExpenseType.AddSkill : KarmaExpenseType.ImproveSkill, Name);

            Character.ExpenseEntries.Add(entry);

            Karma += 1;
            Character.Karma -= price;
        }
예제 #7
0
        public void Upgrade()
        {
            if (!CanUpgradeCareer) return;

            int price = UpgradeKarmaCost();

            //If data file contains {4} this crashes but...
            string upgradetext =
                $"{LanguageManager.Instance.GetString("String_ExpenseSkillGroup")} {DisplayName} {LearnedRating} -> {(LearnedRating + 1)}";

            ExpenseLogEntry entry = new	ExpenseLogEntry();
            entry.Create(price * -1, upgradetext, ExpenseType.Karma, DateTime.Now);
            entry.Undo = new ExpenseUndo().CreateKarma(LearnedRating == 0 ? KarmaExpenseType.AddSkill : KarmaExpenseType.ImproveSkill, Id.ToString());

            CharacterObject.ExpenseEntries.Add(entry);

            Karma += 1;
            CharacterObject.Karma -= price;
        }
예제 #8
0
        public void AddSpecialization(string name)
        {
            if (!CharacterObject.CanAffordSpecialization) return;

            int price = CharacterObject.Options.KarmaSpecialization;

            //If data file contains {4} this crashes but...
            string upgradetext = //TODO WRONG
                $"{LanguageManager.Instance.GetString("String_ExpenseLearnSpecialization")} {DisplayName} ({name})";

            SkillSpecialization nspec = new SkillSpecialization(name, false);

            ExpenseLogEntry entry = new ExpenseLogEntry();
            entry.Create(price * -1, upgradetext, ExpenseType.Karma, DateTime.Now);
            entry.Undo = new ExpenseUndo().CreateKarma(KarmaExpenseType.AddSpecialization, nspec.InternalId);

            CharacterObject.ExpenseEntries.Add(entry);

            Specializations.Add(nspec);
            CharacterObject.Karma -= price;
        }