Search in sources :

Example 11 with PARAMS

use of eidolons.content.PARAMS in project Eidolons by IDemiurge.

the class AttackTooltipFactory method extractActionValues.

private static List<MultiValueContainer> extractActionValues(DC_UnitAction el, VALUE[] baseKeys) {
    List<MultiValueContainer> list = new ArrayList<>();
    Pair<PARAMS, PARAMS> pair;
    for (VALUE key : baseKeys) {
        pair = ACTION_TOOLTIPS_PARAMS_MAP.get(key);
        String name = ActionTooltipMaster.getStringForTableValue(key, el);
        String imagePath = ActionTooltipMaster.getIconPathForTableRow(key);
        final String leftVal = ActionTooltipMaster.getValueForTableParam(pair.getLeft(), el);
        final String rightVal = ActionTooltipMaster.getValueForTableParam(pair.getRight(), el);
        MultiValueContainer mvc;
        if (!ImageManager.isImage(imagePath)) {
            mvc = new MultiValueContainer(name, leftVal, rightVal);
        } else {
            mvc = new MultiValueContainer(TextureCache.getOrCreateR(imagePath), name, leftVal, rightVal);
        }
        list.add(mvc);
    }
    return list;
}
Also used : MultiValueContainer(eidolons.libgdx.gui.panels.dc.unitinfo.MultiValueContainer) ArrayList(java.util.ArrayList) UNIT_INFO_PARAMS(eidolons.content.UNIT_INFO_PARAMS) PARAMS(eidolons.content.PARAMS) VALUE(main.content.VALUE)

Example 12 with PARAMS

use of eidolons.content.PARAMS in project Eidolons by IDemiurge.

the class HeroScreenDataSourceImpl method getUnlockedMasteries.

@Override
public List<ValueContainer> getUnlockedMasteries() {
    List<ValueContainer> list = new ArrayList<>();
    for (PARAMS params : DC_ContentManager.getMasteryParams()) {
        Integer v = hero.getIntParam(params);
        if (v > 0) {
            TextureRegion texture = TextureCache.getOrCreateR(ImageManager.getValueIconPath(params));
            list.add(new ValueContainer(texture, params.getName(), String.valueOf(v)));
        }
    }
    return null;
}
Also used : TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) ArrayList(java.util.ArrayList) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer) PARAMS(eidolons.content.PARAMS)

Example 13 with PARAMS

use of eidolons.content.PARAMS in project Eidolons by IDemiurge.

the class XlsMaster method main.

public static void main(String[] args) {
    String types = "units;";
    for (DC_TYPE type : TYPES) {
        types += type.getName() + ";";
    }
    CoreEngine.setSelectivelyReadTypes(types);
    // args[0];
    String path = "Y:\\Google Drive\\Project Eidolons\\content\\";
    String filename = path + "content.xls";
    DC_Engine.mainMenuInit();
    int i = 0;
    HSSFWorkbook workbook = new HSSFWorkbook();
    new DC_Game();
    for (DC_TYPE TYPE : TYPES) {
        PARAMS[] params = PARAM_ARRAYS[i];
        String[] formulas = FORMULA_ARRAYS[i];
        createSheet(workbook, TYPE, GROUPS_ARRAYS[i], params, formulas);
        i++;
    }
    try {
        FileOutputStream fileOut = new FileOutputStream(filename);
        workbook.write(fileOut);
        fileOut.close();
    } catch (IOException e) {
        main.system.ExceptionMaster.printStackTrace(e);
    }
    System.out.println("Content excel file has been generated!");
}
Also used : DC_TYPE(main.content.DC_TYPE) FileOutputStream(java.io.FileOutputStream) DC_Game(eidolons.game.core.game.DC_Game) PARAMS(eidolons.content.PARAMS) IOException(java.io.IOException) HSSFWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook)

Example 14 with PARAMS

use of eidolons.content.PARAMS in project Eidolons by IDemiurge.

the class PrincipleMaster method fixParamBonuses.

