use of main.content.enums.entity.HeroEnums.PRINCIPLES in project Eidolons by IDemiurge.
the class UnitInitializer method initIntegrityAlignments.
public void initIntegrityAlignments() {
Map<PRINCIPLES, Integer> map = new RandomWizard<PRINCIPLES>().constructWeightMap(getProperty(G_PROPS.PRINCIPLES), PRINCIPLES.class);
for (PRINCIPLES principle : map.keySet()) {
Integer amount = map.get(principle);
if (amount == 0) {
continue;
}
PARAMETER alignmentParam = DC_ContentManager.getAlignmentForPrinciple(principle);
getEntity().modifyParameter(alignmentParam, amount);
}
}
use of main.content.enums.entity.HeroEnums.PRINCIPLES in project Eidolons by IDemiurge.
the class PrinciplesCondition method check.
@Override
public boolean check(Ref ref) {
super.check(ref);
for (String s : StringMaster.open(val1)) {
for (String s2 : StringMaster.open(val2)) {
PRINCIPLES p1 = new EnumMaster<PRINCIPLES>().retrieveEnumConst(PRINCIPLES.class, s);
PRINCIPLES p2 = new EnumMaster<PRINCIPLES>().retrieveEnumConst(PRINCIPLES.class, s2);
if (exclusive) {
if (p1.getOpposite() == p2) {
return false;
}
} else if (p1 == p2) {
return true;
}
}
}
return true;
}
use of main.content.enums.entity.HeroEnums.PRINCIPLES in project Eidolons by IDemiurge.
the class PrincipleTable method paint.
@Override
public void paint(Graphics g) {
drawValueIcons(g);
int i = 0;
if (principleData) {
for (PRINCIPLES p : HeroEnums.PRINCIPLES.values()) {
Integer[] values = IntegrityRule.getValues(p, null, hero);
drawRow(i, values, g);
i++;
// drawRow(identity, alignment, integrity, true);
}
} else {
if (items != null) {
for (Entity item : items) {
if (item == null) {
continue;
}
if (selectedPrinciple == null) {
int n = 0;
List<PRINCIPLES> principles = IntegrityRule.getAffectingPrinciples(item, hero);
for (PRINCIPLES principle : principles) {
Integer[] values = IntegrityRule.getValues(principle, item, hero);
drawRow(principle, i, values, g, principles.size(), n);
i++;
n++;
}
continue;
}
Integer[] values = IntegrityRule.getValues(selectedPrinciple, item, hero);
drawRow(i, values, g);
i++;
}
}
}
}
use of main.content.enums.entity.HeroEnums.PRINCIPLES in project Eidolons by IDemiurge.
the class PrincipleMaster method initParams.
private static boolean initParams(ObjType type, boolean alignmentOrIdentity) {
Map<PRINCIPLES, String> map = new RandomWizard<PRINCIPLES>().constructStringWeightMap(type.getProperty(G_PROPS.PRINCIPLES), PRINCIPLES.class);
if (map.isEmpty()) {
return false;
}
boolean result = false;
for (PRINCIPLES principle : map.keySet()) {
// Integer amount =StringMaster.getInteger(map.getOrCreate(principle));
// if (amount == 0)
// continue;
result = true;
PARAMETER param = alignmentOrIdentity ? DC_ContentManager.getAlignmentForPrinciple(principle) : DC_ContentManager.getIdentityParamForPrinciple(principle);
type.setParam(param, map.get(principle));
}
return result;
}
use of main.content.enums.entity.HeroEnums.PRINCIPLES in project Eidolons by IDemiurge.
the class PrincipleChoiceView method itemSelected.
@Override
public void itemSelected(PRINCIPLES i) {
super.itemSelected(i);
PRINCIPLES principles = data.get(getSelectedIndex());
blocked = (checkBlocked(principles));
String text = principles.getDescription();
customIp.setText(text);
customIp.refresh();
}
Aggregations