Search in sources :

Example 31 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class HT_Node method getReqs.

public List<String> getReqs() {
    if (reqs == null) {
        Ref ref = getRef();
        DC_Game.game.getRequirementsManager().getRequirements(getType(), 0).check(ref, true);
        setReqs(DC_Game.game.getRequirementsManager().getRequirements(getType(), 0).getReasons());
    }
    return reqs;
}
Also used : Ref(main.entity.Ref)

Example 32 with Ref

use of main.entity.Ref 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 33 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class FloatingTextMaster method createAndShowParamModText.

public void createAndShowParamModText(Object o) {
    Pair<PARAMETER, Ref> pair = (Pair<PARAMETER, Ref>) o;
    Entity active = pair.getValue().getObj(KEYS.ACTIVE);
    int amount = 0;
    if (pair.getValue().getAmount() != null)
        amount = pair.getValue().getAmount();
    else {
        return;
    }
    FloatingText text = getFloatingText(active, TEXT_CASES.PARAM_MOD, new ImmutablePair<>(pair.getKey(), amount));
    Obj obj = active.getRef().getTargetObj();
    if (obj == null)
        obj = active.getRef().getSourceObj();
    if (obj != null) {
        BaseView view = DungeonScreen.getInstance().getGridPanel().getViewMap().get(obj);
        if (view != null) {
            Vector2 v = view.localToStageCoordinates(new Vector2(view.getX(), view.getY()));
            text.setPosition(v.x, v.y);
        }
    }
    GuiEventManager.trigger(GuiEventType.ADD_FLOATING_TEXT, text);
}
Also used : Entity(main.entity.Entity) Ref(main.entity.Ref) Vector2(com.badlogic.gdx.math.Vector2) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Obj(main.entity.obj.Obj) BaseView(eidolons.libgdx.bf.grid.BaseView) PARAMETER(main.content.values.parameters.PARAMETER) Pair(org.apache.commons.lang3.tuple.Pair) ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair)

Example 34 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class LockMaster method tryUnlock.

public boolean tryUnlock(Entity lockedObj, Unit lockPicker, Formula formula) {
    boolean result = TrapMaster.checkTrapOnLock(lockedObj);
    if (!result) {
        return false;
    }
    Ref ref = new Ref(lockPicker);
    ref.setTarget(lockedObj.getId());
    // preCheck lockpick
    if (formula != null) {
    // TODO
    } else {
        result = RollMaster.roll(GenericEnums.ROLL_TYPES.UNLOCK, ref);
    }
    // roll
    lockedObj.getIntParam(PARAMS.LOCK_LEVEL);
    // DC_SoundMaster.playStandardSound(STD_SOUNDS.UNLOCK_SUCCESS);
    return result;
}
Also used : Ref(main.entity.Ref)

Example 35 with Ref

use of main.entity.Ref in project Eidolons by IDemiurge.

the class GameManager method effectApplies.

public boolean effectApplies(EffectImpl effect) {
    Ref ref = effect.getRef();
    ref.setEffect(effect);
    return (!getGame().fireEvent(new Event(STANDARD_EVENT_TYPE.EFFECT_IS_BEING_APPLIED, ref)));
}
Also used : Ref(main.entity.Ref) Event(main.game.logic.event.Event)

Aggregations

Ref (main.entity.Ref)155 Unit (eidolons.entity.obj.unit.Unit)28 ObjType (main.entity.type.ObjType)23 Event (main.game.logic.event.Event)16 ArrayList (java.util.ArrayList)15 Obj (main.entity.obj.Obj)15 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)13 Coordinates (main.game.bf.Coordinates)13 Conditions (main.elements.conditions.Conditions)12 Formula (main.system.math.Formula)11 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)10 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)9 PARAMETER (main.content.values.parameters.PARAMETER)9 DC_SpellObj (eidolons.entity.active.DC_SpellObj)8 Effects (main.ability.effects.Effects)8 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)7 Wave (eidolons.game.battlecraft.logic.battle.arena.Wave)7 Effect (main.ability.effects.Effect)7 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)5 DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)5