use of eidolons.content.PROPS in project Eidolons by IDemiurge.
the class UnitInitializer method initNaturalWeapon.
public void initNaturalWeapon(boolean offhand) {
if (offhand) {
if (StringMaster.isEmpty(getProperty(PROPS.OFFHAND_NATURAL_WEAPON))) {
return;
}
}
PROPS prop = (offhand) ? PROPS.OFFHAND_NATURAL_WEAPON : PROPS.NATURAL_WEAPON;
// if (game.isSimulation())
// return;
ObjType weaponType = DataManager.getType(getProperty(prop), DC_TYPE.WEAPONS);
if (weaponType == null) {
return;
}
DC_WeaponObj weapon = new DC_WeaponObj(weaponType, getEntity().getOwner(), getGame(), getRef(), !offhand);
getEntity().setNaturalWeapon(offhand, weapon);
}
use of eidolons.content.PROPS in project Eidolons by IDemiurge.
the class HeroManager method classAdded.
private void classAdded(Unit hero, Entity class_type) {
if (ClassView.isMulticlass(class_type)) {
if (!class_type.checkProperty(G_PROPS.BASE_TYPE)) {
// prime
// multiclass
hero.setProperty(PROPS.MULTICLASSES, hero.getType().getProperty(PROPS.CLASSES), true);
hero.setProperty(PROPS.FIRST_CLASS, ClassView.MULTICLASS + " " + StringMaster.wrapInParenthesis(class_type.getName()), true);
hero.setProperty(PROPS.SECOND_CLASS, "", true);
} else {
hero.getType().addProperty(PROPS.MULTICLASSES, class_type.getName());
}
return;
}
PROPS property = PROPS.FIRST_CLASS;
String value = hero.getProperty(property);
String group = class_type.getProperty(G_PROPS.CLASS_GROUP);
if (StringMaster.isEmpty(value)) {
hero.getType().setProperty(property, group);
return;
}
if (StringMaster.compare(hero.getProperty(property), group, true)) {
return;
}
property = PROPS.SECOND_CLASS;
value = hero.getProperty(property);
if (StringMaster.isEmpty(value)) {
hero.getType().setProperty(property, group);
}
}
use of eidolons.content.PROPS in project Eidolons by IDemiurge.
the class ToolTipTextComp method getFeatLines.
private String[] getFeatLines(Boolean req, ObjType item, Unit hero, boolean skill) {
List<String> list = new ArrayList<>();
PROPS p = skill ? PROPS.SKILLS : PROPS.CLASSES;
if (!hero.checkProperty(p, item.getName())) {
addReqLines(item, hero, list, RequirementsManager.NORMAL_MODE);
} else {
DC_FeatObj feat = hero.getFeat(skill, item);
int sd = feat.getIntParam(PARAMS.SKILL_DIFFICULTY);
if (skill) {
String points = "Skill Difficulty (skill points spent): " + sd;
list.add(points);
} else {
}
int rank = feat.getIntParam(PARAMS.RANK);
if (rank > 0) {
int xp = feat.getIntParam(PARAMS.XP_COST) * feat.getIntParam(PARAMS.RANK_XP_MOD) / 100;
int skillPoints = sd * feat.getIntParam(PARAMS.RANK_SD_MOD) / 100;
String rankInfo = "Current rank: " + rank + ", max: " + feat.getIntParam(PARAMS.RANK_MAX);
String rankBonus = "Rank Bonus: " + rank * feat.getIntParam(PARAMS.RANK_FORMULA_MOD) + "%";
String skillRanksInfo = "Increase rank for " + xp + (skill ? " Xp and " + skillPoints + " Skill Points" : "");
if (!skill) {
// skills also have those!
addReqLines(item, hero, list, RequirementsManager.RANK_MODE);
}
if (list.size() <= getMaxListSize()) {
list.add(rankInfo);
}
if (list.size() <= getMaxListSize()) {
list.add(rankBonus);
}
if (list.size() <= getMaxListSize()) {
list.add(skillRanksInfo);
}
}
}
return list.toArray(new String[list.size()]);
}
use of eidolons.content.PROPS in project Eidolons by IDemiurge.
the class TextMaster method initValueDescriptionsFolder.
public static void initValueDescriptionsFolder() {
for (PARAMS p : PARAMS.values()) {
String path = getParamsPath();
String name = p.getName();
if (p.isMastery()) {
path += "mastery\\";
}
if (p.isAttribute()) {
path += "attributes\\";
}
if (p.isDynamic()) {
name = name.replace("c ", "");
}
String descr = FileManager.readFile(path + name);
if (!descr.isEmpty()) {
p.setDescr(descr);
}
}
for (PROPS p : PROPS.values()) {
String path = getPropsPath();
String name = p.getName();
if (p.isPrinciple()) {
path += "principles\\";
}
String descr = FileManager.readFile(path + name);
if (!descr.isEmpty()) {
p.setDescr(descr);
}
}
}
use of eidolons.content.PROPS in project Eidolons by IDemiurge.
the class BattleCraft method chooseMastery.
public static void chooseMastery(Unit hero, Boolean weapon_magic_misc) {
PROPS prop = PROPS.MASTERY_GROUPS_WEAPONS;
if (weapon_magic_misc == null) {
prop = PROPS.MASTERY_GROUPS_MISC;
} else if (!weapon_magic_misc) {
prop = PROPS.MASTERY_GROUPS_MAGIC;
}
String tip = " had trained with...";
if (weapon_magic_misc == null) {
tip = " had learned... ";
} else if (!weapon_magic_misc) {
tip = " had studied... ";
}
for (String item : StringMaster.open(hero.getProperty(prop))) {
if (item.contains(StringMaster.OR)) {
String[] options = item.split(StringMaster.OR);
int index = DialogMaster.askOptionsAndWait(hero.getName() + tip, false, options);
item = options[index];
}
int amount = StringMaster.getInteger(VariableManager.getVarPart(item));
PARAMETER[] masteries = VALUE_GROUP.valueOf(StringMaster.toEnumFormat(VariableManager.removeVarPart(item))).getParams();
List<String> options = new ArrayList<>();
for (PARAMETER m : masteries) {
options.add(m.toString().replace(" Mastery", ""));
}
// multi-disc groups?
int index = DialogMaster.askOptionsAndWait(hero.getName() + tip + StringMaster.wrapInParenthesis("" + amount), false, options.toArray());
if (index == -1) {
index = RandomWizard.getRandomIntBetween(0, masteries.length - 1);
DialogMaster.inform("Random choice - " + masteries[index]);
// bonus 1? 50%!
}
hero.modifyParameter(masteries[index], amount, true);
}
}
Aggregations