Search in sources :

Example 41 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class ItemGenerator method generateName.

public static String generateName(JEWELRY_ITEM_TRAIT trait, MAGICAL_ITEM_LEVEL level, ObjType type) {
    PARAMETER p = trait.getParams()[0];
    String name = type.getName();
    int amount = trait.getIntegers()[level.getInt()];
    if (!ItemMaster.isRing(type) && trait.isDoubleAmulet()) {
        amount *= 2;
    }
    name = level.toString() + " " + name + " of " + p.getName() + StringMaster.wrapInParenthesis("+" + amount);
    return name;
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Example 42 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class ItemGenerator method applyWeightPenalties.

private static void applyWeightPenalties(ObjType type) {
    // TODO magical item exception!
    if (type.getGroupingKey().equalsIgnoreCase("" + ItemEnums.WEAPON_TYPE.NATURAL)) {
        return;
    }
    // robes?
    // ++ apply durability from quality?
    int w = type.getIntParam(PARAMS.WEIGHT);
    for (PARAMETER p : (type.getOBJ_TYPE_ENUM() == DC_TYPE.WEAPONS ? DC_ContentManager.getWeaponWeightPenaltyParams() : DC_ContentManager.getArmorWeightPenaltyParams())) {
        if (type.getGroupingKey().equalsIgnoreCase("" + ItemEnums.WEAPON_TYPE.MAGICAL)) {
            if (!p.getName().contains("move") && !p.getName().contains("attack")) {
                continue;
            }
        }
        type.modifyParameter(p, w);
    }
    type.modifyParameter(PARAMS.DEFENSE_MOD, -w);
    type.modifyParameter(PARAMS.ATTACK_MOD, -w);
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Example 43 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class ItemGenerator method generateJewelryItem.

private static ObjType generateJewelryItem(ObjType type, JEWELRY_ITEM_TRAIT trait, MAGICAL_ITEM_LEVEL level) {
    boolean ring = ItemMaster.isRing(type);
    if (trait == null)
        return null;
    PARAMETER[] params = trait.getParams();
    PARAMETER p = params[0];
    ObjType newType = generateEmptyJewelryItem(ring, type, null);
    // double for
    int amount = trait.getIntegers()[level.getInt()];
    // amulets?
    if (!ring && trait.isDoubleAmulet()) {
        amount = amount * 2;
    }
    newType.setParam(p, amount);
    type.getGame().initType(newType);
    newType.setGenerated(true);
    String name = generateName(trait, level, type);
    newType.setProperty(G_PROPS.NAME, name);
    DataManager.addType(newType.getName(), DC_TYPE.JEWELRY, newType);
    // String img = type.getProperty(prop) + suffix + format;
    // newType.setProperty(G_PROPS.IMAGE, name);
    newType.setProperty(PROPS.MAGICAL_ITEM_TRAIT, trait.toString());
    newType.setProperty(PROPS.MAGICAL_ITEM_LEVEL, level.toString());
    int costMod = trait.getCostBase() * level.getCostFactor();
    if (!ring && trait.isDoubleAmulet()) {
        costMod = costMod * 5 / 2;
    }
    newType.modifyParameter(PARAMS.GOLD_COST, costMod);
    newType.modifyParamByPercent(PARAMS.GOLD_COST, JEWELRY_COST_MODIFIER);
    String group = DataManager.MISC;
    if (trait == JEWELRY_ITEM_TRAIT.ATTRIBUTE_BONUS) {
        group = DataManager.ATTR;
    }
    newType.setProperty(G_PROPS.JEWELRY_GROUP, group);
    String code = "" + (level.getInt());
    if (level.getInt() > 0) {
        String img = generateImgPath(code, type);
        if (ImageManager.isImage(img)) {
            newType.setProperty(G_PROPS.IMAGE, img);
        }
    }
    return newType;
}
Also used : ObjType(main.entity.type.ObjType) PARAMETER(main.content.values.parameters.PARAMETER)

Example 44 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class PointView method generateValuePanel.

private void generateValuePanel() {
    String str = "";
    if (attributes) {
        str = "flowy";
        columns = ATTRIBUTE.values().length;
    }
    valPanel = new G_Panel(str);
    int i = 1;
    for (PARAMETER value : values) {
        addValueComponent(value, i, valPanel);
        i++;
    }
}
Also used : G_Panel(main.swing.generic.components.G_Panel) PARAMETER(main.content.values.parameters.PARAMETER)

Example 45 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class PointView method initValues.

private void initValues() {
    if (params) {
        return;
    }
    this.values = new ArrayList<>();
    List<PARAMETER> list = (attributes) ? ContentManager.getAttributes() : ContentManager.getMasteries();
    for (PARAMETER p : list) {
        if (checkValue(p)) {
            values.add(p);
        }
    }
}
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