Search in sources :

Example 1 with ObjType

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

the class UnitAI method initActionPriorities.

private void initActionPriorities() {
    actionPriorityBonuses = RandomWizard.constructWeightMap(unit.getProperty(PROPS.ACTION_PRIORITY_BONUSES), C_OBJ_TYPE.ACTIVE);
    actionPriorityMods = RandomWizard.constructWeightMap(unit.getProperty(PROPS.ACTION_PRIORITY_MODS), C_OBJ_TYPE.ACTIVE);
    for (ObjType spell : DataManager.toTypeList(unit.getProperty(PROPS.VERBATIM_SPELLS), DC_TYPE.SPELLS)) {
        Integer mastery = unit.getIntParam(ContentManager.getSpellMasteryForSpell(spell));
        // WHY VERBATIM? MAYBE FROM *TYPE*, YES...
        int mod = DEFAULT_VERBATIM_MOD + mastery;
    }
// default additions?
/*
         * verbatim spell list per mastery
		 */
}
Also used : ObjType(main.entity.type.ObjType)

Example 2 with ObjType

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

the class UnitInitializer method initNaturalWeapon.

public void initNaturalWeapon(boolean offhand) {
    if (offhand) {
        if (StringMaster.isEmpty(getProperty(PROPS.OFFHAND_NATURAL_WEAPON))) {
            return;
        }
    }
    PROPS prop = (offhand) ? PROPS.OFFHAND_NATURAL_WEAPON : PROPS.NATURAL_WEAPON;
    // if (game.isSimulation())
    // return;
    ObjType weaponType = DataManager.getType(getProperty(prop), DC_TYPE.WEAPONS);
    if (weaponType == null) {
        return;
    }
    DC_WeaponObj weapon = new DC_WeaponObj(weaponType, getEntity().getOwner(), getGame(), getRef(), !offhand);
    getEntity().setNaturalWeapon(offhand, weapon);
}
Also used : ObjType(main.entity.type.ObjType) G_PROPS(main.content.values.properties.G_PROPS) PROPS(eidolons.content.PROPS)

Example 3 with ObjType

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

the class UnitInitializer method initFeatContainer.

// TODO reqs: save() ; modify() ; resetSkillRanks() for (s s : skills)
public void initFeatContainer(PROPERTY PROP, DC_TYPE TYPE, DequeImpl<DC_FeatObj> list) {
    // TODO make it dynamic and clean!
    List<String> feats = StringMaster.openContainer(getProperty(PROP));
    for (String feat : feats) {
        DC_FeatObj featObj = null;
        int rank = 0;
        // or special separator!
        if (StringMaster.isInteger(StringMaster.cropParenthesises(VariableManager.getVarPart(feat)))) {
            rank = StringMaster.getInteger(StringMaster.cropParenthesises(VariableManager.getVarPart(feat)));
            feat = VariableManager.removeVarPart(feat);
        }
        ObjType featType = DataManager.getType(feat, TYPE);
        if (game.isSimulation()) {
            featObj = (DC_FeatObj) getGame().getSimulationObj(getEntity(), featType, PROP);
        }
        if (featObj == null) {
            try {
                featObj = new DC_FeatObj(featType, getEntity().getOriginalOwner(), getGame(), getRef());
            } catch (Exception e) {
                main.system.ExceptionMaster.printStackTrace(e);
                continue;
            }
            if (game.isSimulation()) {
                getGame().addSimulationObj(getEntity(), featType, featObj, PROP);
            }
        }
        if (rank != 0) {
            featObj.setParam(PARAMS.RANK, rank);
        }
        list.add(featObj);
    }
}
Also used : DC_FeatObj(eidolons.entity.obj.attach.DC_FeatObj) ObjType(main.entity.type.ObjType) ExpressionParseException(com.graphbuilder.math.ExpressionParseException)

Example 4 with ObjType

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

the class DC_QuickItemObj method construct.

@Override
public void construct() {
    if (active == null) {
        if (wrapped) {
            generateWrappedActive();
            return;
        }
    }
    if (!constructed) {
        ref.setID(KEYS.ACTIVE, getId());
    } else {
        if (getActive() == null) {
            generateWrappedActive();
        } else {
            // TODO for parsing?
            ref.setID(KEYS.ACTIVE, getActive().getId());
        }
    }
    super.construct();
    if (!StringMaster.isEmpty(getProperty(PROPS.ITEM_SPELL))) {
    }
    if (// ?
    actives == null) {
        return;
    }
    if (actives.isEmpty()) {
        return;
    }
    ObjType type = initActiveType();
    setActive(new DC_QuickItemAction(type, getOriginalOwner(), getGame(), ref));
    getActive().setActives(getActives());
    getActive().setConstructed(true);
    getActive().setItem(this);
}
Also used : ObjType(main.entity.type.ObjType) DC_QuickItemAction(eidolons.entity.active.DC_QuickItemAction)

Example 5 with ObjType

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

the class ContainerTextElement method getRef.

@Override
protected Ref getRef() {
    if (entity == null) {
        return null;
    }
    int id = entity.getId();
    Ref ref;
    // if (entity.getGame().isSimulation())
    // ref = CharacterCreator.getHeroPanel().getHero().getRef();
    // else TODO
    ref = entity.getRef();
    if (entity.getOBJ_TYPE_ENUM() instanceof DC_TYPE) {
        switch((DC_TYPE) entity.getOBJ_TYPE_ENUM()) {
            case UNITS:
            case CHARS:
                ref = entity.getRef();
                break;
            case ACTIONS:
                ref.setID(KEYS.ACTIVE, id);
                break;
            case ARMOR:
                ref.setID(KEYS.ARMOR, id);
                break;
            case ITEMS:
                ref.setID(KEYS.ITEM, id);
                break;
            case SPELLS:
                ref.setID(KEYS.SPELL, id);
                ref.setID(KEYS.ACTIVE, id);
                break;
            case WEAPONS:
                ref.setID(KEYS.WEAPON, id);
                break;
        }
    }
    ref.setID(KEYS.INFO, id);
    ref.setInfoEntity(entity);
    if (CharacterCreator.getHero() != null) {
        if (Game.game.isSimulation()) {
            if (entity instanceof ObjType) {
                entity = HeroCreator.getObjForType(CharacterCreator.getHero(), (ObjType) entity);
            }
        }
        ref.setSource(CharacterCreator.getHero().getId());
        // if (item!=null )
        // ref.setSource(item.getRef().getSource());
        CharacterCreator.getHero().getRef().setInfoEntity(entity);
    }
    return ref;
}
Also used : Ref(main.entity.Ref) DC_TYPE(main.content.DC_TYPE) 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