use of main.ability.ActiveAbility in project Eidolons by IDemiurge.
the class WaitEffect method getAbility.
protected Ability getAbility(Ref ref) {
Effect effect = new Effects(new RemoveBuffEffect(getBuffName()));
Ability ability = new ActiveAbility(new FixedTargeting(KEYS.SOURCE), effect);
ability.setRef(ref);
return ability;
}
use of main.ability.ActiveAbility in project Eidolons by IDemiurge.
the class ObjectiveMaster method initObjectiveTrigger.
public static void initObjectiveTrigger(OBJECTIVE_TYPE type, String data, Location mission) {
Dungeon dungeon = mission.getBossLevel();
objectiveData = data;
STANDARD_EVENT_TYPE eventType = null;
Conditions conditions = new Conditions();
Abilities abilities = new Abilities();
abilities.add(new ActiveAbility(new FixedTargeting(), new EndGameEffect(true)));
Ref ref = new Ref();
Integer id = null;
String name;
switch(type) {
case BOSS:
eventType = STANDARD_EVENT_TYPE.UNIT_HAS_BEEN_KILLED;
Coordinates c = DC_ObjInitializer.getCoordinatesFromObjString(objectiveData);
// new Coordinates(s);
name = DC_ObjInitializer.getNameFromObjString(objectiveData);
// conditions.add(new ObjComparison(KEY, KEYS.TARGET.toString()));
break;
case CAPTURE_HOLD:
// "As long as
break;
case SURVIVE_TIME:
break;
case ESCAPE:
// eventType = STANDARD_EVENT_TYPE.UNIT_GONE_THRU_ENTRANCE;
break;
case ITEM:
break;
}
// some objectives will be initialized on a condition, e.g. capture-hold
addTrigger(eventType, conditions, abilities);
}
use of main.ability.ActiveAbility 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.ActiveAbility in project Eidolons by IDemiurge.
the class BlockEffect method applyThis.
@Override
public boolean applyThis() {
// effect interrupt
String OBJ_REF = null;
switch(BLOCK_TYPE) {
case ATTACK:
event_type = Event.STANDARD_EVENT_TYPE.UNIT_IS_BEING_ATTACKED;
conditions.add(new RefCondition(KEYS.EVENT_TARGET, KEYS.SOURCE, false));
break;
case HOSTILE_ACTION:
event_type = Event.STANDARD_EVENT_TYPE.HOSTILE_ACTION;
conditions.add(new RefCondition(KEYS.EVENT_TARGET, KEYS.SOURCE, false));
break;
case DAMAGE:
event_type = Event.STANDARD_EVENT_TYPE.UNIT_IS_BEING_DEALT_TOUGHNESS_DAMAGE;
break;
case DAMAGE_FROM_SOURCE:
break;
case DAMAGE_TYPE:
break;
case HOSTILE_SPELLS:
event_type = Event.STANDARD_EVENT_TYPE.SPELL_BEING_RESOLVED;
conditions.add(new RefCondition(KEYS.EVENT_TARGET, KEYS.TARGET, false));
OBJ_REF = Ref.KEYS.SPELL.name();
break;
case SPELLS_FROM_SOURCE:
break;
default:
break;
}
effects = new Effects(new InterruptEffect(OBJ_REF));
ActiveAbility abilities = new ActiveAbility(new FixedTargeting(KEYS.SOURCE), effects);
abilities.setRef(ref);
new AddTriggerEffect(event_type, conditions, abilities).apply(ref);
return true;
}
use of main.ability.ActiveAbility in project Eidolons by IDemiurge.
the class DamageInversionEffect method applyThis.
@Override
public boolean applyThis() {
// endurance damage; modify endurance only? above base?
Targeting targeting = new FixedTargeting(KEYS.SOURCE);
Effects effects = new Effects();
if (restoreEndurance) {
ModifyValueEffect effect = new ModifyValueEffect(PARAMS.C_ENDURANCE, code, formula.toString());
if (!restoreEnduranceAboveBase) {
effect.setMaxParam(PARAMS.ENDURANCE);
}
effects.add(effect);
}
if (restoreToughness) {
ModifyValueEffect effect = new ModifyValueEffect(PARAMS.C_TOUGHNESS, code, formula.toString());
if (!restoreToughnessAboveBase) {
effect.setMaxParam(PARAMS.TOUGHNESS);
}
effects.add(effect);
}
ActiveAbility ability = new ActiveAbility(targeting, effects);
new AddTriggerEffect(event_type, conditions, ability).apply(ref);
return true;
}
Aggregations