22 public boolean execute(String ruleId, InteractionDialogAPI dialog, List<Token> params, Map<String, MemoryAPI> memoryMap) {
24 SectorEntityToken entity = dialog.getInteractionTarget();
25 if (entity.getActivePerson() ==
null)
return false;
28 RepActions action = RepActions.valueOf(params.get(0).getString(memoryMap));
29 RepActionEnvelope envelope =
new RepActionEnvelope(action,
null, dialog.getTextPanel());
30 ReputationAdjustmentResult result =
Global.
getSector().adjustPlayerReputation(envelope, entity.getActivePerson());
31 return result.delta != 0;
32 }
catch (Throwable t) {
33 CustomRepImpact impact =
new CustomRepImpact();
34 if (params.size() >= 2) {
35 impact.limit = RepLevel.valueOf(params.get(0).getString(memoryMap));
36 impact.delta = params.get(1).getFloat(memoryMap) * 0.01f;
38 impact.delta = params.get(0).getFloat(memoryMap) * 0.01f;
40 ReputationAdjustmentResult result =
Global.
getSector().adjustPlayerReputation(
41 new RepActionEnvelope(RepActions.CUSTOM, impact,
42 null, dialog.getTextPanel(),
true), entity.getActivePerson());
43 return result.delta != 0;