Search in sources :

Example 6 with NumericCondition

use of main.elements.conditions.NumericCondition in project Eidolons by IDemiurge.

the class ClaimRule method initEffects.

@Override
public void initEffects() {
    Conditions conditions = new Conditions();
    conditions.add(new NumericCondition("0", CLAIM_COUNTERS));
    Conditions conditions2 = new Conditions();
    conditions2.add(new OwnershipCondition(KEYS.EVENT_TARGET.name(), true));
    conditions2.add(nOfCounters);
    RemoveBuffEffect removeBuffEffect = new RemoveBuffEffect(buffName);
    Effect effect = new OwnershipChangeEffect(false);
    AddBuffEffect addBuffEffect = new AddBuffEffect(new NumericCondition("{BASIS_CLAIM_COUNTERS}", "0"), buffName, effect);
    effects = new IfElseEffect(removeBuffEffect, conditions, new ConditionalEffect(conditions2, addBuffEffect));
}
Also used : ConditionalEffect(main.ability.effects.container.ConditionalEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) OwnershipCondition(main.elements.conditions.standard.OwnershipCondition) RemoveBuffEffect(eidolons.ability.effects.oneshot.buff.RemoveBuffEffect) OwnershipChangeEffect(main.ability.effects.common.OwnershipChangeEffect) NumericCondition(main.elements.conditions.NumericCondition) ConditionalEffect(main.ability.effects.container.ConditionalEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) Effect(main.ability.effects.Effect) OwnershipChangeEffect(main.ability.effects.common.OwnershipChangeEffect) RemoveBuffEffect(eidolons.ability.effects.oneshot.buff.RemoveBuffEffect) IfElseEffect(main.ability.effects.container.IfElseEffect) Conditions(main.elements.conditions.Conditions) IfElseEffect(main.ability.effects.container.IfElseEffect)

Example 7 with NumericCondition

use of main.elements.conditions.NumericCondition in project Eidolons by IDemiurge.

the class TrampleRule method initConditions.

@Override
public void initConditions() {
    conditions = new Conditions(// make sure the *source* is correct ref!
    new StdPassiveCondition(UnitEnums.STANDARD_PASSIVES.TRAMPLE, KEYS.EVENT_SOURCE), new AttackCondition(false), new NumericCondition("{source_total_weight}+{Strength}*2", "{event_target_bludgeoning_resistance}/100*{event_target_total_weight}*2+{event_target_Strength}*6"), // reflex roll?
    new RollCondition(GenericEnums.ROLL_TYPES.REFLEX));
    conditions.setFastFailOnCheck(true);
}
Also used : AttackCondition(eidolons.ability.conditions.special.AttackCondition) StdPassiveCondition(eidolons.ability.conditions.shortcut.StdPassiveCondition) NumericCondition(main.elements.conditions.NumericCondition) Conditions(main.elements.conditions.Conditions) RollCondition(eidolons.ability.conditions.special.RollCondition)

Example 8 with NumericCondition

use of main.elements.conditions.NumericCondition in project Eidolons by IDemiurge.

the class DivinationMaster method divine.

public static List<DC_SpellObj> divine(Unit diviningHero) {
    hero = diviningHero;
    List<DC_SpellObj> list = new ArrayList<>();
    pool = DC_MathManager.getDivinationPool(hero);
    // divination cap limiting?
    sdCondition = new NumericCondition(DC_Formulas.DIVINATION_MAX_SD_FORMULA.toString(), StringMaster.getValueRef(KEYS.MATCH, (PARAMS.SPELL_DIFFICULTY)));
    DC_SpellObj spell;
    spellGroups = initSpellGroups();
    if (spellGroups.isEmpty()) {
        return list;
    }
    Loop.startLoop(1000);
    while (!Loop.loopEnded()) {
        initSpellPool();
        if (spellPool.isEmpty()) {
            continue;
        }
        spell = tryDivine();
        if (spell == null) {
            break;
        }
        list.add(spell);
    }
    return list;
}
Also used : DC_SpellObj(eidolons.entity.active.DC_SpellObj) NumericCondition(main.elements.conditions.NumericCondition)

Example 9 with NumericCondition

use of main.elements.conditions.NumericCondition in project Eidolons by IDemiurge.

the class DC_CostsFactory method getCostsForSpell.

