private static ActivityBase BuildShowRangeActivity(ShowRangePack pack) { if (pack == null) { throw new ArgumentNullException("pack"); } CallbackActivity activity = new CallbackActivity( (gameInterface) => { gameInterface.PlaceIndicators(pack.Range); }); return(activity); }
public override void OnEnter() { base.OnEnter(); if (range == null) { DirectRangeFinder finder = new DirectRangeFinder(gameAction.GetField(), this.Creature.Position, 1, 1); range = finder.CalculateRange(); } ShowRangePack rangePack = new ShowRangePack(range); SendPack(rangePack); }
public override void OnEnter() { base.OnEnter(); if (this.ItemRange == null) { DirectRangeFinder rangeFinder = new DirectRangeFinder(this.gameAction.GetField(), this.Creature.Position, 1); this.ItemRange = rangeFinder.CalculateRange(); } // Display the attack range on the UI. ShowRangePack pack = new ShowRangePack(this.ItemRange); SendPack(pack); }
public override void OnEnter() { base.OnEnter(); // Calculcate the moving scopes and save it in cache if (moveRange == null) { MoveRangeFinder finder = new MoveRangeFinder(gameAction, this.creature); moveRange = finder.CalculateMoveRange(); } // If the creature has moved, reset the creature position this.creature.ResetPosition(); CreatureRefreshPack reset = new CreatureRefreshPack(this.creature.Clone()); SendPack(reset); ShowRangePack showRange = new ShowRangePack(moveRange); SendPack(showRange); }
public override void OnEnter() { base.OnEnter(); if (this.AttackRange == null) { AttackItemDefinition attackItem = this.Creature.Data.GetAttackItem(); if (attackItem == null) { return; } FDSpan span = attackItem.AttackScope; DirectRangeFinder finder = new DirectRangeFinder(gameAction.GetField(), this.Creature.Position, span.Max, span.Min); this.AttackRange = finder.CalculateRange(); } // Display the attack range on the UI. ShowRangePack pack = new ShowRangePack(this.AttackRange); SendPack(pack); }