private static void fixParamBonuses(ObjType type) {
    String prop = type.getProperty(PROPS.PARAMETER_BONUSES);
    Map<PARAMS, String> map = new RandomWizard<PARAMS>().constructStringWeightMap(prop, PARAMS.class);
    Ref ref = new Ref(type.getGame());
    ref.setID(KEYS.INFO, type.getId());
    for (PARAMS param : map.keySet()) {
        if (!(param.getName().contains(StringMaster.ALIGNMENT) || param.getName().contains(StringMaster.IDENTITY))) {
            continue;
        }
        String string = map.get(param);
        // string = TextParser.parse(string, ref,
        // TextParser.INFO_PARSING_CODE);
        // Ref.setInfoObject(type); TODO support {n} or is it useless?
        int amount = StringMaster.getInteger(TextParser.parse(string, ref, TextParser.INFO_PARSING_CODE));
        // if (param.getName().contains(StringMaster.ALIGNMENT)) {
        // 
        // type.modifyParameter(param, amount);
        // } else if (param.getName().contains(StringMaster.IDENTITY)) {
        type.setParameter(param, amount);
        String value = param.getName() + StringMaster.wrapInParenthesis(string + "");
        type.removeProperty(PROPS.PARAMETER_BONUSES, value);
        LogMaster.log(1, value + " move to parameter on " + type);
    }
// TODO from prop to params
}
Also used : Ref(main.entity.Ref) PARAMS(eidolons.content.PARAMS)

Example 15 with PARAMS

use of eidolons.content.PARAMS in project Eidolons by IDemiurge.

the class ChannelingRule method getChannelingCosts.

public static Costs getChannelingCosts(DC_SpellObj action, boolean activateOrResolve) {
    List<Cost> list = new ArrayList<>();
    for (PARAMS costParam : activateOrResolve ? costParamsActivate : costParamsResolve) {
        PARAMS payParam = DC_ContentManager.getPayParameterForCost(costParam);
        Cost cost = DC_CostsFactory.getCost(action, costParam, payParam);
        // int mod = 100;
        // cost.getPayment().getAmountFormula().applyModifier(mod);
        list.add(cost);
    }
    // Costs costs = getEntity().getCosts();
    // Costs channelingResolveCosts = new Costs(costs.getRequirements(), costs.getCosts());
    // Costs channelingActivateCosts = new Costs(costs.getRequirements(), costs
    // .getCost(PARAMS.C_N_OF_ACTIONS));
    // channelingResolveCosts.removeCost(PARAMS.C_N_OF_ACTIONS);
    CostRequirements reqs = action.getCosts().getRequirements();
    Costs costs = new Costs(reqs, list);
    if (!activateOrResolve)
        costs.removeRequirement(InfoMaster.COOLDOWN_REASON);
    return costs;
}
Also used : Costs(main.elements.costs.Costs) CostRequirements(main.elements.costs.CostRequirements) ArrayList(java.util.ArrayList) PARAMS(eidolons.content.PARAMS) Cost(main.elements.costs.Cost)

Aggregations

PARAMS (eidolons.content.PARAMS)29 PARAMETER (main.content.values.parameters.PARAMETER)8 ArrayList (java.util.ArrayList)7 ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)5 UNIT_INFO_PARAMS (eidolons.content.UNIT_INFO_PARAMS)4 ValueTooltip (eidolons.libgdx.gui.tooltips.ValueTooltip)4 G_PROPS (main.content.values.properties.G_PROPS)4 Pair (org.apache.commons.lang3.tuple.Pair)4 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)3 DC_UnitAction (eidolons.entity.active.DC_UnitAction)3 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)3 Unit (eidolons.entity.obj.unit.Unit)3 Tooltip (eidolons.libgdx.gui.tooltips.Tooltip)3 TextureCache (eidolons.libgdx.texture.TextureCache)3 Arrays (java.util.Arrays)3 List (java.util.List)3 Collectors (java.util.stream.Collectors)3 VALUE (main.content.VALUE)3 Ref (main.entity.Ref)3 ImageManager (main.system.images.ImageManager)3