use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class UnitCalculator method calculateDamage.
@Deprecated
public Integer calculateDamage(boolean offhand, boolean set) {
int dmg = DamageCalculator.getUnitAttackDamage(getEntity(), offhand);
Integer mod;
mod = getIntParam((offhand) ? PARAMS.OFFHAND_DAMAGE_MOD : PARAMS.DAMAGE_MOD);
if (mod != 0) {
dmg = dmg * mod / 100;
}
PARAMS minDamage = (offhand) ? PARAMS.OFF_HAND_MIN_DAMAGE : PARAMS.MIN_DAMAGE;
if (set) {
setParam(minDamage, dmg);
}
PARAMS damage = (offhand) ? PARAMS.OFF_HAND_DAMAGE : PARAMS.DAMAGE;
DC_WeaponObj weapon = getEntity().getWeapon(offhand);
if (weapon == null) {
weapon = getEntity().getNaturalWeapon(offhand);
}
Integer dieSize = (weapon == null) ? getIntParam(PARAMS.DIE_SIZE) : weapon.getIntParam(PARAMS.DIE_SIZE);
if (mod != 0) {
dieSize = dieSize * mod / 100;
}
if (set) {
setParam(damage, MathMaster.getAverage(dmg, dmg + dieSize));
}
PARAMS maxDamage = (offhand) ? PARAMS.OFF_HAND_MAX_DAMAGE : PARAMS.MAX_DAMAGE;
if (set) {
setParam(maxDamage, dmg + dieSize);
}
if (isDiceAccountedElsewhere()) {
// TODO review this
Integer min = getIntParam(minDamage);
setParameter(damage, min);
setParameter(maxDamage, min);
return min;
}
return MathMaster.getAverage(dmg, dmg + dieSize);
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class UnitResetter method resetMasteryScores.
public void resetMasteryScores() {
for (PARAMS mastery : DC_ContentManager.getMasteryParams()) {
PARAMETER score = ContentManager.getMasteryScore(mastery);
getEntity().getType().setParam(score, getIntParam(mastery));
getEntity().setParam(score, getIntParam(mastery));
}
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class ActionAnimation method drawMissed.
protected boolean drawMissed(AnimPhase phase) {
int chance = (int) phase.getArgs()[0];
boolean concealment_evasion = (boolean) phase.getArgs()[1];
PARAMS param = concealment_evasion ? PARAMS.CONCEALMENT : PARAMS.EVASION;
Image val_image = ImageManager.getValueIcon(param);
// drawValueImageText(param, null, null, ALIGNMENT.WEST);
setAlignmentX(ALIGNMENT.NORTH);
setDrawOnTargetOrSource(true);
drawTextOnTarget("Chance: " + chance, 0, 0);
Image image = action.getIcon().getImage();
image = ImageManager.applyBorder(image, BORDER.SPELL_UNAVAILABLE);
drawOnTargetCenter(image);
return true;
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class DC_RequirementsManager method generateClassRequirements.
public Requirements generateClassRequirements(Entity type, int mode) {
// multi :
if (mode == RANK_MODE) {
return generateClassRankRequirements(type);
}
Requirements requirements = new Requirements();
for (PARAMS mastery : DC_ContentManager.getMasteryParams()) {
PARAMETER req = ContentManager.getReqParam(mastery);
int param = type.getIntParam(req);
if (param <= 0) {
continue;
}
Condition c = ConditionMaster.getParamCondition(0, mastery, req);
String t = InfoMaster.getParamReasonString(type, mastery, req);
Requirement r = new Requirement(c, t);
requirements.add(r);
}
String cost = HeroManager.getCost(type, getHero());
Requirement xpReq = new Requirement(ConditionMaster.getParamCondition(0, PARAMS.XP, PARAMS.XP_COST), InfoMaster.getParamReasonString(type, PARAMS.XP, cost));
((NumericCondition) xpReq.getCondition()).setComparingValue(new Formula("" + cost));
requirements.add(xpReq);
if (ClassView.isMulticlass(type)) {
// TODO changing to simpler form with baseType?
requirements.add(getBaseTypeRequirement(type, type.getOBJ_TYPE_ENUM()));
requirements.add(new Requirement(new PropCondition(PROPS.CLASSES, type.getProperty(PROPS.BASE_CLASSES_TWO), false), InfoMaster.MULTICLASS_SECOND_CLASS + StringMaster.cropLast(type.getProperty(PROPS.BASE_CLASSES_TWO), 2, ";").replace(";", " or ")));
requirements.add(new Requirement(new MultiClassCondition(type.getName()), InfoMaster.MULTICLASS));
} else {
requirements.add(new Requirement(new ClassTreeCondition(type.getName()), InfoMaster.CLASS_TREE));
Conditions conditions = new OrConditions();
conditions.add(new EmptyStringCondition(StringMaster.getValueRef(KEYS.SOURCE, PROPS.FIRST_CLASS)));
conditions.add(new EmptyStringCondition(StringMaster.getValueRef(KEYS.SOURCE, PROPS.SECOND_CLASS)));
conditions.add(new StringComparison(type.getProperty(G_PROPS.CLASS_GROUP), StringMaster.getValueRef(KEYS.SOURCE, PROPS.FIRST_CLASS), true));
conditions.add(new StringComparison(type.getProperty(G_PROPS.CLASS_GROUP), StringMaster.getValueRef(KEYS.SOURCE, PROPS.SECOND_CLASS), true));
requirements.add(new Requirement(conditions, InfoMaster.MAX_CLASSES));
}
return requirements;
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class StatsControlComponent method buyPoints.
public void buyPoints(boolean attr, boolean gold) {
PARAMS cost_param = (gold) ? PARAMS.GOLD : PARAMS.XP;
PARAMS param = (attr) ? PARAMS.ATTR_POINTS : PARAMS.MASTERY_POINTS;
PARAMS buyParam = (attr) ? (gold) ? PARAMS.ATTR_BOUGHT_WITH_GOLD : PARAMS.ATTR_BOUGHT_WITH_XP : (gold) ? PARAMS.MASTERY_BOUGHT_WITH_GOLD : PARAMS.MASTERY_BOUGHT_WITH_XP;
int amount = DC_MathManager.getBuyCost(attr, gold, bufferType);
bufferType.modifyParameter(cost_param, -amount);
bufferType.modifyParameter(param, 1);
bufferType.modifyParameter(buyParam, 1);
refresh();
}
Aggregations