Search in sources :

Example 16 with EnumMaster

use of main.system.auxiliary.EnumMaster in project Eidolons by IDemiurge.

the class HT_View method selectAltLink.

private String selectAltLink(String name, String prevData) {
    LINK_VARIANT variant;
    variant = new EnumMaster<LINK_VARIANT>().retrieveEnumConst(LINK_VARIANT.class, new ListChooser(SELECTION_MODE.SINGLE, LINK_VARIANT.class).choose());
    if (variant == null) {
        if (prevData != null) {
        } else {
            return null;
        }
    }
    String offsetX = "" + DialogMaster.inputInt("offset x", 0);
    String offsetY = "" + DialogMaster.inputInt("offset y", 0);
    String offsets = offsetX + "," + offsetY;
    String suffix = (variant + "");
    suffix += "=" + offsets;
    String value = name + StringMaster.wrapInParenthesis(suffix);
    return value;
}
Also used : EnumMaster(main.system.auxiliary.EnumMaster) LINK_VARIANT(eidolons.client.cc.gui.neo.tree.logic.TreeMap.LINK_VARIANT) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Example 17 with EnumMaster

use of main.system.auxiliary.EnumMaster in project Eidolons by IDemiurge.

the class ScriptParser method parseEvent.

public static STANDARD_EVENT_TYPE parseEvent(String eventPart) {
    STANDARD_EVENT_TYPE eventType = getEventByShortcut(eventPart);
    if (eventType != null)
        return eventType;
    eventType = new EnumMaster<STANDARD_EVENT_TYPE>().retrieveEnumConst(STANDARD_EVENT_TYPE.class, eventPart);
    if (eventType != null)
        return eventType;
    return STANDARD_EVENT_TYPE.GAME_STARTED;
}
Also used : EnumMaster(main.system.auxiliary.EnumMaster) STANDARD_EVENT_TYPE(main.game.logic.event.Event.STANDARD_EVENT_TYPE)

Example 18 with EnumMaster

use of main.system.auxiliary.EnumMaster in project Eidolons by IDemiurge.

the class OptionsMaster method applyGameplayOptions.

private static void applyGameplayOptions(GameplayOptions gameplayOptions) {
    for (Object sub : gameplayOptions.getValues().keySet()) {
        new EnumMaster<GAMEPLAY_OPTION>().retrieveEnumConst(GAMEPLAY_OPTION.class, gameplayOptions.getValues().get(sub).toString());
        GAMEPLAY_OPTION key = gameplayOptions.getKey((sub.toString()));
        String value = gameplayOptions.getValue(key);
        if (!StringMaster.isInteger(value)) {
            switch(key) {
                case RULES_SCOPE:
                    RuleMaster.setScope(new EnumMaster<RULE_SCOPE>().retrieveEnumConst(RULE_SCOPE.class, gameplayOptions.getValues().get(sub).toString()));
                    break;
                case GAME_DIFFICULTY:
                    if (Eidolons.game != null)
                        if (Eidolons.game.getBattleMaster() != null)
                            Eidolons.game.getBattleMaster().getOptionManager().difficultySet(value);
                    break;
            }
        }
    }
}
Also used : EnumMaster(main.system.auxiliary.EnumMaster) RULE_SCOPE(eidolons.game.battlecraft.rules.RuleMaster.RULE_SCOPE) GAMEPLAY_OPTION(eidolons.system.options.GameplayOptions.GAMEPLAY_OPTION)

Example 19 with EnumMaster

use of main.system.auxiliary.EnumMaster in project Eidolons by IDemiurge.

the class ContentGenerator method generateArmorPerDamageType.

