Search in sources :

Example 16 with Obj

use of main.entity.obj.Obj in project Eidolons by IDemiurge.

the class SlotItem method getCompIcon.

@Override
protected ImageIcon getCompIcon(Entity entity, boolean isSelected) {
    Obj obj = getObj().getRef().getObj(KEYS.AMMO);
    ImageIcon compIcon = super.getCompIcon(entity, isSelected);
    if (obj == null) {
        return drawCounters(compIcon.getImage(), entity);
    }
    Image ammo = ImageTransformer.getCircleCroppedImage(ImageManager.applyBorder(ImageManager.getSizedVersion(obj.getImagePath(), BORDER.CIRCLE_GLOW_40.getImage().getWidth(null)).getImage(), BORDER.CIRCLE_GLOW_40));
    return drawCounters(ImageManager.applyImage(compIcon.getImage(), ammo, 38, 28, false), obj);
}
Also used : Obj(main.entity.obj.Obj) DC_HeroAttachedObj(eidolons.entity.obj.attach.DC_HeroAttachedObj) BufferedImage(java.awt.image.BufferedImage)

Example 17 with Obj

use of main.entity.obj.Obj in project Eidolons by IDemiurge.

the class HeroItemSlots method getType.

private Entity getType(ITEM_SLOT slot, DC_TYPE TYPE) {
    if (hero.getItem(slot) != null) {
        return hero.getItem(slot);
    }
    String string = hero.getProperty(slot.getProp());
    Entity type = DataManager.getType(string, C_OBJ_TYPE.SLOT_ITEMS);
    if (type == null) {
        if (StringMaster.isInteger(string)) {
            Obj obj = hero.getGame().getObjectById(StringMaster.getInteger(string));
            if (obj != null) {
                type = obj.getType();
            } else {
                type = hero.getGame().getTypeById(StringMaster.getInteger(string));
            }
        }
    }
    return type;
}
Also used : Entity(main.entity.Entity) Obj(main.entity.obj.Obj)

Example 18 with Obj

use of main.entity.obj.Obj in project Eidolons by IDemiurge.

the class DoorAnimation method start.

@Override
public void start() {
    setDuration(1);
    Obj door = getRef().getTargetObj();
    BaseView actor = DungeonScreen.getInstance().getGridPanel().getViewMap().get(door);
    // ActorMaster.addFadeInOrOut(actor.getPortrait(), getDuration());
    if (open) {
        String path = door.getImagePath();
        path = StringMaster.cropFormat(path) + "_open" + ".png";
        // if (newImage == null)
        {
            // TODO as an afterAction!
            TextureRegion r = TextureCache.getOrCreateR(path);
            actor.setOriginalTextureAlt(r);
        // newImage = new Image(r);
        }
    } else {
        actor.setOriginalTextureAlt(null);
    // newImage = actor.getAltPortrait();
    }
    // newImage.setColor(1, 1, 1, 0);
    // actor.setAltPortrait(actor.getPortrait());
    // actor.setPortrait(newImage);
    // actor.addActor(newImage);
    // ActorMaster.addFadeInOrOut(actor.getPortrait(), getDuration());
    super.start();
}
Also used : TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) Obj(main.entity.obj.Obj) BaseView(eidolons.libgdx.bf.grid.BaseView)

Example 19 with Obj

use of main.entity.obj.Obj in project Eidolons by IDemiurge.

the class EffectAnimCreator method getOrCreateEffectAnim.

public static Anim getOrCreateEffectAnim(Effect e) {
    Anim anim = map.get(e);
    if (anim == null) {
        anim = createAnim(e);
        if (cachingOn) {
            map.put(e, anim);
        }
    }
    if (anim == null) {
        return null;
    }
    Obj target = e.getRef().getTargetObj();
    if (target != null) {
        anim.setForcedDestination(target.getCoordinates());
    }
    // TODO gotta be some way to generalize this
    anim.setPart(ANIM_PART.MAIN);
    anim.setMaster(AnimMaster.getInstance());
    return anim;
}
Also used : DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Obj(main.entity.obj.Obj)

Example 20 with Obj

use of main.entity.obj.Obj 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)

Aggregations

Obj (main.entity.obj.Obj)127 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)34 DC_Obj (eidolons.entity.obj.DC_Obj)30 Coordinates (main.game.bf.Coordinates)27 Unit (eidolons.entity.obj.unit.Unit)24 ArrayList (java.util.ArrayList)19 Ref (main.entity.Ref)15 DC_SpellObj (eidolons.entity.active.DC_SpellObj)14 BuffObj (main.entity.obj.BuffObj)13 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)12 DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)11 ActiveObj (main.entity.obj.ActiveObj)10 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)9 PassiveAbilityObj (main.ability.PassiveAbilityObj)9 ObjType (main.entity.type.ObjType)8 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)7 DC_BuffObj (eidolons.entity.obj.attach.DC_BuffObj)7 PARAMETER (main.content.values.parameters.PARAMETER)7 Conditions (main.elements.conditions.Conditions)6 MicroObj (main.entity.obj.MicroObj)6