use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.
the class AI_SpellMaster method getLogicByTargeting.
private static AI_LOGIC getLogicByTargeting(DC_ActiveObj spell) {
Targeting t = spell.getTargeting();
TARGETING_MODE mode = spell.getTargetingMode();
if (mode == null) {
if (t instanceof TemplateSelectiveTargeting) {
mode = ((TemplateSelectiveTargeting) t).getTemplate().getMode();
}
if (t instanceof TemplateAutoTargeting) {
mode = ((TemplateAutoTargeting) t).getTemplate().getMode();
}
}
Abilities actives = spell.getAbilities();
if (mode != null) {
switch(mode) {
case ENEMY_WEAPON:
case ENEMY_ARMOR:
return AiEnums.AI_LOGIC.BUFF_NEGATIVE;
case MY_WEAPON:
case MY_ARMOR:
case SELF:
return AiEnums.AI_LOGIC.SELF;
case ANY_ALLY:
if (EffectFinder.check(actives, AddBuffEffect.class)) {
return AiEnums.AI_LOGIC.BUFF_POSITIVE;
}
if (EffectFinder.check(actives, ModifyValueEffect.class)) {
return AiEnums.AI_LOGIC.RESTORE;
}
case ANY_ENEMY:
if (EffectFinder.check(actives, DealDamageEffect.class)) {
return AiEnums.AI_LOGIC.DAMAGE;
}
if (EffectFinder.check(actives, AddBuffEffect.class)) {
return AiEnums.AI_LOGIC.BUFF_NEGATIVE;
}
if (EffectFinder.check(actives, ModifyValueEffect.class)) {
return AiEnums.AI_LOGIC.DEBILITATE;
}
if (EffectFinder.check(actives, DrainEffect.class)) {
return AiEnums.AI_LOGIC.DEBILITATE;
}
break;
case ANY_UNIT:
if (EffectFinder.check(actives, AddBuffEffect.class)) {
if (((AddBuffEffect) EffectFinder.getEffectsOfClass(actives, AddBuffEffect.class).get(0)).getEffect().getFormula().getInt(spell.getOwnerObj().getRef()) > 0) {
return AiEnums.AI_LOGIC.BUFF_POSITIVE;
} else {
return AiEnums.AI_LOGIC.BUFF_NEGATIVE;
}
}
List<Effect> effects = EffectFinder.getEffectsOfClass(actives, ModifyValueEffect.class);
if (effects.isEmpty()) {
effects = EffectFinder.getEffectsOfClass(actives, ModifyCounterEffect.class);
}
Effect effect = effects.get(0);
if (effect instanceof ModifyCounterEffect) {
ModifyCounterEffect counterEffect = (ModifyCounterEffect) effect;
boolean positive = isCounterEffectPositive(spell, counterEffect);
if (positive) {
return AiEnums.AI_LOGIC.RESTORE;
}
return AiEnums.AI_LOGIC.DEBILITATE;
}
if (effect instanceof ModifyValueEffect) {
if (isModifyValueEffectPositive(spell, effect)) {
return AiEnums.AI_LOGIC.RESTORE;
}
return AiEnums.AI_LOGIC.DEBILITATE;
}
break;
case BLAST:
break;
case CELL:
break;
case RAY:
break;
default:
break;
}
}
return null;
}
use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.
the class RestMasterOld method applyMacroMode.
public static void applyMacroMode(Unit hero) {
MACRO_MODES mode = new EnumMaster<MACRO_MODES>().retrieveEnumConst(MACRO_MODES.class, hero.getProperty(MACRO_PROPS.MACRO_MODE));
String paramString = mode.getParamString();
Map<PARAMETER, String> map = new RandomWizard<PARAMETER>().constructStringWeightMap(paramString, PARAMETER.class);
for (PARAMETER p : map.keySet()) {
Ref ref = hero.getRef().getCopy();
// TODO MAX
setModeTargets(mode, ref);
String string = formatModeFormula(map.get(p));
new ModifyValueEffect(p, MOD.MODIFY_BY_CONST, string).apply(ref);
// hero.modifyParameter(portrait, amount);
}
// applyCustomEffect
if (mode.isSpecEffect()) {
switch(mode) {
// break;
case BREW:
break;
case DIVINATION:
DivinationMaster.divine(hero, TimeMaster.hoursLeft());
break;
case RECHARGE:
break;
case REPAIR:
break;
case SCOUT:
break;
case STAND_WATCH:
break;
case TRAIN_WITH_MAGIC:
// choose mastery? minor xp bonus?
break;
case TRAIN_WITH_WEAPONS:
break;
}
}
}
Aggregations