Exemplo n.º 1
0
 private bool TryProcessAction()
 {
     if (CombatManager.Instance.IsValidActionClick(this._data.Target))
     {
         VMapCombatController.Instance.ClearDecoratedTiles(null);
         var data = new EvPerformAbilityData();
         data.Ability = CombatManager.Instance.GetCurrentAbility();
         data.Callbacks.Add(this.CallbackHandler);
         data.LWeapon      = CombatManager.Instance.GetLWeapon();
         data.ParentWeapon = CombatManager.Instance.GetCurrentWeapon();
         data.Source       = CombatManager.Instance.GetCurrentlyActing();
         data.Target       = this._data.Target;
         data.WpnAbility   = CombatManager.Instance.GetIsWpnAbility();
         var e = new EvPerformAbility(data);
         e.AddCallback(this.UpdateActingBox);
         e.TryProcess();
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 private void DoAbility(AgentAbilityData abilityData)
 {
     if (abilityData.Weight > 0)
     {
         var data = new EvPerformAbilityData();
         data.Ability      = abilityData.Ability.Type;
         data.LWeapon      = abilityData.LWeapon;
         data.ParentWeapon = abilityData.ParentWeapon;
         data.Source       = this._agent;
         data.Target       = abilityData.Target.Tile;
         data.WpnAbility   = abilityData.WpnAbiltiy;
         var e = new EvPerformAbility(data);
         e.AddCallback(this.InitCallbackToDetermineAction, CALLBACK_PRIORITY);
         e.TryProcess();
     }
     else
     {
         this.EndTurn(null);
     }
 }