use of main.ability.PassiveAbilityObj in project Eidolons by IDemiurge.
the class UpkeepRule method addUpkeep.
public static void addUpkeep(Obj payObj) {
Obj spell = payObj.getRef().getObj(KEYS.ACTIVE);
if (spell == null) {
return;
}
Obj abil = payObj.getRef().getObj(KEYS.ABILITY);
if (abil != null) {
if (abil instanceof PassiveAbilityObj) {
return;
}
}
String property = spell.getProperty(PROPS.UPKEEP_FAIL_ACTION);
if (new EnumMaster<UPKEEP_FAIL_ACTION>().retrieveEnumConst(UPKEEP_FAIL_ACTION.class, property) == null) {
property = UPKEEP_FAIL_ACTION.DEATH + "";
}
payObj.setProperty(PROPS.UPKEEP_FAIL_ACTION, property);
for (PARAMETER p : ValuePages.UPKEEP_PARAMETERS) {
Integer param = spell.getIntParam(p);
if (param > 0) {
payObj.getType().setParam(p, param);
}
}
}
use of main.ability.PassiveAbilityObj in project Eidolons by IDemiurge.
the class EffectImpl method apply.
@Override
public boolean apply(Ref ref) {
setRef(ref);
// for logging
boolean active = getLayer() != BUFF_RULE && ref.getObj(KEYS.ACTIVE) != null && (!(ref.getObj(KEYS.ABILITY) instanceof PassiveAbilityObj));
if ((ref.getGroup() == null && targetGroup == null) || isIgnoreGroupTargeting()) {
// single-target effect
return apply();
} else {
// multi-target effect, applies to each target
GroupImpl group = ref.getGroup();
if (group == null) {
group = targetGroup;
} else if (targetGroup == null) {
// group.setIgnoreGroupTargeting(true);// TODO later instead?
targetGroup = group;
}
if (group.isIgnoreGroupTargeting()) {
return apply();
}
List<Integer> groupIds = group.getObjectIds();
boolean result = true;
for (Integer id : groupIds) {
if (isInterrupted()) {
break;
}
Ref REF = this.ref.getCopy();
// REF.setGroup(new GroupImpl(targetGroup));
REF.getGroup().setIgnoreGroupTargeting(true);
REF.setTarget(id);
if (construct != null) {
result &= getCopy().apply(REF);
} else {
// this.ref.setTarget(id);
setIgnoreGroupTargeting(true);
result &= apply(REF);
setIgnoreGroupTargeting(false);
}
}
// game.getManager().refreshAll();
return result;
}
}
Aggregations