Search in sources :

Example 11 with Event

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

the class SpellExecutor method resolve.

@Override
public void resolve() {
    if (!getRef().isQuiet()) {
        result = new Event(STANDARD_EVENT_TYPE.SPELL_BEING_RESOLVED, getRef()).fire();
        if (!result) {
            return;
        }
    }
    if (isInterrupted()) {
        return;
    // return true; // TODO group effects blocked?!
    }
    applySpellpowerMod();
    DC_SoundMaster.playEffectSound(SOUNDS.RESOLVE, getSpell());
    super.resolve();
    if (result) {
        applyImpactSpecialEffect();
    }
    if (!getRef().isQuiet()) {
        new Event(STANDARD_EVENT_TYPE.SPELL_RESOLVED, getRef()).fire();
    }
    if (!result) {
        if (channeling) {
            DC_SoundMaster.playEffectSound(SOUNDS.FAIL, getSpell());
        } else // try fail sound?
        {
            DC_SoundMaster.playStandardSound(STD_SOUNDS.SPELL_RESISTED);
        }
    }
}
Also used : Event(main.game.logic.event.Event)

Example 12 with Event

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

the class DoorMaster method open.

@Override
public void open(DungeonObj obj, Ref ref) {
    Door door = (Door) obj;
    door.setState(DOOR_STATE.OPEN);
    // GuiEventManager.trigger(GuiEventType.OPEN_DOOR);
    obj.getGame().fireEvent(new Event(STANDARD_EVENT_TYPE.DOOR_OPENS, ref));
}
Also used : Event(main.game.logic.event.Event)

Example 13 with Event

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

the class OwnershipChangeEffect method applyThis.

@Override
public boolean applyThis() {
    if (!new Event(STANDARD_EVENT_TYPE.UNIT_OWNERSHIP_CHANGED, ref).fire()) {
        return false;
    }
    // + trigger rule flip image when ownership changes ;)
    Obj obj = ref.getTargetObj();
    Player newOwner = obj.getOriginalOwner();
    if (!neutral) {
        newOwner = // ref.getSourceObj().getOwner();
        ((MicroGame) ref.getGame()).getPlayer(!obj.getOwner().isMe());
    }
    obj.setOwner(newOwner);
    if (permanent) {
        obj.setOriginalOwner(newOwner);
    // obj.addProperty(G_PROPS.STATUS, STATUS.CHARMED.name());
    }
    if (berserker) {
    }
    LogMaster.log(LogMaster.CORE_DEBUG_1, ref.getTargetObj().getName() + "'s new owner: " + obj.getOwner());
    return true;
}
Also used : Player(main.game.logic.battle.player.Player) Obj(main.entity.obj.Obj) Event(main.game.logic.event.Event)

Example 14 with Event

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

the class PassiveAbilityObj method kill.

// @Override
// public boolean activate() {
// boolean result = true;
// 
// 
// return result;
// }
@Override
public boolean kill() {
    Ref REF = Ref.getCopy(ref);
    if (isDead()) {
        return false;
    }
    if (!game.fireEvent(new Event(STANDARD_EVENT_TYPE.PASSIVE_BEING_REMOVED, REF))) {
        return false;
    }
    setDead(true);
    game.getManager().attachmentRemoved(this, ownerObj);
    game.fireEvent(new Event(STANDARD_EVENT_TYPE.PASSIVE_REMOVED, REF));
    applied = false;
    return super.kill();
}
Also used : Ref(main.entity.Ref) Event(main.game.logic.event.Event)

Example 15 with Event

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

the class DeathMaster method unitAnnihilated.

public void unitAnnihilated(Obj _killed, Obj _killer) {
    String message = null;
    if (_killed == _killer) {
        // + _killed.getInfoString();
        message = _killed + " annihilates ";
    } else
        message = _killed + " annihilated by " + _killer;
    SpecialLogger.getInstance().appendSpecialLog(SPECIAL_LOG.MAIN, message);
    getGame().getGraveyardManager().removeCorpse(_killed);
    _killed.setAnnihilated(true);
    getGame().fireEvent(new Event(STANDARD_EVENT_TYPE.UNIT_HAS_BEEN_ANNIHILATED, new Context(_killer, _killed)));
// TODO 	getGame().getDroppedItemManager().remove((DC_HeroObj) _killed, item);
}
Also used : Context(main.game.logic.action.context.Context) Event(main.game.logic.event.Event)

Aggregations

Event (main.game.logic.event.Event)34 Ref (main.entity.Ref)17 Unit (eidolons.entity.obj.unit.Unit)10 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)6 Coordinates (main.game.bf.Coordinates)4 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)3 Gdx (com.badlogic.gdx.Gdx)2 Keys (com.badlogic.gdx.Input.Keys)2 Batch (com.badlogic.gdx.graphics.g2d.Batch)2 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)2 Vector2 (com.badlogic.gdx.math.Vector2)2 Group (com.badlogic.gdx.scenes.scene2d.Group)2 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)2 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)2 Label (com.badlogic.gdx.scenes.scene2d.ui.Label)2 Align (com.badlogic.gdx.utils.Align)2 DC_Obj (eidolons.entity.obj.DC_Obj)2 DC_Engine (eidolons.game.battlecraft.DC_Engine)2 LastSeenMaster (eidolons.game.battlecraft.logic.battlefield.vision.LastSeenMaster)2 OutlineMaster (eidolons.game.battlecraft.logic.battlefield.vision.OutlineMaster)2