use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.
the class DeedLinksResolver method loadMapByKey.
private void loadMapByKey() {
_mapByKey = new HashMap<String, DeedDescription>();
for (DeedDescription deed : _deeds) {
String deedKey = deed.getKey();
DeedDescription old = _mapByKey.put(deedKey, deed);
if (old != null) {
System.out.println("Multiple instances of deed key: " + deedKey);
}
}
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.
the class DeedLinksResolver method buildAdvancedSkirmishLieutenantDeed.
private DeedDescription buildAdvancedSkirmishLieutenantDeed(DeedDescription baseDeed) {
DeedDescription deed = new DeedDescription();
deed.setKey(baseDeed.getKey() + "_(Advanced)");
deed.setName(baseDeed.getName() + " (Advanced)");
deed.setType(DeedType.SLAYER);
deed.setCategory(baseDeed.getCategory());
deed.setDescription(baseDeed.getDescription());
// Objectives
// First line of base deed, replace (5) by (50)
{
String newObjectives = "";
String objectives = baseDeed.getObjectives();
int index = objectives.indexOf('\n');
if (index != -1) {
newObjectives = objectives.substring(0, index);
} else {
newObjectives = objectives;
}
newObjectives = newObjectives.replace("(5)", "(50)");
deed.setObjectives(newObjectives);
}
// Previous
DeedProxy previous = new DeedProxy();
previous.setDeed(baseDeed);
previous.setKey(previous.getKey());
previous.setName(previous.getName());
deed.setPreviousDeedProxy(previous);
// Rewards
ObjectItem item = new ObjectItem("Mark");
item.setItemId(1879224343);
deed.getRewards().getObjects().addObject(item, 500);
return deed;
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.
the class DeedLinksResolver method checkPrevious2NextSymetry.
private void checkPrevious2NextSymetry(DeedDescription deed) {
DeedProxy previousProxy = deed.getPreviousDeedProxy();
if (previousProxy != null) {
String previousKey = previousProxy.getKey();
DeedDescription previousDeed = _mapByKey.get(previousKey);
if (previousDeed != null) {
DeedProxy nextProxy = previousDeed.getPreviousDeedProxy();
if (nextProxy == null) {
nextProxy = new DeedProxy();
nextProxy.setDeed(deed);
nextProxy.setKey(deed.getKey());
nextProxy.setName(deed.getName());
previousDeed.setNextDeedProxy(nextProxy);
}
}
}
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.
the class DeedLinksResolver method checkForUnwantedChildren.
private void checkForUnwantedChildren(DeedDescription deed) {
List<DeedProxy> children = deed.getChildDeedProxies().getDeedProxies();
// Grab child deed names
Map<String, DeedProxy> childNames = new HashMap<String, DeedProxy>();
for (DeedProxy child : children) {
childNames.put(child.getName(), child);
}
// For each child, check if one of its previous is the children list
List<DeedProxy> toRemove = new ArrayList<DeedProxy>();
for (DeedProxy child : children) {
DeedDescription childDeed = child.getDeed();
DeedProxy previous = childDeed.getPreviousDeedProxy();
while (previous != null) {
DeedProxy previousInChildren = childNames.get(previous.getName());
if (previousInChildren != null) {
toRemove.add(previousInChildren);
break;
}
DeedDescription previousDeed = previous.getDeed();
previous = (previousDeed != null) ? previousDeed.getPreviousDeedProxy() : null;
}
}
children.removeAll(toRemove);
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.
the class DeedObjectivesParser method findDeedInObjectivesLine.
private DeedDescription findDeedInObjectivesLine(DeedDescription parentDeed, String line) {
DeedDescription ret = null;
List<String> links = TextTools.findAllBetween(line, "[[", "]]");
if (links.size() > 0) {
boolean ignore = false;
for (String link : links) {
int index = link.indexOf('|');
String linkId;
String linkText;
if (index != -1) {
linkId = link.substring(0, index).trim();
linkText = link.substring(index + 1).trim();
} else {
linkId = null;
linkText = link.trim();
}
if (linkId != null) {
boolean ignoreLink = ignoreLink(linkId);
if (ignoreLink) {
ignore = true;
continue;
}
ret = resolveDeed(linkId);
}
if (ret == null) {
boolean ignoreLink = ignoreLink(linkText);
if (ignoreLink) {
ignore = true;
continue;
}
ret = resolveDeed(linkText);
}
}
if ((ret == null) && (!ignore)) {
boolean ignoreLine = ignoreLine(line);
if (!ignoreLine) {
System.out.println(parentDeed.getName() + " => " + line);
}
}
}
return ret;
}
Aggregations