Search in sources :

Example 1 with STANDARD_EVENT_TYPE

use of main.game.logic.event.Event.STANDARD_EVENT_TYPE in project Eidolons by IDemiurge.

the class ModeEffect method addDispelOnHitTrigger.

private void addDispelOnHitTrigger() {
    Effects effects = new Effects(new RemoveBuffEffect(addBuffEffect.getBuffTypeName()));
    if (!mode.equals(STD_MODES.ALERT)) {
        effects.add(InterruptRule.getEffect());
    } else {
        effects.add(AlertRule.getInterruptEffect());
    }
    if (mode.equals(STD_MODES.CHANNELING)) {
        effects.add(new EffectImpl() {

            @Override
            public boolean applyThis() {
                ChannelingRule.channelingInterrupted((Unit) getRef().getSourceObj());
                return true;
            }
        });
    }
    // TODO
    STANDARD_EVENT_TYPE event_type = STANDARD_EVENT_TYPE.UNIT_IS_DEALT_TOUGHNESS_DAMAGE;
    Condition conditions = (mode.equals(STD_MODES.ALERT)) ? InterruptRule.getConditionsAlert() : InterruptRule.getConditions();
    addBuffEffect.addEffect(new DelayedEffect(event_type, effects, conditions));
}
Also used : Condition(main.elements.conditions.Condition) RefCondition(main.elements.conditions.RefCondition) RemoveBuffEffect(eidolons.ability.effects.oneshot.buff.RemoveBuffEffect) STANDARD_EVENT_TYPE(main.game.logic.event.Event.STANDARD_EVENT_TYPE) Unit(eidolons.entity.obj.unit.Unit)

Example 2 with STANDARD_EVENT_TYPE

use of main.game.logic.event.Event.STANDARD_EVENT_TYPE in project Eidolons by IDemiurge.

the class BattleStatManager method eventBeingHandled.

@Override
public void eventBeingHandled(Event event) {
    if (!(event.getRef().getSourceObj() instanceof Unit))
        return;
    Unit source = (Unit) event.getRef().getSourceObj();
    Unit target = null;
    if ((event.getRef().getTargetObj() instanceof Unit))
        target = (Unit) event.getRef().getTargetObj();
    if (event.getType() instanceof STANDARD_EVENT_TYPE) {
        switch((STANDARD_EVENT_TYPE) event.getType()) {
            case UNIT_FALLS_UNCONSCIOUS:
                modifyUnitStat(COMBAT_STATS.DIED, source, 1);
                break;
            case UNIT_HAS_BEEN_DEALT_PURE_DAMAGE:
                {
                    unitDealtDamage(source, target, event.getRef().getAmount());
                    break;
                }
            case UNIT_HAS_BEEN_KILLED:
                {
                    unitKilled(source, target);
                    break;
                }
        }
    } else if (AiTrainingRunner.running)
        if (event.getRef().getAmount() != null) {
            if (event.getType() instanceof EventType) {
                modifyUnitModStat(target.isEnemyTo(source.getOwner()), (event.getType()).getArg(), source, event.getRef().getAmount());
            }
        }
}
Also used : EventType(main.game.logic.event.EventType) STANDARD_EVENT_TYPE(main.game.logic.event.Event.STANDARD_EVENT_TYPE) Unit(eidolons.entity.obj.unit.Unit)

Example 3 with STANDARD_EVENT_TYPE

use of main.game.logic.event.Event.STANDARD_EVENT_TYPE 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;
}
Also used : AutoTargeting(main.elements.targeting.AutoTargeting) Targeting(main.elements.targeting.Targeting) AutoTargeting(main.elements.targeting.AutoTargeting) NonTriggeredEventCondition(main.elements.conditions.standard.NonTriggeredEventCondition) STANDARD_EVENT_TYPE(main.game.logic.event.Event.STANDARD_EVENT_TYPE) RefCondition(main.elements.conditions.RefCondition) CustomTargetEffect(main.ability.effects.continuous.CustomTargetEffect) DealDamageEffect(eidolons.ability.effects.oneshot.DealDamageEffect) Effects(main.ability.effects.Effects) Conditions(main.elements.conditions.Conditions) AddTriggerEffect(eidolons.ability.effects.attachment.AddTriggerEffect) Ref(main.entity.Ref) GroupImpl(main.entity.group.GroupImpl) KEYS(main.entity.Ref.KEYS) AlteringEffect(eidolons.ability.effects.oneshot.misc.AlteringEffect) GroupCondition(main.elements.conditions.standard.GroupCondition)

Example 4 with STANDARD_EVENT_TYPE

use of main.game.logic.event.Event.STANDARD_EVENT_TYPE 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);
}
Also used : ActiveAbility(main.ability.ActiveAbility) Ref(main.entity.Ref) Abilities(main.ability.Abilities) FixedTargeting(main.elements.targeting.FixedTargeting) Dungeon(eidolons.game.battlecraft.logic.dungeon.universal.Dungeon) STANDARD_EVENT_TYPE(main.game.logic.event.Event.STANDARD_EVENT_TYPE) EndGameEffect(eidolons.ability.effects.special.meta.EndGameEffect) Coordinates(main.game.bf.Coordinates) Conditions(main.elements.conditions.Conditions)

Example 5 with STANDARD_EVENT_TYPE

use of main.game.logic.event.Event.STANDARD_EVENT_TYPE in project Eidolons by IDemiurge.

the class ObjectiveMaster method addTrigger.

private static void addTrigger(EVENT_TEMPLATE ET, String eventData, SCRIPT_CONDITION_TEMPLATE CT, String conditionData, ACTION_TEMPLATE AT, String actionData) {
    STANDARD_EVENT_TYPE eventType = null;
    Conditions conditions = null;
    Abilities abilities = null;
    addTrigger(eventType, conditions, abilities);
}
Also used : Abilities(main.ability.Abilities) STANDARD_EVENT_TYPE(main.game.logic.event.Event.STANDARD_EVENT_TYPE) Conditions(main.elements.conditions.Conditions)

Aggregations

STANDARD_EVENT_TYPE (main.game.logic.event.Event.STANDARD_EVENT_TYPE)7 Conditions (main.elements.conditions.Conditions)3 Ref (main.entity.Ref)3 Unit (eidolons.entity.obj.unit.Unit)2 Abilities (main.ability.Abilities)2 Condition (main.elements.conditions.Condition)2 RefCondition (main.elements.conditions.RefCondition)2 AddTriggerEffect (eidolons.ability.effects.attachment.AddTriggerEffect)1 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)1 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)1 AlteringEffect (eidolons.ability.effects.oneshot.misc.AlteringEffect)1 EndGameEffect (eidolons.ability.effects.special.meta.EndGameEffect)1 Dungeon (eidolons.game.battlecraft.logic.dungeon.universal.Dungeon)1 Ability (main.ability.Ability)1 AbilityImpl (main.ability.AbilityImpl)1 ActiveAbility (main.ability.ActiveAbility)1 Effects (main.ability.effects.Effects)1 CustomTargetEffect (main.ability.effects.continuous.CustomTargetEffect)1 GroupCondition (main.elements.conditions.standard.GroupCondition)1 NonTriggeredEventCondition (main.elements.conditions.standard.NonTriggeredEventCondition)1