use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class PrincipleMaster method initParams.
private static boolean initParams(ObjType type, boolean alignmentOrIdentity) {
Map<PRINCIPLES, String> map = new RandomWizard<PRINCIPLES>().constructStringWeightMap(type.getProperty(G_PROPS.PRINCIPLES), PRINCIPLES.class);
if (map.isEmpty()) {
return false;
}
boolean result = false;
for (PRINCIPLES principle : map.keySet()) {
// Integer amount =StringMaster.getInteger(map.getOrCreate(principle));
// if (amount == 0)
// continue;
result = true;
PARAMETER param = alignmentOrIdentity ? DC_ContentManager.getAlignmentForPrinciple(principle) : DC_ContentManager.getIdentityParamForPrinciple(principle);
type.setParam(param, map.get(principle));
}
return result;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class Level method getXml.
public String getXml() {
String xml = XML_Converter.openXmlFormatted("Level");
xml += XML_Converter.openXmlFormatted("Custom Props");
for (PROPERTY prop : location.getPropMap().keySet()) {
String value = location.getProperty(prop);
if (prop == G_PROPS.WORKSPACE_GROUP || prop == PROPS.ENEMY_SPAWN_COORDINATES || prop == PROPS.PARTY_SPAWN_COORDINATES || !value.equals(location.getType().getType().getProperty(prop))) // dungeon.getType().getType() - original type
{
xml += XML_Converter.wrapLeaf(prop.getName(), value);
}
}
xml += XML_Converter.closeXmlFormatted("Custom Props");
xml += XML_Converter.openXmlFormatted("Custom Params");
for (PARAMETER param : location.getParamMap().keySet()) {
String value = location.getParam(param);
if (!value.equals(location.getType().getType().getParam(param))) {
xml += XML_Converter.wrapLeaf(param.getName(), value);
}
}
xml += XML_Converter.closeXmlFormatted("Custom Params");
String wallObjData = getWallObjData();
xml += XML_Converter.wrapLeaf(DungeonBuilder.WALL_OBJ_DATA_NODE, wallObjData);
String facingMapData = getFacingMapData();
if (!facingMapData.isEmpty()) {
xml += XML_Converter.wrapLeaf(DungeonBuilder.DIRECTION_MAP_NODE, facingMapData);
}
String aiGroupData = getAiGroupData();
if (!aiGroupData.isEmpty()) {
xml += XML_Converter.wrapLeaf(LocationBuilder.AI_GROUPS_NODE, aiGroupData);
}
xml += location.getPlan().getXml();
xml += XML_Converter.closeXmlFormatted("Level");
return xml;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class Mission method getData.
public String getData() {
String data = "";
// obj.setProperty(MACRO_PROPS.DUNGEON_LEVELS,
// StringMaster.constructContainer(ListMaster
// .toStringList(levels.toArray())));
data += XML_Converter.openXmlFormatted("Custom Props");
for (PROPERTY p : obj.getPropMap().keySet()) {
String value = obj.getProperty(p);
if (!StringMaster.compareByChar(value, obj.getType().getProperty(p))) {
// data += portrait.getName() + "=" + value + ",";
data += XML_Converter.wrapLeaf(p.getName(), value);
}
}
data += XML_Converter.closeXmlFormatted("Custom Props");
data += XML_Converter.openXmlFormatted("Custom Params");
for (PARAMETER p : obj.getParamMap().keySet()) {
String value = obj.getParam(p);
if (!StringMaster.compareByChar(value, obj.getType().getParam(p))) {
// data += portrait.getName() + "=" + value + ";";
data += XML_Converter.wrapLeaf(p.getName(), value);
}
}
data += XML_Converter.closeXmlFormatted("Custom Params");
// }
return data;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class TypeBuilder method getAlteredValuesXml.
public static String getAlteredValuesXml(DataModel entity, ObjType type) {
StringBuilder xmlBuilder = new StringBuilder();
xmlBuilder.append(XML_Converter.openXml(PROPS_NODE));
for (PROPERTY sub : entity.getPropMap().keySet()) {
if (sub.isDynamic() || !entity.getProperty(sub).equalsIgnoreCase(type.getProperty(sub)))
xmlBuilder.append(XML_Formatter.getValueNode(entity, (sub)));
}
xmlBuilder.append(XML_Converter.closeXml(PROPS_NODE));
xmlBuilder.append(XML_Converter.openXml(PARAMS_NODE));
for (PARAMETER sub : entity.getParamMap().keySet()) {
if (sub.isDynamic() || !entity.getParam(sub).equals(type.getParam(sub)))
xmlBuilder.append(XML_Formatter.getValueNode(entity, (sub)));
}
xmlBuilder.append(XML_Converter.closeXml(PARAMS_NODE));
return xmlBuilder.toString();
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class ActiveResetter method addCustomMods.
protected void addCustomMods() {
if (getOwnerObj().getCustomParamMap() == null) {
return;
}
for (PARAMETER param : DC_ContentManager.getCostParams()) {
addCustomMod(COST_REDUCTION_ACTIVE_NAME, getName(), param, false);
addCustomMod(COST_MOD_ACTIVE_NAME, getName(), param, true);
}
}
Aggregations