private StateOperationResult OnConfrimRestAll(int index) { if (index == 1) { gameAction.DoCreatureAllRest(); return(StateOperationResult.Clear()); } return(StateOperationResult.None()); }
private StateOperationResult OnSelectedUseItem(int index) { int itemId = this.Creature.Data.GetItemAt(index); if (itemId < 0) { // Item not found, should not reach here return(StateOperationResult.Clear()); } // Selete Target Friend SelectItemUseTargetState selectTargetState = new SelectItemUseTargetState(gameAction, this.CreatureId, index); return(StateOperationResult.Push(selectTargetState)); }
public override StateOperationResult OnSelectPosition(FDPosition position) { if (this.AttackRange != null && this.AttackRange.Contains(position)) { FDCreature target = this.gameAction.GetCreatureAt(position); if (target != null && target.Faction == Definitions.CreatureFaction.Enemy) { // Do the attack this.gameAction.DoCreatureAttack(this.Creature.CreatureId, position); return(StateOperationResult.Clear()); } else { // Clicked in the range, but no target, let the player to click again return(StateOperationResult.None()); } } else { // Clicked out of range, cancel return(StateOperationResult.Pop()); } }