37 public boolean execute(String ruleId, InteractionDialogAPI dialog, List<Token> params, Map<String, MemoryAPI> memoryMap) {
38 if (dialog ==
null)
return false;
40 OptionPanelAPI options = dialog.getOptionPanel();
41 TextPanelAPI text = dialog.getTextPanel();
43 CargoAPI cargo = pf.getCargo();
45 SectorEntityToken entity = dialog.getInteractionTarget();
46 if (entity ==
null)
return false;
48 String action = params.get(0).getString(memoryMap);
50 MemoryAPI memory = memoryMap.get(MemKeys.LOCAL);
51 if (memory ==
null)
return false;
55 StarSystemAPI system =
null;
56 if (dialog.getInteractionTarget().getContainingLocation() instanceof StarSystemAPI) {
57 system = (StarSystemAPI) dialog.getInteractionTarget().getContainingLocation();
63 if (
"hasRecentReadingsNearby".equals(action)) {
64 return HyperspaceTopographyEventIntel.hasRecentReadingsNearPlayer();
65 }
else if (
"computeDataStats".equals(action)) {
66 if (entity instanceof CampaignFleetAPI) {
67 CampaignFleetAPI fleet = (CampaignFleetAPI) entity;
68 float fp = fleet.getFleetPoints();
71 memory.set(
"$ht_dataCost", Misc.getWithDGS(cost));
72 memory.set(
"$ht_dataRange",
"" + (
int) range);
76 }
else if (
"getScavengerData".equals(action)) {
77 if (entity instanceof CampaignFleetAPI) {
78 CampaignFleetAPI fleet = (CampaignFleetAPI) entity;
79 float fp = fleet.getFleetPoints();
82 SlipstreamVisibilityManager.updateSlipstreamVisibility(entity.getLocationInHyperspace(), range);
85 boolean hasRecent = HyperspaceTopographyEventIntel.hasRecentReadingsNearPlayer();
86 if (!hasRecent && points > 0) {
87 HyperspaceTopographyEventIntel.addFactorCreateIfNecessary(
new HTScavengerDataFactor(points), dialog);
88 if (HyperspaceTopographyEventIntel.get() !=
null) {
89 HyperspaceTopographyEventIntel.get().addRecentReadings(entity.getLocationInHyperspace());