Simple code for calculating damage increase In my little game project, I have the following piece of code, in the static class DamageHelper, that takes a Spell, and returns it's damage in the Entity:

public static float DamageIncrease(SpellData attack, Entity caster)
{
    //Elemental damage is more increased by wisdom attribute
    //Impact damage is more increased by dominance attribute 
    //summon level is increased by control attribute

    float bonus = 0f;
    switch (attack.element)
    {
        case Element.Fire:
        case Element.Earth:
        case Element.Water:
        case Element.Wind:
            bonus = caster.wisdom * 0.3f + caster.dominance * 0.1f + caster.control * 0.1f;
            break;
        case Element.Impact:
            bonus = caster.wisdom * 0.1f + caster.dominance * 0.3f + caster.control * 0.1f;
            break;
        default:
            bonus = caster.wisdom * 0.1f + caster.dominance * 0.1f + caster.control * 0.3f;
            break;
    }

    return attack.damage + bonus;
}


The function above is called by the this RealDamage function, that may also be improved:

public static float RealDamage(SpellData attack, Entity target, Entity caster)
    {
        float max_variation = attack.damage_variation / 2f;
        float min_variation = max_variation - attack.damage_variation;
        float resist_percent = 0f;
        float dmg = DamageIncrease(attack, caster) + Random.Range(min_variation, max_variation);
        switch (attack.element)
        {
            case (Element.Fire):
                resist_percent = target.GetFireResistance();
                break;
            case (Element.Earth):
                resist_percent = target.GetEarthResistance();
                break;
            case (Element.Water):
                resist_percent = target.GetWaterResistance();
                break;
            case (Element.Wind):
                resist_percent = target.GetWindResistance();
                break;
            case (Element.Impact):
                resist_percent = target.GetPhysicalResistance();
                break;
        }

        dmg -= (dmg * resist_percent / 100f);

        if (dmg &lt; 1f)
            dmg = 0f;

        return dmg;
    }


and this one is called when player casts a spell:

float damage = DamageHelper.RealDamage(data, e, spellCaster);
dmg.GetComponent&lt;DamageText&gt;().MakeTooltip(data.element, damage, e.transform.position);
e.TakeDamage(damage);


It's pretty simple, but I would like to know if there are any ways it can be improved. Also, I will probably add more formulas, since I have to get the bonus from the Entity equipment. In this case, where should I put these?
Define some data structures. 


Data definitions are clear, complete, obvious, in one place
DRY principle - a single place to change data values
client code does not change if data values change
Declared "Default" Element to keep code consistent
Reusable


.

public DamageFactor {
   public float Wisdom    { get; protected set; }
   public float Domanince { get; protected set; }
   public float Control   { get; protected set; }

   public DamageFactor (int wisdom, int domanince, int control) { ... }
}

public Dictionary&lt;Element, DamageFactor&gt; Damage = new Dictionary&lt;Element, DamageFactor&gt;() {  
    { Element.Fire,    new DamageFactor { Wisdom = 0.3f, Dominance = 0.1f, Control = 0.1f },
    { Element.Earth,   new DamageFactor { Wisdom = 0.3f, Dominance = 0.1f, Control = 0.1f },
    { Element.Wind,    new DamageFactor { Wisdom = 0.3f, Dominance = 0.1f, Control = 0.1f },
    { Element.Water,   new DamageFactor { Wisdom = 0.3f, Dominance = 0.1f, Control = 0.1f },
    { Element.Impact,  new DamageFactor { Wisdom = 0.1f, Dominance = 0.3f, Control = 0.1f },
    { Element.Default, new DamageFactor { Wisdom = 0.1f, Dominance = 0.1f, Control = 0.3f }
};

public Dictionary&lt;Element, int&gt; Resistance = new Dictionary&lt;Element, int&gt;() {
    { Element.Fire, 12 },
    { Element.Earth, 9 },
    { Element.Water, 7 },
    { Element.Wind, 5 }, 
    { Element.Impact, 3 },
    { Element.Default, 1 }
};

public static float DamageIncrease(SpellData attack, Entity caster) {
//Elemental damage is more increased by wisdom attribute
//Impact damage is more increased by dominance attribute 
//summon level is increased by control attribute

float bonus = 0f;
bonus = caster.wisdom    * Damage[attack.element].Wisdom +
        caster.dominance * Damage[attack.element].Dominance +
        caster.control   * Damage[attach.element].Control;

return attack.damage + bonus;
}

public static float RealDamage(SpellData attack, Entity target, Entity caster) {
    float max_variation = attack.damage_variation / 2f;
    float min_variation = max_variation - attack.damage_variation;
    float resist_percent = 0f;
    float dmg = DamageIncrease(attack, caster) + Random.Range(min_variation, max_variation);

    resist_percent = Resistance[attack.element];
    dmg -= (dmg * resist_percent / 100f);

    if (dmg &lt; 1f)
        dmg = 0f;

    return dmg;
}