use of eidolons.ability.effects.oneshot.activation.ActivateEffect 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;
}
Aggregations