public override void ProcessEnterZone(TileMoveData moveData)
 {
     base.ProcessEnterZone(moveData);
     if (this._suppressionZoneData.Source != null)
     {
         if (moveData.Target.Proxy.LParty != this._suppressionZoneData.Source.Proxy.LParty)
         {
             var data = new ActionData();
             data.Ability      = EAbility.Aim;
             data.LWeapon      = this._suppressionZoneData.LWeapon;
             data.ParentWeapon = this._suppressionZoneData.ParentWeapon;
             data.Source       = this._suppressionZoneData.Source;
             data.Target       = moveData.Target.Tile;
             data.WpnAbility   = true;
             this._action      = new MAction(data);
             moveData.ParentEvent.AddChildAction(this._action);
             this._action.AddCallback(moveData.ParentEvent.TryDone);
             var staminaCalc = new StaminaCalculator();
             var cost        = staminaCalc.Process(this._action);
             if (cost <= this._action.Data.Source.Proxy.GetPoints(ESecondaryStat.Stamina))
             {
                 moveData.Callback(this);
                 this._action.TryProcessNoDisplay();
                 this.HandleAim(null);
             }
         }
     }
 }
Exemple #2
0
        private void ProcessAction()
        {
            var calc = new InjuryCalculator();

            foreach (var hit in this._data.Hits)
            {
                calc.ProcessHitInjuries(hit);
            }
            var staminaCalc = new StaminaCalculator();
            var cost        = staminaCalc.Process(this);

            this.Data.Source.Proxy.ModifyPoints(ESecondaryStat.Stamina, cost, false);
        }
Exemple #3
0
        private void TryUndoSpearwall(object o)
        {
            var staminaCalc = new StaminaCalculator();
            var cost        = staminaCalc.Process(this._action);

            if (cost >= this._action.Data.Source.Proxy.GetPoints(ESecondaryStat.Stamina))
            {
                var data = new EvUndoSpearwallData();
                data.Action = this._action;
                data.Char   = this._action.Data.Source;
                var e = new EvUndoSpearwall(data);
                e.TryProcess();
            }
        }
Exemple #4
0
 public override void ProcessEnterZone(TileMoveData moveData)
 {
     this.FirstSpearWallHit = false;
     this.SpearWallHit      = false;
     base.ProcessEnterZone(moveData);
     if (this._spearWallData.Source != null)
     {
         if (moveData.Target.Proxy.LParty != this._spearWallData.Source.Proxy.LParty)
         {
             moveData.Callback(this);
             var data = new ActionData();
             data.Ability      = EAbility.Pierce;
             data.LWeapon      = this._spearWallData.LWeapon;
             data.ParentWeapon = this._spearWallData.ParentWeapon;
             data.Source       = this._spearWallData.Source;
             data.Target       = moveData.Target.Tile;
             data.WpnAbility   = true;
             this._action      = new MAction(data);
             this._action.AddCallback(moveData.ParentEvent.TryDone);
             moveData.ParentEvent.AddChildAction(this._action);
             var staminaCalc = new StaminaCalculator();
             var cost        = staminaCalc.Process(this._action);
             if (FActionStatus.HasFlag(this._action.Data.Source.Proxy.GetActionFlags().CurFlags, FActionStatus.Flags.Spearwalling) &&
                 cost <= this._action.Data.Source.Proxy.GetPoints(ESecondaryStat.Stamina))
             {
                 this._action.TryProcessNoDisplay();
                 foreach (var hit in this._action.Data.Hits)
                 {
                     if (!FHit.HasFlag(hit.Data.Flags.CurFlags, FHit.Flags.Block) &&
                         !FHit.HasFlag(hit.Data.Flags.CurFlags, FHit.Flags.Dodge) &&
                         !FHit.HasFlag(hit.Data.Flags.CurFlags, FHit.Flags.Parry))
                     {
                         this.SpearWallHit = true;
                     }
                 }
                 this.HandleSpeared(null);
             }
         }
     }
 }