70 if (market.isHidden())
continue;
71 if (market.getFactionId().equals(Factions.PIRATES))
continue;
72 MarketConditionAPI mc = market.getCondition(Conditions.PIRATE_ACTIVITY);
73 if (mc !=
null && mc.getPlugin() instanceof PirateActivity) {
74 PirateActivity pa = (PirateActivity) mc.getPlugin();
75 return pa.getIntel() ==
null ? null : pa.getIntel().getTier();
106 if (system ==
null)
return null;
109 if (player ==
null)
return null;
111 int num = Misc.getMarketsInLocation(system).size();
112 if (Misc.getMarketsInLocation(system, Factions.PLAYER).size() == num && num > 0) {
122 float bountyMult = 0f;
123 if (largestBounty !=
null) {
124 bountyMult = largestBounty.getSize();
129 float bonus = tierMult + bountyMult;
132 float timeFactor = (PirateBaseManager.getInstance().getDaysSinceStart() - 180f) / (365f * 2f);
133 if (timeFactor < 0) timeFactor = 0;
134 if (timeFactor > 1) timeFactor = 1;
136 float earlyTimeFactor = (PirateBaseManager.getInstance().getDaysSinceStart() - 60f) / 120f;
137 if (earlyTimeFactor < 0) earlyTimeFactor = 0;
138 if (earlyTimeFactor > 1) earlyTimeFactor = 1;
142 float r = (float) Math.random();
147 float fp = (10f + bonus) * earlyTimeFactor +
148 (5f + bonus) * (0.5f + 0.5f * (float) Math.random()) +
149 50f * (0.5f + 0.5f * r) * timeFactor;
154 fp += ((desired - 2) * (0.5f + (
float) Math.random() * 0.5f)) * 2f * timeFactor;
157 if (fp < 10) fp = 10;
161 type = MercType.SCOUT;
162 }
else if (fp < 75) {
163 type = MercType.PRIVATEER;
164 }
else if (fp < 125) {
165 type = MercType.PATROL;
167 type = MercType.ARMADA;
170 String fleetType = type.fleetType;
175 if (type == MercType.PATROL || type == MercType.ARMADA) {
176 tanker = combat * 0.1f;
179 combat = Math.round(combat);
180 tanker = Math.round(tanker);
184 system.getLocation(),
196 params.ignoreMarketFleetSizeMult =
true;
197 if (timeFactor <= 0) {
198 params.maxShipSize = 1;
202 if (fleet ==
null || fleet.isEmpty())
return null;
204 fleet.getMemoryWithoutUpdate().set(MemFlags.MEMORY_KEY_PIRATE,
true);
205 fleet.getMemoryWithoutUpdate().set(MemFlags.FLEET_NO_MILITARY_RESPONSE,
true);