internal static LUA.LuaAbilityInfo abiToLuaAbilityInfo(TBAGW.BasicAbility ba, LuaCharacterInfo caster, LuaCharacterInfo target, CallType ct = CallType.Attack)
        {
            LuaAbilityInfo lai = new LuaAbilityInfo();

            lai.abiType     = ba.abilityType.ToString();
            lai.abiCastType = ba.abilityFightStyle.ToString();
            lai.bIsAttack   = ba.abilityType == (int)BasicAbility.ABILITY_TYPE.ATTACK;

            lai.minDmg = ba.baseDamage;
            lai.minDmg = (int)(lai.minDmg * target.parent.combatInfo.baseVSModifier(ba));
            lai.maxDmg = (int)(lai.minDmg * 1.5f);

            lai.abiName = ba.abilityName;
            lai.target  = target;

            lai.caster = caster;
            lai.target = target;

            lai.parent = ba;

            lai.hitChance  = ba.ReturnAbilityHitChanceNum(caster.parent);
            lai.critChance = ba.ReturnAbilityCritChanceNum(caster.parent);

            if (caster != null)
            {
                caster.parent.combatInfo.CheckAffinity(target.parent);
            }
            if (target != null)
            {
                target.parent.combatInfo.CheckAffinity(target.parent);
            }


            if (target.parent.combatInfo.Absorbs(ba.affinity))
            {
                lai.bAbsorbs = true;
            }

            if (BattleGUI.bIsRunning)
            {
                var surroundInfo = BattleGUI.GetSurroundInfo();
                lai.surrAliesCaster   = surroundInfo.gbcAllies;
                lai.surrEnemiesCaster = surroundInfo.gbcEnemies;
                lai.surrAliesTarget   = surroundInfo.rbcAllies;
                lai.surrEnemiesTarget = surroundInfo.rbcEnemies;
                lai.critChance       += surroundInfo.critChance;
                lai.hitChance        += surroundInfo.hitChance;
            }

            switch (ct)
            {
            case CallType.Attack:
                break;

            case CallType.Area:
                lai.bCalledForArea = true;
                break;

            default:
                break;
            }

            return(lai);
        }