My bonfamiliar.cs files looks like this,
//If Skele is a pet then it will do an AOE attack.
if (Master != null)
{
AoeAttack();
}
}
/// <summary>
/// JS - Attack all targets 1 space away from Skele.
/// </summary>
private void AoeAttack()
{
int damage = 0;
//Get the damage based on the skele's DC
damage = GetAttackPower(MinDC, MaxDC);
if (damage == 0) return;
//Loop round the cells around the skele to check for targets and do damage to them.
for (int i = 0; i < 8; i++)
{
Point target = Functions.PointMove(CurrentLocation, Direction, 1);
Direction = Functions.NextDir(Direction);
if (Target != null && target == Target.CurrentLocation)
Target.Attacked(this, damage, DefenceType.AC);
else
{
if (!CurrentMap.ValidPoint(target)) continue;
Cell cell = CurrentMap.GetCell(target);
if (cell.Objects == null) continue;
for (int o = 0; o < cell.Objects.Count; o++)
{
MapObject ob = cell.Objects[o];
if (ob.Race == ObjectType.Monster || ob.Race == ObjectType.Player)
{
if (!ob.IsAttackTarget(this)) continue;
ob.Attacked(this, damage, DefenceType.AC);
}
else continue;
break;
}
}
}
}
is this correct? again i am sorry if ive done it wrong, all new to me but interesting enough to want to try and learn.