Search in sources :

Example 11 with DC_FeatObj

use of eidolons.entity.obj.attach.DC_FeatObj in project Eidolons by IDemiurge.

the class UnitResetter method resetObjects.

public void resetObjects() {
    if (ExplorationMaster.isExplorationOn()) {
        if (!getEntity().isDirty()) {
            return;
        }
    }
    getEntity().setBeingReset(true);
    Chronos.mark(toString() + " OBJECTS APPLY");
    applyBackground();
    resetAttributes();
    resetMasteryScores();
    if (getEntity().getSkills() != null) {
        resetRanks(getEntity().getSkills(), PROPS.SKILLS);
        for (DC_FeatObj feat : getEntity().getSkills()) {
            feat.apply();
        }
    }
    if (getEntity().getClasses() != null) {
        resetRanks(getEntity().getClasses(), PROPS.CLASSES);
        for (DC_FeatObj feat : getEntity().getClasses()) {
            feat.apply();
        }
    }
    if (getEntity().getMainWeapon() != null) {
        getEntity().getMainWeapon().apply();
    } else if (getEntity().getNaturalWeapon() != null) {
        getEntity().getNaturalWeapon().apply();
    }
    if (getEntity().getOffhandWeapon() != null) {
        getEntity().getOffhandWeapon().apply();
    // if (checkDualWielding())
    // DC_Formulas.MAIN_HAND_DUAL_ATTACK_MOD
    } else if (getEntity().getOffhandNaturalWeapon() != null) {
        getEntity().getOffhandNaturalWeapon().apply();
    }
    if (getEntity().getArmor() != null) {
        getEntity().getArmor().apply();
    }
    resetQuickSlotsNumber();
    for (DC_HeroItemObj item : getEntity().getQuickItems()) {
        item.apply();
    }
    for (DC_HeroItemObj item : getEntity().getJewelry()) {
        item.apply();
    }
    // Chronos.logTimeElapsedForMark(toString() + " OBJECTS APPLY");
    // Chronos.mark(toString() + " activate PASSIVES");
    getInitializer().initSpells(game.isSimulation());
    getEntity().activatePassives();
    // Chronos.logTimeElapsedForMark(toString() + " activate PASSIVES");
    getEntity().setDirty(false);
    getEntity().setBeingReset(false);
    if (game.isSimulation() || getType().isModel()) {
        // initSpellbook(); //in afterEffect()
        return;
    }
    // Chronos.mark(toString() + " init ACTIVES");
    getInitializer().initActives();
// Chronos.logTimeElapsedForMark(toString() + " init ACTIVES");
}
Also used : DC_FeatObj(eidolons.entity.obj.attach.DC_FeatObj) DC_HeroItemObj(eidolons.entity.item.DC_HeroItemObj)

Aggregations

DC_FeatObj (eidolons.entity.obj.attach.DC_FeatObj)11 ObjType (main.entity.type.ObjType)3 ArrayList (java.util.ArrayList)2 ExpressionParseException (com.graphbuilder.math.ExpressionParseException)1 PROPS (eidolons.content.PROPS)1 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)1 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)1 Unit (eidolons.entity.obj.unit.Unit)1 G_PROPS (main.content.values.properties.G_PROPS)1 ListItem (main.swing.generic.components.list.ListItem)1 DequeImpl (main.system.datatypes.DequeImpl)1 Before (org.junit.Before)1