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