Search in sources :

Example 11 with DC_WeaponObj

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

the class ActionTooltipMaster method getDiceText.

private static String getDiceText(DC_ActiveObj action) {
    DC_WeaponObj weapon = action.getActiveWeapon();
    int dieSize = MathMaster.applyMod(weapon.getIntParam(PARAMS.DIE_SIZE), action.getFinalModParam(PARAMS.DAMAGE_MOD));
    Integer dice = MathMaster.applyMod(weapon.getIntParam(PARAMS.DICE), action.getFinalModParam(PARAMS.DAMAGE_MOD));
    return dice + "d" + dieSize;
}
Also used : DC_WeaponObj(eidolons.entity.item.DC_WeaponObj)

Example 12 with DC_WeaponObj

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

the class PriorityManagerImpl method applyThrowPenalty.

private void applyThrowPenalty(DC_ActiveObj active) {
    DC_WeaponObj item = null;
    boolean offhand = active.isOffhand();
    boolean quick = active instanceof DC_QuickItemAction;
    if (quick) {
        DC_QuickItemAction itemActiveObj = (DC_QuickItemAction) active;
        item = itemActiveObj.getItem().getWrappedWeapon();
    } else {
        item = getUnit().getWeapon(offhand);
    }
    if (item == null) {
        return;
    }
    int factor = (int) -Math.sqrt(item.getIntParam(PARAMS.GOLD_COST)) * 50;
    if (!quick) {
        factor *= 2;
    }
    if (!offhand) {
        factor *= 2;
    }
    addConstant(factor, "item thrown");
    if (priority > 0) {
        addMultiplier(factor / 5, "item thrown");
    }
}
Also used : DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) DC_QuickItemAction(eidolons.entity.active.DC_QuickItemAction)

Example 13 with DC_WeaponObj

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

the class DC_HeroManager method addQuickItem_.

private int addQuickItem_(Unit hero, DC_HeroItemObj itemObj) {
    hero.removeFromInventory(itemObj);
    // } else
    if (itemObj instanceof DC_WeaponObj) {
        hero.getQuickItems().add(new DC_QuickItemObj(itemObj.getType(), hero.getOwner(), game, hero.getRef(), true));
    } else {
        hero.getQuickItems().add((DC_QuickItemObj) itemObj);
    }
    update(hero);
    return 1;
}
Also used : DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj)

Example 14 with DC_WeaponObj

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

the class EnsnaredRule method checkCutAway.

private boolean checkCutAway(boolean offhand) {
    int amount = 0;
    DC_WeaponObj weapon = unit.getWeapon(offhand);
    if (weapon == null) {
        weapon = unit.getNaturalWeapon(offhand);
    }
    DC_UnitAction attack_action = unit.getAction(offhand ? "Offhand Attack" : "Attack");
    if (// unit.getRef(),
    !attack_action.canBeActivated(unit.getRef(), true)) // true
    {
        // TODO log " has no strength left to cut the bonds"
        return false;
    }
    // }
    if (weapon.getDamageType() != GenericEnums.DAMAGE_TYPE.BLUDGEONING) {
        amount += unit.calculateDamage(offhand);
    }
    amount = MathMaster.applyMod(amount, unit.getIntParam(offhand ? PARAMS.OFF_HAND_ATTACK : PARAMS.ATTACK));
    amount = MathMaster.applyMod(amount, CUT_AWAY_MOD);
    amount = Math.min(getNumberOfCounters(unit), amount);
    unit.modifyCounter(getCounterName(), -amount);
    attack_action.payCosts();
    // unit.modifyParameter(PARAMS.C_STAMINA, -sta_cost);
    // unit.modifyParameter(PARAMS.C_N_OF_ACTIONS, -1);
    String string = ((offhand) ? "...Then " : unit.getName()) + " cuts away " + ((offhand) ? " another " + amount : amount + " Ensnare counters") + " with " + weapon.getName();
    if (getNumberOfCounters(unit) <= 0) {
        string += " and breaks free!";
        game.getLogManager().log(string);
        return true;
    } else {
        game.getLogManager().log(string);
    }
    return false;
}
Also used : DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) DC_UnitAction(eidolons.entity.active.DC_UnitAction)

Example 15 with DC_WeaponObj

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

the class AmmoEffect method applyThis.

@Override
public boolean applyThis() {
    DC_WeaponObj rangedWeapon = (DC_WeaponObj) ref.getObj(KEYS.RANGED);
    if (add) {
        DC_QuickItemObj ammo = (DC_QuickItemObj) ref.getActive().getRef().getObj(KEYS.AMMO);
        rangedWeapon.setAmmo(ammo);
    } else {
        rangedWeapon.setAmmo(null);
    }
    return true;
}
Also used : DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj)

Aggregations

DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)22 DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)7 Unit (eidolons.entity.obj.unit.Unit)3 ArrayList (java.util.ArrayList)3 PARAMS (eidolons.content.PARAMS)2 DC_UnitAction (eidolons.entity.active.DC_UnitAction)2 DC_ArmorObj (eidolons.entity.item.DC_ArmorObj)2 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)2 Ref (main.entity.Ref)2 Obj (main.entity.obj.Obj)2 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 AddTriggerEffect (eidolons.ability.effects.attachment.AddTriggerEffect)1 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)1 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)1 UNIT_INFO_PARAMS (eidolons.content.UNIT_INFO_PARAMS)1 ValuePages (eidolons.content.ValuePages)1 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 DC_QuickItemAction (eidolons.entity.active.DC_QuickItemAction)1 DC_FeatObj (eidolons.entity.obj.attach.DC_FeatObj)1