Search in sources :

Example 1 with Targeting

use of main.elements.targeting.Targeting in project Eidolons by IDemiurge.

the class AuraEffect method init.

private void init() {
    event_type = (continuous) ? STANDARD_EVENT_TYPE.UNIT_MOVED : STANDARD_EVENT_TYPE.UNIT_TURN_STARTED;
    Targeting t = new FixedTargeting(KEYS.SOURCE);
    Conditions conditions = new Conditions();
    if (additionalConditions != null) {
        conditions.add(additionalConditions);
    }
    if (!continuous) {
        conditions.add(ConditionMaster.getSelfTriggerCondition());
    } else {
    // Condition retainCondition = ConditionMaster
    // .getDistanceCondition("TARGET", "SOURCE", radius);
    // effect = new AddBuffEffect(retainCondition, null, effect);
    // conditions.add(ConditionMaster
    // .getDistanceCondition("EVENT_SOURCE", "SOURCE", radius));
    }
    ZoneEffect zone_effect = new ZoneEffect(effect, radius, onlyEnemiesOrAllies, notSelf);
    ActiveAbility ability = new ActiveAbility(t, zone_effect);
    trigger = new AddTriggerEffect(event_type, conditions, ability);
}
Also used : ActiveAbility(main.ability.ActiveAbility) FixedTargeting(main.elements.targeting.FixedTargeting) Targeting(main.elements.targeting.Targeting) AutoTargeting(main.elements.targeting.AutoTargeting) FixedTargeting(main.elements.targeting.FixedTargeting) ZoneEffect(eidolons.ability.effects.containers.customtarget.ZoneEffect) AddTriggerEffect(eidolons.ability.effects.attachment.AddTriggerEffect)

Example 2 with Targeting

use of main.elements.targeting.Targeting in project Eidolons by IDemiurge.

the class DialogueSyntax method getAbilities.

public static Abilities getAbilities(String text) {
    if (!text.contains(PARAM_MOD))
        return null;
    String parsedPart = text.substring(text.indexOf(PARAM_MOD), text.indexOf(PARAM_MOD_CLOSE));
    // specify KEY
    Targeting t = new FixedTargeting();
    Effects paramModEffects = getParamModEffects(parsedPart);
    if (!paramModEffects.getEffects().isEmpty()) {
        return new Abilities(new ActiveAbility(t, paramModEffects));
    }
    return new Abilities(new ActiveAbility(t, new AbilityEffect(parsedPart)));
}
Also used : ActiveAbility(main.ability.ActiveAbility) Abilities(main.ability.Abilities) FixedTargeting(main.elements.targeting.FixedTargeting) Targeting(main.elements.targeting.Targeting) FixedTargeting(main.elements.targeting.FixedTargeting) Effects(main.ability.effects.Effects) AbilityEffect(eidolons.ability.effects.containers.AbilityEffect)

Example 3 with Targeting

use of main.elements.targeting.Targeting in project Eidolons by IDemiurge.

the class ActivesConstructor method getSingleTargeting.

public static Targeting getSingleTargeting(DC_ActiveObj obj) {
    List<ActiveObj> actives = obj.getActives();
    if (actives == null) {
        return null;
    }
    if (actives.size() < 1) {
        return null;
    }
    if (actives.get(0) == null) {
        return null;
    }
    Targeting targeting;
    try {
        targeting = ((AbilityObj) actives.get(0)).getType().getAbilities().getTargeting();
    } catch (Exception e) {
        targeting = getDefaultSingleTargeting(obj);
    }
    return targeting;
}
Also used : DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) ActiveObj(main.entity.obj.ActiveObj) FixedTargeting(main.elements.targeting.FixedTargeting) TemplateAutoTargeting(eidolons.ability.targeting.TemplateAutoTargeting) TemplateSelectiveTargeting(eidolons.ability.targeting.TemplateSelectiveTargeting) Targeting(main.elements.targeting.Targeting) MultiTargeting(main.elements.targeting.MultiTargeting) SelectiveTargeting(main.elements.targeting.SelectiveTargeting)

Example 4 with Targeting

use of main.elements.targeting.Targeting in project Eidolons by IDemiurge.

the class ActivesConstructor method getDefaultSingleTargeting.

public static Targeting getDefaultSingleTargeting(DC_ActiveObj entity) {
    Conditions conditions = (DC_ConditionMaster.getSelectiveTargetingTemplateConditions(DEFAULT_TARGETING_TEMPLATE));
    Targeting targeting = new SelectiveTargeting(conditions);
    return targeting;
}
Also used : TemplateSelectiveTargeting(eidolons.ability.targeting.TemplateSelectiveTargeting) SelectiveTargeting(main.elements.targeting.SelectiveTargeting) FixedTargeting(main.elements.targeting.FixedTargeting) TemplateAutoTargeting(eidolons.ability.targeting.TemplateAutoTargeting) TemplateSelectiveTargeting(eidolons.ability.targeting.TemplateSelectiveTargeting) Targeting(main.elements.targeting.Targeting) MultiTargeting(main.elements.targeting.MultiTargeting) SelectiveTargeting(main.elements.targeting.SelectiveTargeting) Conditions(main.elements.conditions.Conditions)

