public void UpdatePatrolArea(LogicLevel level) { if (this.m_wayPoints != null) { int wayPointCount = this.m_wayPoints.Size(); if (wayPointCount > 0 && this.m_pathLength == 0) { for (int i = wayPointCount - 1; i >= 0; i--) { this.m_patrolAreaCounter = (this.m_patrolAreaCounter + 1) % wayPointCount; if (this.MoveTo(this.m_wayPoints[this.m_patrolAreaCounter].m_x, this.m_wayPoints[this.m_patrolAreaCounter].m_y, level.GetTileMap(), true)) { break; } } if (this.m_patrolPost != null && this.m_patrolPost.GetDefenceUnitProduction() != null) { this.m_freezeTime = (level.IsInCombatState() ? 100 : 5000) + level.GetLogicTime().GetTick() % (level.IsInCombatState() ? 200 : 3000); } } } }
public override void Tick() { if (this.m_triggeredByRadius) { LogicLevel level = this.m_parent.GetLevel(); if (level.IsInCombatState()) { if (!this.m_triggered) { if (((level.GetLogicTime().GetTick() / 4) & 7) == 0) { LogicArrayList <LogicComponent> components = this.m_parent.GetComponentManager().GetComponents(LogicComponentType.MOVEMENT); for (int i = 0; i < components.Size(); i++) { LogicGameObject gameObject = components[i].GetParent(); if (gameObject.GetGameObjectType() == LogicGameObjectType.CHARACTER) { LogicCharacter character = (LogicCharacter)gameObject; LogicMovementComponent movementComponent = character.GetMovementComponent(); bool triggerDisabled = false; if (movementComponent != null) { LogicMovementSystem movementSystem = movementComponent.GetMovementSystem(); if (movementSystem != null && movementSystem.IsPushed()) { triggerDisabled = movementSystem.IgnorePush(); } } if (!triggerDisabled && character.GetCharacterData().GetTriggersTraps()) { this.ObjectClose(character); } } } } } } } }