public static void generateArmorPerDamageType(ObjType t, MATERIAL material) {
    Integer armor = t.getIntParam(PARAMS.ARMOR);
    for (DAMAGE_TYPE dmg_type : GenericEnums.DAMAGE_TYPE.values()) {
        RESIST_GRADE grade = (material == null) ? getGradeForUnitType(t, dmg_type) : material.getResistGrade(dmg_type);
        PROPERTY prop = DC_ContentManager.getResistGradeForDmgType(dmg_type);
        if (prop == null) {
            continue;
        }
        t.setProperty(prop, grade.toString());
        t.setParam(DC_ContentManager.getArmorParamForDmgType(dmg_type), Math.round(armor * grade.getPercent() / 100));
        if (material == null) {
            grade = new EnumMaster<RESIST_GRADE>().retrieveEnumConst(RESIST_GRADE.class, t.getProperty(DC_ContentManager.getResistGradeForDmgType(dmg_type)));
        } else {
            grade = material.getSelfDamageGrade(dmg_type);
        }
        t.setProperty(DC_ContentManager.getSelfDamageGradeForDmgType(dmg_type), grade.toString());
        prop = DC_ContentManager.getSelfDamageGradeForDmgType(dmg_type);
        if (prop == null) {
            continue;
        }
        grade = new EnumMaster<RESIST_GRADE>().retrieveEnumConst(RESIST_GRADE.class, t.getProperty(prop));
        t.setParam(DC_ContentManager.getArmorSelfDamageParamForDmgType(dmg_type), Math.round(grade.getPercent()));
    }
}
Also used : RESIST_GRADE(main.content.enums.GenericEnums.RESIST_GRADE) EnumMaster(main.system.auxiliary.EnumMaster) PROPERTY(main.content.values.properties.PROPERTY) DAMAGE_TYPE(main.content.enums.GenericEnums.DAMAGE_TYPE)

Example 20 with EnumMaster

use of main.system.auxiliary.EnumMaster in project Eidolons by IDemiurge.

the class DC_MovementManager method getTemplateMoveCoordinate.

@Override
public Coordinates getTemplateMoveCoordinate(MOVE_TEMPLATES template, FACING_DIRECTION facing, Obj obj, Ref ref) {
    // getOrCreate some caching to optimize this!
    UNIT_DIRECTION direction = template.getDirection();
    String range = template.getRange();
    Boolean selective = template.isSelectiveTargeting();
    if (template.getVarClasses() != null) {
        String vars = ref.getObj(KEYS.ACTIVE).getCustomProperty(CustomValueManager.getVarEnumCustomValueName(MOVE_TEMPLATES.class));
        List<String> varList = VariableManager.getVarList(vars);
        range = varList.get(0);
        if (varList.size() > 1) {
            direction = new EnumMaster<UNIT_DIRECTION>().retrieveEnumConst(UNIT_DIRECTION.class, varList.get(1));
        }
        if (varList.size() > 2) {
            selective = new Boolean(varList.get(2));
        }
    }
    switch(template) {
    }
    if (selective == null) {
        selective = false;
    }
    if (selective) {
    // create filter by directions and range!
    } else {
        if (range.equals("1")) {
            return obj.getCoordinates().getAdjacentCoordinate(DirectionMaster.getDirectionByFacing(facing, direction));
        }
    // preCheck int >= formla
    }
    return null;
}
Also used : EnumMaster(main.system.auxiliary.EnumMaster) UNIT_DIRECTION(main.game.bf.Coordinates.UNIT_DIRECTION)

Aggregations

EnumMaster (main.system.auxiliary.EnumMaster)28 ObjType (main.entity.type.ObjType)10 Unit (eidolons.entity.obj.unit.Unit)4 LINK_VARIANT (eidolons.client.cc.gui.neo.tree.logic.TreeMap.LINK_VARIANT)3 ArrayList (java.util.ArrayList)3 PROPERTY (main.content.values.properties.PROPERTY)3 ListChooser (main.swing.generic.components.editors.lists.ListChooser)3 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)2 RULE_SCOPE (eidolons.game.battlecraft.rules.RuleMaster.RULE_SCOPE)2 GAMEPLAY_OPTION (eidolons.system.options.GameplayOptions.GAMEPLAY_OPTION)2 MATERIAL (main.content.enums.entity.ItemEnums.MATERIAL)2 QUALITY_LEVEL (main.content.enums.entity.ItemEnums.QUALITY_LEVEL)2 Coordinates (main.game.bf.Coordinates)2 Color (com.badlogic.gdx.graphics.Color)1 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 Align (com.badlogic.gdx.utils.Align)1 DC_Effect (eidolons.ability.effects.DC_Effect)1 ModifyPropertyEffect (eidolons.ability.effects.common.ModifyPropertyEffect)1 AbilityEffect (eidolons.ability.effects.containers.AbilityEffect)1 RayEffect (eidolons.ability.effects.containers.customtarget.RayEffect)1