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;
}
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;
}
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()));
}
}
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;
}
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;
}
Aggregations