use of eidolons.ability.effects.oneshot.unit.GatewayEffect in project Eidolons by IDemiurge.
the class AI_SpellMaster method getSummonedUnit.
public static ObjType getSummonedUnit(DC_ActiveObj active, Ref ref) {
ObjType type;
List<Effect> list = EffectFinder.getEffectsOfClass(active.getAbilities(), GatewayEffect.class);
if (!list.isEmpty()) {
GatewayEffect effect = (GatewayEffect) list.get(0);
return DataManager.getType(effect.getUnitType(), C_OBJ_TYPE.BF_OBJ);
}
SummonEffect effect = null;
try {
effect = (SummonEffect) EffectFinder.getEffectsOfClass(active.getAbilities(), SummonEffect.class).get(0);
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
if (effect instanceof RaiseEffect) {
RaiseEffect raiseEffect = (RaiseEffect) effect;
effect.setRef(ref);
return DataManager.getType(raiseEffect.getUnitType(), C_OBJ_TYPE.BF_OBJ);
}
if (effect != null) {
type = DataManager.getType(effect.getTypeName(), C_OBJ_TYPE.BF_OBJ);
return type;
}
if (effect instanceof RaiseEffect) {
RaiseEffect raiseEffect = (RaiseEffect) effect;
return DataManager.getType(raiseEffect.getUnitType(), C_OBJ_TYPE.BF_OBJ);
}
if (effect instanceof RaiseEffect) {
RaiseEffect raiseEffect = (RaiseEffect) effect;
return DataManager.getType(raiseEffect.getUnitType(), C_OBJ_TYPE.BF_OBJ);
}
return null;
}
Aggregations