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