use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class FreezeRule method getEffect.
@Override
protected Effect getEffect() {
Effects effects = new Effects(new ModifyValueEffect(PARAMS.ENDURANCE_REGEN, MOD.MODIFY_BY_PERCENT, getCounterRef() + "*" + ENDURANCE_REGEN_PER_COUNTER), new ModifyValueEffect(PARAMS.INITIATIVE_MODIFIER, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + INITIATIVE_PER_COUNTER));
// if (checkIsFrozen(unit)) {
effects.add(new ConditionalEffect(new StatusCheckCondition(UnitEnums.STATUS.FROZEN), new Effects(new ModifyValueEffect(RESISTANCES_REDUCED, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + RESISTANCE_REDUCED_PER_COUNTER), new ModifyValueEffect(RESISTANCES_BOOSTED, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + BONUS_RESISTANCE_PER_COUNTER))));
return effects;
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class DialogueSyntax method getParamModEffects.
private static Effects getParamModEffects(String text) {
Effects e = new Effects();
for (String substring : StringMaster.open(text, item_separator)) {
// TODO permanent for non-dynamic? base?
MOD mod = MOD.MODIFY_BY_CONST;
String param = text.split(pair_separator)[0];
String formula = text.split(pair_separator)[1];
ModifyValueEffect ef = new ModifyValueEffect(param, mod, formula);
// ef.setBase()
e.add(ef);
}
return e;
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class StateCloner method cloneAbility.
private Ability cloneAbility(Ability abilities) {
Effects effects = new Effects();
for (Effect e : abilities.getEffects()) {
effects.add(cloneEffect(e));
}
Ability ability = (abilities instanceof ActiveAbility) ? new ActiveAbility(abilities.getTargeting(), effects) : new PassiveAbility(abilities.getTargeting(), effects);
return ability;
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class ActivesConstructor method getEffectsFromAbilityType.
public static Effect getEffectsFromAbilityType(String abilName) {
AbilityType abilType = (AbilityType) DataManager.getType(abilName, DC_TYPE.ABILS);
if (abilType == null) {
abilType = VariableManager.getVarType(abilName);
if (abilType == null) {
LogMaster.log(1, "getEffectsFromAbilityType: no such ability - " + abilName);
return null;
}
}
Abilities abils = AbilityConstructor.constructAbilities(abilType.getDoc());
Effects effects = new Effects();
for (Ability ability : abils) {
effects.add(ability.getEffects());
}
return effects;
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class ActivesConstructor method constructActive.
public static void constructActive(TARGETING_MODE mode, DC_ActiveObj entity) {
if (mode == AbilityEnums.TARGETING_MODE.MULTI) {
addMultiTargetingMods(entity);
return;
}
if (entity.checkBool(GenericEnums.STD_BOOLS.MULTI_TARGETING)) {
// constructMultiAbilities(entity);
return;
}
if (entity.getActives() == null) {
return;
}
List<ActiveObj> list = new ArrayList<>(entity.getActives());
Effects effects = new Effects();
for (Active active : list) {
for (Ability abil : ((AbilityObj) active).getAbilities().getAbils()) {
for (Effect effect : abil.getEffects().getEffects()) {
// anything?
if (effect instanceof DC_Effect) {
DC_Effect effect2 = (DC_Effect) effect;
effect2.setAnimationActive(entity);
}
effects.add(effect);
}
}
}
// TODO what if the effects should have different targetings like in
// damage+light?
String saveRoll = entity.getProperty(PROPS.ROLL_TYPES_TO_SAVE);
if (!StringMaster.isEmpty(saveRoll)) {
wrapInSaveRollEffect(effects, saveRoll);
}
String wrap = entity.getProperty(PROPS.EFFECTS_WRAP);
Effect wrappedEffect;
if (StringMaster.isEmpty(wrap)) {
wrappedEffect = wrapEffects(mode, effects, entity);
} else {
EFFECTS_WRAP WRAP = new EnumMaster<EFFECTS_WRAP>().retrieveEnumConst(EFFECTS_WRAP.class, wrap);
wrappedEffect = wrapEffects(WRAP, effects, entity);
}
Targeting targeting = getTargeting(mode, entity);
if (targeting == null) {
try {
targeting = entity.getActives().get(0).getActives().get(0).getTargeting();
} catch (Exception e) {
// targeting = getDefaultSingleTargeting(entity);TODO necessary?
}
}
if (targeting != null)
entity.setTargeting(targeting);
Abilities abilities = new Abilities();
abilities.add(new ActiveAbility(null, wrappedEffect));
entity.setAbilities(abilities);
// TODO wrapping in RollEffect - each single effect or the resulting
// wrapped Effects?
}
Aggregations