/* * public bool Run(long Tick) * { * if (!Running) * return false; * * int i = 0; * lock (_Objects) * { * UpdateAnnounces(Tick); * * } * * return true; * }*/ #endregion #region HotSpots public void AddHotspotDamage(int zoneX, int zoneY) { int x = (int)Point2D.Clamp(zoneX / 1024, 0, 63); int y = (int)Point2D.Clamp(zoneY / 1024, 0, 63); if (_heatmap[x, y] <= LARGE_FIGHT + 1000) { _heatmap[x, y]++; } }
private void RecalculatePopFactor() { if (_popHistory[0].Count > 14) { _popHistory[0].RemoveAt(0); _popHistory[1].RemoveAt(0); } _popHistory[0].Add(_orderCount); _popHistory[1].Add(_destroCount); int orderPop = Math.Max(12, _popHistory[0].Max()); int destroPop = Math.Max(12, _popHistory[1].Max()); foreach (Keep keep in _Keeps) { keep.ScaleLord(keep.Realm == Realms.REALMS_REALM_ORDER ? destroPop : orderPop); } _relativePopulationFactor = Point2D.Clamp(orderPop / (float)destroPop, 0.25f, 4f); int popBase = Math.Min(orderPop, destroPop); if (popBase < 50) { PopulationScaleFactor = 1; } else if (popBase < 100) { PopulationScaleFactor = 1.35f; } else if (popBase < 200) { PopulationScaleFactor = 1.65f; } else { PopulationScaleFactor = 2f; } if (orderPop > destroPop) { _ArtilleryDamageScale[0] = 2f - Math.Min(1.5f, _relativePopulationFactor); _ArtilleryDamageScale[1] = Math.Min(1.1f, _relativePopulationFactor); } else { _ArtilleryDamageScale[1] = 2f - Math.Min(1.5f, 1f / _relativePopulationFactor); _ArtilleryDamageScale[0] = Math.Min(1.1f, 1f / _relativePopulationFactor); } }
/// <summary> /// キャレット位置及び領域設定。 /// </summary> public void SetArea(Rect2D area, Point2D caretLocation) { if (area.IsInvalid) { return; } caretLocation = caretLocation.Clamp(area); _jsInputMethod.CallVoid("setArea", new { x = area.X, y = area.Y, w = area.Width, h = area.Height }, new { x = caretLocation.X, y = caretLocation.Y }); }
// Higher if enemy realm's population is lower. public float GetLockPopulationScaler(Realms realm) { if (realm == Realms.REALMS_REALM_NEUTRAL) { return(1f); } // Factor for how much this realm outnumbers the enemy. float popFactor = Point2D.Clamp((realm == Realms.REALMS_REALM_ORDER ? _relativePopulationFactor : 1f / _relativePopulationFactor), 0.33f, 3f); if (popFactor > 1f) { return(popFactor / ((popFactor + 1f) / 2f)); } return(1f / ((1f / popFactor + 1f) / 2f)); }
public void SetArea(Rect2D rect, Point2D location) { if (rect.IsInvalid) { return; } location = location.Clamp(rect); #warning 相違がある時だけ行う if (true) { _location = location; _area = rect; Reset(); } }