private void SetBulletStrayChance(MHit hit) { if (hit.Data.Source.Proxy.GetStat(ESecondaryStat.Ranged) < BASE_STRAY_FLOOR) { double delta = BASE_STRAY_FLOOR - hit.Data.Source.Proxy.GetStat(ESecondaryStat.Ranged); this._currentStrayChance = delta / BASE_STRAY_SCALAR / 100; foreach (var neighbor in hit.Data.Target.Model.GetAoETiles(1)) { var data = new StrayTargetData(); data.Tile = neighbor.Controller; data.Chance = this._currentStrayChance * BASE_ADJACENT_DIST_ONE_STRAY_CHANCE / BASE_ADJACENT_MULTIPLE; this._strayTargets.Add(new Pair <double, double>(neighbor.GetCol(), neighbor.GetRow()), data); } foreach (var neighbor in hit.Data.Target.Model.GetAoETiles(2)) { var pair = new Pair <double, double>(neighbor.GetCol(), neighbor.GetRow()); if (!this._strayTargets.ContainsKey(pair)) { var data = new StrayTargetData(); data.Tile = neighbor.Controller; data.Chance = this._currentStrayChance * BASE_ADJACENT_DIST_TWO_STRAY_CHANCE / BASE_ADJACENT_MULTIPLE; this._strayTargets.Add(new Pair <double, double>(neighbor.GetCol(), neighbor.GetRow()), data); } } } }
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); } }
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); } }