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