Search in sources :

Example 11 with DAMAGE_TYPE

use of main.content.enums.GenericEnums.DAMAGE_TYPE in project Eidolons by IDemiurge.

the class ContentGenerator method getDefaultSelfDamageMap.

private static Map<DAMAGE_TYPE, RESIST_GRADE> getDefaultSelfDamageMap(ITEM_MATERIAL_GROUP group) {
    Map<DAMAGE_TYPE, RESIST_GRADE> map = new HashMap<>();
    for (DAMAGE_TYPE dmg_type : GenericEnums.DAMAGE_TYPE.values()) {
        if (!dmg_type.isMagical()) {
            map.put(dmg_type, GenericEnums.RESIST_GRADE.Normal);
        } else {
            map.put(dmg_type, GenericEnums.RESIST_GRADE.Ineffective);
        }
    }
    switch(group) {
        case BONE:
            map.put(GenericEnums.DAMAGE_TYPE.PIERCING, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.LIGHTNING, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.SONIC, GenericEnums.RESIST_GRADE.Resistant);
            break;
        case CLOTH:
        case LEATHER:
            map.put(GenericEnums.DAMAGE_TYPE.BLUDGEONING, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.LIGHTNING, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.SONIC, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.COLD, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.FIRE, GenericEnums.RESIST_GRADE.Resistant);
            break;
        case METAL:
        case STONE:
            map.put(GenericEnums.DAMAGE_TYPE.FIRE, GenericEnums.RESIST_GRADE.Resistant);
            break;
    }
    switch(group) {
        case BONE:
            map.put(GenericEnums.DAMAGE_TYPE.LIGHTNING, GenericEnums.RESIST_GRADE.Impregnable);
            break;
        case CLOTH:
            map.put(GenericEnums.DAMAGE_TYPE.PIERCING, GenericEnums.RESIST_GRADE.Vulnerable);
            break;
        case LEATHER:
            map.put(GenericEnums.DAMAGE_TYPE.FIRE, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.SONIC, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.SLASHING, GenericEnums.RESIST_GRADE.Vulnerable);
            break;
        case METAL:
            map.put(GenericEnums.DAMAGE_TYPE.BLUDGEONING, GenericEnums.RESIST_GRADE.Vulnerable);
            map.put(GenericEnums.DAMAGE_TYPE.LIGHT, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.SONIC, GenericEnums.RESIST_GRADE.Vulnerable);
            map.put(GenericEnums.DAMAGE_TYPE.ACID, GenericEnums.RESIST_GRADE.Vulnerable);
            map.put(GenericEnums.DAMAGE_TYPE.COLD, GenericEnums.RESIST_GRADE.Vulnerable);
            map.put(GenericEnums.DAMAGE_TYPE.LIGHTNING, GenericEnums.RESIST_GRADE.Ineffective);
            break;
        case STONE:
            map.put(GenericEnums.DAMAGE_TYPE.LIGHTNING, GenericEnums.RESIST_GRADE.Impregnable);
            map.put(GenericEnums.DAMAGE_TYPE.PIERCING, GenericEnums.RESIST_GRADE.Resistant);
            break;
    }
    // fill with 'normals'
    return map;
}
Also used : RESIST_GRADE(main.content.enums.GenericEnums.RESIST_GRADE) HashMap(java.util.HashMap) DAMAGE_TYPE(main.content.enums.GenericEnums.DAMAGE_TYPE)

Example 12 with DAMAGE_TYPE

use of main.content.enums.GenericEnums.DAMAGE_TYPE in project Eidolons by IDemiurge.

the class ContentGenerator method getDefaultResistMap.

