use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class RangeRule method getMod.
/*
*
* some weapons/units may receive bonus/penalty based on this...
*
* status? stdCondition?
*
*/
public static int getMod(boolean dmg_atk, boolean close_long, Unit source, BattleFieldObject target, DC_WeaponObj weapon, DC_ActiveObj action) {
PARAMS param;
if (close_long) {
param = dmg_atk ? PARAMS.CLOSE_QUARTERS_DAMAGE_MOD : PARAMS.CLOSE_QUARTERS_ATTACK_MOD;
} else {
param = dmg_atk ? PARAMS.LONG_REACH_DAMAGE_MOD : PARAMS.LONG_REACH_ATTACK_MOD;
}
int mod = 100;
MathMaster.applyModIfNotZero(mod, source.getIntParam(param));
MathMaster.applyModIfNotZero(mod, weapon.getIntParam(param));
MathMaster.applyModIfNotZero(mod, action.getIntParam(param));
mod -= 100;
return mod;
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class HC_Tree method getGroupBackgroundPath.
private String getGroupBackgroundPath() {
String imageName;
if (arg instanceof CLASS_GROUP) {
CLASS_GROUP group = (CLASS_GROUP) arg;
// morph based on highest class?
imageName = getBgImageForClass(group);
} else {
imageName = ContentManager.getMasteryGroup((PARAMETER) arg);
switch(imageName) {
case "Heavy":
imageName = "war";
break;
case "Combat":
imageName = "combat";
break;
case "Weapons":
imageName = "weapons";
break;
case "Misc":
imageName = "misc";
break;
case "Stealth":
imageName = "stealth";
break;
}
if (imageName.isEmpty()) {
switch((PARAMS) arg) {
case ARMORER_MASTERY:
imageName = "war";
break;
case BLADE_MASTERY:
case POLEARM_MASTERY:
case BLUNT_MASTERY:
case AXE_MASTERY:
imageName = "weapons";
break;
}
}
}
return "big\\trees\\" + imageName + ".jpg";
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class HT_View method adjustOffset.
public void adjustOffset(Boolean node_link, Boolean x_y, HT_Node node) {
ObjType type = node.getType();
PARAMS param = node_link ? x_y ? PARAMS.TREE_NODE_OFFSET_X : PARAMS.TREE_NODE_OFFSET_Y : x_y ? PARAMS.TREE_LINK_OFFSET_X : PARAMS.TREE_LINK_OFFSET_Y;
Integer offset = type.getIntParam(param);
offset = DialogMaster.inputInt(offset);
if (offset == null) {
return;
}
type.setParameter(param, offset);
rebuildAndSetTree();
XML_Writer.writeXML_ForType(type, isSkill() ? DC_TYPE.SKILLS : DC_TYPE.CLASSES);
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class InstantAttackRule method getInterruptChance.
private static int getInterruptChance(INSTANT_ATTACK_TYPE type, DC_ActiveObj attackAction, Unit attacked) {
Unit attacker = attackAction.getOwnerObj();
Attack a = DC_AttackMaster.getAttackFromAction(attackAction);
int damage = a.getDamageDealt();
if (damage == 0) {
return 0;
}
// attackAction.getIntParam(PARAMS.DAMAGE_LAST_DEALT);
int chance = damage * 100 / attacked.getIntParam(PARAMS.TOUGHNESS);
// TODO force vs weight?
// if (InterruptRule.isDamageInterrupting(damage, attacked))
PARAMS stopChanceMod = null;
PARAMS passChanceMod = null;
// ContentManager.getPARAM(valueName)
switch(type) {
case DISENGAGEMENT:
stopChanceMod = PARAMS.STOP_DISENGAGEMENT_CHANCE_MOD;
passChanceMod = PARAMS.PASS_DISENGAGEMENT_CHANCE_MOD;
break;
case ENGAGEMENT:
stopChanceMod = PARAMS.STOP_ENGAGEMENT_CHANCE_MOD;
passChanceMod = PARAMS.PASS_ENGAGEMENT_CHANCE_MOD;
break;
case FLIGHT:
stopChanceMod = PARAMS.STOP_FLIGHT_CHANCE_MOD;
passChanceMod = PARAMS.PASS_FLIGHT_CHANCE_MOD;
break;
case PASSAGE:
stopChanceMod = PARAMS.STOP_PASSAGE_CHANCE_MOD;
passChanceMod = PARAMS.PASS_PASSAGE_CHANCE_MOD;
break;
case STUMBLE:
// also apply Interrupt effect on sta/foc?
return chance;
}
// String tip = "Chance: " + StringMaster.wrapInParenthesis(value)
int stop = chance * 100 * attacker.getIntParam(stopChanceMod);
int pass = chance * 100 * attacked.getIntParam(passChanceMod);
return chance - pass + stop;
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class AttackCalculator method initializeExtraModifiers.
private void initializeExtraModifiers() {
Integer mod = 100;
PARAMS param = null;
if (counter) {
param = PARAMS.COUNTER_MOD;
}
if (AoO) {
// watch bonuses here!
param = PARAMS.AOO_DAMAGE_MOD;
}
if (instant) {
param = PARAMS.INSTANT_DAMAGE_MOD;
}
if (param == null) {
return;
}
if (weapon != null) {
mod = MathMaster.applyMod(mod, weapon.getIntParam(param));
extraMap.put(MOD_IDENTIFIER.WEAPON, weapon.getIntParam(param));
}
mod = MathMaster.applyModIfNotZero(mod, action.getIntParam(param));
mod = MathMaster.applyModIfNotZero(mod, attacker.getIntParam(param));
// mod += weapon.getIntParam(param) - 100;
// mod += action.getIntParam(param) - 100;
extraMap.put(MOD_IDENTIFIER.ACTION, action.getIntParam(param));
// mod += attacker.getIntParam(param) - 100;
extraMap.put(MOD_IDENTIFIER.UNIT, attacker.getIntParam(param));
mod -= 100;
modMap.put(MOD_IDENTIFIER.EXTRA_ATTACK, mod);
}
Aggregations