Search in sources :

Example 36 with PARAMETER

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;
}
Also used : PRINCIPLES(main.content.enums.entity.HeroEnums.PRINCIPLES) PARAMETER(main.content.values.parameters.PARAMETER)

Example 37 with PARAMETER

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;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) PARAMETER(main.content.values.parameters.PARAMETER)

Example 38 with PARAMETER

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;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) PARAMETER(main.content.values.parameters.PARAMETER)

Example 39 with PARAMETER

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();
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) PARAMETER(main.content.values.parameters.PARAMETER)

Example 40 with PARAMETER

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);
    }
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Aggregations

PARAMETER (main.content.values.parameters.PARAMETER)136 PROPERTY (main.content.values.properties.PROPERTY)22 ObjType (main.entity.type.ObjType)13 ArrayList (java.util.ArrayList)12 Formula (main.system.math.Formula)12 Ref (main.entity.Ref)9 VALUE (main.content.VALUE)7 Obj (main.entity.obj.Obj)7 PARAMS (eidolons.content.PARAMS)6 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)5 Cost (main.elements.costs.Cost)5 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)4 G_Panel (main.swing.generic.components.G_Panel)4 Node (org.w3c.dom.Node)4 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)3 HashMap (java.util.HashMap)3 DAMAGE_TYPE (main.content.enums.GenericEnums.DAMAGE_TYPE)3 Costs (main.elements.costs.Costs)3 Entity (main.entity.Entity)3 GraphicComponent (main.swing.generic.components.misc.GraphicComponent)3