Search in sources :

Example 11 with PRINCIPLES

use of main.content.enums.entity.HeroEnums.PRINCIPLES in project Eidolons by IDemiurge.

the class PrincipleInfoPanel method refresh.

@Override
public void refresh() {
    textLines = new ArrayList<>();
    if (principle == null) {
        for (PRINCIPLES p : HeroEnums.PRINCIPLES.values()) {
            addStatusLines(p);
        }
    } else {
        addStatusLines(principle);
    }
    repaint();
}
Also used : PRINCIPLES(main.content.enums.entity.HeroEnums.PRINCIPLES)

Example 12 with PRINCIPLES

use of main.content.enums.entity.HeroEnums.PRINCIPLES in project Eidolons by IDemiurge.

the class PrinciplePanel method init.

public void init() {
    principlesIcon.addMouseListener(this);
    helpIcon.addMouseListener(this);
    pool = new PoolComp(getBuffer(), PARAMS.IDENTITY_POINTS, "", null) {

        @Override
        protected int getOffsetY() {
            return 6;
        }

        @Override
        protected Font getDefaultFont() {
            return PrincipleView.getDefaultFont();
        }
    };
    table = new PrincipleTable(hero, true);
    int x = (VISUALS.PRINCIPLE_VALUE_BOX.getWidth() + 24 - 50) / 2;
    add(principlesIcon, "id principlesIcon, pos " + x + " " + getFrameBorderWidth());
    x = VISUALS.PRINCIPLE_VALUE_BOX.getWidth() - VISUALS.POOL_MECH.getWidth() + 44;
    add(pool, "id pool, pos " + x + " 12");
    add(table, "pos pool.x2 pool.y");
    int height = VISUALS.PRINCIPLE_VALUE_BOX.getHeight();
    int y = 0;
    for (PRINCIPLES p : HeroEnums.PRINCIPLES.values()) {
        PrinciplePointComp pointComp = new PrinciplePointComp(this, p, hero, this, getBuffer());
        pointComps.add(pointComp);
        y += height;
        // TODO
        add(pointComp, "pos " + getFrameBorderWidth() + " " + y);
    // buffer
    }
}
Also used : PoolComp(eidolons.client.cc.gui.misc.PoolComp) PRINCIPLES(main.content.enums.entity.HeroEnums.PRINCIPLES)

Example 13 with PRINCIPLES

use of main.content.enums.entity.HeroEnums.PRINCIPLES in project Eidolons by IDemiurge.

the class Party method initBattleSpirit.

public void initBattleSpirit() {
    // if (!getOwner().isMe()) {
    // setParam(PARAMS.BATTLE_SPIRIT, 100);
    // return;
    // }
    int principleClashes = 0;
    int sharedPrinciples = 0;
    int deityClashes = 0;
    int sharedDeities = 0;
    int i = 0;
    int pc_mod = 100;
    int sp_mod = 100;
    int dc_mod = 100;
    int sd_mod = 100;
    for (Unit hero : members) {
        // getOrCreate condition, preCheck per unit, add up on false!
        if (hero.isDead()) {
            continue;
        }
        i++;
        ref.setMatch(hero.getId());
        for (PRINCIPLES principle : HeroEnums.PRINCIPLES.values()) {
            Integer hero_identity = hero.getIntParam(DC_ContentManager.getIdentityParamForPrinciple(principle));
            for (Unit m : members) {
                if (m == hero || m.isDead()) {
                    continue;
                }
                Integer member_identity = m.getIntParam(DC_ContentManager.getIdentityParamForPrinciple(principle));
                if (hero_identity > 0) {
                    if (member_identity < 0) {
                        principleClashes += Math.min(hero_identity, Math.abs(member_identity));
                    } else {
                        sharedPrinciples += Math.min(hero_identity, (member_identity));
                    }
                } else {
                    if (member_identity > 0) {
                        principleClashes += Math.min(Math.abs(hero_identity), member_identity);
                    } else {
                        sharedPrinciples += Math.min(Math.abs(hero_identity), Math.abs(member_identity));
                    }
                }
                if (m.getDeity() == hero.getDeity()) {
                    sharedDeities += 2;
                } else if (m.getDeity().getAllyDeities().contains(hero.getDeity())) {
                    sharedDeities++;
                } else if (m.getDeity().getEnemyDeities().contains(hero.getDeity())) {
                    deityClashes++;
                }
            }
            principleClashes -= hero.getIntParam(PARAMS.PRINCIPLE_CLASHES_REMOVED);
            pc_mod -= pc_mod * hero.getIntParam(PARAMS.PRINCIPLE_CLASHES_REDUCTION) / 100;
            dc_mod -= dc_mod * hero.getIntParam(PARAMS.DEITY_CLASHES_REDUCTION) / 100;
            sp_mod += sp_mod * hero.getIntParam(PARAMS.SHARED_PRINCIPLES_BOOST);
            sd_mod += hero.getIntParam(PARAMS.SHARED_DEITIES_BOOST);
        }
        setParam(PARAMS.PRINCIPLE_CLASHES, principleClashes);
        pc_mod = Math.max(pc_mod, 1);
        sp_mod = Math.max(sp_mod, 1);
        dc_mod = Math.max(dc_mod, 1);
        sd_mod = Math.max(sd_mod, 1);
        int maxLeadership = getMaxParam(ContentManager.getMasteryScore(PARAMS.LEADERSHIP_MASTERY));
        // if (!leader.getOwner().isMe()) {
        // // mod /= 2; ???
        // maxLeadership += 10;
        // // ++ TODO special bonus per wave type!
        // }
        // int max= Math.max(getMaxParam(PARAMS.PRINCIPLE_CLASH_MAXIMUM),
        // 5);
        // principleClashes = Math.min(principleClashes, max);
        int principleClashesPenalty = pc_mod / 100 * (principleClashes);
        int sharedPrinciplesBonus = sp_mod / 100 * (sharedPrinciples);
        int deityClashesPenalty = 15 * dc_mod / 100 * (deityClashes);
        int sharedDeitiesBonus = 5 * sd_mod / 100 * (sharedDeities);
        int leadershipBonus = Math.round((float) Math.sqrt(i) * maxLeadership);
        int principleBonus = MathMaster.getMinMax(sharedPrinciplesBonus - principleClashesPenalty, -75, 200);
        int deityBonus = MathMaster.getMinMax(sharedDeitiesBonus - deityClashesPenalty, -50, 150);
        int battleSpirit = 100 + principleBonus + deityBonus + // should it be PC^2*5 instead?
        leadershipBonus;
        // TODO
        setParam(PARAMS.BATTLE_SPIRIT, Math.min(300, battleSpirit));
        if (!getOwner().isMe()) {
            setParamMin(PARAMS.ORGANIZATION, 60);
            setParamMax(PARAMS.ORGANIZATION, 200);
        }
    }
}
Also used : Unit(eidolons.entity.obj.unit.Unit) PRINCIPLES(main.content.enums.entity.HeroEnums.PRINCIPLES)

Aggregations

PRINCIPLES (main.content.enums.entity.HeroEnums.PRINCIPLES)13 PARAMETER (main.content.values.parameters.PARAMETER)2 PoolComp (eidolons.client.cc.gui.misc.PoolComp)1 Unit (eidolons.entity.obj.unit.Unit)1 Entity (main.entity.Entity)1