Search in sources :

Example 16 with PARAMS

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;
}
Also used : PARAMS(eidolons.content.PARAMS)

Example 17 with PARAMS

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";
}
Also used : CLASS_GROUP(main.content.enums.entity.HeroEnums.CLASS_GROUP) PARAMS(eidolons.content.PARAMS) PARAMETER(main.content.values.parameters.PARAMETER)

Example 18 with PARAMS

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);
}
Also used : ObjType(main.entity.type.ObjType) PARAMS(eidolons.content.PARAMS)

Example 19 with PARAMS

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;
}
Also used : Attack(eidolons.game.battlecraft.rules.combat.attack.Attack) PARAMS(eidolons.content.PARAMS) Unit(eidolons.entity.obj.unit.Unit)

Example 20 with PARAMS

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);
}
Also used : PARAMS(eidolons.content.PARAMS)

Aggregations

PARAMS (eidolons.content.PARAMS)29 PARAMETER (main.content.values.parameters.PARAMETER)8 ArrayList (java.util.ArrayList)7 ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)5 UNIT_INFO_PARAMS (eidolons.content.UNIT_INFO_PARAMS)4 ValueTooltip (eidolons.libgdx.gui.tooltips.ValueTooltip)4 G_PROPS (main.content.values.properties.G_PROPS)4 Pair (org.apache.commons.lang3.tuple.Pair)4 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)3 DC_UnitAction (eidolons.entity.active.DC_UnitAction)3 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)3 Unit (eidolons.entity.obj.unit.Unit)3 Tooltip (eidolons.libgdx.gui.tooltips.Tooltip)3 TextureCache (eidolons.libgdx.texture.TextureCache)3 Arrays (java.util.Arrays)3 List (java.util.List)3 Collectors (java.util.stream.Collectors)3 VALUE (main.content.VALUE)3 Ref (main.entity.Ref)3 ImageManager (main.system.images.ImageManager)3