<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Magecrawl.GameEngine.Actors;
using Magecrawl.GameEngine.Interfaces;

namespace Magecrawl.GameEngine.Magic
{
    internal sealed class Spell : ISpell
    {
        private string m_name;
        private string m_effectType;
        private int m_cost;
        private string m_school;
        private TargetingInfo.TargettingType m_targettingType;
        private int m_range;

        internal Spell(string name, string school, string effectType, int cost, TargetingInfo.TargettingType targettingType, int range)
        {
            m_name = name;
            m_effectType = effectType;
            m_cost = cost;
            m_school = school;
            m_targettingType = targettingType;
            m_range = range;
        }

        public string Name
        {
            get
            {
                return m_name;
            }
        }

        public string DisplayName
        {
            get
            {
                return Name + '\t' + m_school + '\t' + "Mp: " + m_cost.ToString();
            }
        }

        public string School
        {
            get
            {
                return m_school;
            }
        }

        internal string EffectType
        {
            get
            {
                return m_effectType;
            }
        }

        internal int Cost
        {
            get
            {
                return m_cost;
            }
        }

        public TargetingInfo Targeting
        {
            get 
            {
                return new TargetingInfo(m_targettingType, m_range);
            }
        }
    }
}
<commit_msg>Heavier Armor = More expensive spell costs.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Magecrawl.GameEngine.Actors;
using Magecrawl.GameEngine.Interfaces;

namespace Magecrawl.GameEngine.Magic
{
    internal sealed class Spell : ISpell
    {
        private string m_name;
        private string m_effectType;
        private int m_cost;
        private string m_school;
        private TargetingInfo.TargettingType m_targettingType;
        private int m_range;

        internal Spell(string name, string school, string effectType, int cost, TargetingInfo.TargettingType targettingType, int range)
        {
            m_name = name;
            m_effectType = effectType;
            m_cost = cost;
            m_school = school;
            m_targettingType = targettingType;
            m_range = range;
        }

        public string Name
        {
            get
            {
                return m_name;
            }
        }

        public string DisplayName
        {
            get
            {
                return Name + '\t' + m_school + '\t' + "Mp: " + Cost.ToString();
            }
        }

        public string School
        {
            get
            {
                return m_school;
            }
        }

        internal string EffectType
        {
            get
            {
                return m_effectType;
            }
        }

        private double GetArmorCostPenaltiy(IArmor armor)
        {
            const double StandardWeightPenality = .125;
            const double HeavyWeightPenality = .25;

            if (armor.Weight == ArmorWeight.Standard)
                return StandardWeightPenality;
            if (armor.Weight == ArmorWeight.Heavy)
                return HeavyWeightPenality;
            return 0;
        }

        private int CalculateSpellCost(Player caster)
        {
            double penalityForHeavyArmor = 0;
            penalityForHeavyArmor += GetArmorCostPenaltiy(caster.Boots);
            penalityForHeavyArmor += GetArmorCostPenaltiy(caster.ChestArmor);
            penalityForHeavyArmor += GetArmorCostPenaltiy(caster.Gloves);
            penalityForHeavyArmor += GetArmorCostPenaltiy(caster.Headpiece);
            return (int)Math.Round(m_cost * (1.0 + penalityForHeavyArmor));
        }

        internal int Cost
        {
            get
            {
                return CalculateSpellCost(CoreGameEngine.Instance.Player);
            }
        }

        public TargetingInfo Targeting
        {
            get 
            {
                return new TargetingInfo(m_targettingType, m_range);
            }
        }
    }
}

{'fraction_non_alphanumeric': 0.06080347448425624, 'fraction_numerical': 0.001954397394136808, 'mean_word_length': 1.258950465914664, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2338936', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1166, 'n_words': 258}