Search in sources :

Example 11 with ActiveAbility

use of main.ability.ActiveAbility in project Eidolons by IDemiurge.

the class TriggerEffect method applyThis.

@Override
public boolean applyThis() {
    if (!initialized) {
        init();
        initialized = true;
    }
    ActiveAbility ability = new ActiveAbility(targeting, effects);
    triggerEffect = new AddTriggerEffect(event_type, conditions, ability);
    return triggerEffect.apply(ref);
}
Also used : ActiveAbility(main.ability.ActiveAbility) AddTriggerEffect(eidolons.ability.effects.attachment.AddTriggerEffect)

Example 12 with ActiveAbility

use of main.ability.ActiveAbility in project Eidolons by IDemiurge.

the class DualAttackMaster method createDual.

private static DC_UnitAction createDual(DC_UnitAction main, DC_UnitAction offhand) {
    Costs costs = getDualCosts(main, offhand);
    // cooldown!
    ActiveAbility activateAttacks = new ActiveAbility(main.getTargeting(), new Effects(new ActivateEffect(main.getName(), true), new ActivateEffect(offhand.getName(), true)));
    Ability setCooldown = new ActiveAbility(new AutoTargeting(new PropCondition(G_PROPS.ACTION_TAGS, "Dual", false)), new ModifyValueEffect(PARAMS.C_COOLDOWN, MOD.SET, getCooldown(main.getOwnerObj())));
    Abilities abilities = new Abilities();
    abilities.add(activateAttacks);
    abilities.add(setCooldown);
    ObjType newType = new ObjType("Dual: " + main.getName() + " and " + offhand.getName(), DataManager.getType("Dual Attack", DC_TYPE.ACTIONS));
    for (Cost cost : costs.getCosts()) {
        PARAMETER p = cost.getCostParam();
        if (p == null)
            continue;
        newType.setParam(p, cost.getPayment().getAmountFormula().toString());
    }
    DC_UnitAction dual = new DC_UnitAction(newType, main.getOwner(), main.getGame(), new Ref(main.getOwnerObj()));
    dual.setAbilities(abilities);
    dual.setCosts(costs);
    dual.setTargeting(main.getTargeting());
    dual.getTargeter().setTargetingInitialized(true);
    dual.setConstructed(true);
    return dual;
}
Also used : ActiveAbility(main.ability.ActiveAbility) ActiveAbility(main.ability.ActiveAbility) Ability(main.ability.Ability) AutoTargeting(main.elements.targeting.AutoTargeting) Costs(main.elements.costs.Costs) Abilities(main.ability.Abilities) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects) PropCondition(main.elements.conditions.PropCondition) Cost(main.elements.costs.Cost) DC_UnitAction(eidolons.entity.active.DC_UnitAction) Ref(main.entity.Ref) ObjType(main.entity.type.ObjType) ActivateEffect(eidolons.ability.effects.oneshot.activation.ActivateEffect) PARAMETER(main.content.values.parameters.PARAMETER)

Aggregations

ActiveAbility (main.ability.ActiveAbility)12 FixedTargeting (main.elements.targeting.FixedTargeting)8 AddTriggerEffect (eidolons.ability.effects.attachment.AddTriggerEffect)7 Effects (main.ability.effects.Effects)7 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)4 Ability (main.ability.Ability)4 Targeting (main.elements.targeting.Targeting)4 Abilities (main.ability.Abilities)3 AutoTargeting (main.elements.targeting.AutoTargeting)3 Ref (main.entity.Ref)3 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)2 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)2 Effect (main.ability.effects.Effect)2 Conditions (main.elements.conditions.Conditions)2 RefCondition (main.elements.conditions.RefCondition)2 AbilityEffect (eidolons.ability.effects.containers.AbilityEffect)1 ZoneEffect (eidolons.ability.effects.containers.customtarget.ZoneEffect)1 SetCustomModeEffect (eidolons.ability.effects.continuous.SetCustomModeEffect)1 ActivateEffect (eidolons.ability.effects.oneshot.activation.ActivateEffect)1 EndGameEffect (eidolons.ability.effects.special.meta.EndGameEffect)1