void Cursor_OnValidation(CombatCursor sender, CombatCursorEventArgs e) { if (!Combat.GetCell(e.CellPosition).IsWithinArea(new CellArea(CellAreaType.Circle, 1, (int)CurrentCombatant.Status[BaseCaracteristic.Mp]), CurrentCellPosition) || !Combat.GetCell(e.CellPosition).IsUsable()) { if (CurrentCellPosition == e.CellPosition) Combat.ChangeState(BlazeraLib.Combat.EState.ActionSelection); return; } CurrentCombatant.OnMoveEnding += new CombatantMoveEventHandler(CurrentCombatant_OnMoveEnding); System.Collections.Generic.List<Vector2I> path = Combat.Map.GetPath(CurrentCellPosition, e.CellPosition); if (path == null) { Combat.ChangeState(BlazeraLib.Combat.EState.ActionSelection); return; } foreach (Vector2I cellPosition in path) CurrentCombatant.AddMovePoint(cellPosition); Combat.AttachViewToCurrentCombatant(); Combat.Cursor.Close(); End(); }
void Cursor_OnMove(CombatCursor sender, CombatCursorMoveEventArgs e) { Combat.RemoveCellColorEffect(CurrentSpell.EffectArea, e.OldCellPosition, CellSelectionType.SpellArea); Combat.RemoveCellColorEffect(CurrentSpell.EffectArea, e.OldCellPosition, CellSelectionType.OutOfRange); if (Combat.GetCell(e.CellPosition).IsWithinArea(CurrentSpell.RangeArea, CurrentCombatant.CellPosition)) Combat.AddCellColorEffect(CurrentSpell.EffectArea, e.CellPosition, CellSelectionType.SpellArea); else Combat.AddCellColorEffect(CurrentSpell.EffectArea, e.CellPosition, CellSelectionType.OutOfRange); }
void Cursor_OnValidation(CombatCursor sender, CombatCursorEventArgs e) { if (!Combat.GetCell(Combat.Cursor.CellPosition).IsWithinArea(CurrentSpell.RangeArea, CurrentCombatant.CellPosition)) return; Spell = new CombatSpell(CurrentSpell, CurrentCombatant); // Spell = new RandomEffectAreaSpell(CurrentSpell, CurrentCombatant); Log("launches " + Spell.GetName()); Spell.Launch(e.CellPosition); Spell.OnStopping += new CombatSpellEventHandler(Spell_OnStopping); SpellIsPerforming = true; Combat.Cursor.Close(); End(); }
void Cursor_OnCancellation(CombatCursor sender, CombatCursorEventArgs e) { Combat.ChangeState(BlazeraLib.Combat.EState.ActionSelection); }