use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class PartyHelper method prepareType.
private static void prepareType(ObjType type) {
for (PROPERTY prop : InventoryTransactionManager.INV_PROPS) {
String propValue = type.getProperty(prop);
List<String> items = StringMaster.openContainer(propValue);
for (String item : items) {
if (StringMaster.isInteger(item)) {
try {
propValue = StringMaster.replaceFirst(propValue, item, type.getGame().getObjectById(StringMaster.getInteger(item)).getType().getName());
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
}
}
type.setProperty(prop, propValue);
}
}
use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class DC_RequirementsManager method getBaseTypeRequirement.
private Requirement getBaseTypeRequirement(Entity type, OBJ_TYPE TYPE) {
PROPERTY prop = TYPE.getUpgradeRequirementProp();
if (prop == null) {
return null;
}
Condition condition = ConditionMaster.getPropConditionSourceMatch(prop.toString(), G_PROPS.BASE_TYPE.toString());
String altBases = type.getProperty(PROPS.ALT_BASE_TYPES);
if (!altBases.isEmpty()) {
OrConditions orCondition = new OrConditions(condition);
for (String s : StringMaster.open(altBases)) {
orCondition.add(new PropCondition(PROPS.ALT_BASE_TYPES, s, false));
}
condition = orCondition;
}
return new Requirement(condition, InfoMaster.BASE + InfoMaster.getPropReasonString(type.getProperty(G_PROPS.BASE_TYPE), prop));
}
use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class DC_SoundMaster method preconstructSpell.
private static void preconstructSpell(DC_SpellObj spell, ANIM_PART part) {
String file = AnimationConstructor.findResourceForSpell(spell, part.toString(), "", propsExact, getSpellSoundPath(), false);
if (file == null) {
file = AnimationConstructor.findResourceForSpell(spell, part.toString(), "", props, getSpellSoundPath(), true);
}
if (file == null) {
file = getActionEffectSoundPath(spell, part);
}
if (file == null) {
return;
}
file = file.replace(PathFinder.getSoundPath().toLowerCase(), "");
PROPERTY prop = getProp(part);
if (prop == null)
return;
spell.getType().setProperty(prop, file);
}
use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class ContentGenerator method generateArmorPerDamageType.
public static void generateArmorPerDamageType(ObjType t, MATERIAL material) {
Integer armor = t.getIntParam(PARAMS.ARMOR);
for (DAMAGE_TYPE dmg_type : GenericEnums.DAMAGE_TYPE.values()) {
RESIST_GRADE grade = (material == null) ? getGradeForUnitType(t, dmg_type) : material.getResistGrade(dmg_type);
PROPERTY prop = DC_ContentManager.getResistGradeForDmgType(dmg_type);
if (prop == null) {
continue;
}
t.setProperty(prop, grade.toString());
t.setParam(DC_ContentManager.getArmorParamForDmgType(dmg_type), Math.round(armor * grade.getPercent() / 100));
if (material == null) {
grade = new EnumMaster<RESIST_GRADE>().retrieveEnumConst(RESIST_GRADE.class, t.getProperty(DC_ContentManager.getResistGradeForDmgType(dmg_type)));
} else {
grade = material.getSelfDamageGrade(dmg_type);
}
t.setProperty(DC_ContentManager.getSelfDamageGradeForDmgType(dmg_type), grade.toString());
prop = DC_ContentManager.getSelfDamageGradeForDmgType(dmg_type);
if (prop == null) {
continue;
}
grade = new EnumMaster<RESIST_GRADE>().retrieveEnumConst(RESIST_GRADE.class, t.getProperty(prop));
t.setParam(DC_ContentManager.getArmorSelfDamageParamForDmgType(dmg_type), Math.round(grade.getPercent()));
}
}
use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class DC_InfoPanelRenderer method getTableCellRendererComponent.
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (!obj.isDirty()) {
return getDefaultComp(table, value, isSelected, hasFocus, row, column);
}
if (column == 0) {
return getDefaultComp(table, value, isSelected, hasFocus, row, column);
}
// lbl = new JLabel(icon);
if (StringMaster.isEmpty(value.toString())) {
return getDefaultComp(table, value, isSelected, hasFocus, row, column);
}
String VALUE = table.getValueAt(row, 0).toString();
if (VALUE == null) {
return getDefaultComp(table, value, isSelected, hasFocus, row, column);
}
if (StringMaster.isEmpty(VALUE.toString())) {
return getDefaultComp(table, value, isSelected, hasFocus, row, column);
}
PARAMETER p = ContentManager.getPARAM(VALUE.toString());
if (p == null) {
PROPERTY prop = ContentManager.getPROP(VALUE.toString());
if (prop != null) {
return getPropertyValueComp(prop, value.toString(), VALUE);
}
return getDefaultComp(table, value, isSelected, hasFocus, row, column);
}
return getParamValueComp(value.toString(), VALUE, p);
}
Aggregations