| | |
| | | public class HandModeOperationAgent : IOperationAgent |
| | | { |
| | | protected StoryBattleField storyBattleField; |
| | | bool autoNext = false; //预存玩家的下一次攻击,让下一次自动执行,因为玩家点的时机不一定是刚好的可攻击状态 |
| | | |
| | | public HandModeOperationAgent(BattleField battleField) : base(battleField) |
| | | { |
| | |
| | | public override void Run() |
| | | { |
| | | base.Run(); |
| | | if (autoNext) |
| | | { |
| | | if (storyBattleField.RequestFight()) |
| | | { |
| | | //直到成功为止 |
| | | autoNext = false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 通过主界面的按钮推动(调用)DoNext |
| | | public override void DoNext() |
| | | { |
| | | base.DoNext(); |
| | | |
| | | storyBattleField.RequestFight(); |
| | | if (!storyBattleField.RequestFight()) |
| | | { |
| | | autoNext = true; |
| | | } |
| | | } |
| | | |
| | | |