public static Costs getCostsForSpell(DC_ActiveObj spell, boolean isSpell) {
    List<Cost> costs = new ArrayList<>();
    Cost cost = null;
    if (!DC_Engine.isAtbMode()) {
        cost = getCost(spell, PARAMS.AP_COST, PARAMS.C_N_OF_ACTIONS);
        if (cost != null) {
            costs.add(cost);
        }
    }
    cost = getCost(spell, PARAMS.ENERGY_COST, PARAMS.C_ENERGY);
    if (cost != null) {
        costs.add(cost);
    }
    // cost = getCost(spell, PARAMS.ATP_COST, PARAMS.C_N_OF_ATTACKS);
    // if (cost != null)
    // costs.add(cost);
    cost = getCost(spell, PARAMS.CP_COST, PARAMS.C_N_OF_COUNTERS);
    if (cost != null) {
        costs.add(cost);
    }
    // cost = getCost(spell, PARAMS.MP_COST, PARAMS.C_N_OF_MOVES);
    // if (cost != null)
    // costs.add(cost);
    cost = getCost(spell, PARAMS.ESS_COST, PARAMS.C_ESSENCE);
    if (cost != null) {
        costs.add(cost);
    }
    cost = getCost(spell, PARAMS.STA_COST, PARAMS.C_STAMINA);
    if (cost != null) {
        costs.add(cost);
    }
    cost = getCost(spell, PARAMS.FOC_COST, PARAMS.C_FOCUS);
    if (cost != null) {
        costs.add(cost);
    }
    cost = getCost(spell, PARAMS.ENDURANCE_COST, PARAMS.C_ENDURANCE);
    if (cost != null) {
        costs.add(cost);
    }
    // if (spell.getIntParam(PARAMS.FOC_REQ) == 0)
    // return new Costs(costs);
    String s = "" + Math.max(spell.getIntParam(PARAMS.FOC_REQ), spell.getIntParam(PARAMS.FOC_COST));
    CostRequirements requirements = new CostRequirements(new Payment(PARAMS.C_FOCUS, new Formula(s)));
    if (!DC_Engine.isAtbMode())
        requirements.add(new Requirement(new NumericCondition("1", StringMaster.getValueRef(KEYS.ACTIVE, PARAMS.C_COOLDOWN)), InfoMaster.COOLDOWN_REASON));
    addSpecialRequirements(requirements, spell);
    return (isSpell) ? new DC_SpellCosts(requirements, costs) : new DC_ActionCosts(requirements, costs);
}
Also used : Formula(main.system.math.Formula) Requirement(main.elements.conditions.Requirement) ArrayList(java.util.ArrayList) NumericCondition(main.elements.conditions.NumericCondition)

Example 10 with NumericCondition

use of main.elements.conditions.NumericCondition in project Eidolons by IDemiurge.

the class MainManager method launchSelection.

public void launchSelection(final DC_TYPE t, final String group, String info) {
    Condition c = null;
    if (t == DC_TYPE.CHARS) {
        if (CharacterCreator.isArcadeMode()) {
            c = new NumericCondition("1", "{match_hero_level}");
        } else {
            if (DC_Game.game.getGameType() == GAME_TYPE.SCENARIO) {
                if (ScenarioPrecombatMaster.getScenario() != null) {
                    c = ScenarioPrecombatMaster.getSelectHeroConditions();
                }
            }
        }
    }
    sequenceMaster.launchEntitySelection(t, group, c, hero, info);
    sequenceMaster.getSequence().setManager(this);
    this.sequence = sequenceMaster.getSequence();
}
Also used : Condition(main.elements.conditions.Condition) NumericCondition(main.elements.conditions.NumericCondition) NumericCondition(main.elements.conditions.NumericCondition)

Aggregations

NumericCondition (main.elements.conditions.NumericCondition)10 Conditions (main.elements.conditions.Conditions)5 NotCondition (main.elements.conditions.NotCondition)3 Condition (main.elements.conditions.Condition)2 Formula (main.system.math.Formula)2 StdPassiveCondition (eidolons.ability.conditions.shortcut.StdPassiveCondition)1 AttackCondition (eidolons.ability.conditions.special.AttackCondition)1 RollCondition (eidolons.ability.conditions.special.RollCondition)1 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)1 DC_SpellObj (eidolons.entity.active.DC_SpellObj)1 ArrayList (java.util.ArrayList)1 Effect (main.ability.effects.Effect)1 OwnershipChangeEffect (main.ability.effects.common.OwnershipChangeEffect)1 ConditionalEffect (main.ability.effects.container.ConditionalEffect)1 IfElseEffect (main.ability.effects.container.IfElseEffect)1 PropCondition (main.elements.conditions.PropCondition)1 Requirement (main.elements.conditions.Requirement)1 StringComparison (main.elements.conditions.StringComparison)1 ClassificationCondition (main.elements.conditions.standard.ClassificationCondition)1