Тема: Потрібно спростити
Ну, що хлопці?? 
Скучили за мною?? 
Вуха потрібно відкрутити тому, хто придумав обїєктно-орієнтоване програмування. 
Це ж який изощрённый(рос.), збочений розум потрібно мати, щоб до такого додуматись!! 
Якщо чотири властивості attackMin, attackMax, shootMin, shootMax замінити однією ataka, то як спроститься функція??
attackMin=attackMax=shootMin=shootMax=ataka
function getDamageData(e, t, n) {
    var r = {
        damage: 0,
        kills: 0,
        injury: 0,
        demonKills: 0,
        retaliate: !1,
        failed: !1,
        isRanged: n };
    units[e.unit].half && Math.random() >= .9 && (r.demonKills = Math.ceil(t.quantity / 2));
    var i = units[e.unit].attackMin,
        s = units[e.unit].attackMax;
    n ? !units[e.unit].magic || !units[t.unit].magicImmunity ? (units[e.unit].shootMin && (i = units[e.unit].shootMin), units[e.unit].shootMax && (s = units[e.unit].shootMax)) : r.failed = !0 : r.retaliate = t.canRetaliate;
    var o = Math.round(Math.random() * (s - i)) + i;
    o *= e.startTurnQuantity;
    var u = units[e.unit].skillLevel + 5 - units[t.unit].skillLevel;
    return o = Math.floor(o * u / 10), o = Math.floor(o * moraleDamageModifier[e.morale]), e.side == 0 && (hasArtefact("Sword of Prowess") && (o = Math.floor(o * 1.5)), hasArtefact("Training Sword") && (o = Math.floor(o * 1.1)), hasArtefact("Bow of Marksmanship") && n && (o = Math.floor(o * 1.25))), t.side == 0 ? (hasArtefact("Ring of Heroism") && Math.random() > .9 && (o *= 4 / 3), hasArtefact("Shield of Protection") && (o = Math.floor(o / 4), o *= 3), hasArtefact("Shield of Assurance") && (o = Math.ceil(o * .9))) : Math.random() > .9 && (o *= .75), r.damage = o, o += t.injury, o += units[t.unit].hitPoints * r.demonKills, r.kills = Math.floor(o / units[t.unit].hitPoints), r.injury = o - r.kills * units[t.unit].hitPoints, r.kills > t.quantity && (r.kills = t.quantity), r }