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);
}
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;
}
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();
}
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;
}
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);
}
Aggregations