Example 5 with Targeting

use of main.elements.targeting.Targeting in project Eidolons by IDemiurge.

the class ActivesConstructor method getTargeting.

public static Targeting getTargeting(TARGETING_MODE mode, DC_ActiveObj obj) {
    Targeting targeting = null;
    switch(mode) {
        case BF_OBJ:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.BF_OBJ);
            break;
        case CORPSE:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.GRAVE_CELL);
            break;
        case BOLT_ANY:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.SHOT);
            break;
        case BOLT_UNITS:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.SHOT, ConditionMaster.getBFObjTypesCondition());
            break;
        case SELF:
            targeting = getSelfTargeting(obj);
            break;
        case SINGLE:
            targeting = getSingleTargeting(obj);
            break;
        case RAY:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.RAY);
            break;
        case CELL:
            // bolt-targeting?
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.CELL);
            break;
        case BLAST:
            // bolt-targeting?
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.BLAST);
            break;
        case DOUBLE:
            targeting = new MultiTargeting(getSingleTargeting(obj), getSingleTargeting(obj));
            ((MultiTargeting) targeting).setIgnoreGroupTargeting(false);
            break;
        case MULTI:
        case TRIPPLE:
            break;
        case ALL_UNITS:
            targeting = new TemplateAutoTargeting(AUTO_TARGETING_TEMPLATES.ALL_UNITS);
            break;
        case ANY_UNIT:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.ANY_UNIT);
            break;
        case ANY_ENEMY:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.ANY_ENEMY);
            break;
        case ANY_ALLY:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.ANY_ALLY);
            break;
        case ALL_ALLIES:
            targeting = new TemplateAutoTargeting(AUTO_TARGETING_TEMPLATES.ALL_ALLIES);
            break;
        case ALL_ENEMIES:
            targeting = new TemplateAutoTargeting(AUTO_TARGETING_TEMPLATES.ALL_ENEMIES);
            break;
        case ALL:
            targeting = new TemplateAutoTargeting(AUTO_TARGETING_TEMPLATES.ALL);
            break;
        case NOVA:
            targeting = new FixedTargeting(KEYS.SOURCE);
            break;
        case WAVE:
            targeting = new FixedTargeting(KEYS.SOURCE);
            break;
        case SPRAY:
            targeting = new FixedTargeting(KEYS.SOURCE);
            break;
        case TRAP:
            break;
        case ANY_ARMOR:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.ANY_ARMOR);
            break;
        case ANY_ITEM:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.ANY_ITEM);
            break;
        case ANY_WEAPON:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.ANY_WEAPON);
            break;
        case ENEMY_ARMOR:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.ENEMY_ARMOR);
            break;
        case ENEMY_ITEM:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.ENEMY_ITEM);
            break;
        case ENEMY_WEAPON:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.ENEMY_WEAPON);
            break;
        case MY_ARMOR:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.MY_ARMOR);
            break;
        case MY_ITEM:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.MY_ITEM);
            break;
        case MY_WEAPON:
            targeting = new TemplateSelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.MY_WEAPON);
            break;
        default:
            break;
    }
    if (targeting == null) {
        targeting = getSingleTargeting(obj);
    }
    if (targeting != null) {
        if (!targeting.isModsAdded()) {
            addTargetingMods(targeting, obj);
        }
    }
    return targeting;
}
Also used : TemplateSelectiveTargeting(eidolons.ability.targeting.TemplateSelectiveTargeting) FixedTargeting(main.elements.targeting.FixedTargeting) TemplateAutoTargeting(eidolons.ability.targeting.TemplateAutoTargeting) TemplateSelectiveTargeting(eidolons.ability.targeting.TemplateSelectiveTargeting) Targeting(main.elements.targeting.Targeting) MultiTargeting(main.elements.targeting.MultiTargeting) SelectiveTargeting(main.elements.targeting.SelectiveTargeting) FixedTargeting(main.elements.targeting.FixedTargeting) MultiTargeting(main.elements.targeting.MultiTargeting) TemplateAutoTargeting(eidolons.ability.targeting.TemplateAutoTargeting)

Aggregations

Targeting (main.elements.targeting.Targeting)18 FixedTargeting (main.elements.targeting.FixedTargeting)12 SelectiveTargeting (main.elements.targeting.SelectiveTargeting)9 TemplateSelectiveTargeting (eidolons.ability.targeting.TemplateSelectiveTargeting)7 Effects (main.ability.effects.Effects)6 MultiTargeting (main.elements.targeting.MultiTargeting)6 TemplateAutoTargeting (eidolons.ability.targeting.TemplateAutoTargeting)5 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)5 AutoTargeting (main.elements.targeting.AutoTargeting)5 Ref (main.entity.Ref)5 Effect (main.ability.effects.Effect)4 AddTriggerEffect (eidolons.ability.effects.attachment.AddTriggerEffect)3 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)3 ActiveAbility (main.ability.ActiveAbility)3 Conditions (main.elements.conditions.Conditions)3 ActiveObj (main.entity.obj.ActiveObj)3 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)2 WaveEffect (eidolons.ability.effects.containers.customtarget.WaveEffect)2 ZoneEffect (eidolons.ability.effects.containers.customtarget.ZoneEffect)2 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)2