use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class ItemGenerator method generateName.
public static String generateName(JEWELRY_ITEM_TRAIT trait, MAGICAL_ITEM_LEVEL level, ObjType type) {
PARAMETER p = trait.getParams()[0];
String name = type.getName();
int amount = trait.getIntegers()[level.getInt()];
if (!ItemMaster.isRing(type) && trait.isDoubleAmulet()) {
amount *= 2;
}
name = level.toString() + " " + name + " of " + p.getName() + StringMaster.wrapInParenthesis("+" + amount);
return name;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class ItemGenerator method applyWeightPenalties.
private static void applyWeightPenalties(ObjType type) {
// TODO magical item exception!
if (type.getGroupingKey().equalsIgnoreCase("" + ItemEnums.WEAPON_TYPE.NATURAL)) {
return;
}
// robes?
// ++ apply durability from quality?
int w = type.getIntParam(PARAMS.WEIGHT);
for (PARAMETER p : (type.getOBJ_TYPE_ENUM() == DC_TYPE.WEAPONS ? DC_ContentManager.getWeaponWeightPenaltyParams() : DC_ContentManager.getArmorWeightPenaltyParams())) {
if (type.getGroupingKey().equalsIgnoreCase("" + ItemEnums.WEAPON_TYPE.MAGICAL)) {
if (!p.getName().contains("move") && !p.getName().contains("attack")) {
continue;
}
}
type.modifyParameter(p, w);
}
type.modifyParameter(PARAMS.DEFENSE_MOD, -w);
type.modifyParameter(PARAMS.ATTACK_MOD, -w);
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class ItemGenerator method generateJewelryItem.
private static ObjType generateJewelryItem(ObjType type, JEWELRY_ITEM_TRAIT trait, MAGICAL_ITEM_LEVEL level) {
boolean ring = ItemMaster.isRing(type);
if (trait == null)
return null;
PARAMETER[] params = trait.getParams();
PARAMETER p = params[0];
ObjType newType = generateEmptyJewelryItem(ring, type, null);
// double for
int amount = trait.getIntegers()[level.getInt()];
// amulets?
if (!ring && trait.isDoubleAmulet()) {
amount = amount * 2;
}
newType.setParam(p, amount);
type.getGame().initType(newType);
newType.setGenerated(true);
String name = generateName(trait, level, type);
newType.setProperty(G_PROPS.NAME, name);
DataManager.addType(newType.getName(), DC_TYPE.JEWELRY, newType);
// String img = type.getProperty(prop) + suffix + format;
// newType.setProperty(G_PROPS.IMAGE, name);
newType.setProperty(PROPS.MAGICAL_ITEM_TRAIT, trait.toString());
newType.setProperty(PROPS.MAGICAL_ITEM_LEVEL, level.toString());
int costMod = trait.getCostBase() * level.getCostFactor();
if (!ring && trait.isDoubleAmulet()) {
costMod = costMod * 5 / 2;
}
newType.modifyParameter(PARAMS.GOLD_COST, costMod);
newType.modifyParamByPercent(PARAMS.GOLD_COST, JEWELRY_COST_MODIFIER);
String group = DataManager.MISC;
if (trait == JEWELRY_ITEM_TRAIT.ATTRIBUTE_BONUS) {
group = DataManager.ATTR;
}
newType.setProperty(G_PROPS.JEWELRY_GROUP, group);
String code = "" + (level.getInt());
if (level.getInt() > 0) {
String img = generateImgPath(code, type);
if (ImageManager.isImage(img)) {
newType.setProperty(G_PROPS.IMAGE, img);
}
}
return newType;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class PointView method generateValuePanel.
private void generateValuePanel() {
String str = "";
if (attributes) {
str = "flowy";
columns = ATTRIBUTE.values().length;
}
valPanel = new G_Panel(str);
int i = 1;
for (PARAMETER value : values) {
addValueComponent(value, i, valPanel);
i++;
}
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class PointView method initValues.
private void initValues() {
if (params) {
return;
}
this.values = new ArrayList<>();
List<PARAMETER> list = (attributes) ? ContentManager.getAttributes() : ContentManager.getMasteries();
for (PARAMETER p : list) {
if (checkValue(p)) {
values.add(p);
}
}
}
Aggregations