private void ProcessTakingAction() { if (this._combatData.InitiativeOrder.Count > 0) { var tgt = this._combatData.InitiativeOrder[0]; tgt.Proxy.ProcessNewTurn(); if (FActionStatus.HasFlag(tgt.Proxy.GetActionFlags().CurFlags, FActionStatus.Flags.Casting)) { var pair = this._currentlyCasting.Find(x => x.X.Equals(tgt)); if (pair.X != null && pair.Y != null) { this._currentlyCasting.Remove(pair); pair.Y.DecrementCastingTurnsRemaining(); if (pair.Y.GetCastingTurnsRemaining() <= 0) { pair.Y.AddCallback(this.CharCastDone); } pair.Y.TryProcess(); } else { throw new System.Exception("Error: Cannot find casting character, but it is required."); } } else { var data = new EvNewTurnData(); data.Target = this._combatData.InitiativeOrder[0]; var acting = new EvNewTurn(data); acting.TryProcess(); } } }
private void CharCastDone(object o) { var data = new EvNewTurnData(); data.Target = this._combatData.InitiativeOrder[0]; var acting = new EvNewTurn(data); acting.TryProcess(); }