public void CheckAttackDst(IBsActor source, IBsActor target, BsActionResult res) { if (_board.Distance(source, target) > ResolveMaxDistance(source)) { res.Reason = "Target out of range"; return; } res.Ok = true; }
public void Leave(IBsActor actor, BsFaction faction, BsActionResult res) { if (!Contains(actor, faction)) { res.Reason = "Join a faction first"; return; } Remove(actor, faction); res.Reason = "Left some fraction"; res.Ok = true; }
public void Join(IBsActor actor, BsFaction faction, BsActionResult res) { if (Contains(actor, faction)) { res.Reason = "Cann't join the same fraction twice"; return; } Add(actor, faction); res.Reason = "Joined new fraction"; res.Ok = true; }
public void Attack(IBsActor source, IBsActor target, BsActionResult res) { // Dead characters cannot be attacked if (IsDead(target)) { res.Reason = "Can't attack a dead character"; return; } var current = Value(target); var diff = Diff(current, target.Config().MaxHealth(), -_stats.ResolveAttack(source, target)); SetValue(target, current + diff); res.Ok = true; res.Reason = "Successful Attack"; res.Value = diff; }