Search in sources :

Example 6 with DC_FeatObj

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++;
        }
    }
}
Also used : DC_FeatObj(eidolons.entity.obj.attach.DC_FeatObj) ObjType(main.entity.type.ObjType) ListItem(main.swing.generic.components.list.ListItem)

Example 7 with DC_FeatObj

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()]);
}
Also used : DC_FeatObj(eidolons.entity.obj.attach.DC_FeatObj) ArrayList(java.util.ArrayList) PROPS(eidolons.content.PROPS) G_PROPS(main.content.values.properties.G_PROPS)

Example 8 with DC_FeatObj

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
}
Also used : DC_FeatObj(eidolons.entity.obj.attach.DC_FeatObj)

Example 9 with DC_FeatObj

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);
}
Also used : DC_FeatObj(eidolons.entity.obj.attach.DC_FeatObj) DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) Before(org.junit.Before)

Example 10 with DC_FeatObj

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;
}
Also used : DC_FeatObj(eidolons.entity.obj.attach.DC_FeatObj)

Aggregations

DC_FeatObj (eidolons.entity.obj.attach.DC_FeatObj)11 ObjType (main.entity.type.ObjType)3 ArrayList (java.util.ArrayList)2 ExpressionParseException (com.graphbuilder.math.ExpressionParseException)1 PROPS (eidolons.content.PROPS)1 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)1 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)1 Unit (eidolons.entity.obj.unit.Unit)1 G_PROPS (main.content.values.properties.G_PROPS)1 ListItem (main.swing.generic.components.list.ListItem)1 DequeImpl (main.system.datatypes.DequeImpl)1 Before (org.junit.Before)1