Search in sources :

Example 1 with EnumMaster

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

the class DataManager method getItemType.

private static ObjType getItemType(String typeName, OBJ_TYPE obj_type) {
    ObjType type = getBaseItemType(typeName, obj_type);
    if (type != null) {
        return type;
    }
    if (obj_type.equals(DC_TYPE.JEWELRY)) {
        // main.system.auxiliary.log.LogMaster.log(log,"NO JEWELRY!  "  );
        return null;
    }
    int i = 0;
    List<String> parts = StringMaster.openContainer(typeName, " ");
    String qualityName = parts.get(0);
    QUALITY_LEVEL q = new EnumMaster<QUALITY_LEVEL>().retrieveEnumConst(QUALITY_LEVEL.class, qualityName);
    if (q == null) {
        q = ItemEnums.QUALITY_LEVEL.NORMAL;
    } else {
        i++;
    }
    String materialName = parts.get(i);
    MATERIAL m = new EnumMaster<MATERIAL>().retrieveEnumConst(MATERIAL.class, materialName);
    while (m == null) {
        i++;
        if (i > parts.size() - 1) {
            return null;
        }
        materialName += " " + parts.get(i);
        m = new EnumMaster<MATERIAL>().retrieveEnumConst(MATERIAL.class, materialName);
    }
    String baseTypeName = "";
    for (int a = i; a <= parts.size() - 1; a++) {
        baseTypeName += parts.get(a) + " ";
    }
    ObjType baseType = getBaseItemType(baseTypeName, obj_type);
    // int j = 0;
    // if (baseType == null) {
    // baseType = getBaseItemType(parts.get(parts.size() - 2) + " "
    // + baseTypeName, obj_type);
    // j++;
    // }
    // typeName.replace(baseTypeName, "");
    // materialName = typeName.replace(qualityName, "");
    // while (parts.size() - i > j) {
    // materialName += parts.get(i) + " ";
    // i++;
    // }
    Map<MATERIAL, Map<ObjType, ObjType>> map = itemMaps.get(q);
    Map<ObjType, ObjType> map2 = map.get(m);
    return map2.get(baseType);
}
Also used : ObjType(main.entity.type.ObjType) EnumMaster(main.system.auxiliary.EnumMaster) QUALITY_LEVEL(main.content.enums.entity.ItemEnums.QUALITY_LEVEL) MATERIAL(main.content.enums.entity.ItemEnums.MATERIAL)

Example 2 with EnumMaster

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

the class OptionsMaster method applySoundOptions_.

private static void applySoundOptions_(SoundOptions soundOptions) {
    for (Object sub : soundOptions.getValues().keySet()) {
        new EnumMaster<SOUND_OPTION>().retrieveEnumConst(SOUND_OPTION.class, soundOptions.getValues().get(sub).toString());
        SOUND_OPTION key = soundOptions.getKey((sub.toString()));
        String value = soundOptions.getValue(key);
        if (!StringMaster.isInteger(value)) {
            switch(key) {
                case SOUNDS_OFF:
                    SoundMaster.setOn(false);
                    // MusicMaster.resetSwitcher();
                    break;
                case MUSIC_OFF:
                    MusicMaster.resetSwitcher();
                    break;
                case MUSIC_VARIANT:
                    MusicMaster.getInstance().setVariant(new EnumMaster<MUSIC_VARIANT>().retrieveEnumConst(MUSIC_VARIANT.class, soundOptions.getValue(key)));
                    break;
            }
        } else {
            Integer integer = Integer.valueOf(value.toLowerCase());
            Float v = new Float(integer) / 100;
            switch(key) {
                case MASTER_VOLUME:
                    SoundMaster.setMasterVolume(integer);
                    MusicMaster.resetVolume();
                    break;
                case MUSIC_VOLUME:
                    MusicMaster.resetVolume();
                    // auto
                    break;
            }
        }
    }
}
Also used : SOUND_OPTION(eidolons.system.options.SoundOptions.SOUND_OPTION) EnumMaster(main.system.auxiliary.EnumMaster) MUSIC_VARIANT(eidolons.system.audio.MusicMaster.MUSIC_VARIANT)

Example 3 with EnumMaster

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

the class HT_View method adjustLink.

