Search in sources :

Example 1 with DC_QuickItemObj

use of eidolons.entity.item.DC_QuickItemObj in project Eidolons by IDemiurge.

the class TossItemEffect method roll.

private boolean roll(Unit source, Unit unit, DC_HeroItemObj item) {
    String fail = "5*1.5*sqrt" + StringMaster.wrapInParenthesis("" + (1 + PositionMaster.getDistance(unit, source)));
    // account for range
    if (item instanceof DC_QuickItemObj) {
        DC_QuickItemObj quickItemObj = (DC_QuickItemObj) item;
    }
    Ref REF = ref.getCopy();
    REF.setTarget(source.getId());
    boolean result = RollMaster.roll(GenericEnums.ROLL_TYPES.ACCURACY, "-", fail, ref, "@, missing the " + item.getName() + " toss", item.getName() + " toss");
    fail = "5";
    if (!result) {
        fail += "*2";
    }
    REF.setTarget(unit.getId());
    result = !RollMaster.roll(GenericEnums.ROLL_TYPES.REFLEX, "-", fail, ref, "@, dropping the tossed " + item.getName(), item.getName() + " toss");
    return result;
}
Also used : Ref(main.entity.Ref) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj)

Example 2 with DC_QuickItemObj

use of eidolons.entity.item.DC_QuickItemObj in project Eidolons by IDemiurge.

the class CampEffect method applyThis.

@Override
public boolean applyThis() {
    /*
        restore fully, dispel all timed buffs, apply bonus
         */
    List<Unit> allies = getGame().getMetaMaster().getPartyManager().getParty().getMembers();
    if (allies.isEmpty())
        getGame().getMetaMaster().getPartyManager().getParty().addMember(getGame().getMetaMaster().getPartyManager().getParty().getLeader());
    // mystery fix
    for (Unit sub : new LinkedList<>(allies)) {
        DC_HeroItemObj item = sub.getItemFromInventory("Food");
        if (item != null) {
            sub.removeFromInventory(item);
            continue;
        }
        DC_QuickItemObj qitem = sub.getQuickItem("Food");
        if (item != null) {
            sub.removeQuickItem(qitem);
            continue;
        }
        allies.remove(sub);
        continue;
    // remove
    }
    if (allies.isEmpty()) {
        FloatingTextMaster.getInstance().createFloatingText(TEXT_CASES.REQUIREMENT, "You need food supplies to camp!", ref.getSourceObj());
        return false;
    }
    Effects restorationEffects = new Effects();
    restorationEffects.add(new ModifyValueEffect(PARAMS.C_ENDURANCE, MOD.SET_TO_PERCENTAGE, "125", true));
    restorationEffects.add(new ModifyValueEffect(PARAMS.C_FOCUS, MOD.SET_TO_PERCENTAGE, "70", true));
    restorationEffects.add(new ModifyValueEffect(PARAMS.C_ESSENCE, MOD.SET_TO_PERCENTAGE, "100", true));
    restorationEffects.add(new ModifyValueEffect(PARAMS.C_STAMINA, MOD.SET_TO_PERCENTAGE, "125", true));
    restorationEffects.add(new ModifyValueEffect(PARAMS.C_TOUGHNESS, MOD.SET_TO_PERCENTAGE, "100", true));
    for (Unit sub : allies) {
        Ref REF = sub.getRef().getTargetingRef(sub);
        restorationEffects.apply(REF);
    }
    float time = 20;
    getGame().getDungeonMaster().getExplorationMaster().getTimeMaster().playerRests(time);
    // applyRested();
    for (Unit sub : allies) {
    }
    return true;
}
Also used : Ref(main.entity.Ref) DC_HeroItemObj(eidolons.entity.item.DC_HeroItemObj) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj) Effects(main.ability.effects.Effects) Unit(eidolons.entity.obj.unit.Unit) LinkedList(java.util.LinkedList)

Example 3 with DC_QuickItemObj

use of eidolons.entity.item.DC_QuickItemObj in project Eidolons by IDemiurge.

the class ThrowEffect method applyThis.

