Пример #1
0
 private void HandleQuadrantHelper(MHit hit, CChar tgt, MTile tile)
 {
     if (tile.GetCurrentOccupant() != null)
     {
         if (tile.GetCurrentOccupant().GetType().Equals(typeof(CChar)))
         {
             this.HandleCharacterOccupant(tile);
         }
         else if (tile.GetCurrentOccupant().GetType().Equals(typeof(CDeco)))
         {
             this.HandleDecoOccupant(tile);
         }
     }
 }
Пример #2
0
        private void PredictAbilitiesHelper(MTile tile, MAbility ability, bool lWeapon, CWeapon parentWeapon, bool wpnAbility)
        {
            var target     = tile.GetCurrentOccupant() as CChar;
            var prediction = new AgentAbilityData();

            prediction.Ability      = ability;
            prediction.LWeapon      = lWeapon;
            prediction.ParentWeapon = parentWeapon;
            prediction.Target       = target;
            prediction.Weight       = 0;
            prediction.WpnAbiltiy   = wpnAbility;
            if (ability.Data.Hostile)
            {
                if (target.Proxy.LParty != this._agent.Proxy.LParty)
                {
                    this.HandleAbility(prediction);
                    this._predictions.Add(prediction);
                }
            }
            else
            {
                if (target.Proxy.LParty == this._agent.Proxy.LParty)
                {
                    this.HandleAbility(prediction);
                    this._predictions.Add(prediction);
                }
            }
        }
Пример #3
0
        private void HandleDecoOccupant(MTile tile)
        {
            var occupant = tile.GetCurrentOccupant() as CDeco;
            var data     = new StrayTargetData();

            data.Chance = occupant.Model.GetBulletObstructionChance();
            data.Tile   = tile.Controller;
            var pair = new Pair <double, double>(tile.GetCol(), tile.GetRow());

            if (this._strayTargets.ContainsKey(pair))
            {
                this._strayTargets[pair].Chance += data.Chance;
            }
            else
            {
                this._strayTargets.Add(pair, data);
            }
        }
Пример #4
0
        private void HandleCharacterOccupant(MTile tile)
        {
            var data = new StrayTargetData();

            data.Tile = tile.Controller;
            var occupant = tile.GetCurrentOccupant() as CChar;

            if (occupant.Proxy.Type == ECharType.Humanoid)
            {
                if (FActionStatus.HasFlag(occupant.Proxy.GetActionFlags().CurFlags, FActionStatus.Flags.ShieldWalling))
                {
                    data.Chance = BASE_SHIELDWALL_OBSTRUCTION_CHANCE;
                }
                else if (occupant.Proxy.GetLWeapon() != null && occupant.Proxy.GetLWeapon().IsTypeOfShield())
                {
                    data.Chance = BASE_SHIELD_OBSTRUCTION_CHANCE;
                }
                else if (occupant.Proxy.GetRWeapon() != null && occupant.Proxy.GetRWeapon().IsTypeOfShield())
                {
                    data.Chance = BASE_SHIELD_OBSTRUCTION_CHANCE;
                }
                else
                {
                    data.Chance = BASE_OBSTRUCTION_CHANCE;
                }
            }
            else
            {
                data.Chance = BASE_OBSTRUCTION_CHANCE;
            }
            var pair = new Pair <double, double>(tile.GetCol(), tile.GetRow());

            if (this._strayTargets.ContainsKey(pair))
            {
                this._strayTargets[pair].Chance += data.Chance;
            }
            else
            {
                this._strayTargets.Add(pair, data);
            }
        }