use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class AttackCalculator method initializeAttackModifiers.
private void initializeAttackModifiers() {
Integer integer = weapon.getIntParam(PARAMS.ATTACK_MOD);
addModifier(atkModMap, MOD_IDENTIFIER.WEAPON, PARAMS.ATTACK, integer);
// }
if (AoO) {
integer = attacker.getIntParam(PARAMS.AOO_ATTACK_MOD);
addModifier(atkModMap, MOD_IDENTIFIER.AOO, PARAMS.ATTACK, integer);
}
if (instant) {
integer = attacker.getIntParam(PARAMS.INSTANT_ATTACK_MOD);
addModifier(atkModMap, MOD_IDENTIFIER.INSTANT_ATTACK, PARAMS.ATTACK, integer);
if (WatchRule.checkWatched(attacker, attacked)) {
addModifier(atkModMap, MOD_IDENTIFIER.WATCHED, PARAMS.ATTACK, MathMaster.applyModIfNotZero(MathMaster.applyModIfNotZero(WatchRule.INSTANT_ATTACK_MOD, attacker.getIntParam(PARAMS.WATCH_ATTACK_MOD)), attacked.getIntParam(PARAMS.WATCHED_ATTACK_MOD)));
// addModifier(attacked, map, id, param, integer);
}
}
if (counter) {
integer = attacker.getIntParam(PARAMS.COUNTER_ATTACK_MOD);
addModifier(atkModMap, MOD_IDENTIFIER.COUNTER_ATTACK, PARAMS.ATTACK, integer);
}
if (attack.getInstantAttackType() != null) {
PARAMETER param = ContentManager.getPARAM(attack.getInstantAttackType().toString() + "_ATTACK_MOD");
integer = attacked.getIntParam(param);
addModifier(atkModMap, MOD_IDENTIFIER.INSTANT_ATTACK, PARAMS.ATTACK, integer);
}
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class ActionAnimation method drawCosts.
protected boolean drawCosts(AnimPhase phase) {
int base = getDefaultIconMapOffsetY();
boolean invert = false;
Boolean edge;
boolean positive;
if (getTarget() == source || phase.isDrawOnSource()) {
edge = game.getBattleField().getGrid().isOnEdgeY(source.getCoordinates());
// TODO
positive = BooleanMaster.isTrue(edge) || edge == null;
base = getOffsetBase(positive);
if (base < 0) {
invert = true;
}
}
if (getTarget().getCoordinates().isAdjacent(source.getCoordinates())) {
if (PositionMaster.inLine(source, target)) {
if (PositionMaster.isAbove(target, source)) {
invert = true;
}
if (PositionMaster.isAbove(source, target)) {
invert = false;
}
}
}
Costs costs = (Costs) phase.getArgs()[0];
Map<Image, String> map = new XLinkedMap<>();
for (Cost s : costs.getCosts()) {
if (s.isPaidAlt()) {
s = s.getAltCost();
}
Formula formula = s.getPayment().getAmountFormula();
PARAMETER param = s.getPayment().getParamToPay();
Image image = ImageManager.getValueIcon(param);
if (image == null) {
continue;
}
String string = "" + (-s.getPayment().getLastPaid());
map.put(image, string);
List<String> list = new ArrayList<>();
list.add(string);
getSubPhaseTooltipMap().put(image, list);
}
drawIconMap(map, false, true, base, invert);
return true;
}
use of main.content.values.parameters.PARAMETER 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 main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class DC_MathManager method calculateClaimedObjects.
@Override
public int calculateClaimedObjects(Obj obj, String BF_OBJECT_TYPE) {
Conditions conditions = ConditionMaster.getClaimedBfObjConditions(BF_OBJECT_TYPE);
Ref ref = new Ref(game, obj.getId());
int i = new Filter<>(ref, conditions).getObjects().size();
PARAMETER param = ContentManager.getPARAM("CLAIMED_" + BF_OBJECT_TYPE + "S");
obj.setParam(param, i);
return i;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class ClassBottomPanel method refresh.
@Override
public void refresh() {
super.refresh();
if (lastSelectedType != selectedType) {
// selectedType.getProperty(PROPS.REQUIREMENTS)
displayedMasteries.clear();
for (String req : hero.getGame().getRequirementsManager().getRequirements(selectedType, 0).getReqMap().keySet()) {
String[] parts = req.split(InfoMaster.PARAM_REASON_STRING);
if (parts.length < 2) {
continue;
}
PARAMETER param = ContentManager.getMastery(parts[0]);
if (param != null) {
if (param.isMastery()) {
displayedMasteries.add(param);
}
}
}
LogMaster.log(1, "displayedMasteries = " + displayedMasteries);
// masteryCompsPanel.removeAll();
for (PARAMETER p : displayedMasteries) {
HC_PointComp comp = generateMasteryComp(p);
// // wrap
Object pos = "";
// i++;
masteryCompsPanel.add(comp, pos);
}
}
super.refresh();
}
Aggregations