private void ManageTank() { var methodName = "ManageTank"; LogTrace(methodName); if (ShouldUseShieldBoosters()) { if (!_ship.ActivateModuleList(_ship.ShieldBoosterModules, false)) { return; } } else { if (!_ship.DeactivateModuleList(_ship.ShieldBoosterModules, true)) { return; } } if (_meCache.Ship.ArmorPct < 95) { if (!_ship.ActivateModuleList(_ship.ArmorRepairerModules, false)) { return; } } else { if (!_ship.DeactivateModuleList(_ship.ArmorRepairerModules, true)) { return; } } //Only kick on hardeners if we have a reason to if (_meCache.TargetedBy.Any() || _defensiveConfiguration.AlwaysRunTank) { _ship.ActivateModuleList(_ship.ActiveHardenerModules, true); _ship.ActivateModuleList(_ship.DamageControlModules, true); _ship.ActivateModuleList(_ship.EccmModules, true); } else { if (!_ship.DeactivateModuleList(_ship.ActiveHardenerModules, false)) { return; } if (!_ship.DeactivateModuleList(_ship.DamageControlModules, false)) { return; } if (!_ship.DeactivateModuleList(_ship.EccmModules, false)) { return; } } }
protected override void ProcessPulseState() { var methodName = "ProcessPulseState"; LogTrace(methodName); LogMessage(methodName, LogSeverityTypes.Debug, "State: {0}", _boostOrcaState); switch (_boostOrcaState) { case BoostOrcaStates.Idle: _boostOrcaState = BoostOrcaStates.GetInPosition; goto case BoostOrcaStates.GetInPosition; case BoostOrcaStates.GetInPosition: var boostLocationBookmark = _bookMarkCache.FirstBookMarkMatching(_miningConfiguration.BoostOrcaBoostLocationLabel, true); if (boostLocationBookmark == null) { LogMessage(methodName, LogSeverityTypes.Standard, "Error: Could not find a bookmark matching the boost orca location label of \"{0}\" in this system.", _miningConfiguration.BoostOrcaBoostLocationLabel); _boostOrcaState = BoostOrcaStates.Error; return; } if (_meCache.InStation) { LogMessage(methodName, LogSeverityTypes.Debug, "Undocking."); _movement.QueueDestination( new Destination(DestinationTypes.Undock)); return; } //Now I need to get to a safespot in space. Preferrably a tower but I can't know what type it is. //If I'm out of warp range, warp to it if (!_bookmarks.IsAtBookmark(boostLocationBookmark)) { _movement.QueueDestination( new Destination(DestinationTypes.BookMark, boostLocationBookmark.Id)); LogMessage(methodName, LogSeverityTypes.Standard, "Moving to boost location bookmark \"{0}\".", boostLocationBookmark.Label); } else { _boostOrcaState = BoostOrcaStates.WaitInPosition; goto case BoostOrcaStates.WaitInPosition; } break; case BoostOrcaStates.WaitInPosition: //Just chill here and boost for the fleet. Turn on ganglinks as needed. if (_ship.GangLinkModules.Count > 0 && !_ship.GangLinkModules[0].IsActive) { LogMessage(methodName, LogSeverityTypes.Standard, "Activating ganglink modules."); _ship.ActivateModuleList(_ship.GangLinkModules, true); } if (_ship.DamageControlModules.Count > 0 && !_ship.DamageControlModules[0].IsActive) { LogMessage(methodName, LogSeverityTypes.Standard, "Activating damage control module."); _ship.ActivateModuleList(_ship.DamageControlModules, false); } break; case BoostOrcaStates.Error: //Make sure I'm at a safespot; preferrably in space, station if required. if (!_safespots.IsSafe()) { var destination = _safespots.GetSafeSpot(); _movement.QueueDestination(destination); } IsEnabled = false; break; } }