Beispiel #1
0
 public VTile(MTile h)
 {
     this._center = h.Center;
     this._col    = h.GetCol();
     this._height = h.GetHeight();
     this._row    = h.GetRow();
     this._type   = h.Type;
 }
Beispiel #2
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);
            }
        }
Beispiel #3
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);
            }
        }