private static Map<DAMAGE_TYPE, RESIST_GRADE> getDefaultResistMap(ITEM_MATERIAL_GROUP group) {
    Map<DAMAGE_TYPE, RESIST_GRADE> map = new HashMap<>();
    for (DAMAGE_TYPE dmg_type : GenericEnums.DAMAGE_TYPE.values()) {
        if (!dmg_type.isMagical()) {
            map.put(dmg_type, GenericEnums.RESIST_GRADE.Normal);
        } else {
            map.put(dmg_type, GenericEnums.RESIST_GRADE.Ineffective);
        }
    }
    switch(group) {
        case BONE:
            map.put(GenericEnums.DAMAGE_TYPE.PIERCING, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.LIGHTNING, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.SONIC, GenericEnums.RESIST_GRADE.Resistant);
            break;
        case CLOTH:
        case LEATHER:
            map.put(GenericEnums.DAMAGE_TYPE.BLUDGEONING, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.LIGHTNING, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.SONIC, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.COLD, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.FIRE, GenericEnums.RESIST_GRADE.Resistant);
            break;
        case METAL:
        case STONE:
            map.put(GenericEnums.DAMAGE_TYPE.FIRE, GenericEnums.RESIST_GRADE.Resistant);
            break;
    }
    switch(group) {
        case BONE:
            map.put(GenericEnums.DAMAGE_TYPE.LIGHTNING, GenericEnums.RESIST_GRADE.Impregnable);
            break;
        case CLOTH:
            map.put(GenericEnums.DAMAGE_TYPE.PIERCING, GenericEnums.RESIST_GRADE.Vulnerable);
            break;
        case LEATHER:
            map.put(GenericEnums.DAMAGE_TYPE.FIRE, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.SONIC, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.SLASHING, GenericEnums.RESIST_GRADE.Vulnerable);
            break;
        case METAL:
            map.put(GenericEnums.DAMAGE_TYPE.SLASHING, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.BLUDGEONING, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.LIGHT, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.SONIC, GenericEnums.RESIST_GRADE.Vulnerable);
            map.put(GenericEnums.DAMAGE_TYPE.ACID, GenericEnums.RESIST_GRADE.Vulnerable);
            map.put(GenericEnums.DAMAGE_TYPE.COLD, GenericEnums.RESIST_GRADE.Vulnerable);
            map.put(GenericEnums.DAMAGE_TYPE.LIGHTNING, GenericEnums.RESIST_GRADE.Ineffective);
            break;
        case STONE:
            map.put(GenericEnums.DAMAGE_TYPE.LIGHTNING, GenericEnums.RESIST_GRADE.Impregnable);
            map.put(GenericEnums.DAMAGE_TYPE.PIERCING, GenericEnums.RESIST_GRADE.Resistant);
            break;
        case CRYSTAL:
            map.put(GenericEnums.DAMAGE_TYPE.FIRE, GenericEnums.RESIST_GRADE.Impregnable);
            map.put(GenericEnums.DAMAGE_TYPE.LIGHTNING, GenericEnums.RESIST_GRADE.Impregnable);
            map.put(GenericEnums.DAMAGE_TYPE.PIERCING, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.SLASHING, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.ACID, GenericEnums.RESIST_GRADE.Resistant);
            map.put(GenericEnums.DAMAGE_TYPE.BLUDGEONING, GenericEnums.RESIST_GRADE.Vulnerable);
            map.put(GenericEnums.DAMAGE_TYPE.SONIC, GenericEnums.RESIST_GRADE.Vulnerable);
            map.put(GenericEnums.DAMAGE_TYPE.COLD, GenericEnums.RESIST_GRADE.Vulnerable);
            map.put(GenericEnums.DAMAGE_TYPE.LIGHT, GenericEnums.RESIST_GRADE.Ineffective);
            break;
    }
    // fill with 'normals'
    return map;
}
Also used : RESIST_GRADE(main.content.enums.GenericEnums.RESIST_GRADE) HashMap(java.util.HashMap) DAMAGE_TYPE(main.content.enums.GenericEnums.DAMAGE_TYPE)

Example 13 with DAMAGE_TYPE

use of main.content.enums.GenericEnums.DAMAGE_TYPE in project Eidolons by IDemiurge.

the class ContentGenerator method generateArmorPerDamageType.

public static void generateArmorPerDamageType(ObjType t, MATERIAL material) {
    Integer armor = t.getIntParam(PARAMS.ARMOR);
    for (DAMAGE_TYPE dmg_type : GenericEnums.DAMAGE_TYPE.values()) {
        RESIST_GRADE grade = (material == null) ? getGradeForUnitType(t, dmg_type) : material.getResistGrade(dmg_type);
        PROPERTY prop = DC_ContentManager.getResistGradeForDmgType(dmg_type);
        if (prop == null) {
            continue;
        }
        t.setProperty(prop, grade.toString());
        t.setParam(DC_ContentManager.getArmorParamForDmgType(dmg_type), Math.round(armor * grade.getPercent() / 100));
        if (material == null) {
            grade = new EnumMaster<RESIST_GRADE>().retrieveEnumConst(RESIST_GRADE.class, t.getProperty(DC_ContentManager.getResistGradeForDmgType(dmg_type)));
        } else {
            grade = material.getSelfDamageGrade(dmg_type);
        }
        t.setProperty(DC_ContentManager.getSelfDamageGradeForDmgType(dmg_type), grade.toString());
        prop = DC_ContentManager.getSelfDamageGradeForDmgType(dmg_type);
        if (prop == null) {
            continue;
        }
        grade = new EnumMaster<RESIST_GRADE>().retrieveEnumConst(RESIST_GRADE.class, t.getProperty(prop));
        t.setParam(DC_ContentManager.getArmorSelfDamageParamForDmgType(dmg_type), Math.round(grade.getPercent()));
    }
}
Also used : RESIST_GRADE(main.content.enums.GenericEnums.RESIST_GRADE) EnumMaster(main.system.auxiliary.EnumMaster) PROPERTY(main.content.values.properties.PROPERTY) DAMAGE_TYPE(main.content.enums.GenericEnums.DAMAGE_TYPE)

Example 14 with DAMAGE_TYPE

