Search in sources :

Example 46 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class HT_MapBuilder method addAltBaseLinks.

private void addAltBaseLinks() {
    for (HT_Node c : map.getNodeMap().values()) {
        String prop = c.getType().getProperty(PROPS.ALT_BASE_LINKS);
        if (prop.isEmpty()) {
            continue;
        }
        for (String s : StringMaster.open(prop)) {
            String typeName = VariableManager.removeVarPart(s);
            String vars = VariableManager.getVar(s);
            LINK_VARIANT variant = new EnumMaster<LINK_VARIANT>().retrieveEnumConst(LINK_VARIANT.class, vars.split("=")[0]);
            ObjType targetType = DataManager.getType(typeName, getTYPE());
            Point point = map.getPointForType(c.getType());
            // getPoint(variant, parent, type, parentX, i, sublingCount)
            // point = getNodePointFromLink(point2.x, targetType, 0, 0,
            // c.getType(), variant);
            /*
                 * use the variant.getOffset()
				 *
				 * what point is base?
				 *
				 * c.
				 *
				 */
            int offsetX = StringMaster.getInteger(vars.split("=")[1].split(",")[0]);
            int offsetY = StringMaster.getInteger(vars.split("=")[1].split(",")[1]);
            point = new PointX(point.x + offsetX, point.y + offsetY);
            StaticTreeLink link = new StaticTreeLink(variant, point, targetType, c.getType());
            // link.setAlt(true); // what will it do?
            map.getAltLinks().put(link, targetType);
        }
    }
}
Also used : HT_Node(eidolons.client.cc.gui.neo.tree.HT_Node) ObjType(main.entity.type.ObjType) LINK_VARIANT(eidolons.client.cc.gui.neo.tree.logic.TreeMap.LINK_VARIANT) PointX(main.swing.PointX)

Example 47 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class AnimationConstructor method preconstructAllForAV.

public static void preconstructAllForAV() {
    for (ObjType type : DataManager.getTypes(DC_TYPE.SPELLS)) {
        DC_SpellObj active = new DC_SpellObj(type, Player.NEUTRAL, DC_Game.game, new Ref());
        AnimData data = null;
        try {
            int i = 0;
            for (ANIM_PART part : ANIM_PART.values()) {
                data = new AnimationConstructor().getStandardData(active, part, i);
                for (ANIM_VALUES val : ANIM_VALUES.values()) {
                    String identifier;
                    switch(val) {
                        case PARTICLE_EFFECTS:
                            identifier = "SFX";
                            break;
                        case SPRITES:
                            identifier = "SPRITE";
                            break;
                        default:
                            continue;
                    }
                    String value = data.getValue(val);
                    if (StringMaster.isEmpty(value))
                        continue;
                    value = value.replace(PathFinder.getImagePath().toLowerCase(), "");
                    i++;
                    PROPERTY prop = ContentManager.findPROP("anim" + "_" + identifier + "_" + part);
                    if (prop == null)
                        continue;
                    type.setProperty(prop, value);
                }
            }
        } catch (Exception e) {
            main.system.ExceptionMaster.printStackTrace(e);
        }
    }
}
Also used : Ref(main.entity.Ref) ObjType(main.entity.type.ObjType) PROPERTY(main.content.values.properties.PROPERTY) ANIM_VALUES(eidolons.libgdx.anims.AnimData.ANIM_VALUES) DC_SpellObj(eidolons.entity.active.DC_SpellObj)

Example 48 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class ActionGenerator method generateOffhandActions.

public static void generateOffhandActions(ACTION_TYPE action_type) {
    for (ObjType type : DataManager.getTypesGroup(DC_TYPE.ACTIONS, "" + action_type)) {
        if (StringMaster.contains(type.getProperty(G_PROPS.ACTION_TAGS), ActionEnums.ACTION_TAGS.MAIN_HAND + "")) {
            ActionType offHandType = new ActionType(type);
            offHandType.addProperty(G_PROPS.ACTION_TAGS, StringMaster.getWellFormattedString(ActionEnums.ACTION_TAGS.OFF_HAND + ""));
            offHandType.removeProperty(G_PROPS.ACTION_TAGS, StringMaster.getWellFormattedString(ActionEnums.ACTION_TAGS.MAIN_HAND + ""));
            // 
            offHandType.setName(getOffhandActionName(type.getName()));
            offHandType.addProperty(G_PROPS.ACTION_TAGS, getOffhandActionName(type.getName()));
            DataManager.addType(offHandType);
        }
    }
}
Also used : ActionType(main.entity.type.ActionType) ObjType(main.entity.type.ObjType)

Example 49 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class InventoryTransactionManager method updateType.

public static void updateType(Unit hero) {
    hero.setType(new ObjType(hero.getType()));
    ObjType type = hero.getType();
    // TODO init type?
    hero.getGame().initType(type);
    for (PROPERTY prop : INV_PROPS) {
        type.copyValue(prop, hero);
    // String property = hero.getProperty(prop);for (String item :
    // StringMaster.openContainer(property)) {
    // if (hero.getGame().getObjectById(StringMaster.getInteger(item))
    // != null) {
    // String string = hero.getGame()
    // .getObjectById(StringMaster.getInteger(item))
    // .getId().toString();
    // // .getName();
    // if (prop.isContainer())
    // type.addProperty(prop, string);
    // else
    // type.setProperty(prop, string);
    // }
    // }
    // type.setProperty(prop, property);
    }
}
Also used : ObjType(main.entity.type.ObjType) PROPERTY(main.content.values.properties.PROPERTY)

Example 50 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class UnitLibrary method initPool.

private static void initPool(LEARN_CASE lc) {
    LibraryManager.initSpellbook(unit);
    spellPool = new XLinkedMap<>();
    for (String substring : StringMaster.open(unit.getProperty(getSourceProp(lc)))) {
        ObjType type = DataManager.getType(VariableManager.removeVarPart(substring), DC_TYPE.SPELLS);
        if (checkCanLearnSpell(type, lc)) {
            Integer weight = StringMaster.getWeight(substring);
            if (weight <= 0) {
                weight = 1;
            }
            spellPool.put(type, weight);
        }
    }
}
Also used : ObjType(main.entity.type.ObjType)

Aggregations

ObjType (main.entity.type.ObjType)354 ArrayList (java.util.ArrayList)42 Coordinates (main.game.bf.Coordinates)30 Ref (main.entity.Ref)25 Unit (eidolons.entity.obj.unit.Unit)24 OBJ_TYPE (main.content.OBJ_TYPE)18 PROPERTY (main.content.values.properties.PROPERTY)18 DC_TYPE (main.content.DC_TYPE)16 PARAMETER (main.content.values.parameters.PARAMETER)16 File (java.io.File)15 Entity (main.entity.Entity)12 XLinkedMap (main.data.XLinkedMap)11 EnumMaster (main.system.auxiliary.EnumMaster)11 DC_SpellObj (eidolons.entity.active.DC_SpellObj)9 MATERIAL (main.content.enums.entity.ItemEnums.MATERIAL)9 Obj (main.entity.obj.Obj)9 QUALITY_LEVEL (main.content.enums.entity.ItemEnums.QUALITY_LEVEL)8 MusicList (main.music.entity.MusicList)8 Wave (eidolons.game.battlecraft.logic.battle.arena.Wave)6 C_OBJ_TYPE (main.content.C_OBJ_TYPE)6