public void adjustLink(Boolean vertical_horizontal_manual, HT_Node node) {
    ObjType type = node.getType();
    LINK_VARIANT variant = null;
    if (tree.getMap().getLinkForChildType(type) != null) {
        variant = tree.getMap().getLinkForChildType(type).getVariant();
    }
    if (variant == null || vertical_horizontal_manual == null) {
        variant = new EnumMaster<LINK_VARIANT>().retrieveEnumConst(LINK_VARIANT.class, new ListChooser(SELECTION_MODE.SINGLE, LINK_VARIANT.class).choose());
    } else {
        variant = HT_MapBuilder.getShiftedLinkVariant(variant, vertical_horizontal_manual);
    }
    if (variant == null) {
        LogMaster.log(1, type + "'s LINK_VARIANT null !!! ");
        return;
    }
    type.setProperty(PROPS.LINK_VARIANT, variant.toString());
    if (!CoreEngine.isArcaneVault()) {
        XML_Writer.writeXML_ForType(type, isSkill() ? DC_TYPE.SKILLS : DC_TYPE.CLASSES);
    }
    LogMaster.log(1, type + "'s LINK_VARIANT set for " + variant);
    rebuildAndSetTree();
}
Also used : ObjType(main.entity.type.ObjType) 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 4 with EnumMaster

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

the class ActivesConstructor method wrapInSaveRollEffect.

public static void wrapInSaveRollEffect(Effects effects, String saveRoll) {
    // TODO
    ArrayList<ROLL_TYPES> rolls = new ArrayList<>();
    ArrayList<String> vars = new ArrayList<>();
    for (String roll : StringMaster.open(saveRoll, StringMaster.AND_SEPARATOR)) {
        String varArgs = VariableManager.getVarPart(roll);
        roll = roll.replace(varArgs, "");
        rolls.add(new EnumMaster<ROLL_TYPES>().retrieveEnumConst(ROLL_TYPES.class, roll));
        vars.add(varArgs);
    }
    int i = 0;
    for (Effect e : effects) {
        for (ROLL_TYPES roll : rolls) {
            String args = StringMaster.cropParenthesises(vars.get(i));
            e = wrapInRoll(e, roll, args);
            i++;
        }
    }
}
Also used : EnumMaster(main.system.auxiliary.EnumMaster) ArrayList(java.util.ArrayList) ROLL_TYPES(main.content.enums.GenericEnums.ROLL_TYPES) DC_Effect(eidolons.ability.effects.DC_Effect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) Effect(main.ability.effects.Effect) RayEffect(eidolons.ability.effects.containers.customtarget.RayEffect) WaveEffect(eidolons.ability.effects.containers.customtarget.WaveEffect) ZoneEffect(eidolons.ability.effects.containers.customtarget.ZoneEffect)

Example 5 with EnumMaster

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

the class ItemCondition method check.

@Override
public boolean check(Ref ref) {
    if (ref.getGame().isSimulation()) {
        return true;
    }
    if (slot == null) {
        slot = (weapon) ? ItemEnums.ITEM_SLOT.MAIN_HAND.toString() : ItemEnums.ITEM_SLOT.ARMOR.toString();
    }
    Entity item;
    Unit unit = (Unit) ref.getObj(obj_ref);
    if (unit == null) {
        return false;
    }
    if (slot.equalsIgnoreCase(KEYS.RANGED.toString())) {
        item = unit.getRef().getObj(KEYS.RANGED);
    } else {
        if (slot.equalsIgnoreCase("weapon"))
            item = unit.getItem(!ref.getActive().isOffhand() ? ITEM_SLOT.MAIN_HAND : ITEM_SLOT.OFF_HAND);
        else
            item = unit.getItem(new EnumMaster<ITEM_SLOT>().retrieveEnumConst(ITEM_SLOT.class, slot, true));
    }
    if (item == null) {
        return false;
    }
    if (// any item in the slot
    prop == null) {
        return true;
    }
    String string = item.getProp(prop);
    return new StringComparison(string, val, strict).preCheck(ref);
// String prop2 = ref.getObj(obj_string).getProp(slot);
// if (StringMaster.isEmpty(prop2)) {
// try {
// prop2 = "" + ref.getObj(obj_string).getRef().getObj(slot).getId();
// } catch (Exception e) {
// return false;
// }
// }
// item = DataManager.getType(prop2, C_OBJ_TYPE.ITEMS);
// return StringMaster.compare(string, val, true);
}
Also used : Entity(main.entity.Entity) ITEM_SLOT(main.content.enums.entity.ItemEnums.ITEM_SLOT) StringComparison(main.elements.conditions.StringComparison) EnumMaster(main.system.auxiliary.EnumMaster) Unit(eidolons.entity.obj.unit.Unit)

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