@Override
public boolean applyThis() {
    if (stormOfMissiles) {
        fromHand = true;
        DC_WeaponObj weapon = (DC_WeaponObj) ref.getObj(KEYS.WEAPON);
        boolean result = throwWeapon(weapon);
        weapon = (DC_WeaponObj) ref.getObj(KEYS.OFFHAND);
        if (weapon != null) {
            offhand = true;
            result = throwWeapon(weapon);
        }
        Unit hero = (Unit) ref.getObj(KEYS.SOURCE);
        fromHand = false;
        for (DC_QuickItemObj q : hero.getQuickItems()) {
            weapon = q.getWrappedWeapon();
            if (weapon != null) {
                result &= throwWeapon(weapon);
            }
        }
        return result;
    }
    DC_WeaponObj weapon = (DC_WeaponObj) ref.getObj(KEYS.WEAPON);
    try {
        if (offhand || ref.getObj(KEYS.ACTIVE).checkProperty(G_PROPS.ACTION_TAGS, "" + ActionEnums.ACTION_TAGS.OFF_HAND)) {
            weapon = (DC_WeaponObj) ref.getObj(KEYS.OFFHAND);
            offhand = true;
        }
    // offhand mods?
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
    }
    return throwWeapon(weapon);
}
Also used : DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj) Unit(eidolons.entity.obj.unit.Unit)

Example 4 with DC_QuickItemObj

use of eidolons.entity.item.DC_QuickItemObj in project Eidolons by IDemiurge.

the class UnitShop method equip.

private static void equip(Unit unit, DC_HeroItemObj item, ITEM_SLOT slot) {
    if (slot != null) {
        if (!unit.equip(item, slot)) {
            LogMaster.log(1, unit.getName() + " failed to equip " + item.getName());
        }
    } else {
        if (item instanceof DC_JewelryObj) {
            unit.addJewelryItem((DC_JewelryObj) item);
        } else {
            if (item instanceof DC_QuickItemObj) {
                unit.getQuickItems().add((DC_QuickItemObj) item);
            } else {
                DC_HeroItemObj itemObj = ItemFactory.createItemObj(item.getType(), unit.getOriginalOwner(), unit.getGame(), unit.getRef(), true);
                unit.getQuickItems().add((DC_QuickItemObj) itemObj);
            }
        }
    }
}
Also used : DC_HeroItemObj(eidolons.entity.item.DC_HeroItemObj) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj) DC_JewelryObj(eidolons.entity.item.DC_JewelryObj)

Example 5 with DC_QuickItemObj

use of eidolons.entity.item.DC_QuickItemObj in project Eidolons by IDemiurge.

the class HungItemMaster method actionActivated.

@Override
protected boolean actionActivated(HUNG_ITEM_ACTION sub, Unit unit, DungeonObj obj) {
    if (!(obj instanceof HungItem))
        return false;
    HungItem hungObj = ((HungItem) obj);
    switch(sub) {
        case TAKE:
            DC_HeroItemObj item = hungObj.getItem();
            if (item == null) {
                item = generateItem(hungObj);
            }
            // quick slot?
            if (!unit.isQuickSlotsFull() && item instanceof DC_QuickItemObj) {
                unit.addQuickItem((DC_QuickItemObj) item);
            } else {
                unit.addItemToInventory(item);
            }
            GuiEventManager.trigger(GuiEventType.ITEM_TAKEN, hungObj);
            // take animation
            obj.kill(obj, false, true);
            break;
        case USE:
            break;
    }
    return true;
}
Also used : DC_HeroItemObj(eidolons.entity.item.DC_HeroItemObj) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj)

Aggregations

DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)17 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)7 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)6 Ref (main.entity.Ref)4 Unit (eidolons.entity.obj.unit.Unit)3 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)2 Obj (main.entity.obj.Obj)2 CanActCondition (eidolons.ability.conditions.special.CanActCondition)1 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)1 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 DC_UnitAction (eidolons.entity.active.DC_UnitAction)1 DC_JewelryObj (eidolons.entity.item.DC_JewelryObj)1 AiQuickItemAction (eidolons.game.battlecraft.ai.elements.actions.AiQuickItemAction)1 ActionValueContainer (eidolons.libgdx.gui.panels.dc.actionpanel.ActionValueContainer)1 ActionCostTooltip (eidolons.libgdx.gui.panels.dc.actionpanel.tooltips.ActionCostTooltip)1 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 Effects (main.ability.effects.Effects)1 ITEM_SLOT (main.content.enums.entity.ItemEnums.ITEM_SLOT)1 WEAPON_GROUP (main.content.enums.entity.ItemEnums.WEAPON_GROUP)1