Example #1
0
        private void btnCareerIncrease_Click(object sender, EventArgs e)
        {
            frmCareer parent = ParentForm as frmCareer;

            if (parent != null)
            {
                int upgradeKarmaCost = _skill.UpgradeKarmaCost();

                if (upgradeKarmaCost == -1)
                {
                    return;                                         //TODO: more descriptive
                }
                string confirmstring;
                if (_skill.Karma == 0)
                {
                    confirmstring = string.Format(LanguageManager.Instance.GetString("Message_ConfirmKarmaExpenseKnowledgeSkill"),
                                                  _skill.DisplayName, _skill.Rating + 1, _skill.CharacterObject.Options.KarmaNewKnowledgeSkill, cboType.GetItemText(cboType.SelectedItem));
                }
                else
                {
                    confirmstring = string.Format(LanguageManager.Instance.GetString("Message_ConfirmKarmaExpense"),
                                                  _skill.DisplayName, _skill.Rating + 1, upgradeKarmaCost, cboType.GetItemText(cboType.SelectedItem));
                }

                if (!parent.ConfirmKarmaExpense(confirmstring))
                {
                    return;
                }
            }
            cboType.Enabled = false;

            _skill.Upgrade();
        }
Example #2
0
        private void btnAddSpec_Click(object sender, EventArgs e)
        {
            frmCareer parrent = ParentForm as frmCareer;

            if (parrent != null)
            {
                string confirmstring = string.Format(LanguageManager.Instance.GetString("Message_ConfirmKarmaExpenseSkillSpecialization"),
                                                     skill.CharacterObject.Options.KarmaSpecialization);

                if (!parrent.ConfirmKarmaExpense(confirmstring))
                {
                    return;
                }
            }

            frmSelectSpec selectForm = new frmSelectSpec(skill);

            selectForm.Mode = "Knowledge";
            selectForm.ShowDialog();

            if (selectForm.DialogResult != DialogResult.OK)
            {
                return;
            }

            skill.AddSpecialization(selectForm.SelectedItem);

            //TODO turn this into a databinding, but i don't care enough right now
            lblSpec.Text = string.Join(", ",
                                       (from specialization in skill.Specializations
                                        select specialization.Name));

            parrent?.UpdateCharacterInfo();
        }
Example #3
0
        private void cmdImproveATT_Click(object sender, EventArgs e)
        {
            frmCareer parent = ParentForm as frmCareer;

            if (parent != null)
            {
                int upgradeKarmaCost = attribute.UpgradeKarmaCost();

                if (upgradeKarmaCost == -1)
                {
                    return;                         //TODO: more descriptive
                }
                string confirmstring = string.Format(LanguageManager.GetString("Message_ConfirmKarmaExpense"),
                                                     attribute.DisplayNameFormatted, attribute.Value + 1, upgradeKarmaCost);
                if (upgradeKarmaCost > _objCharacter.Karma)
                {
                    MessageBox.Show(LanguageManager.GetString("Message_NotEnoughKarma"), LanguageManager.GetString("MessageTitle_NotEnoughKarma"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                if (!parent.ConfirmKarmaExpense(confirmstring))
                {
                    return;
                }
            }
            attribute.Upgrade();
            ValueChanged?.Invoke(this, e);
        }
        private void btnAddSpec_Click(object sender, EventArgs e)
        {
            frmCareer parrent = ParentForm as frmCareer;

            if (parrent != null)
            {
                int price = _skill.CharacterObject.Options.KarmaKnowledgeSpecialization;

                int     intExtraSpecCost      = 0;
                int     intTotalBaseRating    = _skill.TotalBaseRating;
                decimal decSpecCostMultiplier = 1.0m;
                foreach (Improvement objLoopImprovement in _skill.CharacterObject.Improvements)
                {
                    if (objLoopImprovement.Minimum <= intTotalBaseRating &&
                        (string.IsNullOrEmpty(objLoopImprovement.Condition) || (objLoopImprovement.Condition == "career") == _skill.CharacterObject.Created || (objLoopImprovement.Condition == "create") != _skill.CharacterObject.Created) && objLoopImprovement.Enabled)
                    {
                        if (objLoopImprovement.ImprovedName == _skill.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

                string confirmstring = string.Format(LanguageManager.GetString("Message_ConfirmKarmaExpenseSkillSpecialization"), price.ToString());

                if (!parrent.ConfirmKarmaExpense(confirmstring))
                {
                    return;
                }
            }

            frmSelectSpec selectForm = new frmSelectSpec(_skill);

            selectForm.Mode = "Knowledge";
            selectForm.ShowDialog();

            if (selectForm.DialogResult != DialogResult.OK)
            {
                return;
            }

            _skill.AddSpecialization(selectForm.SelectedItem);

            //TODO turn this into a databinding, but i don't care enough right now
            lblSpec.Text = string.Join(", ", _skill.Specializations.Select(x => x.Name));

            parrent?.ScheduleCharacterUpdate();
        }
Example #5
0
        private void btnAddSpec_Click(object sender, EventArgs e)
        {
            frmCareer parrent = ParentForm as frmCareer;

            if (parrent != null)
            {
                string confirmstring = string.Format(LanguageManager.GetString("Message_ConfirmKarmaExpenseSkillSpecialization"),
                                                     _skill.CharacterObject.Options.KarmaSpecialization);

                if (!parrent.ConfirmKarmaExpense(confirmstring))
                {
                    return;
                }
            }

            frmSelectSpec selectForm = new frmSelectSpec(_skill);

            selectForm.ShowDialog();

            if (selectForm.DialogResult != DialogResult.OK)
            {
                return;
            }

            _skill.AddSpecialization(selectForm.SelectedItem);

            //TODO turn this into a databinding, but i don't care enough right now
            lblCareerSpec.Text = string.Join(", ", _skill.Specializations.Select(x => x.DisplayName));

            parrent?.ScheduleCharacterUpdate();
        }
Example #6
0
        private void btnCareerIncrease_Click(object sender, EventArgs e)
        {
            frmCareer parrent = ParentForm as frmCareer;

            if (parrent != null)
            {
                string confirmstring = string.Format(LanguageManager.GetString("Message_ConfirmKarmaExpense"),
                                                     _skill.DisplayName, _skill.Rating + 1, _skill.UpgradeKarmaCost());

                if (!parrent.ConfirmKarmaExpense(confirmstring))
                {
                    return;
                }
            }

            _skill.Upgrade();
        }
Example #7
0
        private void btnCareerIncrease_Click(object sender, EventArgs e)
        {
            frmCareer parrent = ParentForm as frmCareer;

            if (parrent != null)
            {
                int upgradeKarmaCost = skill.UpgradeKarmaCost();

                if (upgradeKarmaCost == -1)
                {
                    return;                                         //TODO: more descriptive
                }
                string confirmstring = string.Format(LanguageManager.Instance.GetString("Message_ConfirmKarmaExpense"),
                                                     skill.DisplayName, skill.Rating + 1, upgradeKarmaCost);

                if (!parrent.ConfirmKarmaExpense(confirmstring))
                {
                    return;
                }
            }

            skill.Upgrade();
        }