use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class PriorityManagerImpl method initRollMap.
private void initRollMap(DC_ActiveObj spell, List<Effect> effects) {
rollMap = new ConcurrentMap<>();
List<RollEffect> rollEffects = EffectFinder.getRollEffects(spell);
for (RollEffect roll : rollEffects) {
for (Effect e : effects) {
Effect effect = roll.getEffect();
if (effect instanceof Effects) {
Effects rolledEffects = (Effects) effect;
for (Effect e1 : rolledEffects.getEffects()) {
rollMap.put(e1, roll);
}
break;
}
if (effect == e) {
rollMap.put(e, roll);
break;
}
}
}
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class EffectFinder method initPropModEffects.
public static Effects initPropModEffects(String modString, Ref ref) {
Effects modEffects = new Effects();
Map<PROPERTY, String> map = new RandomWizard<PROPERTY>().constructStringWeightMap(modString, PROPERTY.class);
initPropModEffects(modEffects, map, ref);
return modEffects;
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class EffectFinder method getEffectsFromAbilityString.
public static Effects getEffectsFromAbilityString(String abilName, Ref ref) {
Effects effects = (new Effects());
String separator = StringMaster.AND_PROPERTY_SEPARATOR;
if (!abilName.contains(separator)) {
separator = StringMaster.AND_SEPARATOR;
}
for (String s : StringMaster.open(abilName, separator)) {
effects.addAll(EffectFinder.getEffectsFromAbilityType(s, ref));
}
return effects;
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class WatchBuffEffect method generateEffects.
private static Effect generateEffects(Unit watcher, List<DC_Obj> list) {
// some triggers? for the list...
// preCheck specials per watcher!
Effects e = new Effects();
if (!watcher.getMode().equals(STD_MODES.ALERT)) {
e.add(new ModifyValueEffect(PARAMS.DEFENSE_MOD, MOD.MODIFY_BY_CONST, WatchRule.getDefenseModVsOthers(watcher, list)));
e.add(new ModifyValueEffect(PARAMS.ATTACK_MOD, MOD.MODIFY_BY_CONST, WatchRule.getAttackModVsOthers(watcher, list)));
e.add(new ModifyValueEffect(PARAMS.AP_PENALTY, MOD.MODIFY_BY_CONST, WatchRule.getApPenaltyMod(watcher, list)));
} else {
}
//
return e;
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class BindingDamageEffect method applyThis.
@Override
public boolean applyThis() {
// Can be initialized() just once
GroupImpl group = ref.getGroup();
Effects effects = new Effects();
STANDARD_EVENT_TYPE event_type;
if (shareOrRedirect) {
// TODO splitMode!
event_type = STANDARD_EVENT_TYPE.UNIT_IS_DEALT_TOUGHNESS_DAMAGE;
if (spellDmgOnly != null) {
if (spellDmgOnly) {
event_type = STANDARD_EVENT_TYPE.UNIT_HAS_BEEN_DEALT_SPELL_DAMAGE;
}
}
if (physicalDmgOnly != null) {
if (physicalDmgOnly) {
event_type = STANDARD_EVENT_TYPE.UNIT_HAS_BEEN_DEALT_PHYSICAL_DAMAGE;
}
}
} else {
effects.add(new AlteringEffect(false, formula.getNegative().toString()));
event_type = Event.STANDARD_EVENT_TYPE.UNIT_IS_BEING_DEALT_DAMAGE;
if (spellDmgOnly != null) {
if (spellDmgOnly) {
event_type = STANDARD_EVENT_TYPE.UNIT_IS_BEING_DEALT_SPELL_DAMAGE;
}
}
if (physicalDmgOnly != null) {
if (physicalDmgOnly) {
event_type = STANDARD_EVENT_TYPE.UNIT_IS_BEING_DEALT_PHYSICAL_DAMAGE;
}
}
}
Targeting targeting_other_units = new AutoTargeting(new Conditions(new GroupCondition(Ref.KEYS.MATCH.name(), group), // negative
new RefCondition(KEYS.EVENT_TARGET, KEYS.MATCH, true)));
effects.add(new CustomTargetEffect(targeting_other_units, new DealDamageEffect(getDamageFormula(), GenericEnums.DAMAGE_TYPE.PURE)));
/*
* ensure there is no deadlock
*/
conditions = new Conditions();
conditions.add(new NonTriggeredEventCondition());
KEYS OBJ_REF = Ref.KEYS.EVENT_TARGET;
conditions.add(new GroupCondition(OBJ_REF, group));
// has the group...
Ref REF = Ref.getCopy(ref);
// REF.setTarget(null); // ???
new AddTriggerEffect(event_type, conditions, OBJ_REF, effects).apply(REF);
return true;
}
Aggregations