public void IncrementDestroyedBuildingCount(LogicBuildingData data) { LogicBuildingClassData buildingClass = data.GetBuildingClass(); if (buildingClass.IsTownHall() || buildingClass.IsTownHall2()) { this.m_townhallDestroyed = true; } if (this.m_level != null) { LogicAvatar homeOwnerAvatar = this.m_level.GetHomeOwnerAvatar(); if (homeOwnerAvatar != null && homeOwnerAvatar.IsClientAvatar()) { if (this.m_level.GetState() == 2) { int matchType = this.m_level.GetMatchType(); if (matchType != 2 && matchType != 5) { this.m_level.GetAchievementManager().BuildingDestroyedInPvP(data); } } } } }
/// <summary> /// Initializes a new instance of the <see cref="LogicNpcAttack"/> class. /// </summary> public LogicNpcAttack(LogicLevel level) { this._placePositionX = -1; this._placePositionY = -1; this._level = level; this._npcAvatar = (LogicNpcAvatar)level.GetVisitorAvatar(); this._buildingClass = LogicDataTables.GetBuildingClassByName("Defense"); if (this._buildingClass == null) { Debugger.Error("LogicNpcAttack - Unable to find Defense building class"); } }
/// <summary> /// Destructs this instance. /// </summary> public void Destruct() { this._level = null; this._npcAvatar = null; this._buildingClass = null; }