use of main.content.enums.GenericEnums.DAMAGE_TYPE in project Eidolons by IDemiurge.

the class ActionAnimation method drawReduction.

protected boolean drawReduction(boolean shield) {
    int percentage = (int) phase.getArgs()[0];
    int blocked = (int) phase.getArgs()[1];
    int durability = (int) phase.getArgs()[2];
    int amount = (int) phase.getArgs()[3];
    DAMAGE_TYPE dmg_type = (DAMAGE_TYPE) phase.getArgs()[4];
    DC_HeroSlotItem armor = (DC_HeroSlotItem) phase.getArgs()[5];
    // calculate centered
    int y = 4;
    Image image = armor.getIcon().getImage();
    int x = (w - image.getWidth(null)) / 2;
    drawOnTarget(image, x, y);
    Font font = getFontNeutral();
    y += 5 + image.getHeight(null);
    image = ImageManager.getDamageTypeImage(dmg_type.getName());
    drawOnTarget(image, 0, y - (image.getHeight(null) - FontMaster.getFontHeight(font)) / 2);
    String string = StringMaster.wrapInBraces(blocked + "") + " blocked " + StringMaster.wrapInParenthesis(ArmorMaster.getArmorValue(armor, dmg_type) + " max.");
    x = (w - FontMaster.getStringWidth(font, string)) / 2;
    y += drawTextOnTarget(string, font, x, y) - 6;
    string = StringMaster.wrapInParenthesis(percentage + "%" + ((shield) ? " chance" : " of attack"));
    x = (w - FontMaster.getStringWidth(font, string)) / 2;
    y += drawTextOnTarget(string, font, x, y) - 6;
    // Shield/armor  chance, numbers, dmg type, durability
    if (durability <= 0) {
        return true;
    }
    font = getFontNegative();
    string = StringMaster.wrapInBraces(durability + "") + " durability lost";
    x = (w - FontMaster.getStringWidth(font, string)) / 2;
    drawTextOnTarget(string, font, x, y, ColorManager.CRIMSON);
    // update initial amount/dmg_type?
    return true;
}
Also used : DAMAGE_TYPE(main.content.enums.GenericEnums.DAMAGE_TYPE) DC_HeroSlotItem(eidolons.entity.item.DC_HeroSlotItem)

Example 15 with DAMAGE_TYPE

use of main.content.enums.GenericEnums.DAMAGE_TYPE in project Eidolons by IDemiurge.

the class ActionAnimation method drawNaturalReduction.

protected boolean drawNaturalReduction(AnimPhase phase) {
    int e_armor = (int) phase.getArgs()[0];
    int e_res = (int) phase.getArgs()[1];
    int e_dmg = (int) phase.getArgs()[2];
    int t_armor = (int) phase.getArgs()[3];
    int t_res = (int) phase.getArgs()[4];
    int t_dmg = (int) phase.getArgs()[5];
    DAMAGE_TYPE dmg_type = (DAMAGE_TYPE) phase.getArgs()[6];
    boolean separate = false;
    if (e_armor != t_armor) {
        separate = true;
    } else if (e_res != t_res) {
        separate = true;
    } else if (e_dmg != t_dmg) {
        separate = true;
    }
    // center damage if not and
    if (!separate) {
        drawNaturalReductionColumn(null, dmg_type, e_dmg, e_res, e_armor);
    } else {
        drawNaturalReductionColumn(false, dmg_type, e_dmg, e_res, e_armor);
        drawNaturalReductionColumn(true, dmg_type, t_dmg, t_res, t_armor);
    }
    return true;
}
Also used : DAMAGE_TYPE(main.content.enums.GenericEnums.DAMAGE_TYPE)

Aggregations

DAMAGE_TYPE (main.content.enums.GenericEnums.DAMAGE_TYPE)18 RESIST_GRADE (main.content.enums.GenericEnums.RESIST_GRADE)4 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)3 Unit (eidolons.entity.obj.unit.Unit)3 PARAMETER (main.content.values.parameters.PARAMETER)3 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)2 Damage (eidolons.game.battlecraft.rules.combat.damage.Damage)2 ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)2 HashMap (java.util.HashMap)2 Ref (main.entity.Ref)2 PARAMS (eidolons.content.PARAMS)1 DC_HeroSlotItem (eidolons.entity.item.DC_HeroSlotItem)1 AttackCalculator (eidolons.game.battlecraft.rules.combat.attack.AttackCalculator)1 MultiValueContainer (eidolons.libgdx.gui.panels.dc.unitinfo.MultiValueContainer)1 ValueTooltip (eidolons.libgdx.gui.tooltips.ValueTooltip)1 PROPERTY (main.content.values.properties.PROPERTY)1 Obj (main.entity.obj.Obj)1 Event (main.game.logic.event.Event)1 EnumMaster (main.system.auxiliary.EnumMaster)1 AnimPhase (main.system.graphics.AnimPhase)1