use of eidolons.entity.obj.attach.DC_FeatObj in project Eidolons by IDemiurge.
the class ClassLine method init.
public void init() {
int x = 0;
int y = 0;
// TODO empty items?
for (String string : StringMaster.open(hero.getProperty(PROPS.CLASSES))) {
string = VariableManager.removeVarPart(string);
ObjType type = DataManager.getType(string, DC_TYPE.CLASSES);
if (!StringMaster.isEmpty(hero.getProperty(PROPS.SECOND_CLASS))) {
String property = (prime) ? hero.getProperty(PROPS.FIRST_CLASS) : hero.getProperty(PROPS.SECOND_CLASS);
if (hero.getProperty(PROPS.FIRST_CLASS).contains(ClassView.MULTICLASS)) {
boolean multi = hero.checkProperty(PROPS.MULTICLASSES, type.getName());
if (prime) {
if (!multi) {
continue;
}
} else if (multi) {
continue;
}
} else {
String property2 = type.getProperty(G_PROPS.CLASS_GROUP);
if (!StringMaster.compare(property, property2)) {
continue;
}
}
}
String pos = (vertical) ? "pos 0 " + (MAX_CLASSES - y - 1) * GuiManager.getSmallObjSize() : "pos " + x * GuiManager.getSmallObjSize() + " 0";
final DC_FeatObj classObj = hero.getFeat(false, type);
ListItem<ObjType> item = new ListItem<ObjType>(type, false, false, GuiManager.getSmallObjSize()) {
public BORDER getSpecialBorder() {
return classObj.getRankBorder();
}
};
add(item, pos);
if (vertical) {
y++;
} else {
x++;
}
}
}
use of eidolons.entity.obj.attach.DC_FeatObj 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.entity.obj.attach.DC_FeatObj in project Eidolons by IDemiurge.
the class Unit method setFeatRank.
public void setFeatRank(boolean skill, int rank, ObjType type) {
DC_FeatObj featObj = getFeat(skill, type);
featObj.setParam(PARAMS.RANK, rank);
// reset
}
use of eidolons.entity.obj.attach.DC_FeatObj in project Eidolons by IDemiurge.
the class WeaponSkillTest method createEntity.
@Before
public void createEntity() {
// ObjType type = DataManager.getType(typeName, DC_TYPE.UNITS);
// entity = (Unit) game.getManager().getObjCreator().createUnit(type, 0, 0, game.getPlayer(true), new Ref(game));
skill = new DC_FeatObj(DataManager.getType(skillName, DC_TYPE.SKILLS), entity.getRef());
dagger = new DC_WeaponObj(DataManager.getType(itemName, DC_TYPE.WEAPONS), entity);
}
use of eidolons.entity.obj.attach.DC_FeatObj in project Eidolons by IDemiurge.
the class HeroManager method tryIncrementRank.
public boolean tryIncrementRank(Unit hero, ObjType type) {
boolean skill = type.getOBJ_TYPE_ENUM() == DC_TYPE.SKILLS;
DC_FeatObj feat = hero.getFeat(skill, type);
if (!checkCanIncrementRank(type, feat, hero)) {
return false;
}
if (!hero.incrementFeatRank(skill, type)) {
return false;
}
saveHero(hero);
hero.saveRanks(skill);
// DC_SoundMaster.playSkillAddSound(STD_SOUNDS.ButtonUp);
int xpCost = feat.getIntParam(PARAMS.XP_COST) * feat.getIntParam(PARAMS.RANK_XP_MOD) / 100;
hero.modifyParameter(PARAMS.XP, -xpCost);
update(hero);
return true;
}
Aggregations