Search in sources :

Example 6 with PRINCIPLES

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

the class IntegrityRule method getDescription.

public static String getDescription(Entity hero) {
    Object[] levels = getHighestLowestLevels(true, hero);
    PRINCIPLES highestPrinciple = (PRINCIPLES) levels[0];
    ALIGNMENT_LEVEL highestLevel = (ALIGNMENT_LEVEL) levels[1];
    PRINCIPLES lowestPrinciple = (PRINCIPLES) levels[2];
    ALIGNMENT_LEVEL lowestLevel = (ALIGNMENT_LEVEL) levels[3];
    String adjective = "";
    if (highestPrinciple != null && highestLevel != null) {
        adjective = getAdjective(highestPrinciple, highestLevel);
    } else {
        if (lowestPrinciple != null && lowestLevel != null) {
            adjective = getAdjective(lowestPrinciple, lowestLevel);
        }
    }
    levels = getHighestLowestLevels(false, hero);
    highestPrinciple = (PRINCIPLES) levels[0];
    IDENTITY_LEVEL highestLevel2 = (IDENTITY_LEVEL) levels[1];
    String noun = "";
    if (highestLevel2 != null) {
        switch(highestLevel2) {
            case FONDNESS:
                noun = getNounFond(highestPrinciple, hero);
                break;
            case PREDILECTION:
                noun = getNounPredilection(highestPrinciple, hero);
                break;
            case LOVE:
                noun = getNounLove(highestPrinciple, hero);
                break;
        }
    }
    /*
         * if no positive alignment,
		 * 
		 * adjective per alignment 
		 * 
		 * TODO this is great but what if the signs don't match? "Guilty" -TR will increase INT ? why not: ) 
		 * short description should be ADJ+NOUN still...
		 * but each Principle should have a 'status' - Alignment and Id. if present! 
		 * 
		 */
    String string = noun;
    if (!StringMaster.isEmpty(adjective)) {
        string = adjective + " " + noun;
    }
    return string;
}
Also used : PRINCIPLES(main.content.enums.entity.HeroEnums.PRINCIPLES)

Example 7 with PRINCIPLES

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

the class IntegrityRule method getHighestLowestLevels.

public static Object[] getHighestLowestLevels(boolean alignment, Entity hero) {
    Integer highestAmount = 0;
    PRINCIPLES highestPrinciple = null;
    VALUE_LEVEL highestLevel = null;
    Integer lowestAmount = 0;
    PRINCIPLES lowestPrinciple = null;
    VALUE_LEVEL lowestLevel = null;
    for (PRINCIPLES principle : HeroEnums.PRINCIPLES.values()) {
        Integer amount = hero.getIntParam(DC_ContentManager.getAlignmentForPrinciple(principle));
        VALUE_LEVEL level = alignment ? getAlignmentLevel(amount) : getIdentityLevel(amount);
        if (highestAmount < amount) {
            highestPrinciple = principle;
            highestLevel = level;
            highestAmount = amount;
        }
        if (lowestAmount > amount) {
            highestPrinciple = principle;
            highestLevel = level;
            highestAmount = amount;
        }
    }
    return new Object[] { highestPrinciple, highestLevel, lowestPrinciple, lowestLevel };
}
Also used : PRINCIPLES(main.content.enums.entity.HeroEnums.PRINCIPLES)

Example 8 with PRINCIPLES

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

the class IntegrityRule method resetIntegrity.

public static void resetIntegrity(Unit hero) {
    resetAlignment(hero);
    resetIdentification(hero);
    for (PRINCIPLES principle : HeroEnums.PRINCIPLES.values()) {
        int product = getIntegrityMod(hero, principle);
        hero.modifyParameter(PARAMS.INTEGRITY, product);
    }
}
Also used : PRINCIPLES(main.content.enums.entity.HeroEnums.PRINCIPLES)

Example 9 with PRINCIPLES

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

the class PrincipleMaster method initPrincipleIdentification.

public static void initPrincipleIdentification(ObjType type) {
    String prop = type.getProperty(G_PROPS.PRINCIPLES);
    if (prop.contains("(")) {
        return;
    }
    String newValue = "";
    int i = Math.min(3, StringMaster.openContainer(prop).size());
    for (String substring : StringMaster.open(prop)) {
        newValue += substring + StringMaster.wrapInParenthesis(i + "") + ";";
        PRINCIPLES principle = new EnumMaster<PRINCIPLES>().retrieveEnumConst(PRINCIPLES.class, substring);
        newValue += principle.getOpposite().toString() + StringMaster.wrapInParenthesis(-i + "") + ";";
        i--;
    }
    type.setProperty(G_PROPS.PRINCIPLES, newValue);
}
Also used : PRINCIPLES(main.content.enums.entity.HeroEnums.PRINCIPLES)

Example 10 with PRINCIPLES

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

the class ContainerTextElement method getText.

public String getText() {
    if (permanent) {
        return text;
    }
    if (getEntity() == null) {
        return text;
    }
    String propertyValue = getEntity().getProperty(property);
    propertyValue = StringMaster.getFormattedContainerString(propertyValue);
    if (property == G_PROPS.PRINCIPLES) {
        String formattedValue = "";
        for (PRINCIPLES principle : HeroEnums.PRINCIPLES.values()) {
            // for (String pr :
            // StringMaster.openFormattedContainer(propertyValue)) {
            // PRINCIPLES principle = new
            // EnumMaster<PRINCIPLES>().retrieveEnumConst(
            // PRINCIPLES.class, pr);
            Integer identification = getEntity().getIntParam(DC_ContentManager.getIdentityParamForPrinciple(principle));
            if (identification == 0) {
                continue;
            }
            String values = getEntity().getIntParam(DC_ContentManager.getAlignmentForPrinciple(principle)) + "/" + identification;
            formattedValue += principle.toString() + StringMaster.wrapInParenthesis(values) + StringMaster.getFormattedContainerSeparator();
        }
        propertyValue = StringMaster.cropLast(formattedValue, 2);
    } else if (property == PROPS.REQUIREMENTS) {
        propertyValue = TextParser.formatRequirements(propertyValue);
        if (entity.getOBJ_TYPE_ENUM() == DC_TYPE.CLASSES) {
            propertyValue += StringMaster.NEW_LINE + TextGenerator.generatePerkParamBonuses(entity);
        }
    }
    return getPrefix() + propertyValue;
}
Also used : 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